ocearo-ui 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.html +1 -1
- package/CHANGELOG.md +364 -0
- package/README.fr.md +28 -31
- package/README.md +28 -31
- package/__next.__PAGE__.txt +3 -3
- package/__next._full.txt +3 -3
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/01ij-cuy61l35.js +1 -0
- package/_next/static/chunks/047e3x_ahxnrl.js +1 -0
- package/_next/static/chunks/0ath9h2eo-m4-.js +1 -0
- package/_next/static/chunks/0bxzs0khjn1uj.js +1 -0
- package/_next/static/chunks/0ejjon45nq_-h.js +9 -0
- package/_next/static/chunks/{1quvj-861o57h.js → 0kdc_niwgmx_8.js} +1 -1
- package/_next/static/chunks/{1bvrvkcwf3ge-.js → 0ngl63fz0a-bo.js} +1 -1
- package/_next/static/chunks/0ucob1nu_x8bl.js +1 -0
- package/_next/static/chunks/0wi5jop1ihbm6.js +2 -0
- package/_next/static/chunks/18e6nw0w7akkb.js +180 -0
- package/_next/static/chunks/18vlmqe7txbmt.js +1 -0
- package/_next/static/chunks/{3utjjgdhnlx86.js → 192c42s2wc7qe.js} +1 -1
- package/_next/static/chunks/1_twx50ejqan5.js +1 -0
- package/_next/static/chunks/1na56snuhu-pc.js +346 -0
- package/_next/static/chunks/1vchkqgn-xw-o.js +1 -0
- package/_next/static/chunks/20p1hr--2grl8.js +9 -0
- package/_next/static/chunks/2393lwi8kee3m.js +48 -0
- package/_next/static/chunks/25v2cwta2fy-7.js +393 -0
- package/_next/static/chunks/28wfa6j-9g_qc.js +1 -0
- package/_next/static/chunks/290k3k__vbum2.js +121 -0
- package/_next/static/chunks/2cecf_xnd_9em.js +1 -0
- package/_next/static/chunks/2die6btm3_mhq.js +1 -0
- package/_next/static/chunks/2hm43avzk8_jb.js +503 -0
- package/_next/static/chunks/2ijx7rln4jshb.css +3 -0
- package/_next/static/chunks/2q_bl16zedyyo.js +503 -0
- package/_next/static/chunks/2xntuu6mzh41s.js +1 -0
- package/_next/static/chunks/30p1dpgmonstj.js +1 -0
- package/_next/static/chunks/31p7nz0hfuym7.js +1 -0
- package/_next/static/chunks/{1e-w_-usen7fy.js → 34nhy77liurum.js} +2 -2
- package/_next/static/chunks/37g-wmrgbgd6h.js +739 -0
- package/_next/static/chunks/{18_i6mf6hb_c7.js → 395ffa6t18601.js} +1 -1
- package/_next/static/chunks/3bai186_bv3i_.js +1 -0
- package/_next/static/chunks/3h_m2s30sr9mt.js +430 -0
- package/_next/static/chunks/3j453-2u58qbv.js +1 -0
- package/_next/static/chunks/3k-r-4veivdjr.js +1 -0
- package/_next/static/chunks/3yz0mxxv4vrfg.js +1 -0
- package/_not-found/__next._full.txt +2 -2
- package/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +2 -2
- package/boats/boats.json +11 -19
- package/boats/windsurf/assets/license.txt +6 -8
- package/boats/windsurf/assets/rider.glb +0 -0
- package/boats/wingfoil/assets/license.txt +9 -0
- package/boats/wingfoil/assets/rider.glb +0 -0
- package/guide/bathymetry.jpg +0 -0
- package/guide/weather.jpg +0 -0
- package/index.html +1 -1
- package/index.txt +3 -3
- package/package.json +27 -5
- package/settings/__next._full.txt +3 -3
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +3 -3
- package/settings.html +1 -1
- package/settings.txt +3 -3
- package/_next/static/chunks/0-19-ljntm5ig.js +0 -1
- package/_next/static/chunks/0-g-ujyrfgutp.js +0 -2
- package/_next/static/chunks/0-jqvc-r0kh0c.js +0 -1
- package/_next/static/chunks/05do10p9ldt1p.js +0 -409
- package/_next/static/chunks/0c91q-13wh8hk.js +0 -1
- package/_next/static/chunks/0fv1wwxeyagln.js +0 -446
- package/_next/static/chunks/0jucaltuccn03.js +0 -1
- package/_next/static/chunks/0m7wbuocx-b4_.js +0 -9
- package/_next/static/chunks/0o7hu-sypv2u9.js +0 -1
- package/_next/static/chunks/0ujzg6ofy2r73.js +0 -1
- package/_next/static/chunks/162bfkgcudvew.js +0 -9
- package/_next/static/chunks/1bo0ke8gjc1c2.js +0 -1
- package/_next/static/chunks/1do-2zwq3ws0f.js +0 -346
- package/_next/static/chunks/1ho2ekxa9io1_.js +0 -1
- package/_next/static/chunks/1m3-nchdgcxy1.css +0 -3
- package/_next/static/chunks/271ys-u920uqd.js +0 -564
- package/_next/static/chunks/2_iau6x7s0vil.js +0 -1131
- package/_next/static/chunks/2ab6q6u6uo_bf.js +0 -1
- package/_next/static/chunks/2pt-apz8_pa4j.js +0 -1
- package/_next/static/chunks/2rnpgrmuyhpkd.js +0 -119
- package/_next/static/chunks/2w71oj1brox5z.js +0 -1
- package/_next/static/chunks/3e5jmzthktu9w.js +0 -1
- package/_next/static/chunks/3r8nellt-dsed.js +0 -1
- package/_next/static/chunks/3wwn1rti8oc_r.js +0 -1
- package/_next/static/chunks/41odv061mfm6t.js +0 -1
- package/boats/optimist/Scene.jsx +0 -28
- package/boats/optimist/assets/license.txt +0 -11
- package/boats/optimist/assets/scene-transformed.glb +0 -0
- package/boats/sailboat/Scene.jsx +0 -21
- package/boats/sailboat/assets/license.txt +0 -10
- package/boats/sailboat/assets/scene-transformed.glb +0 -0
- package/boats/windsurf/Scene.jsx +0 -22
- package/boats/windsurf/assets/scene-transformed.glb +0 -0
- /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → 0nycI4RUzRHiehQwdbDCp}/_buildManifest.js +0 -0
- /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → 0nycI4RUzRHiehQwdbDCp}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → 0nycI4RUzRHiehQwdbDCp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67561,t=>{"use strict";t.s(["OcearoContextProvider",()=>v,"useOcearoContext",()=>x]);var e=t.i(43476),r=t.i(71645),i=t.i(83402),s=t.i(30206),n=t.i(66799),a=t.i(48390),o=t.i(90072),h=t.i(78037),l=t.i(63532),u=t.i(18638),c=t.i(14421),d=t.i(95430);t.i(11426);let p=(0,r.createContext)(),f={autopilot:!0,anchorWatch:!1,parkingMode:!1,moored:!1,mob:!1,oceanMode:"black",ais:!1,showPolar:!0,showLaylines3D:!1,showWind:!1,showCurrent:!1,showSeamarks:!0,racing:!1},m=["oceanMode","ais","showPolar","showLaylines3D","showWind","showCurrent","showSeamarks"],y=["environment.wind.speedTrue","environment.wind.angleTrueWater","environment.wind.directionTrue"],g=["environment.wind.angleApparent","environment.wind.speedApparent","navigation.speedThroughWater","navigation.speedOverGround","navigation.headingTrue","navigation.courseOverGroundTrue"],b=["water","black","depth"],v=({children:t})=>{let[v,x]=(0,r.useState)(()=>(0,u.normalizeThemeMode)(i.default.get("theme"))),[w,S]=(0,r.useState)("dark"),M="auto"===v?w:v,_="night"===M,[A,T]=(0,r.useState)(()=>({...f,...(()=>{let t=i.default.get("uiStates");if(!t||"object"!=typeof t)return{};let e=m.reduce((e,r)=>(r in t&&(e[r]=t[r]),e),{});return"chart"===e.oceanMode&&(e.oceanMode="depth"),"meteo"===e.oceanMode&&(e.oceanMode="depth",e.showWind=!0),b.includes(e.oceanMode)||delete e.oceanMode,e})()}));(0,r.useEffect)(()=>{i.default.set("uiStates",m.reduce((t,e)=>(t[e]=A[e],t),{}))},m.map(t=>A[t]));let C=(0,r.useCallback)(t=>{let e=(0,u.normalizeThemeMode)(t);i.default.set("theme",e),x(e)},[]);(0,r.useEffect)(()=>{"u">typeof document&&(0,u.applyThemeTokens)(u.THEMES[M])},[M]);let E=(0,r.useRef)({}),R=(0,r.useRef)({}),O=(0,r.useCallback)((t,e)=>{E.current[t]||(E.current[t]=new Set),E.current[t].add(e)},[]),I=(0,r.useCallback)((t,e)=>{E.current[t]&&(E.current[t].delete(e),0===E.current[t].size&&delete E.current[t])},[]),k=(0,r.useRef)(new Map),P=(0,r.useCallback)((t,e)=>{k.current.set(e,t)},[]),B=(0,r.useCallback)(t=>{k.current.delete(t)},[]),L=(0,r.useCallback)(t=>{let e={};for(let[r,i]of Object.entries(R.current))r.startsWith(t)&&(e[r]=i);return e},[]),z=(0,r.useCallback)((t,e)=>{E.current[t]&&E.current[t].forEach(t=>t(e)),k.current.size>0&&k.current.forEach((r,i)=>{t.startsWith(r)&&i(t,e)})},[]),N=(0,r.useRef)(0),F=(0,r.useCallback)(t=>{let e=R.current;y.some(e=>Number.isFinite(t[e]))&&(N.current=Date.now());let r=t=>{let r=!1;for(let[i,s]of Object.entries(t)){let t=e[i];t!==s&&("object"!=typeof t||"object"!=typeof s||null===t||null===s||JSON.stringify(t)!==JSON.stringify(s))&&(e[i]=s,r=!0,z(i,s))}return r},i=r(t);if(i&&Date.now()-N.current>1e4&&g.some(e=>e in t)){let t=(t=>{let e=t["environment.wind.angleApparent"],r=t["environment.wind.speedApparent"];if(!Number.isFinite(e)||!Number.isFinite(r))return null;let i=t["navigation.speedThroughWater"],s=Number.isFinite(i)?i:t["navigation.speedOverGround"]??0,n=r*Math.cos(e)-(Number.isFinite(s)?s:0),a=r*Math.sin(e),o=Math.hypot(n,a),h=o>.05?Math.atan2(a,n):e,l={"environment.wind.speedTrue":o,"environment.wind.angleTrueWater":h},u=t["navigation.headingTrue"]??t["navigation.courseOverGroundTrue"];return Number.isFinite(u)&&(l["environment.wind.directionTrue"]=((u+h)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)),l})(e);t&&r(t)}i&&(R.current=e)},[z]),j=(0,r.useCallback)(t=>Object.prototype.hasOwnProperty.call(R.current,t)?R.current[t]:null,[]),U=(0,r.useCallback)(()=>{let t=R.current,e=i.default.get("preferredHeadingPath")||"courseOverGroundTrue",r=t[`navigation.${e}`];if(null!=r)return r;let s=t["navigation.headingTrue"]||t["navigation.headingMagnetic"];return t["navigation.courseOverGroundTrue"]||t["navigation.courseOverGroundMagnetic"]||s||0},[]),D=(0,r.useCallback)((t,e)=>{if(!t?.lat||!t?.lon||!e?.lat||!e?.lon)return console.warn("Invalid input to convertLatLonToXY",t,e),{x:0,y:0};let r=e.lat*Math.PI/180,i=e.lon*Math.PI/180,s=t.lat*Math.PI/180,n=t.lon*Math.PI/180-i,a=s-r,o=Math.atan2(Math.sin(n)*Math.cos(s),Math.cos(r)*Math.sin(s)-Math.sin(r)*Math.cos(s)*Math.cos(n)),h=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(s)*Math.sin(n/2)*Math.sin(n/2),l=2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))*6371e3;return{x:l*Math.sin(o),y:l*Math.cos(o)}},[]),V=(0,r.useCallback)(()=>{T(t=>{let e=(b.indexOf(t.oceanMode)+1)%b.length;return{...t,oceanMode:b[e]}})},[]),W=(0,r.useRef)(null),q=(0,r.useRef)(0),G=(0,r.useCallback)(async(t,e)=>{let r=void 0!==e?e:!A[t];if(q.current=Date.now(),T(e=>({...e,[t]:r})),"anchorWatch"===t)try{if(r)(0,a.isOcearoCoreEnabled)()&&await (0,a.updateOcearoCoreMode)("anchored");else{let t=R.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];(0,a.isOcearoCoreEnabled)()&&await (0,a.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing")}}catch(t){"NetworkError"===t.name?console.warn("OcearoCore unreachable for anchorWatch update"):console.warn("Failed to update OcearoCore mode for anchorWatch:",(0,a.handleOcearoCoreError)(t))}if("parkingMode"===t)try{if(r)(0,a.isOcearoCoreEnabled)()&&await (0,a.updateOcearoCoreMode)("moored");else if((0,a.isOcearoCoreEnabled)()){let t=R.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];await (0,a.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing")}}catch(t){"NetworkError"===t.name?console.warn("OcearoCore unreachable for parkingMode update"):console.warn("Failed to update OcearoCore mode for parkingMode:",(0,a.handleOcearoCoreError)(t))}if("racing"===t)try{r?(0,a.isOcearoCoreEnabled)()&&await (0,a.updateOcearoCoreMode)("racing"):(0,a.isOcearoCoreEnabled)()&&await (0,a.updateOcearoCoreMode)("sailing")}catch(t){"NetworkError"===t.name?console.warn("OcearoCore unreachable for racing update"):console.error("Failed to update OcearoCore mode for racing:",(0,a.handleOcearoCoreError)(t))}},[A]),H=(0,r.useCallback)(async t=>{let e=["autopilot","anchorWatch","parkingMode"];if(!e.includes(t))return G(t);let r=!A[t];if(q.current=Date.now(),r){T(r=>{let i={...r};return e.forEach(e=>{i[e]=e===t}),i});try{if((0,a.isOcearoCoreEnabled)()){if("anchorWatch"===t)await (0,a.updateOcearoCoreMode)("anchored");else if("parkingMode"===t)await (0,a.updateOcearoCoreMode)("moored");else if("autopilot"===t){let t=R.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];await (0,a.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing")}}}catch(e){"NetworkError"===e.name?console.warn(`OcearoCore unreachable for exclusive mode update: ${t}`):console.warn(`Failed to update OcearoCore mode for ${t}:`,(0,a.handleOcearoCoreError)(e))}}else if("autopilot"!==t)return T(t=>({...t,autopilot:!0})),G(t,!1);else if(A.moored&&(0,a.isOcearoCoreEnabled)())try{let t=R.current,e=t["propulsion.main.state"]||t["propulsion.main.revolutions"];await (0,a.updateOcearoCoreMode)("running"===e||"number"==typeof e&&e>0?"motoring":"sailing"),T(t=>({...t,moored:!1}))}catch(t){console.warn("Failed to leave moored mode:",(0,a.handleOcearoCoreError)(t))}},[A,G]);(0,r.useEffect)(()=>{if(!(0,a.isOcearoCoreEnabled)())return;let t=!1,e=async()=>{let e=await (0,a.getOcearoCoreStatus)(),r=e?.mode,i=e?.modeSource,s=`${r}/${i}`;if(t||"string"!=typeof r||s===W.current||Date.now()-q.current<5e3)return;W.current=s;let n="moored"===r&&"user"===i;T(t=>({...t,autopilot:"anchored"!==r&&!n,anchorWatch:"anchored"===r,parkingMode:n,moored:"moored"===r,racing:"racing"===r}))};e();let r=setInterval(e,1e4);return()=>{t=!0,clearInterval(r)}},[]);let J=(0,r.useRef)(null),$=(0,r.useRef)(null),Y=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=!0;return(async()=>{let e=i.default.getAll(),{debugMode:r}=e,a=i.default.getSignalKUrl(),u=(0,l.createStaleTracker)(r?0:(0,l.staleTimeoutMs)(e.staleDataTimeout)),c=t=>{0!==t.length&&F(Object.fromEntries(t.map(t=>[t,null])))},d=new Set,p=t=>Object.fromEntries(Object.entries(t).filter(([t])=>!d.has(t))),f=()=>[...d].some(t=>t.startsWith("environment.wind.")),m=(t=!1)=>{if($.current&&clearInterval($.current),t){$.current=setTimeout(()=>m(!1),3e3);return}let e=0,r=0,n=1,a={"steering.rudderAngle":o.MathUtils.degToRad(r),...h.SAMPLE_DATA.temperature,...h.SAMPLE_DATA.environment,...h.SAMPLE_DATA.performance,...h.SAMPLE_DATA.navigation,...h.SAMPLE_DATA.racing,...h.SAMPLE_DATA.electrical,...h.SAMPLE_DATA.propulsion,...h.SAMPLE_DATA.tanks};i.default.get("debugWindOverride")||f()||Object.assign(a,h.SAMPLE_DATA.wind),F(p(a)),$.current=setInterval(()=>{if((0,s.isReplaying)())return;((r+=2*n)>=15||r<=-15)&&(n*=-1);let t={"steering.rudderAngle":o.MathUtils.degToRad(r)};i.default.get("debugWindOverride")||f()||(e=(e+5)%360,t["environment.wind.angleTrueWater"]=o.MathUtils.degToRad(e),t["environment.wind.angleApparent"]=o.MathUtils.degToRad(e));let a=p(t);Object.keys(a).length&&F(a)},h.SAMPLE_DATA_INTERVAL)};if(!a||0===a.trim().length){r&&m();return}try{let e=n.default.createClient({deltaStreamBehaviour:"self",sendMeta:"all"});J.current=e,await e.connect();let a=["environment.wind.speedTrue","environment.wind.speedApparent","environment.wind.angleTrueWater","environment.wind.angleApparent","environment.wind.directionTrue","environment.wind.speedOverGround","environment.wind.angleTrueGround"];e.on("delta",e=>{if(!t)return;let r=Date.now();e.updates.forEach(t=>{t.values&&t.values.forEach(e=>{i.default.get("debugWindOverride")&&a.includes(e.path)?u.forget(e.path):(0,s.isReplaying)()||u.seen(e.path,t.timestamp,r)&&(d.add(e.path),F({[e.path]:e.value}))})})}),e.on("connect",()=>u.reset());let o=t=>u.syncClock(t?.timestamp,Date.now());e.on("connectionInfo",o),e.connection?.connectionInfo&&o(e.connection.connectionInfo),e.on("disconnect",()=>{t&&(u.reset(),(0,s.isReplaying)()||c(u.clear()))}),u.timeoutMs&&(Y.current=setInterval(()=>{let t=Date.now();(0,s.isReplaying)()?u.touchAll(t):c(u.expire(t))},l.STALE_CHECK_INTERVAL_MS)),r&&m(!0)}catch(e){let t;if(e instanceof Error)t=e.message;else if(e&&"object"==typeof e&&"isTrusted"in e)t="Network error (Event). Check SignalK URL, server availability, and CORS settings.";else try{t=JSON.stringify(e)}catch(r){t=String(e)}console.warn(`Failed to connect to SignalK (${a}): ${t}`),r&&m()}})(),()=>{t=!1,J.current&&J.current.disconnect(),$.current&&clearInterval($.current),Y.current&&clearInterval(Y.current)}},[]),(0,r.useEffect)(()=>{if("auto"!==v)return;let t=()=>{let t=R.current["navigation.position"],e=(0,c.sunPosition)(t?.latitude,t?.longitude,(0,d.vesselNow)());S(t=>(0,u.themeForSunElevation)(e?.elevation,t))},e=setTimeout(t,1500),r=setInterval(t,6e4);return()=>{clearTimeout(e),clearInterval(r)}},[v]);let X=(0,r.useMemo)(()=>({getSignalKValue:j,subscribe:O,unsubscribe:I,subscribePrefix:P,unsubscribePrefix:B,getSignalKValuesByPrefix:L,updateSignalKData:F,getBoatRotationAngle:U,convertLatLonToXY:D,theme:M,themeMode:v,setTheme:C,tokens:u.THEMES[M],nightMode:_,states:A,toggleState:G,toggleExclusiveMode:H,cycleOceanMode:V}),[j,O,I,P,B,L,F,U,D,M,v,C,_,A,G,H,V]);return(0,e.jsx)(p.Provider,{value:X,children:t})},x=()=>(0,r.useContext)(p)},78037,63532,18638,14421,t=>{"use strict";var e=t.i(90072),r=t.i(46991);let i={wind:{"environment.wind.angleTrueWater":e.MathUtils.degToRad(0),"environment.wind.speedTrue":10.288,"environment.wind.angleApparent":e.MathUtils.degToRad(0),"environment.wind.speedApparent":10.288},temperature:{"environment.water.temperature":(0,r.toKelvin)(17),"environment.outside.temperature":(0,r.toKelvin)(21),"propulsion.main.exhaustTemperature":(0,r.toKelvin)(95),"environment.inside.fridge.temperature":(0,r.toKelvin)(4)},environment:{"environment.outside.pressure":102300,"environment.inside.relativeHumidity":.74,"environment.inside.voc":.03,"environment.inside.co2":640,"environment.inside.pm25":8,"environment.inside.dewPoint":288.4,"environment.outside.relativeHumidity":.68,"environment.outside.uvIndex":4.2,"environment.outside.visibility":14800},performance:{"performance.beatAngle":e.MathUtils.degToRad(45),"performance.gybeAngle":e.MathUtils.degToRad(135),"performance.beatAngleVelocityMadeGood":6,"performance.gybeAngleVelocityMadeGood":5,"performance.targetAngle":e.MathUtils.degToRad(45),"performance.polarSpeed":8,"performance.polarSpeedRatio":.95,"performance.velocityMadeGood":5,"performance.polarVelocityMadeGood":6,"performance.polarVelocityMadeGoodRatio":.9},navigation:{"navigation.speedThroughWater":7,"navigation.headingTrue":e.MathUtils.degToRad(0),"navigation.courseOverGround":e.MathUtils.degToRad(20),"navigation.courseGreatCircle.nextPoint.bearingTrue":e.MathUtils.degToRad(30),"navigation.courseGreatCircle.nextPoint.distance":1500,"navigation.attitude":{roll:e.MathUtils.degToRad(5),pitch:e.MathUtils.degToRad(2),yaw:e.MathUtils.degToRad(2)}},racing:{"navigation.racing.layline":e.MathUtils.degToRad(10),"navigation.racing.layline.distance":100,"navigation.racing.layline.time":180,"navigation.racing.oppositeLayline":e.MathUtils.degToRad(45),"navigation.racing.oppositeLayline.distance":80,"navigation.racing.oppositeLayline.time":180,"navigation.racing.startLineStb":{latitude:0,longitude:0,altitude:0},"navigation.racing.startLinePort":{latitude:0,longitude:0,altitude:0},"navigation.racing.distanceStartline":50,"navigation.racing.timeToStart":120,"navigation.racing.timePortDown":60,"navigation.racing.timePortUp":70,"navigation.racing.timeStbdDown":65,"navigation.racing.timeStbdUp":75},electrical:{"electrical.batteries.1.name":"House Battery","electrical.batteries.1.location":"Under Starboard Bed","electrical.batteries.1.capacity.nominal":768,"electrical.batteries.1.capacity.actual":707,"electrical.batteries.1.capacity.remaining":601,"electrical.batteries.1.capacity.dischargeLimit":.2,"electrical.batteries.1.capacity.timeRemaining":9860,"electrical.batteries.1.lifetimeDischarge":54e4,"electrical.batteries.1.lifetimeRecharge":545e3,"electrical.batteries.1.voltage.ripple":.05,"electrical.batteries.1.chemistry":"LeadAcid","electrical.batteries.1.manufacturer.name":"VARTA","electrical.batteries.1.manufacturer.model":"Professional Dual Purpose RA 595 985","electrical.batteries.1.manufacturer.URL":"https://www.varta-automotive.com","electrical.batteries.1.dateInstalled":"2020-06-15T00:00:00Z","electrical.batteries.1.associatedBus":"House Bus","electrical.batteries.1.voltage":12.6,"electrical.batteries.1.current":-2.3,"electrical.batteries.0.name":"Engine Start Battery","electrical.batteries.0.location":"Engine Compartment","electrical.batteries.0.capacity.nominal":888,"electrical.batteries.0.capacity.actual":861,"electrical.batteries.0.chemistry":"LeadAcid","electrical.batteries.0.manufacturer.name":"VARTA","electrical.batteries.0.manufacturer.model":"Blue Dynamic E11","electrical.batteries.0.manufacturer.URL":"https://www.varta-automotive.com","electrical.batteries.0.dateInstalled":"2022-04-10T00:00:00Z","electrical.batteries.0.associatedBus":"Start Bus","electrical.batteries.0.voltage":12.4,"electrical.batteries.0.current":.1,"electrical.alternators.0.voltage":14.2,"electrical.alternators.0.current":35.5,"navigation.lights":!1,"steering.autopilot.state":"auto"},propulsion:{"propulsion.0.revolutions":25,"propulsion.0.runTime":125e3,"propulsion.0.coolantTemperature":353.15,"propulsion.0.coolantPressure":18e4,"propulsion.0.oilPressure":35e4,"propulsion.0.oilTemperature":363.15,"propulsion.0.exhaustTemperature":623.15,"propulsion.0.intakeManifoldTemperature":313.15,"propulsion.0.boostPressure":15e4,"propulsion.0.load":.45,"propulsion.0.torque":.52,"propulsion.0.state":"started","propulsion.0.fuel.rate":2778e-9,"propulsion.0.fuel.pressure":28e4,"propulsion.0.fuel.economyRate":.45,"propulsion.0.transmission.gear":1,"propulsion.0.transmission.oilPressure":32e4,"propulsion.0.transmission.oilTemperature":343.15,"propulsion.0.tilt":0,"propulsion.1.revolutions":26,"propulsion.1.runTime":128e3,"propulsion.1.coolantTemperature":355.15,"propulsion.1.coolantPressure":185e3,"propulsion.1.oilPressure":36e4,"propulsion.1.oilTemperature":365.15,"propulsion.1.exhaustTemperature":633.15,"propulsion.1.intakeManifoldTemperature":315.15,"propulsion.1.boostPressure":155e3,"propulsion.1.load":.48,"propulsion.1.torque":.54,"propulsion.1.state":"started","propulsion.1.fuel.rate":2917e-9,"propulsion.1.fuel.pressure":285e3,"propulsion.1.transmission.gear":1,"propulsion.1.transmission.oilPressure":325e3,"propulsion.1.transmission.oilTemperature":345.15,"propulsion.1.tilt":0},tanks:{"tanks.fuel.0.currentLevel":.75,"tanks.fuel.0.capacity":.2,"tanks.fuel.0.currentVolume":150,"tanks.fuel.0.type":"fuel","tanks.freshWater.0.currentLevel":.45,"tanks.freshWater.0.capacity":.2,"tanks.freshWater.0.type":"freshWater","tanks.wasteWater.0.currentLevel":.25,"tanks.wasteWater.0.capacity":.2,"tanks.wasteWater.0.type":"wasteWater","tanks.blackWater.0.currentLevel":.25,"tanks.blackWater.0.capacity":.2,"tanks.blackWater.0.type":"blackWater","tanks.oil.0.currentLevel":.9,"tanks.oil.0.capacity":.005,"tanks.oil.0.type":"oil"}};t.s(["SAMPLE_DATA",0,i,"SAMPLE_DATA_INTERVAL",0,5e3],78037);let s=3e4,n=[/^navigation\.(position|speedOverGround|speedThroughWater|courseOverGround(True|Magnetic)|heading(True|Magnetic)|attitude|rateOfTurn|leewayAngle)$/,/^environment\.wind\./,/^environment\.depth\./,/^steering\.rudderAngle$/,/^propulsion\.[^.]+\.revolutions$/,/^performance\./];t.s(["STALE_CHECK_INTERVAL_MS",0,5e3,"createStaleTracker",0,(t=s)=>{let e=new Map,r=1/0,i=()=>Number.isFinite(r)?r:0,a=(t,e)=>e-i()-t;return{get timeoutMs(){return t},reset(){r=1/0},syncClock(t,e){let i=t?new Date(t).getTime():NaN;Number.isFinite(i)&&(r=e-i)},seen(s,o,h){let l;if(!t||!n.some(t=>t.test(s)))return!0;let u=o?new Date(o).getTime():NaN;return Number.isFinite(u)?(r=Math.min(r,h-u),l=u):l=h-i(),!(a(l,h)>t)&&(l>=(e.get(s)??-1/0)&&e.set(s,l),!0)},forget(t){e.delete(t)},touchAll(t){for(let r of e.keys())e.set(r,t-i())},expire(r){let i=[];if(!t)return i;for(let[s,n]of e)a(n,r)>t&&(e.delete(s),i.push(s));return i},clear(){let t=[...e.keys()];return e.clear(),t}}},"staleTimeoutMs",0,t=>{if(null==t||""===t)return s;let e=Number(t);return Number.isFinite(e)?e>0?1e3*e:0:s}],63532);let a=["auto","day","dark","night"],o="#ff7a63";t.s(["THEMES",0,{day:{id:"day",appBg:"#f2f3f5",leftPaneBg:"#e9ebee",rightPaneBg:"#f6f7f9",surface:"rgba(255, 255, 255, 0.72)",surfaceElevated:"rgba(0, 0, 0, 0.045)",card:"rgba(255, 255, 255, 0.9)",border:"rgba(0, 0, 0, 0.08)",textMain:"#111418",textSecondary:"rgba(17, 20, 24, 0.62)",textMuted:"rgba(17, 20, 24, 0.45)",textDim:"rgba(17, 20, 24, 0.28)",accent:"#0a7fc2",ok:"#0e9f47",warn:"#c98a00",danger:"#d0021b",neutral:"#7d8288",neutralStrong:"#c5c9ce",shadowSoft:"0 1px 4px rgba(0, 0, 0, 0.08)",shadowSubtle:"0 1px 3px rgba(0, 0, 0, 0.05)",instrument:{sky:"#9fd3f2",sea:"#b9bcc0",bezel:"#c5c9ce"},scene:{background:"#f7f8f9",ground:"#f2f3f5",grid:"#dcdfe3",sea:"#134868",seaScatter:"#2b97a3",seaFoam:"#f3f7f9",skyZenith:"#4f86b8",skyHorizon:"#dbe6ed",markerDim:"#b5bac0",water:"#9fb4c2",ownHull:"#ffffff",ownDeck:"#8f99a4",sail:"#f7f8fa",rigging:"#5a6068",compass:"#2b3036",compassDim:"#8a9097",compassFace:"#dfe2e6",vessel:"#9aa0a6",vesselDanger:"#d2504f",vesselYields:"#8f86c9",vesselClose:"#d9a066",route:"#1688d8",routeGlow:"#5fb8ff",laylinePort:"#e0262f",laylineStarboard:"#0e9f47",wakeGood:"#0e9f47",wakeFair:"#e3a400",wakeBad:"#e0262f",wakeFoam:"#ffffff",ghost:"#5f6b78",giveWay:"#e8954f",target:"#c98a00",wind:"#2b3036",current:"#0e9f47",light:"#ffffff",rimLight:"#ffffff",ambient:1.3,keyLight:2.4,fillLight:1}},dark:{id:"dark",appBg:"#101216",leftPaneBg:"#121418",rightPaneBg:"#171a1f",surface:"rgba(255, 255, 255, 0.03)",surfaceElevated:"rgba(255, 255, 255, 0.07)",card:"rgba(255, 255, 255, 0.045)",border:"rgba(255, 255, 255, 0.09)",textMain:"#f2f4f7",textSecondary:"rgba(235, 240, 245, 0.68)",textMuted:"rgba(235, 240, 245, 0.52)",textDim:"rgba(235, 240, 245, 0.36)",accent:"#3ec6ff",ok:"#2fd27a",warn:"#ffc53d",danger:"#ff4d4f",neutral:"#9aa3ad",neutralStrong:"#4a525c",shadowSoft:"0 4px 20px rgba(0, 0, 0, 0.35)",shadowSubtle:"0 2px 10px rgba(0, 0, 0, 0.25)",instrument:{sky:"#5b8fb8",sea:"#3a4048",bezel:"#4a525c"},scene:{background:"#16191e",ground:"#20252c",grid:"#353d47",sea:"#0b1e2b",seaScatter:"#16485a",seaFoam:"#3e4a55",skyZenith:"#0b1016",skyHorizon:"#222c37",markerDim:"#4a525c",water:"#0d3550",ownHull:"#f4f6f8",ownDeck:"#c9cfd6",sail:"#eef1f4",rigging:"#aeb6bf",compass:"#e8ecf0",compassDim:"#7d8690",compassFace:"#16191e",vessel:"#b9c0c8",vesselDanger:"#ff4d4f",vesselYields:"#a99cf0",vesselClose:"#f0b46e",route:"#3ec6ff",routeGlow:"#8fe0ff",laylinePort:"#ff5a5a",laylineStarboard:"#2fd27a",wakeGood:"#2fd27a",wakeFair:"#ffc53d",wakeBad:"#ff4d4f",wakeFoam:"#8fd4ff",ghost:"#a9bccf",giveWay:"#f0a060",target:"#ffc53d",wind:"#ffffff",current:"#2fd27a",light:"#ffffff",rimLight:"#dfe9f5",ambient:1,keyLight:2,fillLight:.9}},night:{id:"night",appBg:"#0f0706",leftPaneBg:"#110807",rightPaneBg:"#160a08",surface:"rgba(255, 110, 90, 0.04)",surfaceElevated:"rgba(255, 110, 90, 0.1)",card:"rgba(255, 110, 90, 0.06)",border:"rgba(255, 110, 90, 0.18)",textMain:o,textSecondary:"rgba(255, 122, 99, 0.78)",textMuted:"rgba(255, 122, 99, 0.6)",textDim:"rgba(255, 122, 99, 0.42)",accent:"#ff8a6b",onAccent:"#1a0806",ok:"#ff9478",warn:"#ffad80",danger:"#ff3b2f",neutral:"#a8473a",neutralStrong:"#4a1a14",shadowSoft:"none",shadowSubtle:"none",instrument:{sky:"#3a1510",sea:"#1a0907",bezel:"#4a1a14"},scene:{background:"#120807",ground:"#1c0e0b",grid:"#43201a",sea:"#1a0907",seaScatter:"#3a130e",seaFoam:"#4f2018",skyZenith:"#0c0504",skyHorizon:"#26110d",markerDim:"#5a261e",water:"#1a0907",ownHull:"#d9705d",ownDeck:"#9c4436",sail:"#c8604e",rigging:"#8a3a2e",compass:"#ff8a72",compassDim:"#93412f",compassFace:"#120807",vessel:"#b35a4a",vesselDanger:"#ff3b2f",vesselYields:"#e0607a",vesselClose:"#ff9a5a",route:o,routeGlow:"#ffab95",laylinePort:"#e04a3a",laylineStarboard:"#ffab95",wakeGood:"#ffab95",wakeFair:"#e0604a",wakeBad:"#8a2a1e",wakeFoam:"#93412f",ghost:"#93412f",giveWay:"#ff7a3a",target:"#ffad80",wind:"#ffb3a3",current:o,light:"#ffb3a3",rimLight:"#ff8a72",ambient:.75,keyLight:1.4,fillLight:.6}}},"THEME_MODES",0,a,"applyThemeTokens",0,(t,e=document.documentElement)=>{for(let[r,i]of Object.entries({"--background":t.appBg,"--foreground":t.textMain,"--color-leftPaneBg":t.leftPaneBg,"--color-rightPaneBg":t.rightPaneBg,"--hud-bg":t.surface,"--hud-bg-elevated":t.surfaceElevated,"--hud-card-bg":t.card,"--hud-border":t.border,"--hud-text-main":t.textMain,"--hud-text-secondary":t.textSecondary,"--hud-text-muted":t.textMuted,"--hud-text-dim":t.textDim,"--color-oBlue":t.accent,"--color-oGreen":t.ok,"--color-oYellow":t.warn,"--color-oRed":t.danger,"--color-oGray":t.neutral,"--color-oGray2":t.neutralStrong,"--color-oNight":t.textMain,"--color-onAccent":t.onAccent||"#ffffff","--shadow-soft":t.shadowSoft,"--shadow-subtle":t.shadowSubtle}))e.style.setProperty(r,i);e.setAttribute("data-theme",t.id),e.style.colorScheme="day"===t.id?"light":"dark"},"normalizeThemeMode",0,t=>"light"===t?"day":a.includes(t)?t:"dark","themeForSunElevation",0,(t,e)=>{if(!Number.isFinite(t))return e||"dark";let r=t=>e===t?1:-1;return t>6-r("day")?"day":t<-6+r("night")?"night":"dark"},"tintForTheme",0,(t,e)=>{if("night"!==t.id)return e;let r=.2126*e.r+.7152*e.g+.0722*e.b;return e.setRGB(Math.min(1,.25+r),.04*r,.04*r)}],18638);let h=t=>Math.PI/180*t,l=t=>180/Math.PI*t,u=(t,e)=>{let r=t%e;return r<0?r+e:r},c=(t,e,r,i)=>{let s,n=(s=Date.UTC(r.getUTCFullYear(),0,1),Math.floor((Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate())-s)/864e5)+1),a=e/15,o=n+((i?6:18)-a)/24,c=.9856*o-3.289,d=u(c+1.916*Math.sin(h(c))+.02*Math.sin(2*h(c))+282.634,360),p=u(l(Math.atan(.91764*Math.tan(h(d)))),360);p+=90*Math.floor(d/90)-90*Math.floor(p/90),p/=15;let f=.39782*Math.sin(h(d)),m=Math.cos(Math.asin(f)),y=(Math.cos(h(90.833))-f*Math.sin(h(t)))/(m*Math.cos(h(t)));return y>1||y<-1?null:u((i?360-l(Math.acos(y)):l(Math.acos(y)))/15+p-.06571*o-6.622-a,24)},d=(t,e,r)=>{if(null===r)return null;let i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),s=i+(12-e/15)*36e5,n=i+36e5*r;for(;n-s>432e5;)n-=864e5;for(;s-n>432e5;)n+=864e5;return new Date(n)};t.s(["computeSunEvents",0,(t,e,r)=>{if(!Number.isFinite(t)||!Number.isFinite(e)||!(r instanceof Date))return null;let i=new Date(r.getTime()+e/15*36e5);return{sunrise:d(i,e,c(t,e,i,!0)),sunset:d(i,e,c(t,e,i,!1))}},"formatClockTime",0,t=>t?t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}):null,"parseSunTime",0,(t,e)=>{if(!t)return null;if("string"==typeof t&&/^\d{1,2}:\d{2}$/.test(t)){let[r,i]=t.split(":").map(Number),s=new Date(e);return s.setHours(r,i,0,0),s}let r=new Date(t);return Number.isNaN(r.getTime())?null:r},"sunPosition",0,(t,e,r)=>{if(!Number.isFinite(t)||!Number.isFinite(e)||!(r instanceof Date))return null;let i=Date.UTC(r.getUTCFullYear(),0,1),s=(r.getTime()-i)/864e5+1,n=r.getUTCHours()+r.getUTCMinutes()/60+r.getUTCSeconds()/3600,a=2*Math.PI/365*(s-1+(n-12)/24),o=229.18*(75e-6+.001868*Math.cos(a)-.032077*Math.sin(a)-.014615*Math.cos(2*a)-.040849*Math.sin(2*a)),c=.006918-.399912*Math.cos(a)+.070257*Math.sin(a)-.006758*Math.cos(2*a)+907e-6*Math.sin(2*a)-.002697*Math.cos(3*a)+.00148*Math.sin(3*a),d=h(u(60*n+o+4*e,1440)/4-180),p=h(t),f=Math.acos(Math.min(Math.max(Math.sin(p)*Math.sin(c)+Math.cos(p)*Math.cos(c)*Math.cos(d),-1),1)),m=u(l(Math.atan2(Math.sin(d),Math.cos(d)*Math.sin(p)-Math.tan(c)*Math.cos(p)))+180,360);return{elevation:90-l(f),azimuth:m}}],14421)},11426,t=>{"use strict";t.s(["TideContextProvider",()=>u,"useTide",()=>c]);var e=t.i(43476),r=t.i(71645),i=t.i(66799),s=t.i(67561),n=t.i(85709),a=t.i(95430);let o=(0,r.createContext)(),h=["environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.tide.timeLow","environment.tide.timeHigh","environment.tide.coeffNow"],l=async t=>{try{let e,r,i=(0,a.vesselNow)(),s=i.getFullYear(),n=(i.getMonth()+1).toString().padStart(2,"0"),o=`./tides/larochelle/${n}_${s}.json`,h=await fetch(o);if(!h.ok)return void console.warn("TideContext: No local tide data found");let l=await h.json(),u=i.toISOString().split("T")[0];if(!l[u])return;let c=(0,a.vesselNow)(),d=60*c.getHours()+c.getMinutes(),p=null,f=null;for(let t of l[u].map(([t,e,r,i])=>{let[s,n]=e.split(":").map(Number);return{type:t,height:parseFloat(r),time:e,timeInMinutes:60*s+n,coef:i}}).sort((t,e)=>t.timeInMinutes-e.timeInMinutes))if(t.timeInMinutes<=d)p=t;else{f=t;break}if(!p||!f)return void console.warn("TideContext: Cannot determine tide trend from local data");if("tide.low"===p.type&&"tide.high"===f.type?(e="tide.high"===f.type?f:null,r="tide.low"===p.type?p:null):(e="tide.high"===p.type?p:null,r="tide.low"===f.type?f:null),e&&r){let i=`${c.getHours().toString().padStart(2,"0")}:${c.getMinutes().toString().padStart(2,"0")}`,s=((t,e,r,i,s)=>{let n,a,o,h;if(!r||!i||!s||!/^\d{1,2}:\d{2}$/.test(r)||!/^\d{1,2}:\d{2}$/.test(i)||!/^\d{1,2}:\d{2}$/.test(s))return console.error("Invalid time format provided to calculateTideHeightUsingTwelfths"),(t+e)/2;let l=t=>{let[e,r]=t.split(":").map(Number);return 60*e+r},u=l(i),c=l(s),d=l(r),p=!1;c<=d&&d<=u?(p=!0,n=e,a=t,o=c,h=u):(n=t,a=e,o=u,h=c+1440*(c<u));let f=Math.abs(h-o),m=Math.abs(a-n),y=d-o;y<0&&(y+=1440);let g=m/12,b=0;return b=y<=f/6?g*Math.ceil(y/(f/12)):y<=2*f/6?2*g+g*Math.ceil((y-f/6)/(f/12)):y<=3*f/6?5*g:y<=4*f/6?8*g:y<=5*f/6?10*g:m,p?n+b:n-b})(e.height,r.height,i,e.time,r.time);t({"environment.tide.heightNow":s,"environment.tide.heightHigh":e.height,"environment.tide.heightLow":r.height,"environment.tide.timeLow":r.time,"environment.tide.timeHigh":e.time,"environment.tide.coeffNow":e.coef})}else console.warn("TideContext: Tide data for today is incomplete")}catch(t){console.warn("TideContext: Failed to fetch local tide data:",t.message)}},u=({children:t})=>{let{updateSignalKData:u}=(0,s.useOcearoContext)(),{offsetMs:c}=(0,a.useVesselClock)(),d=(0,n.useSignalKPaths)(h),[p,f]=(0,r.useState)(null),[m,y]=(0,r.useState)(!1),[g,b]=(0,r.useState)(null),[v,x]=(0,r.useState)(null),[w,S]=(0,r.useState)(null),M=(0,r.useRef)(null),_=(0,r.useRef)(null),A=(0,r.useRef)(u);A.current=u;let T=(0,r.useCallback)(async()=>{y(!0),b(null);try{let t=await i.default.checkTideApiAvailability();if(f(t),t){S("signalk");let t=await i.default.getTideData();if(t){let e={};t.heightNow?.value!==void 0&&(e["environment.tide.heightNow"]=t.heightNow.value),t.heightHigh?.value!==void 0&&(e["environment.tide.heightHigh"]=t.heightHigh.value),t.heightLow?.value!==void 0&&(e["environment.tide.heightLow"]=t.heightLow.value),t.timeLow?.value!==void 0&&(e["environment.tide.timeLow"]=t.timeLow.value),t.timeHigh?.value!==void 0&&(e["environment.tide.timeHigh"]=t.timeHigh.value),t.coeffNow?.value!==void 0&&(e["environment.tide.coeffNow"]=t.coeffNow.value),Object.keys(e).length>0&&A.current(e)}x(new Date)}else S("local"),await l(A.current),x(new Date)}catch(t){console.warn("TideContext: Failed to fetch tide data:",t.message),b(t.message);try{S("local"),await l(A.current),x(new Date)}catch(t){console.warn("TideContext: Local fallback also failed:",t.message)}}finally{y(!1)}},[]),C=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let t=0!==c;t&&!C.current?(C.current=!0,T()):t||(C.current=!1)},[c,T]),(0,r.useEffect)(()=>(_.current=setTimeout(()=>{T()},3e3),M.current=setInterval(()=>{T()},6e5),()=>{_.current&&clearTimeout(_.current),M.current&&clearInterval(M.current)}),[T]);let E=(0,r.useMemo)(()=>({level:d["environment.tide.heightNow"],high:d["environment.tide.heightHigh"],low:d["environment.tide.heightLow"],timeLow:d["environment.tide.timeLow"],timeHigh:d["environment.tide.timeHigh"],coefficient:d["environment.tide.coeffNow"]}),[d]),R=(0,r.useMemo)(()=>({tideData:E,tideApiAvailable:p,source:w,isLoading:m,error:g,lastFetchTime:v,fetchTideData:T}),[E,p,w,m,g,v,T]);return(0,e.jsx)(o.Provider,{value:R,children:t})},c=()=>{let t=(0,r.useContext)(o);if(!t)throw Error("useTide must be used within a TideContextProvider");return t}},85709,t=>{"use strict";t.s(["useSignalKPath",()=>i,"useSignalKPaths",()=>n,"useSignalKPrefix",()=>a,"useSignalKRef",()=>s]);var e=t.i(71645),r=t.i(67561);let i=(t,i=null)=>{let{getSignalKValue:s,subscribe:n,unsubscribe:a}=(0,r.useOcearoContext)(),[o,h]=(0,e.useState)(()=>s(t)??i),l=(0,e.useRef)(i),u=(0,e.useRef)(o);l.current=i;let c=(0,e.useCallback)(t=>{let e=t??l.current;u.current=e,h(e)},[]);return(0,e.useEffect)(()=>{n&&n(t,c);let e=s(t);return null!=e&&(u.current=e,h(e)),()=>{a&&a(t,c)}},[t,n,a,s,c]),o},s=t=>{let{getSignalKValue:i,subscribe:s,unsubscribe:n}=(0,r.useOcearoContext)(),a=(0,e.useRef)(null);return(0,e.useEffect)(()=>{let e=t=>{a.current=t??null};return e(i(t)),s?.(t,e),()=>n?.(t,e)},[t,s,n,i]),a},n=t=>{let{getSignalKValue:i,subscribe:s,unsubscribe:n}=(0,r.useOcearoContext)(),a=JSON.stringify(t),o=(0,e.useRef)(t);JSON.stringify(o.current)!==a&&(o.current=t);let[h,l]=(0,e.useState)(()=>{let t={};return o.current.forEach(e=>{t[e]=i(e)}),t});return(0,e.useEffect)(()=>{let t=o.current,e={};t.forEach(t=>{e[t]=e=>{l(r=>r[t]===e?r:{...r,[t]:e})}}),s&&t.forEach(t=>s(t,e[t]));let r={},a=!1;return t.forEach(t=>{let e=i(t);null!=e&&(r[t]=e,a=!0)}),a&&l(t=>({...t,...r})),()=>{n&&t.forEach(t=>{e[t]&&n(t,e[t])})}},[a,s,n,i]),h},a=t=>{let{getSignalKValuesByPrefix:i,subscribePrefix:s,unsubscribePrefix:n}=(0,r.useOcearoContext)(),[a,o]=(0,e.useState)(()=>i(t));return(0,e.useEffect)(()=>{let e=(t,e)=>{o(r=>r[t]===e?r:{...r,[t]:e})};return s(t,e),o(i(t)),()=>n(e)},[t,s,n,i]),a}},66799,46991,t=>{"use strict";var e=t.i(67034),r=t.i(49018),i=t.i(83402);let s=t=>{if(null==t||""===t)return null;let e="number"==typeof t?t:Number(t);return Number.isFinite(e)?e:null},n=t=>null===(t=s(t))?null:Math.round(180*t/Math.PI*10)/10,a=t=>null===(t=s(t))?null:Math.round(1.94384*t*10)/10,o=t=>null===(t=s(t))?null:Math.round((t-273.15)*10)/10,h=null,l=()=>(h||(h=t.r(83402).default),h);t.s(["EARTH_RADIUS_METERS",0,6371e3,"KNOTS_TO_MPS",0,.51444,"convertDepthUnit",0,t=>{if(null===(t=s(t)))return null;switch(l().get("depthUnits")||"m"){case"ft":return Math.round(3.28084*t*10)/10;case"fa":return Math.round(.546807*t*10)/10;default:return Math.round(10*t)/10}},"convertDistanceUnit",0,t=>{if(null===(t=s(t)))return null;switch(l().get("distanceUnits")||"nm"){case"km":return Math.round(t/1e3*100)/100;case"mi":return Math.round(t/1609.344*100)/100;default:return Math.round(t/1852*100)/100}},"convertPressure",0,t=>null===(t=s(t))?null:Math.round(t/100*10)/10,"convertSpeedUnit",0,t=>{if(null===(t=s(t)))return null;switch(l().get("speedUnits")||"kn"){case"km/h":return Math.round(3.6*t*10)/10;case"mph":return Math.round(2.23694*t*10)/10;case"m/s":return Math.round(10*t)/10;default:return Math.round(1.94384*t*10)/10}},"convertTemperature",0,o,"convertTemperatureUnit",0,t=>null===(t=s(t))?null:"F"===(l().get("temperatureUnits")||"C")?Math.round(((t-273.15)*9/5+32)*10)/10:Math.round((t-273.15)*10)/10,"degToRad",0,t=>null===(t=s(t))?null:Math.PI/180*t,"finite",0,s,"getDepthUnitLabel",0,()=>l().get("depthUnits")||"m","getDistanceUnitLabel",0,()=>l().get("distanceUnits")||"nm","getSpeedUnitLabel",0,()=>l().get("speedUnits")||"kn","getTemperatureUnitLabel",0,()=>"F"===(l().get("temperatureUnits")||"C")?"°F":"°C","kelvinToCelsius",0,o,"knotsToMs",0,t=>null===(t=s(t))?null:t/1.94384,"msToKnots",0,a,"radToDeg",0,t=>null===(t=s(t))?null:180/Math.PI*t,"radiansToDegrees",0,n,"toDegrees",0,t=>null===(t=s(t))?null:Math.round((180*t/Math.PI+360)%360),"toKelvin",0,t=>{let e=s(t);return null===e?null:e+273.15},"toKnots",0,t=>null===(t=s(t))?null:(1.94384*t).toFixed(1)],46991);let u=new class t{constructor(){this.client=null,this.authToken=null,this.weatherApiAvailable=null,this.featuresCache=null,this.connectionListeners=[],this.isConnected=!1}getClientConfig(){let t=i.default.getAll(),e=i.default.getSignalKUrl(),[r,s]=e.replace(/https?:\/\//,"").replace(/\/.*$/,"").split(":"),n=e.startsWith("https");return{hostname:r||"localhost",port:parseInt(s)||(n?443:80),useTLS:n,useAuthentication:t.useAuthentication||!1,username:t.username||null,password:t.password||null,reconnect:!0,autoConnect:!1,notifications:!1,deltaStreamBehaviour:"self",sendMeta:"all",wsKeepaliveInterval:10}}createClient(t={}){let e={...this.getClientConfig(),...t};return new r.default(e)}async connect(t={}){try{return this.client=this.createClient(t),await this.client.connect(),this.isConnected=!0,await this.checkWeatherApiAvailability(),this.connectionListeners.forEach(t=>t(!0,this.client)),this.client}catch(t){throw console.error("SignalKService: Failed to connect:",t),this.isConnected=!1,this.connectionListeners.forEach(e=>e(!1,null,t)),t}}disconnect(){this.client&&(this.client.disconnect(),this.client=null,this.isConnected=!1,this.connectionListeners.forEach(t=>t(!1,null)))}addConnectionListener(t){this.connectionListeners.push(t)}removeConnectionListener(t){this.connectionListeners=this.connectionListeners.filter(e=>e!==t)}getBaseUrl(){return i.default.getSignalKUrl()}isDemoSignalK(){let t=i.default.getAll(),e=i.default.getSignalKUrl()||"";return t.debugMode||e.includes("demo.signalk.org")}getAuthHeaders(){let t=i.default.getAll(),r={"Content-Type":"application/json"};if(t.useAuthentication&&t.username){let i="function"==typeof btoa?btoa(`${t.username}:${t.password||""}`):e.Buffer.from(`${t.username}:${t.password||""}`).toString("base64");r.Authorization=`Basic ${i}`}return this.authToken&&(r.Authorization=`Bearer ${this.authToken}`),r}async apiCall(t,e={}){let r=this.getBaseUrl(),s=`${r}${t}`,n=this.getAuthHeaders(),a=i.default.getAll(),o=a.useAuthentication&&a.username?"include":"omit",{timeoutMs:h=1e4,...l}=e,u=new AbortController,c=setTimeout(()=>u.abort(),h);try{let t=await fetch(s,{credentials:o,...l,headers:{...n,...l.headers},signal:u.signal}),e=await t.text(),r=null;if(e)try{r=JSON.parse(e)}catch{r=e}if(!t.ok){let e=r?.message?` — ${r.message}`:"",i=Error(`SignalK API error (${t.status}): ${t.statusText}${e}`);throw i.status=t.status,i}return r}catch(e){if("AbortError"===e.name){let e=Error(`SignalK request timed out after ${h/1e3}s`);throw e.name="NetworkError",console.warn(`SignalKService: Timeout for ${t}`),e}if("TypeError"===e.name&&("Failed to fetch"===e.message||e.message.includes("NetworkError"))){let i=Error(`SignalK server unreachable at ${r}`);throw i.name="NetworkError",console.warn(`SignalKService: Server unreachable for ${t}:`,e.message),i}throw 400===e.status||404===e.status?console.warn(`SignalKService: API call returned error for ${t}:`,e.message):console.warn(`SignalKService: API call failed for ${t}:`,e),e}finally{clearTimeout(c)}}async getHistoryValues({paths:t,duration:e,resolution:r,context:i}){let s=new URLSearchParams({paths:t.join(","),duration:e});r&&s.set("resolution",r),i&&s.set("context",i);try{let t=await this.apiCall(`/signalk/v2/api/history/values?${s}`);return Array.isArray(t?.data)?t.data:null}catch{return null}}async notificationAction(t,e){if(!t||!["silence","acknowledge"].includes(e))throw Error(`Invalid notification action: ${e}`);return this.apiCall(`/signalk/v2/api/notifications/${encodeURIComponent(t)}/${e}`,{method:"POST"})}async clearNotification(t){if(!t)throw Error("Notification id required");return this.apiCall(`/signalk/v2/api/notifications/${encodeURIComponent(t)}`,{method:"DELETE"})}async raiseMob(t){let e=await this.apiCall("/signalk/v2/api/notifications/mob",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{message:t}:{})});return e?.id}async getFeatures(){let t=this.getBaseUrl();if(this.featuresCache?.baseUrl===t)return this.featuresCache.promise;let e=this.apiCall("/signalk/v2/features?enabled=1").then(t=>({apis:Array.isArray(t?.apis)?t.apis:[],plugins:Array.isArray(t?.plugins)?t.plugins:[]})).catch(t=>404===t.status?{apis:[],plugins:[]}:(this.featuresCache?.promise===e&&(this.featuresCache=null),null));return this.featuresCache={baseUrl:t,promise:e},e}async checkWeatherApiAvailability(){try{let t=await fetch(`${this.getBaseUrl()}/signalk/v2/api/weather`,{method:"GET",headers:this.getAuthHeaders()});return this.weatherApiAvailable=t.ok,this.weatherApiAvailable}catch(t){return"TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))||console.warn("SignalKService: Weather API check failed:",t.message),this.weatherApiAvailable=!1,!1}}isWeatherApiAvailable(){return this.weatherApiAvailable}async getWeatherForecast(t,e,r=48){if(!1===this.weatherApiAvailable)throw Error("Weather API is not available");if(null==t||null==e)throw Error("Position is required for weather forecast");let i=`/signalk/v2/api/weather/forecasts/point?lat=${t}&lon=${e}&count=${r}`;return await this.apiCall(i)}async getDailyWeatherForecast(t,e,r=7){if(!1===this.weatherApiAvailable)throw Error("Weather API is not available");if(null==t||null==e)throw Error("Position is required for weather forecast");let i=`/signalk/v2/api/weather/forecasts/daily?lat=${t}&lon=${e}&count=${r}`;return await this.apiCall(i)}async getCurrentWeather(){if(!1===this.weatherApiAvailable)throw Error("Weather API is not available");return await this.apiCall("/signalk/v2/api/weather/observations")}parseWeatherForecast(t){let e=[],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return Object.values(t).forEach(t=>{let i={description:t.description||"",date:t.date||null,time:"",temperature:null,temperatureMin:null,temperatureMax:null,dewPoint:null,humidity:null,pressure:null,rain:null,uvIndex:null,clouds:null,visibility:null,wind:{speed:null,direction:null,gust:null}};if(t.date){let e=new Date(t.date);i.time=`${r[e.getDay()]} ${e.getHours()}:${("00"+e.getMinutes()).slice(-2)}`}if(void 0!==t.outside?.temperature&&(i.temperature=this.kelvinToCelsius(t.outside.temperature)),void 0!==t.outside?.minTemperature&&(i.temperatureMin=this.kelvinToCelsius(t.outside.minTemperature)),void 0!==t.outside?.maxTemperature&&(i.temperatureMax=this.kelvinToCelsius(t.outside.maxTemperature)),void 0!==t.outside?.dewPointTemperature&&(i.dewPoint=this.kelvinToCelsius(t.outside.dewPointTemperature)),"number"==typeof t.outside?.relativeHumidity){let e=t.outside.relativeHumidity;i.humidity=e>1?e/100:e}void 0!==t.outside?.pressure&&(i.pressure=Math.round(t.outside.pressure)),void 0!==t.outside?.uvIndex&&(i.uvIndex=t.outside.uvIndex),void 0!==t.outside?.cloudCover?i.clouds=t.outside.cloudCover:void 0!==t.outside?.clouds&&(i.clouds=t.outside.clouds),void 0!==t.outside?.horizontalVisibility?i.visibility=t.outside.horizontalVisibility:void 0!==t.outside?.visibility&&(i.visibility=t.outside.visibility),void 0!==t.outside?.precipitationVolume&&(i.rain=1e3*t.outside.precipitationVolume),void 0!==t.wind&&(void 0!==t.wind.speedTrue&&(i.wind.speed=this.msToKnots(t.wind.speedTrue)),void 0!==t.wind.gust&&(i.wind.gust=this.msToKnots(t.wind.gust)),void 0!==t.wind.directionTrue&&(i.wind.direction=this.radiansToDegrees(t.wind.directionTrue))),e.push(i)}),e}kelvinToCelsius(t){return o(t)}msToKnots(t){return a(t)}radiansToDegrees(t){return n(t)}async login(t,e){let r=this.getBaseUrl();try{let i=await fetch(`${r}/signalk/v1/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:e})});if(!i.ok)throw Error(`Login failed: ${i.statusText}`);let s=await i.json();return this.authToken=s.token,this.authToken}catch(t){if("TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))){let t=Error(`SignalK server unreachable at ${r}`);throw t.name="NetworkError",t}throw console.error("SignalKService: Login failed:",t),t}}async isLoggedIn(){try{return(await fetch(`${this.getBaseUrl()}/signalk/v1/auth/user`,{headers:this.getAuthHeaders()})).ok}catch(t){return"TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError")),!1}}static RESOURCE_TYPES=["routes","waypoints","notes","regions","charts"];async listResources(e,r={}){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);let i=`/signalk/v2/api/resources/${e}`,s=new URLSearchParams;r.bbox&&s.append("bbox",r.bbox),r.distance&&s.append("distance",r.distance),r.position&&s.append("position",r.position);let n=s.toString();return n&&(i+=`?${n}`),await this.apiCall(i)}async getResource(e,r){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);let i=`/signalk/v2/api/resources/${e}/${encodeURIComponent(r)}`;return await this.apiCall(i)}async setResource(e,r,i){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);let s=`/signalk/v2/api/resources/${e}/${encodeURIComponent(r)}`;return await this.apiCall(s,{method:"PUT",body:JSON.stringify(i)})}async deleteResource(e,r){if(!t.RESOURCE_TYPES.includes(e))throw Error(`Invalid resource type: ${e}`);await this.apiCall(`/signalk/v2/api/resources/${e}/${encodeURIComponent(r)}`,{method:"DELETE"})}async getRoutes(t={}){return await this.listResources("routes",t)}async getRoute(t){return await this.getResource("routes",t)}async saveRoute(t,e){return await this.setResource("routes",t,e)}async deleteRoute(t){return await this.deleteResource("routes",t)}async getWaypoints(t={}){return await this.listResources("waypoints",t)}async getWaypoint(t){return await this.getResource("waypoints",t)}async saveWaypoint(t,e){return await this.setResource("waypoints",t,e)}async deleteWaypoint(t){return await this.deleteResource("waypoints",t)}async getCharts(){return await this.listResources("charts")}async getChart(t){return await this.getResource("charts",t)}async getNotes(t={}){return await this.listResources("notes",t)}async getNote(t){return await this.getResource("notes",t)}async saveNote(t,e){return await this.setResource("notes",t,e)}async deleteNote(t){return await this.deleteResource("notes",t)}async getRegions(t={}){return await this.listResources("regions",t)}async getRegion(t){return await this.getResource("regions",t)}async getCourse(){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course")}async getCourseCalculations(){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/calcValues")}async setDestinationWaypoint(t){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/destination",{method:"PUT",body:JSON.stringify({href:`/resources/waypoints/${t}`})})}async setDestinationPosition(t,e){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/destination",{method:"PUT",body:JSON.stringify({position:{latitude:t,longitude:e}})})}async activateRoute(t,e=0,r=!1){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/activeRoute",{method:"PUT",body:JSON.stringify({href:`/resources/routes/${t}`,pointIndex:e,reverse:r})})}async clearCourse(){await this.apiCall("/signalk/v2/api/vessels/self/navigation/course",{method:"DELETE"})}async moveRoutePoint(t){return this.apiCall("/signalk/v2/api/vessels/self/navigation/course/activeRoute/nextPoint",{method:"PUT",body:JSON.stringify({value:t})})}async nextWaypoint(){return this.moveRoutePoint(1)}async previousWaypoint(){return this.moveRoutePoint(-1)}async setArrivalCircle(t){return await this.apiCall("/signalk/v2/api/vessels/self/navigation/course/arrivalCircle",{method:"PUT",body:JSON.stringify({value:t})})}generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}createWaypointFeature(t,e,r,i=""){return{name:r,description:i,feature:{type:"Feature",geometry:{type:"Point",coordinates:[t,e]},properties:{}}}}createRouteFeature(t,e,r=""){return{name:e,description:r,feature:{type:"Feature",geometry:{type:"LineString",coordinates:t},properties:{}}}}parseRouteCoordinates(t){return t?.feature?.geometry?.coordinates?t.feature.geometry.coordinates.map(t=>({longitude:t[0],latitude:t[1]})):[]}parseWaypointPosition(t){if(!t?.feature?.geometry?.coordinates)return null;let e=t.feature.geometry.coordinates;return{longitude:e[0],latitude:e[1]}}autopilotPath(t="_default",e=""){return`/signalk/v2/api/vessels/self/autopilots/${encodeURIComponent(t)}${e}`}async getAutopilotDevices(){try{let t=await this.apiCall("/signalk/v2/api/vessels/self/autopilots");return Object.keys(t||{})}catch(t){return console.warn("SignalKService: Could not fetch autopilot devices:",t.message),[]}}async getAutopilotData(t="_default"){return this.apiCall(this.autopilotPath(t))}async setAutopilotState(t,e="_default"){if("string"!=typeof t||!t)throw Error(`Invalid autopilot state: ${t}`);return this.apiCall(this.autopilotPath(e,"/state"),{method:"PUT",body:JSON.stringify({value:t})})}async setAutopilotMode(t,e="_default"){if("string"!=typeof t||!t)throw Error(`Invalid autopilot mode: ${t}`);return this.apiCall(this.autopilotPath(e,"/mode"),{method:"PUT",body:JSON.stringify({value:t})})}async setAutopilotTarget(t,e="_default"){return this.apiCall(this.autopilotPath(e,"/target"),{method:"PUT",body:JSON.stringify({value:t})})}async adjustAutopilotTarget(t,e="_default"){return this.apiCall(this.autopilotPath(e,"/target/adjust"),{method:"PUT",body:JSON.stringify({value:t,units:"deg"})})}async engageAutopilot(t="_default"){return this.apiCall(this.autopilotPath(t,"/engage"),{method:"POST"})}async disengageAutopilot(t="_default"){return this.apiCall(this.autopilotPath(t,"/disengage"),{method:"POST"})}async autopilotManeuver(t,e,r="_default"){if("tack"!==t&&"gybe"!==t)throw Error(`Invalid maneuver: ${t}`);if("port"!==e&&"starboard"!==e)throw Error(`Invalid direction: ${e}`);return this.apiCall(this.autopilotPath(r,`/${t}/${e}`),{method:"POST"})}async autopilotTack(t,e="_default"){return this.autopilotManeuver("tack",t,e)}async autopilotGybe(t,e="_default"){return this.autopilotManeuver("gybe",t,e)}async autopilotDodge({deltaDegrees:t=null,exit:e=!1}={},r="_default"){let i=this.autopilotPath(r,"/dodge");return e?this.apiCall(i,{method:"DELETE"}):null===t?this.apiCall(i,{method:"POST"}):this.apiCall(i,{method:"PUT",body:JSON.stringify({value:t,units:"deg"})})}async autopilotCourseAction(t,e="_default"){if("courseCurrentPoint"!==t&&"courseNextPoint"!==t)throw Error(`Invalid course action: ${t}`);return this.apiCall(this.autopilotPath(e,`/${t}`),{method:"POST"})}async isAutopilotAvailable(){try{return(await this.getAutopilotDevices()).length>0}catch(t){return!1}}async checkTideApiAvailability(){if(this.isDemoSignalK())return!1;try{let t=await fetch(`${this.getBaseUrl()}/signalk/v1/api/vessels/self/environment/tide`,{method:"GET",headers:this.getAuthHeaders()});if(t.ok){let e=await t.json();return null!==e&&"object"==typeof e&&Object.keys(e).length>0}return!1}catch(t){return"TypeError"===t.name&&("Failed to fetch"===t.message||t.message.includes("NetworkError"))||console.warn("SignalKService: Tide API check failed:",t.message),!1}}async getTideData(){if(this.isDemoSignalK())return null;try{return await this.apiCall("/signalk/v1/api/vessels/self/environment/tide")}catch(t){return console.warn("SignalKService: Could not fetch tide data:",t.message),null}}};t.s(["default",0,u],66799)},95430,t=>{"use strict";t.s(["useVesselClock",()=>a,"vesselNow",()=>n]);var e=t.i(71645),r=t.i(85709);let i=0,s=!1,n=()=>new Date(Date.now()+i),a=()=>{let t=(0,r.useSignalKPath)("navigation.datetime");(0,e.useEffect)(()=>{(t=>{if(null==t)return;let e=t instanceof Date?t.getTime():new Date(t).getTime();if(!Number.isFinite(e))return;let r=e-Date.now(),n=Math.abs(r)>=6e4,a=n?r:0;return(a!==i||s!==n)&&(i=a,s=n)})(t)},[t]);let{offsetMs:n,corrected:a}=(0,e.useMemo)(()=>{let e=null==t?NaN:new Date(t).getTime(),r=Number.isFinite(e)?e-Date.now():0,i=Math.abs(r)>=6e4;return{offsetMs:i?r:0,corrected:i}},[t]),o=(0,e.useRef)(n);o.current=n;let h=(0,e.useCallback)(()=>new Date(Date.now()+o.current),[]);return(0,e.useMemo)(()=>({now:h,offsetMs:n,corrected:a}),[h,n,a])}},78492,(t,e,r)=>{"use strict";var i=Object.prototype.hasOwnProperty,s="~";function n(){}function a(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,r,i,n){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new a(r,i||t,n),h=s?s+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(s=!1)),l.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(s?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},l.prototype.listeners=function(t){var e=s?s+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,n=r.length,a=Array(n);i<n;i++)a[i]=r[i].fn;return a},l.prototype.listenerCount=function(t){var e=s?s+t:t,r=this._events[e];return r?r.fn?1:r.length:0},l.prototype.emit=function(t,e,r,i,n,a){var o=s?s+t:t;if(!this._events[o])return!1;var h,l,u=this._events[o],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,n),!0;case 6:return u.fn.call(u.context,e,r,i,n,a),!0}for(l=1,h=Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!h)for(d=1,h=Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},l.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},l.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},l.prototype.removeListener=function(t,e,r,i){var n=s?s+t:t;if(!this._events[n])return this;if(!e)return h(this,n),this;var a=this._events[n];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||h(this,n);else{for(var o=0,l=[],u=a.length;o<u;o++)(a[o].fn!==e||i&&!a[o].once||r&&a[o].context!==r)&&l.push(a[o]);l.length?this._events[n]=1===l.length?l[0]:l:h(this,n)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&h(this,e)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=s,l.EventEmitter=l,e.exports=l},58033,(t,e,r)=>{var i=null;e.exports=i="u">typeof WebSocket?WebSocket:"u">typeof MozWebSocket?MozWebSocket:t.g.WebSocket||t.g.MozWebSocket},20502,(t,e,r)=>{var i="u">typeof globalThis&&globalThis||"u">typeof self&&self||t.g,s=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();(function(e){var r=void 0!==s&&s||"u">typeof self&&self||t.g||{},i={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(i.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function c(t){if(!t._noBody){if(t.bodyUsed)return Promise.reject(TypeError("Already read"));t.bodyUsed=!0}}function d(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function p(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){if(this.bodyUsed=this.bodyUsed,this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(i.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(i.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else{var e;i.arrayBuffer&&i.blob&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||a(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=c(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(p);throw Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,i,s,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=d(e=new FileReader),s=(i=/charset=([A-Za-z0-9_-]+)/.exec(t.type))?i[1]:"utf-8",e.readAsText(t,s),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=Array(e.length),i=0;i<e.length;i++)r[i]=String.fromCharCode(e[i]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=o(t),e=h(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[o(t)]},u.prototype.get=function(t){return t=o(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(o(t))},u.prototype.set=function(t,e){this.map[o(t)]=h(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),l(t)},u.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),l(t)},u.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),l(t)},i.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function g(t,e){if(!(this instanceof g))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var i,s,n=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new u(e.headers)),this.method=(s=(i=e.method||this.method||"GET").toUpperCase(),y.indexOf(s)>-1?s:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in r)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),("GET"===this.method||"HEAD"===this.method)&&("no-store"===e.cache||"no-cache"===e.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function b(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(s))}}),e}function v(t,e){if(!(this instanceof v))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},m.call(g.prototype),m.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var x=[301,302,303,307,308];v.redirect=function(t,e){if(-1===x.indexOf(e))throw RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(t,s){return new Promise(function(n,a){var l=new g(t,s);if(l.signal&&l.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}if(c.onload=function(){var t,e,r={statusText:c.statusText,headers:(t=c.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var r=t.split(":"),i=r.shift().trim();if(i){var s=r.join(":").trim();try{e.append(i,s)}catch(t){console.warn("Response "+t.message)}}}),e)};0===l.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var i="response"in c?c.response:c.responseText;setTimeout(function(){n(new v(i,r))},0)},c.onerror=function(){setTimeout(function(){a(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){a(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){a(new e.DOMException("Aborted","AbortError"))},0)},c.open(l.method,function(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?c.withCredentials=!0:"omit"===l.credentials&&(c.withCredentials=!1),"responseType"in c&&(i.blob?c.responseType="blob":i.arrayBuffer&&(c.responseType="arraybuffer")),s&&"object"==typeof s.headers&&!(s.headers instanceof u||r.Headers&&s.headers instanceof r.Headers)){var p=[];Object.getOwnPropertyNames(s.headers).forEach(function(t){p.push(o(t)),c.setRequestHeader(t,h(s.headers[t]))}),l.headers.forEach(function(t,e){-1===p.indexOf(e)&&c.setRequestHeader(e,t)})}else l.headers.forEach(function(t,e){c.setRequestHeader(e,t)});l.signal&&(l.signal.addEventListener("abort",d),c.onreadystatechange=function(){4===c.readyState&&l.signal.removeEventListener("abort",d)}),c.send(void 0===l._bodyInit?null:l._bodyInit)})}w.polyfill=!0,r.fetch||(r.fetch=w,r.Headers=u,r.Request=g,r.Response=v),e.Headers=u,e.Request=g,e.Response=v,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})})({}),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var n=i.fetch?i:s;(r=n.fetch).default=n.fetch,r.fetch=n.fetch,r.Headers=n.Headers,r.Request=n.Request,r.Response=n.Response,e.exports=r},76775,(t,e,r)=>{function i(t,e,r,i){return Math.round(t/r)+" "+i+(e>=1.5*r?"s":"")}e.exports=function(t,e){e=e||{};var r,s,n,a,o=typeof t;if("string"===o&&t.length>0){var h=t;if(!((h=String(h)).length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(l){var u=parseFloat(l[1]);switch((l[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===o&&isFinite(t)){return e.long?(s=Math.abs(r=t))>=864e5?i(r,s,864e5,"day"):s>=36e5?i(r,s,36e5,"hour"):s>=6e4?i(r,s,6e4,"minute"):s>=1e3?i(r,s,1e3,"second"):r+" ms":(a=Math.abs(n=t))>=864e5?Math.round(n/864e5)+"d":a>=36e5?Math.round(n/36e5)+"h":a>=6e4?Math.round(n/6e4)+"m":a>=1e3?Math.round(n/1e3)+"s":n+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},7003,(t,e,r)=>{e.exports=function(e){function r(t){let e,s,n,a=null;function o(...t){if(!o.enabled)return;let i=Number(new Date);o.diff=i-(e||i),o.prev=e,o.curr=i,e=i,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(e,i)=>{if("%%"===e)return"%";s++;let n=r.formatters[i];if("function"==typeof n){let r=t[s];e=n.call(o,r),t.splice(s,1),s--}return e}),r.formatArgs.call(o,t),(o.log||r.log).apply(o,t)}return o.namespace=t,o.useColors=r.useColors(),o.color=r.selectColor(t),o.extend=i,o.destroy=r.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==r.namespaces&&(s=r.namespaces,n=r.enabled(t)),n),set:t=>{a=t}}),"function"==typeof r.init&&r.init(o),o}function i(t,e){let i=r(this.namespace+(void 0===e?":":e)+t);return i.log=this.log,i}function s(t,e){let r=0,i=0,s=-1,n=0;for(;r<t.length;)if(i<e.length&&(e[i]===t[r]||"*"===e[i]))"*"===e[i]?(s=i,n=r):r++,i++;else{if(-1===s)return!1;i=s+1,r=++n}for(;i<e.length&&"*"===e[i];)i++;return i===e.length}return r.debug=r,r.default=r,r.coerce=function(t){return t instanceof Error?t.stack||t.message:t},r.disable=function(){let t=[...r.names,...r.skips.map(t=>"-"+t)].join(",");return r.enable(""),t},r.enable=function(t){for(let e of(r.save(t),r.namespaces=t,r.names=[],r.skips=[],("string"==typeof t?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===e[0]?r.skips.push(e.slice(1)):r.names.push(e)},r.enabled=function(t){for(let e of r.skips)if(s(t,e))return!1;for(let e of r.names)if(s(t,e))return!0;return!1},r.humanize=t.r(76775),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{r[t]=e[t]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r)|0;return r.colors[Math.abs(e)%r.colors.length]},r.enable(r.load()),r}},48450,(t,e,r)=>{let i;var s=t.i(47167);r.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let i=0,s=0;t[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(i++,"%c"===t&&(s=i))}),t.splice(s,0,r)},r.save=function(t){try{t?r.storage.setItem("debug",t):r.storage.removeItem("debug")}catch(t){}},r.load=function(){let t;try{t=r.storage.getItem("debug")||r.storage.getItem("DEBUG")}catch(t){}return!t&&void 0!==s.default&&"env"in s.default&&(t=s.default.env.DEBUG),t},r.useColors=function(){let t;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage=function(){try{return localStorage}catch(t){}}(),i=!1,r.destroy=()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))},r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],r.log=console.debug||console.log||(()=>{}),e.exports=t.r(7003)(r);let{formatters:n}=e.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=l(t),r=e[0],i=e[1];return(r+i)*3/4-i},r.toByteArray=function(t){var e,r,i=l(t),a=i[0],o=i[1],h=new n((a+o)*3/4-o),u=0,c=o>0?a-4:a;for(r=0;r<c;r+=4)e=s[t.charCodeAt(r)]<<18|s[t.charCodeAt(r+1)]<<12|s[t.charCodeAt(r+2)]<<6|s[t.charCodeAt(r+3)],h[u++]=e>>16&255,h[u++]=e>>8&255,h[u++]=255&e;return 2===o&&(e=s[t.charCodeAt(r)]<<2|s[t.charCodeAt(r+1)]>>4,h[u++]=255&e),1===o&&(e=s[t.charCodeAt(r)]<<10|s[t.charCodeAt(r+1)]<<4|s[t.charCodeAt(r+2)]>>2,h[u++]=e>>8&255,h[u++]=255&e),h},r.fromByteArray=function(t){for(var e,r=t.length,s=r%3,n=[],a=0,o=r-s;a<o;a+=16383)n.push(function(t,e,r){for(var s,n=[],a=e;a<r;a+=3)s=(t[a]<<16&0xff0000)+(t[a+1]<<8&65280)+(255&t[a+2]),n.push(i[s>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return n.join("")}(t,a,a+16383>o?o:a+16383));return 1===s?n.push(i[(e=t[r-1])>>2]+i[e<<4&63]+"=="):2===s&&n.push(i[(e=(t[r-2]<<8)+t[r-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),n.join("")};for(var i=[],s=[],n="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=a.length;o<h;++o)i[o]=a[o],s[a.charCodeAt(o)]=o;function l(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var i=r===e?0:4-r%4;return[r,i]}s[45]=62,s[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,i,s){var n,a,o=8*s-i-1,h=(1<<o)-1,l=h>>1,u=-7,c=r?s-1:0,d=r?-1:1,p=t[e+c];for(c+=d,n=p&(1<<-u)-1,p>>=-u,u+=o;u>0;n=256*n+t[e+c],c+=d,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=i;u>0;a=256*a+t[e+c],c+=d,u-=8);if(0===n)n=1-l;else{if(n===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,i),n-=l}return(p?-1:1)*a*Math.pow(2,n-i)},r.write=function(t,e,r,i,s,n){var a,o,h,l=8*n-s-1,u=(1<<l)-1,c=u>>1,d=5960464477539062e-23*(23===s),p=i?0:n-1,f=i?1:-1,m=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(o=+!!isNaN(e),a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),a+c>=1?e+=d/h:e+=d*Math.pow(2,1-c),e*h>=2&&(a++,h/=2),a+c>=u?(o=0,a=u):a+c>=1?(o=(e*h-1)*Math.pow(2,s),a+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,s),a=0));s>=8;t[r+p]=255&o,p+=f,o/=256,s-=8);for(a=a<<s|o,l+=s;l>0;t[r+p]=255&a,p+=f,a/=256,l-=8);t[r+p-f]|=128*m}},43943,(t,e,r)=>{"use strict";let i=t.r(34582),s=t.r(38492),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return u(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t){var i=t,s=e;if(("string"!=typeof s||""===s)&&(s="utf8"),!o.isEncoding(s))throw TypeError("Unknown encoding: "+s);let r=0|f(i,s),n=a(r),h=n.write(i,s);return h!==r&&(n=n.slice(0,h)),n}if(ArrayBuffer.isView(t)){var n=t;if(N(n,Uint8Array)){let t=new Uint8Array(n);return d(t.buffer,t.byteOffset,t.byteLength)}return c(n)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let h=t.valueOf&&t.valueOf();if(null!=h&&h!==t)return o.from(h,e,r);let l=function(t){if(o.isBuffer(t)){let e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(l)return l;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),a(t<0?0:0|p(t))}function c(t){let e=t.length<0?0:0|p(t.length),r=a(e);for(let i=0;i<e;i+=1)r[i]=255&t[i];return r}function d(t,e,r){let i;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),o.prototype),i}function p(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function f(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(s)return i?-1:B(t).length;e=(""+e).toLowerCase(),s=!0}}function m(t,e,r){let s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let s="";for(let i=e;i<r;++i)s+=F[t[i]];return s}(this,e,r);case"utf8":case"utf-8":return v(this,e,r);case"ascii":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let s=e;s<r;++s)i+=String.fromCharCode(127&t[s]);return i}(this,e,r);case"latin1":case"binary":return function(t,e,r){let i="";r=Math.min(t.length,r);for(let s=e;s<r;++s)i+=String.fromCharCode(t[s]);return i}(this,e,r);case"base64":var n,a,o;return n=this,a=e,o=r,0===a&&o===n.length?i.fromByteArray(n):i.fromByteArray(n.slice(a,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let i=t.slice(e,r),s="";for(let t=0;t<i.length-1;t+=2)s+=String.fromCharCode(i[t]+256*i[t+1]);return s}(this,e,r);default:if(s)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}function y(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,s){var n;if(0===t.length)return -1;if("string"==typeof r?(i=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(n=r*=1)!=n&&(r=s?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(s)return -1;else r=t.length-1;else if(r<0)if(!s)return -1;else r=0;if("string"==typeof e&&(e=o.from(e,i)),o.isBuffer(e))return 0===e.length?-1:b(t,e,r,i,s);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,i,s)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,i,s){let n,a=1,o=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return -1;a=2,o/=2,h/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(s){let i=-1;for(n=r;n<o;n++)if(l(t,n)===l(e,-1===i?0:n-i)){if(-1===i&&(i=n),n-i+1===h)return i*a}else -1!==i&&(n-=n-i),i=-1}else for(r+h>o&&(r=o-h),n=r;n>=0;n--){let r=!0;for(let i=0;i<h;i++)if(l(t,n+i)!==l(e,i)){r=!1;break}if(r)return n}return -1}function v(t,e,r){r=Math.min(t.length,r);let i=[],s=e;for(;s<r;){let e=t[s],n=null,a=e>239?4:e>223?3:e>191?2:1;if(s+a<=r){let r,i,o,h;switch(a){case 1:e<128&&(n=e);break;case 2:(192&(r=t[s+1]))==128&&(h=(31&e)<<6|63&r)>127&&(n=h);break;case 3:r=t[s+1],i=t[s+2],(192&r)==128&&(192&i)==128&&(h=(15&e)<<12|(63&r)<<6|63&i)>2047&&(h<55296||h>57343)&&(n=h);break;case 4:r=t[s+1],i=t[s+2],o=t[s+3],(192&r)==128&&(192&i)==128&&(192&o)==128&&(h=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&o)>65535&&h<1114112&&(n=h)}}null===n?(n=65533,a=1):n>65535&&(n-=65536,i.push(n>>>10&1023|55296),n=56320|1023&n),i.push(n),s+=a}var n=i;let a=n.length;if(a<=4096)return String.fromCharCode.apply(String,n);let o="",h=0;for(;h<a;)o+=String.fromCharCode.apply(String,n.slice(h,h+=4096));return o}function x(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function w(t,e,r,i,s,n){if(!o.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<n)throw RangeError('"value" argument is out of bounds');if(r+i>t.length)throw RangeError("Index out of range")}function S(t,e,r,i,s){O(e,i,s,t,r,7);let n=Number(e&BigInt(0xffffffff));t[r++]=n,n>>=8,t[r++]=n,n>>=8,t[r++]=n,n>>=8,t[r++]=n;let a=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function M(t,e,r,i,s){O(e,i,s,t,r,7);let n=Number(e&BigInt(0xffffffff));t[r+7]=n,n>>=8,t[r+6]=n,n>>=8,t[r+5]=n,n>>=8,t[r+4]=n;let a=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function _(t,e,r,i,s,n){if(r+i>t.length||r<0)throw RangeError("Index out of range")}function A(t,e,r,i,n){return e*=1,r>>>=0,n||_(t,e,r,4,34028234663852886e22,-34028234663852886e22),s.write(t,e,r,i,23,4),r+4}function T(t,e,r,i,n){return e*=1,r>>>=0,n||_(t,e,r,8,17976931348623157e292,-17976931348623157e292),s.write(t,e,r,i,52,8),r+8}r.Buffer=o,r.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,r){return(l(t),t<=0)?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(N(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let s=0,n=Math.min(r,i);s<n;++s)if(t[s]!==e[s]){r=t[s],i=e[s];break}return r<i?-1:+(i<r)},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let i=o.allocUnsafe(e),s=0;for(r=0;r<t.length;++r){let e=t[r];if(N(e,Uint8Array))s+e.length>i.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(i,s)):Uint8Array.prototype.set.call(i,e,s);else if(o.isBuffer(e))e.copy(i,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=e.length}return i},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},o.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},o.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},o.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?v(this,0,t):m.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,e,r,i,s){if(N(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||r>t.length||i<0||s>this.length)throw RangeError("out of range index");if(i>=s&&e>=r)return 0;if(i>=s)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,s>>>=0,this===t)return 0;let n=s-i,a=r-e,h=Math.min(n,a),l=this.slice(i,s),u=t.slice(e,r);for(let t=0;t<h;++t)if(l[t]!==u[t]){n=l[t],a=u[t];break}return n<a?-1:+(a<n)},o.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},o.prototype.write=function(t,e,r,i){var s,n,a,o,h,l,u,c;if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let d=this.length-e;if((void 0===r||r>d)&&(r=d),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let p=!1;for(;;)switch(i){case"hex":return function(t,e,r,i){let s;r=Number(r)||0;let n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;let a=e.length;for(i>a/2&&(i=a/2),s=0;s<i;++s){var o;let i=parseInt(e.substr(2*s,2),16);if((o=i)!=o)break;t[r+s]=i}return s}(this,t,e,r);case"utf8":case"utf-8":return s=e,n=r,z(B(t,this.length-s),this,s,n);case"ascii":case"latin1":case"binary":return a=e,o=r,z(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,a,o);case"base64":return h=e,l=r,z(L(t),this,h,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=e,c=r,z(function(t,e){let r,i,s=[];for(let n=0;n<t.length&&!((e-=2)<0);++n)i=(r=t.charCodeAt(n))>>8,s.push(r%256),s.push(i);return s}(t,this.length-u),this,u,c);default:if(p)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,o.prototype),i},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t],s=1,n=0;for(;++n<e&&(s*=256);)i+=this[t+n]*s;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t+--e],s=1;for(;e>0&&(s*=256);)i+=this[t+--e]*s;return i},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=j(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&k(t,this.length-8);let i=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],s=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(i)+(BigInt(s)<<BigInt(32))}),o.prototype.readBigUInt64BE=j(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&k(t,this.length-8);let i=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],s=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<<BigInt(32))+BigInt(s)}),o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=this[t],s=1,n=0;for(;++n<e&&(s*=256);)i+=this[t+n]*s;return i>=(s*=128)&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let i=e,s=1,n=this[t+--i];for(;i>0&&(s*=256);)n+=this[t+--i]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*e)),n},o.prototype.readInt8=function(t,e){return(t>>>=0,e||x(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=j(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&k(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),o.prototype.readBigInt64BE=j(function(t){I(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&k(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),s.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),s.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),s.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),s.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}let s=1,n=0;for(this[e]=255&t;++n<r&&(s*=256);)this[e+n]=t/s&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,i){if(t*=1,e>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;w(this,t,e,r,i,0)}let s=r-1,n=1;for(this[e+s]=255&t;--s>=0&&(n*=256);)this[e+s]=t/n&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=j(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=j(function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}let s=0,n=1,a=0;for(this[e]=255&t;++s<r&&(n*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/n|0)-a&255;return e+r},o.prototype.writeIntBE=function(t,e,r,i){if(t*=1,e>>>=0,!i){let i=Math.pow(2,8*r-1);w(this,t,e,r,i-1,-i)}let s=r-1,n=1,a=0;for(this[e+s]=255&t;--s>=0&&(n*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/n|0)-a&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||w(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=j(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=j(function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,i){if(!o.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);let s=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),s},o.prototype.fill=function(t,e,r,i){let s;if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===t.length){let e=t.charCodeAt(0);("utf8"===i&&e<128||"latin1"===i)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{let n=o.isBuffer(t)?t:o.from(t,i),a=n.length;if(0===a)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=n[s%a]}return this};let C={};function E(t,e,r){C[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function R(t){let e="",r=t.length,i=+("-"===t[0]);for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function O(t,e,r,i,s,n){if(t>r||t<e){let i,s="bigint"==typeof e?"n":"";throw i=n>3?0===e||e===BigInt(0)?`>= 0${s} and < 2${s} ** ${(n+1)*8}${s}`:`>= -(2${s} ** ${(n+1)*8-1}${s}) and < 2 ** ${(n+1)*8-1}${s}`:`>= ${e}${s} and <= ${r}${s}`,new C.ERR_OUT_OF_RANGE("value",i,t)}I(s,"offset"),(void 0===i[s]||void 0===i[s+n])&&k(s,i.length-(n+1))}function I(t,e){if("number"!=typeof t)throw new C.ERR_INVALID_ARG_TYPE(e,"number",t)}function k(t,e,r){if(Math.floor(t)!==t)throw I(t,r),new C.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new C.ERR_BUFFER_OUT_OF_BOUNDS;throw new C.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${e}`,t)}E("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),E("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),E("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,s=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?s=R(String(r)):"bigint"==typeof r&&(s=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(s=R(s)),s+="n"),i+=` It must be ${e}. Received ${s}`},RangeError);let P=/[^+/0-9A-Za-z-_]/g;function B(t,e){let r;e=e||1/0;let i=t.length,s=null,n=[];for(let a=0;a<i;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!s){if(r>56319||a+1===i){(e-=3)>-1&&n.push(239,191,189);continue}s=r;continue}if(r<56320){(e-=3)>-1&&n.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(e-=3)>-1&&n.push(239,191,189);if(s=null,r<128){if((e-=1)<0)break;n.push(r)}else if(r<2048){if((e-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return n}function L(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){let s;for(s=0;s<i&&!(s+r>=e.length)&&!(s>=t.length);++s)e[s+r]=t[s];return s}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let F=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let s=0;s<16;++s)e[i+s]=t[r]+t[s]}return e}();function j(t){return"u"<typeof BigInt?U:t}function U(){throw Error("BigInt not supported")}},30662,(t,e,r)=>{!function(){"use strict";var t={294:function(t){var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function n(){n.init.call(this)}t.exports=n,t.exports.once=function(t,e){return new Promise(function(r,i){var s,n,a;function o(r){t.removeListener(e,h),i(r)}function h(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}m(t,e,h,{once:!0}),"error"!==e&&(s=t,n=o,a={once:!0},"function"==typeof s.on&&m(s,"error",n,a))})},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var a=10;function o(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?n.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){if(o(r),void 0===(n=t._events)?(n=t._events=Object.create(null),t._eventsCount=0):(void 0!==n.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),n=t._events),a=n[e]),void 0===a)a=n[e]=r,++t._eventsCount;else if("function"==typeof a?a=n[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),(s=h(t))>0&&a.length>s&&!a.warned){a.warned=!0;var s,n,a,l=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,console&&console.warn&&console.warn(l)}return t}function u(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},s=u.bind(i);return s.listener=r,i.wrapFn=s,s}function d(t,e,r){var i=t._events;if(void 0===i)return[];var s=i[e];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(t){for(var e=Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(s):f(s,s.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(t,e){for(var r=Array(e),i=0;i<e;++i)r[i]=t[i];return r}function m(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else if("function"==typeof t.addEventListener)t.addEventListener(e,function s(n){i.once&&t.removeEventListener(e,s),r(n)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||s(t))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),n.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},n.prototype.getMaxListeners=function(){return h(this)},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var s="error"===t,n=this._events;if(void 0!==n)s=s&&void 0===n.error;else if(!s)return!1;if(s){if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var a,o=Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else for(var l=h.length,u=f(h,l),r=0;r<l;++r)i(u[r],this,e);return!0},n.prototype.addListener=function(t,e){return l(this,t,e,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(t,e){return l(this,t,e,!0)},n.prototype.once=function(t,e){return o(e),this.on(t,c(this,t,e)),this},n.prototype.prependOnceListener=function(t,e){return o(e),this.prependListener(t,c(this,t,e)),this},n.prototype.removeListener=function(t,e){var r,i,s,n,a;if(o(e),void 0===(i=this._events)||void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(s=-1,n=r.length-1;n>=0;n--)if(r[n]===e||r[n].listener===e){a=r[n].listener,s=n;break}if(s<0)return this;0===s?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,s),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,a||e)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0==arguments.length){var s,n=Object.keys(r);for(i=0;i<n.length;++i)"removeListener"!==(s=n[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},n.prototype.listeners=function(t){return d(this,t,!0)},n.prototype.rawListeners=function(t){return d(this,t,!1)},n.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},n.prototype.listenerCount=p,n.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}},a=!0;try{t[e](n,n.exports,i),a=!1}finally{a&&delete r[e]}return n.exports}i.ab="/ROOT/node_modules/next/dist/compiled/events/",e.exports=i(294)}()},77398,(t,e,r)=>{var i=t.i(67034),s=t.i(47167),n={7492:function(t){t.exports=function(t,r,i){if(t.filter)return t.filter(r,i);if(null==t||"function"!=typeof r)throw TypeError();for(var s=[],n=0;n<t.length;n++)if(e.call(t,n)){var a=t[n];r.call(i,a,n,t)&&s.push(a)}return s};var e=Object.prototype.hasOwnProperty},1648:function(t,e,r){"use strict";var i=r(7797),s=r(4834),n=r(8772);t.exports=r(9095)||i.call(n,s)},4757:function(t,e,r){"use strict";var i=r(7797),s=r(4834),n=r(1648);t.exports=function(){return n(i,s,arguments)}},4834:function(t){"use strict";t.exports=Function.prototype.apply},8772:function(t){"use strict";t.exports=Function.prototype.call},2462:function(t,e,r){"use strict";var i=r(7797),s=r(4785),n=r(8772),a=r(1648);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new s("a function is required");return a(i,n,t)}},9095:function(t){"use strict";t.exports="u">typeof Reflect&&Reflect&&Reflect.apply},2982:function(t,e,r){"use strict";var i=r(1893),s=r(5494),n=s(i("String.prototype.indexOf"));t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&n(t,".prototype.")>-1?s(r):r}},5494:function(t,e,r){"use strict";var i=r(3798),s=r(871),n=r(2462),a=r(4757);t.exports=function(t){var e=n(arguments),r=t.length-(arguments.length-1);return i(e,1+(r>0?r:0),!0)},s?s(t.exports,"apply",{value:a}):t.exports.apply=a},2071:function(t,e,r){"use strict";var i=r(871),s=r(9546),n=r(4785),a=r(8322);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new n("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new n("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],c=!!a&&a(t,e);if(i)i(t,e,{configurable:null===l&&c?c.configurable:!l,enumerable:null===o&&c?c.enumerable:!o,value:r,writable:null===h&&c?c.writable:!h});else if(!u&&(o||h||l))throw new s("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else t[e]=r}},3859:function(t,e,r){"use strict";var i,s=r(2462),n=r(8322);try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var a=!!i&&n&&n(Object.prototype,"__proto__"),o=Object,h=o.getPrototypeOf;t.exports=a&&"function"==typeof a.get?s([a.get]):"function"==typeof h&&function(t){return h(null==t?t:o(t))}},871:function(t){"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},1247:function(t){"use strict";t.exports=EvalError},6621:function(t){"use strict";t.exports=Error},6136:function(t){"use strict";t.exports=RangeError},252:function(t){"use strict";t.exports=ReferenceError},9546:function(t){"use strict";t.exports=SyntaxError},4785:function(t){"use strict";t.exports=TypeError},1223:function(t){"use strict";t.exports=URIError},8300:function(t){"use strict";t.exports=Object},4680:function(t){var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,i,s){if("[object Function]"!==r.call(i))throw TypeError("iterator must be a function");var n=t.length;if(n===+n)for(var a=0;a<n;a++)i.call(s,t[a],a,t);else for(var o in t)e.call(t,o)&&i.call(s,t[o],o,t)}},6555:function(t){"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var s=0;s<e.length;s+=1)r[s+t.length]=e[s];return r},s=function(t,e){for(var r=[],i=e||0,s=0;i<t.length;i+=1,s+=1)r[s]=t[i];return r},n=function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r};t.exports=function(t){var a,o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw TypeError("Function.prototype.bind called on incompatible "+o);for(var h=s(arguments,1),l=r(0,o.length-h.length),u=[],c=0;c<l;c++)u[c]="$"+c;if(a=Function("binder","return function ("+n(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var e=o.apply(this,i(h,arguments));return Object(e)===e?e:this}return o.apply(t,i(h,arguments))}),o.prototype){var d=function(){};d.prototype=o.prototype,a.prototype=new d,d.prototype=null}return a}},7797:function(t,e,r){"use strict";var i=r(6555);t.exports=Function.prototype.bind||i},1893:function(t,e,r){"use strict";var i,s=r(8300),n=r(6621),a=r(1247),o=r(6136),h=r(252),l=r(9546),u=r(4785),c=r(1223),d=r(4197),p=r(4455),f=r(1295),m=r(6949),y=r(2943),g=r(1721),b=r(3536),v=Function,x=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},w=r(8322),S=r(871),M=function(){throw new u},_=w?function(){try{return arguments.callee,M}catch(t){try{return w(arguments,"callee").get}catch(t){return M}}}():M,A=r(9131)(),T=r(9717),C=r(45),E=r(7767),R=r(4834),O=r(8772),I={},k="u">typeof Uint8Array&&T?T(Uint8Array):i,P={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":A&&T?T([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"u"<typeof Atomics?i:Atomics,"%BigInt%":"u"<typeof BigInt?i:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"u"<typeof Float16Array?i:Float16Array,"%Float32Array%":"u"<typeof Float32Array?i:Float32Array,"%Float64Array%":"u"<typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":"u"<typeof Int8Array?i:Int8Array,"%Int16Array%":"u"<typeof Int16Array?i:Int16Array,"%Int32Array%":"u"<typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&T?T(T([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"u"<typeof Map?i:Map,"%MapIteratorPrototype%":"u">typeof Map&&A&&T?T((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":s,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?i:Promise,"%Proxy%":"u"<typeof Proxy?i:Proxy,"%RangeError%":o,"%ReferenceError%":h,"%Reflect%":"u"<typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?i:Set,"%SetIteratorPrototype%":"u">typeof Set&&A&&T?T((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"u"<typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&T?T(""[Symbol.iterator]()):i,"%Symbol%":A?Symbol:i,"%SyntaxError%":l,"%ThrowTypeError%":_,"%TypedArray%":k,"%TypeError%":u,"%Uint8Array%":"u"<typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"u"<typeof WeakMap?i:WeakMap,"%WeakRef%":"u"<typeof WeakRef?i:WeakRef,"%WeakSet%":"u"<typeof WeakSet?i:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":R,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":C,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":y,"%Math.round%":g,"%Math.sign%":b,"%Reflect.getPrototypeOf%":E};if(T)try{null.error}catch(t){var B=T(T(t));P["%Error.prototype%"]=B}var L=function t(e){var r;if("%AsyncFunction%"===e)r=x("async function () {}");else if("%GeneratorFunction%"===e)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=x("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var s=t("%AsyncGenerator%");s&&T&&(r=T(s.prototype))}return P[e]=r,r},z={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=r(7797),F=r(3383),j=N.call(O,Array.prototype.concat),U=N.call(R,Array.prototype.splice),D=N.call(O,String.prototype.replace),V=N.call(O,String.prototype.slice),W=N.call(O,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,H=function(t){var e=V(t,0,1),r=V(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var i=[];return D(t,q,function(t,e,r,s){i[i.length]=r?D(s,G,"$1"):e||t}),i},J=function(t,e){var r,i=t;if(F(z,i)&&(i="%"+(r=z[i])[0]+"%"),F(P,i)){var s=P[i];if(s===I&&(s=L(i)),void 0===s&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===W(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=H(t),i=r.length>0?r[0]:"",s=J("%"+i+"%",e),n=s.name,a=s.value,o=!1,h=s.alias;h&&(i=h[0],U(r,j([0,1],h)));for(var c=1,d=!0;c<r.length;c+=1){var p=r[c],f=V(p,0,1),m=V(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&d||(o=!0),i+="."+p,F(P,n="%"+i+"%"))a=P[n];else if(null!=a){if(!(p in a)){if(!e)throw new u("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&c+1>=r.length){var y=w(a,p);a=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:a[p]}else d=F(a,p),a=a[p];d&&!o&&(P[n]=a)}}return a}},45:function(t,e,r){"use strict";t.exports=r(8300).getPrototypeOf||null},7767:function(t){"use strict";t.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null},9717:function(t,e,r){"use strict";var i=r(7767),s=r(45),n=r(3859);t.exports=i?function(t){return i(t)}:s?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("getProto: not an object");return s(t)}:n?function(t){return n(t)}:null},8422:function(t){"use strict";t.exports=Object.getOwnPropertyDescriptor},8322:function(t,e,r){"use strict";var i=r(8422);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},8122:function(t,e,r){"use strict";var i=r(871),s=function(){return!!i};s.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch(t){return!0}},t.exports=s},8564:function(t,e,r){"use strict";var i="u">typeof Symbol&&Symbol,s=r(9094);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&s()}},9094:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,e);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},9131:function(t,e,r){"use strict";var i="u">typeof Symbol&&Symbol,s=r(6313);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&s()}},6313:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var s=Object.getOwnPropertySymbols(t);if(1!==s.length||s[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},3383:function(t,e,r){"use strict";var i=Function.prototype.call,s=Object.prototype.hasOwnProperty;t.exports=r(7797).call(i,s)},1638:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},6960:function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,i=function(t){return(!e||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===r.call(t)},s=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r.call(t)&&"[object Function]"===r.call(t.callee)},n=function(){return i(arguments)}();i.isLegacyArguments=s,t.exports=n?i:s},8979:function(t){"use strict";var e=Object.prototype.toString,r=Function.prototype.toString,i=/^\s*(?:function)?\*/,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,n=Object.getPrototypeOf,a=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}(),o=a?n(a):{};t.exports=function(t){return"function"==typeof t&&(!!i.test(r.call(t))||(s?n(t)===o:"[object GeneratorFunction]"===e.call(t)))}},9572:function(e,r,i){"use strict";var s=i(4680),n=i(3147),a=i(2982),o=a("Object.prototype.toString"),h=i(8564)()&&"symbol"==typeof Symbol.toStringTag,l=n(),u=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return -1},c=a("String.prototype.slice"),d={},p=i(9745),f=Object.getPrototypeOf;h&&p&&f&&s(l,function(e){var r=new t.g[e];if(!(Symbol.toStringTag in r))throw EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var i=f(r),s=p(i,Symbol.toStringTag);s||(s=p(f(i),Symbol.toStringTag)),d[e]=s.get});var m=function(t){var e=!1;return s(d,function(r,i){if(!e)try{e=r.call(t)===i}catch(t){}}),e};e.exports=function(t){return!!t&&"object"==typeof t&&(h?!!p&&m(t):u(l,c(o(t),8,-1))>-1)}},4197:function(t){"use strict";t.exports=Math.abs},4455:function(t){"use strict";t.exports=Math.floor},6128:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},1295:function(t){"use strict";t.exports=Math.max},6949:function(t){"use strict";t.exports=Math.min},2943:function(t){"use strict";t.exports=Math.pow},1721:function(t){"use strict";t.exports=Math.round},3536:function(t,e,r){"use strict";var i=r(6128);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},3798:function(t,e,r){"use strict";var i=r(1893),s=r(2071),n=r(8122)(),a=r(8322),o=r(4785),h=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new o("`fn` is not a function");if("number"!=typeof e||e<0||e>0xffffffff||h(e)!==e)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,l=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(l=!1)}return(i||l||!r)&&(n?s(t,"length",e,!0,!0):s(t,"length",e)),t}},3614:function(t){t.exports=function(t){return t instanceof i.Buffer}},7551:function(t,e,r){"use strict";var i=r(6960),s=r(8979),n=r(3051),a=r(9572);function o(t){return t.call.bind(t)}var h="u">typeof BigInt,l="u">typeof Symbol,u=o(Object.prototype.toString),c=o(Number.prototype.valueOf),d=o(String.prototype.valueOf),p=o(Boolean.prototype.valueOf);if(h)var f=o(BigInt.prototype.valueOf);if(l)var m=o(Symbol.prototype.valueOf);function y(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===u(t)}function b(t){return"[object Set]"===u(t)}function v(t){return"[object WeakMap]"===u(t)}function x(t){return"[object WeakSet]"===u(t)}function w(t){return"[object ArrayBuffer]"===u(t)}function S(t){return!("u"<typeof ArrayBuffer)&&(w.working?w(t):t instanceof ArrayBuffer)}function M(t){return"[object DataView]"===u(t)}function _(t){return!("u"<typeof DataView)&&(M.working?M(t):t instanceof DataView)}e.isArgumentsObject=i,e.isGeneratorFunction=s,e.isTypedArray=a,e.isPromise=function(t){return"u">typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||_(t)},e.isUint8Array=function(t){return"Uint8Array"===n(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===n(t)},e.isUint16Array=function(t){return"Uint16Array"===n(t)},e.isUint32Array=function(t){return"Uint32Array"===n(t)},e.isInt8Array=function(t){return"Int8Array"===n(t)},e.isInt16Array=function(t){return"Int16Array"===n(t)},e.isInt32Array=function(t){return"Int32Array"===n(t)},e.isFloat32Array=function(t){return"Float32Array"===n(t)},e.isFloat64Array=function(t){return"Float64Array"===n(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===n(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===n(t)},g.working="u">typeof Map&&g(new Map),e.isMap=function(t){return!("u"<typeof Map)&&(g.working?g(t):t instanceof Map)},b.working="u">typeof Set&&b(new Set),e.isSet=function(t){return!("u"<typeof Set)&&(b.working?b(t):t instanceof Set)},v.working="u">typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return!("u"<typeof WeakMap)&&(v.working?v(t):t instanceof WeakMap)},x.working="u">typeof WeakSet&&x(new WeakSet),e.isWeakSet=function(t){return x(t)},w.working="u">typeof ArrayBuffer&&w(new ArrayBuffer),e.isArrayBuffer=S,M.working="u">typeof ArrayBuffer&&"u">typeof DataView&&M(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=_;var A="u">typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===u(t)}function C(t){return void 0!==A&&(void 0===T.working&&(T.working=T(new A)),T.working?T(t):t instanceof A)}function E(t){return y(t,c)}function R(t){return y(t,d)}function O(t){return y(t,p)}function I(t){return h&&y(t,f)}function k(t){return l&&y(t,m)}e.isSharedArrayBuffer=C,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},e.isGeneratorObject=function(t){return"[object Generator]"===u(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},e.isNumberObject=E,e.isStringObject=R,e.isBooleanObject=O,e.isBigIntObject=I,e.isSymbolObject=k,e.isBoxedPrimitive=function(t){return E(t)||R(t)||O(t)||I(t)||k(t)},e.isAnyArrayBuffer=function(t){return"u">typeof Uint8Array&&(S(t)||C(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})},4268:function(t,e,r){var i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},i=0;i<e.length;i++)r[e[i]]=Object.getOwnPropertyDescriptor(t,e[i]);return r},n=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}for(var r=1,i=arguments,s=i.length,a=String(t).replace(n,function(t){if("%%"===t)return"%";if(r>=s)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}}),o=i[r];r<s;o=i[++r])g(o)||!S(o)?a+=" "+o:a+=" "+l(o);return a},e.deprecate=function(t,r){if(void 0!==s.default&&!0===s.default.noDeprecation)return t;if(void 0===s.default)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(s.default.throwDeprecation)throw Error(r);s.default.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var a={},o=/^$/;if(s.default.env.NODE_DEBUG){var h=s.default.env.NODE_DEBUG;o=RegExp("^"+(h=h.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase())+"$","i")}function l(t,r){var i={seen:[],stylize:c};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),y(r)?i.showHidden=r:r&&e._extend(i,r),x(i.showHidden)&&(i.showHidden=!1),x(i.depth)&&(i.depth=2),x(i.colors)&&(i.colors=!1),x(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),d(i,t,i.depth)}function u(t,e){var r=l.styles[e];return r?"\x1b["+l.colors[r][0]+"m"+t+"\x1b["+l.colors[r][1]+"m":t}function c(t,e){return t}function d(t,r,i){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var s,n,a,o,h,l,u=r.inspect(i,t);return v(u)||(u=d(t,u,i)),u}var c=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}(t,r);if(c)return c;var S=Object.keys(r),T=(h={},S.forEach(function(t,e){h[t]=!0}),h);if(t.showHidden&&(S=Object.getOwnPropertyNames(r)),_(r)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return p(r);if(0===S.length){if(A(r)){var C=r.name?": "+r.name:"";return t.stylize("[Function"+C+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return p(r)}var E="",O=!1,I=["{","}"];if(m(r)&&(O=!0,I=["[","]"]),A(r)&&(E=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(E=" "+RegExp.prototype.toString.call(r)),M(r)&&(E=" "+Date.prototype.toUTCString.call(r)),_(r)&&(E=" "+p(r)),0===S.length&&(!O||0==r.length))return I[0]+E+I[1];if(i<0)if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");else return t.stylize("[Object]","special");return t.seen.push(r),l=O?function(t,e,r,i,s){for(var n=[],a=0,o=e.length;a<o;++a)R(e,String(a))?n.push(f(t,e,r,i,String(a),!0)):n.push("");return s.forEach(function(s){s.match(/^\d+$/)||n.push(f(t,e,r,i,s,!0))}),n}(t,r,i,T,S):S.map(function(e){return f(t,r,i,T,e,O)}),t.seen.pop(),s=l,n=E,a=I,o=0,s.reduce(function(t,e){return o++,e.indexOf("\n")>=0&&o++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===n?"":n+"\n ")+" "+s.join(",\n ")+" "+a[1]:a[0]+n+" "+s.join(", ")+" "+a[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,i,s,n){var a,o,h;if((h=Object.getOwnPropertyDescriptor(e,s)||{value:e[s]}).get?o=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(o=t.stylize("[Setter]","special")),R(i,s)||(a="["+s+"]"),!o&&(0>t.seen.indexOf(h.value)?(o=g(r)?d(t,h.value,null):d(t,h.value,r-1)).indexOf("\n")>-1&&(o=n?o.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+o.split("\n").map(function(t){return" "+t}).join("\n")):o=t.stylize("[Circular]","special")),x(a)){if(n&&s.match(/^\d+$/))return o;(a=JSON.stringify(""+s)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+o}function m(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function x(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===T(t)}function S(t){return"object"==typeof t&&null!==t}function M(t){return S(t)&&"[object Date]"===T(t)}function _(t){return S(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(!a[t=t.toUpperCase()])if(o.test(t)){var r=s.default.pid;a[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else a[t]=function(){};return a[t]},e.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(7551),e.isArray=m,e.isBoolean=y,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=M,e.types.isDate=M,e.isError=_,e.types.isNativeError=_,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(3614);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[C((t=new Date).getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(1638),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};var O="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(O&&t[O]){var e=t[O];if("function"!=typeof e)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,i=new Promise(function(t,i){e=t,r=i}),s=[],n=0;n<arguments.length;n++)s.push(arguments[n]);s.push(function(t,i){t?r(t):e(i)});try{t.apply(this,s)}catch(t){r(t)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),O&&Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=O,e.callbackify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw TypeError("The last argument must be of type Function");var n=this,a=function(){return i.apply(n,arguments)};t.apply(this,e).then(function(t){s.default.nextTick(a.bind(null,null,t))},function(t){s.default.nextTick(I.bind(null,t,a))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},3051:function(e,r,i){"use strict";var s=i(4680),n=i(3147),a=i(2982),o=a("Object.prototype.toString"),h=i(8564)()&&"symbol"==typeof Symbol.toStringTag,l=n(),u=a("String.prototype.slice"),c={},d=i(9745),p=Object.getPrototypeOf;h&&d&&p&&s(l,function(e){if("function"==typeof t.g[e]){var r=new t.g[e];if(!(Symbol.toStringTag in r))throw EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var i=p(r),s=d(i,Symbol.toStringTag);s||(s=d(p(i),Symbol.toStringTag)),c[e]=s.get}});var f=function(t){var e=!1;return s(c,function(r,i){if(!e)try{var s=r.call(t);s===i&&(e=s)}catch(t){}}),e},m=i(9572);e.exports=function(t){return!!m(t)&&(h?f(t):u(o(t),8,-1))}},3147:function(e,r,i){"use strict";var s=i(7492);e.exports=function(){return s(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],function(e){return"function"==typeof t.g[e]})}},9745:function(t,e,r){"use strict";t.exports=r(8322)}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={exports:{}},i=!0;try{n[t](r,r.exports,o),i=!1}finally{i&&delete a[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/util/",e.exports=o(4268)},12569,(t,e,r)=>{var i=t.i(47167),s={638:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},329:function(t){"use strict";let e={};function r(t,r,i){i||(i=Error);class s extends i{constructor(t,e,i){super(function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(t,e,i))}}s.prototype.name=i.name,s.prototype.code=t,e[t]=s}function i(t,e){if(!Array.isArray(t))return`of ${e} ${String(t)}`;{let r=t.length;return(t=t.map(t=>String(t)),r>2)?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var s,n,a,o;let h,l;if("string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(h="must not be",e=e.replace(/^not /,"")):h="must be",n=" argument",(void 0===a||a>t.length)&&(a=t.length),t.substring(a-n.length,a)===n)l=`The ${t} ${h} ${i(e,"type")}`;else{let r=("number"!=typeof o&&(o=0),o+1>t.length||-1===t.indexOf(".",o))?"argument":"property";l=`The "${t}" ${r} ${h} ${i(e,"type")}`}return l+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.F=e},686:function(t,e,r){"use strict";var s=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(276),a=r(732);r(638)(u,n);for(var o=s(a.prototype),h=0;h<o.length;h++){var l=o[h];u.prototype[l]||(u.prototype[l]=a.prototype[l])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),a.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||i.default.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},512:function(t,e,r){"use strict";t.exports=s;var i=r(586);function s(t){if(!(this instanceof s))return new s(t);i.call(this,t)}r(638)(s,i),s.prototype._transform=function(t,e,r){r(null,t)}},276:function(e,r,s){"use strict";e.exports=T,T.ReadableState=A,s(434).EventEmitter;var n,a,o,h,l,u=function(t,e){return t.listeners(e).length},c=s(120),d=s(181).Buffer,p=t.g.Uint8Array||function(){},f=s(23);a=f&&f.debuglog?f.debuglog("stream"):function(){};var m=s(137),y=s(528),g=s(771).getHighWaterMark,b=s(329).F,v=b.ERR_INVALID_ARG_TYPE,x=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;s(638)(T,c);var M=y.errorOrDestroy,_=["error","close","destroy","pause","resume"];function A(t,e,r){n=n||s(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof n),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(o||(o=s(319).I),this.decoder=new o(t.encoding),this.encoding=t.encoding)}function T(t){if(n=n||s(686),!(this instanceof T))return new T(t);var e=this instanceof n;this._readableState=new A(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function C(t,e,r,i,s){a("readableAddChunk",e);var n,o,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(a("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,h);else if(s||(o=function(t,e){var r;return d.isBuffer(e)||e instanceof p||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),o)M(t,o);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===d.prototype||(n=e,e=d.from(n)),i)h.endEmitted?M(t,new S):E(t,h,e,!0);else if(h.ended)M(t,new x);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?E(t,h,e,!1):k(t,h)):E(t,h,e,!1)}else i||(h.reading=!1,k(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function E(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),k(t,e)}function R(t,e){var r;if(t<=0||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length;return(t>e.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function O(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,i.default.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function k(t,e){e.readingMore||(e.readingMore=!0,i.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(a("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){a("readable nexttick read 0"),t.read(0)}function z(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function j(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.default.nextTick(U,e,t))}function U(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return -1}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=d.from(t,e),e=""),r=!0),C(this,t,e,!1,r)},T.prototype.unshift=function(t){return C(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){o||(o=s(319).I);var e=new o(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},T.prototype.read=function(t){a("read",t),t=parseInt(t,10);var e,r=this._readableState,i=t;if(0!==t&&(r.emittedReadable=!1),0===t&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?j(this):O(this),null;if(0===(t=R(t,r))&&r.ended)return 0===r.length&&j(this),null;var s=r.needReadable;return a("need readable",s),(0===r.length||r.length-t<r.highWaterMark)&&a("length less than watermark",s=!0),r.ended||r.reading?a("reading or ended",s=!1):s&&(a("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(t=R(i,r))),null===(e=t>0?F(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),i!==t&&r.ended&&j(this)),null!==e&&this.emit("data",e),e},T.prototype._read=function(t){M(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r,s=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,e);var o=e&&!1===e.end||t===i.default.stdout||t===i.default.stderr?y:h;function h(){a("onend"),t.end()}n.endEmitted?i.default.nextTick(o):s.once("end",o),t.on("unpipe",function e(r,i){a("onunpipe"),r===s&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,a("cleanup"),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",p),t.removeListener("unpipe",e),s.removeListener("end",h),s.removeListener("end",y),s.removeListener("data",d),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l())});var l=(r=s,function(){var t=r._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(r,"data")&&(t.flowing=!0,N(r))});t.on("drain",l);var c=!1;function d(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==D(n.pipes,t))&&!c&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),s.pause())}function p(e){a("onerror",e),y(),t.removeListener("error",p),0===u(t,"error")&&M(t,e)}function f(){t.removeListener("finish",m),y()}function m(){a("onfinish"),t.removeListener("close",f),y()}function y(){a("unpipe"),s.unpipe(t)}return s.on("data",d),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",f),t.once("finish",m),t.emit("pipe",s),n.flowing||(a("pipe resume"),s.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,s=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n<s;n++)i[n].emit("unpipe",this,{hasUnpiped:!1});return this}var a=D(e.pipes,t);return -1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=c.prototype.on.call(this,t,e),s=this._readableState;return"data"===t?(s.readableListening=this.listenerCount("readable")>0,!1!==s.flowing&&this.resume()):"readable"!==t||s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,a("on readable",s.length,s.reading),s.length?O(this):s.reading||i.default.nextTick(L,this)),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&i.default.nextTick(B,this),r},T.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&i.default.nextTick(B,this),e},T.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,i.default.nextTick(z,t,e))),r.paused=!1,this},T.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var s in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(s){a("wrapped data"),r.decoder&&(s=r.decoder.write(s)),r.objectMode&&null==s||(r.objectMode||s&&s.length)&&(e.push(s)||(i=!0,t.pause()))}),t)void 0===this[s]&&"function"==typeof t[s]&&(this[s]=function(e){return function(){return t[e].apply(t,arguments)}}(s));for(var n=0;n<_.length;n++)t.on(_[n],this.emit.bind(this,_[n]));return this._read=function(e){a("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=s(531)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=F,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===l&&(l=s(812)),l(T,t,e)})},586:function(t,e,r){"use strict";t.exports=u;var i=r(329).F,s=i.ERR_METHOD_NOT_IMPLEMENTED,n=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(686);function l(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);h.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(e,r){d(t,e,r)})}function d(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new o;if(t._transformState.transforming)throw new a;return t.push(null)}r(638)(u,h),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,r){r(new s("_transform()"))},u.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var s=this._readableState;(i.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,function(t){e(t)})}},732:function(e,r,s){"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){var r=e,i=t,s=r.entry;for(r.entry=null;s;){var n=s.callback;i.pendingcb--,n(void 0),s=s.next}i.corkedRequestsFree.next=r}}e.exports=T,T.WritableState=A;var a,o,h={deprecate:s(774)},l=s(120),u=s(181).Buffer,c=t.g.Uint8Array||function(){},d=s(528),p=s(771).getHighWaterMark,f=s(329).F,m=f.ERR_INVALID_ARG_TYPE,y=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,v=f.ERR_STREAM_DESTROYED,x=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,M=d.errorOrDestroy;function _(){}function A(t,e,r){a=a||s(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof a),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=p(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,s=r.sync,n=r.writecb;if("function"!=typeof n)throw new g;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e)--r.pendingcb,s?(i.default.nextTick(n,e),i.default.nextTick(k,t,r),t._writableState.errorEmitted=!0,M(t,e)):(n(e),t._writableState.errorEmitted=!0,M(t,e),k(t,r));else{var a=O(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),s?i.default.nextTick(E,t,r,a,n):E(t,r,a,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}s(638)(T,l),A.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};try{Object.defineProperty(A.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}function T(t){var e=this instanceof(a=a||s(686));if(!e&&!o.call(T,this))return new T(t);this._writableState=new A(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function C(t,e,r,i,s,n,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):r?t._writev(s,e.onwrite):t._write(s,n,e.onwrite),e.sync=!1}function E(t,e,r,i){var s,n;r||(s=t,0===(n=e).length&&n.needDrain&&(n.needDrain=!1,s.emit("drain"))),e.pendingcb--,i(),k(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=Array(e.bufferedRequestCount),s=e.corkedRequestsFree;s.entry=r;for(var a=0,o=!0;r;)i[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;i.allBuffers=o,C(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,l=r.encoding,u=r.callback,c=e.objectMode?1:h.length;if(C(t,e,!1,c,h,l,u),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final(function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=O(e);if(r&&(e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.default.nextTick(I,t,e))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var s=t._readableState;(!s||s.autoDestroy&&s.endEmitted)&&t.destroy()}return r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===T&&t&&t._writableState instanceof A}})):o=function(t){return t instanceof this},T.prototype.pipe=function(){M(this,new b)},T.prototype.write=function(t,e,r){var s,n,a,o,h,l,d,p=this._writableState,f=!1,y=!p.objectMode&&(s=t,u.isBuffer(s)||s instanceof c);return(y&&!u.isBuffer(t)&&(n=t,t=u.from(n)),"function"==typeof e&&(r=e,e=null),y?e="buffer":e||(e=p.defaultEncoding),"function"!=typeof r&&(r=_),p.ending)?(a=r,M(this,o=new w),i.default.nextTick(a,o)):(y||(h=t,l=r,null===h?d=new x:"string"==typeof h||p.objectMode||(d=new m("chunk",["string","Buffer"],h)),!d||(M(this,d),i.default.nextTick(l,d),0)))&&(p.pendingcb++,f=function(t,e,r,i,s,n){if(!r){var a,o,h=(a=i,o=s,e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=u.from(a,o)),a);i!==h&&(r=!0,s="buffer",i=h)}var l=e.objectMode?1:i.length;e.length+=l;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var d=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:s,isBuf:r,callback:n,next:null},d?d.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,l,i,s,n);return c}(this,p,y,t,e,r)),f},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||R(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var s,n,a,o=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),o.corked&&(o.corked=1,this.uncork()),o.ending||(s=this,n=o,a=r,n.ending=!0,k(s,n),a&&(n.finished?i.default.nextTick(a):s.once("finish",a)),n.ended=!0,s.writable=!1),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=d.destroy,T.prototype._undestroy=d.undestroy,T.prototype._destroy=function(t,e){e(t)}},531:function(t,e,r){"use strict";function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var n,a=r(134),o=Symbol("lastResolve"),h=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function f(t,e){return{value:t,done:e}}function m(t){var e=t[o];if(null!==e){var r=t[p].read();null!==r&&(t[c]=null,t[o]=null,t[h]=null,e(f(r,!1)))}}function y(t){i.default.nextTick(m,t)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((s(n={get stream(){return this[p]},next:function(){var t,e,r=this,s=this[l];if(null!==s)return Promise.reject(s);if(this[u])return Promise.resolve(f(void 0,!0));if(this[p].destroyed)return new Promise(function(t,e){i.default.nextTick(function(){r[l]?e(r[l]):t(f(void 0,!0))})});var n=this[c];if(n)e=new Promise((t=this,function(e,r){n.then(function(){t[u]?e(f(void 0,!0)):t[d](e,r)},r)}));else{var a=this[p].read();if(null!==a)return Promise.resolve(f(a,!1));e=new Promise(this[d])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),s(n,"return",function(){var t=this;return new Promise(function(e,r){t[p].destroy(null,function(t){t?r(t):e(f(void 0,!0))})})}),n),g);t.exports=function(t){var e,r=Object.create(b,(s(e={},p,{value:t,writable:!0}),s(e,o,{value:null,writable:!0}),s(e,h,{value:null,writable:!0}),s(e,l,{value:null,writable:!0}),s(e,u,{value:t._readableState.endEmitted,writable:!0}),s(e,d,{value:function(t,e){var i=r[p].read();i?(r[c]=null,r[o]=null,r[h]=null,t(f(i,!1))):(r[o]=t,r[h]=e)},writable:!0}),e));return r[c]=null,a(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[h];null!==e&&(r[c]=null,r[o]=null,r[h]=null,e(t)),r[l]=t;return}var i=r[o];null!==i&&(r[c]=null,r[o]=null,r[h]=null,i(f(void 0,!0))),r[u]=!0}),t.on("readable",y.bind(null,r)),r}},137:function(t,e,r){"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var s=r(181).Buffer,n=r(23).inspect,a=n&&n.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,i=s.allocUnsafe(t>>>0),n=this.head,a=0;n;)e=n.data,r=a,s.prototype.copy.call(e,i,r),a+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var s=e.data,n=t>s.length?s.length:t;if(n===s.length?i+=s:i+=s.slice(0,t),0==(t-=n)){n===s.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=s.slice(n));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,a=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,a),0==(t-=a)){a===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(a));break}++i}return this.length-=i,e}},{key:a,value:function(t,e){return n(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){var i,s,n;i=t,s=e,n=r[e],s in i?Object.defineProperty(i,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[s]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},e,{depth:0,customInspect:!1}))}}],function(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(e.prototype,t),e}()},528:function(t){"use strict";function e(t,e){s(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||(!t._readableState||t._readableState.emitClose)&&t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var a=this,o=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return o||h?n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.default.nextTick(s,this,t)):i.default.nextTick(s,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!n&&t?a._writableState?a._writableState.errorEmitted?i.default.nextTick(r,a):(a._writableState.errorEmitted=!0,i.default.nextTick(e,a,t)):i.default.nextTick(e,a,t):n?(i.default.nextTick(r,a),n(t)):i.default.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},134:function(t,e,r){"use strict";var i=r(329).F.ERR_STREAM_PREMATURE_CLOSE;function s(){}t.exports=function t(e,r,n){if("function"==typeof r)return t(e,null,r);r||(r={}),a=n||s,o=!1,n=function(){if(!o){o=!0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e)}};var a,o,h=r.readable||!1!==r.readable&&e.readable,l=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||d()},c=e._writableState&&e._writableState.finished,d=function(){l=!1,c=!0,h||n.call(e)},p=e._readableState&&e._readableState.endEmitted,f=function(){h=!1,p=!0,l||n.call(e)},m=function(t){n.call(e,t)},y=function(){var t;return h&&!p?(e._readableState&&e._readableState.ended||(t=new i),n.call(e,t)):l&&!c?(e._writableState&&e._writableState.ended||(t=new i),n.call(e,t)):void 0},g=function(){e.req.on("finish",d)};return e.setHeader&&"function"==typeof e.abort?(e.on("complete",d),e.on("abort",y),e.req?g():e.on("request",g)):l&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",f),e.on("finish",d),!1!==r.error&&e.on("error",m),e.on("close",y),function(){e.removeListener("complete",d),e.removeListener("abort",y),e.removeListener("request",g),e.req&&e.req.removeListener("finish",d),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",d),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",y)}}},812:function(t,e,r){"use strict";function i(t,e,r,i,s,n,a){try{var o=t[n](a),h=o.value}catch(t){r(t);return}o.done?e(h):Promise.resolve(h).then(i,s)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var n=r(329).F.ERR_INVALID_ARG_TYPE;t.exports=function(t,e,r){if(e&&"function"==typeof e.next)a=e;else if(e&&e[Symbol.asyncIterator])a=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])a=e[Symbol.iterator]();else throw new n("iterable",["Iterable"],e);var a,o=new t(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){var i,s,n;i=t,s=e,n=r[e],s in i?Object.defineProperty(i,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[s]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({objectMode:!0},r)),h=!1;function l(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var t=yield a.next(),e=t.value;t.done?o.push(null):o.push((yield e))?l():h=!1}catch(t){o.destroy(t)}},(u=function(){var e=this,r=arguments;return new Promise(function(s,n){var a=t.apply(e,r);function o(t){i(a,s,n,o,h,"next",t)}function h(t){i(a,s,n,o,h,"throw",t)}o(void 0)})}).apply(this,arguments)}return o._read=function(){h||(h=!0,l())},o}},694:function(t,e,r){"use strict";var i,s=r(329).F,n=s.ERR_MISSING_ARGS,a=s.ERR_STREAM_DESTROYED;function o(t){if(t)throw t}function h(t){t()}function l(t,e){return t.pipe(e)}t.exports=function(){for(var t,e,s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=(t=u).length&&"function"==typeof t[t.length-1]?t.pop():o;if(Array.isArray(u[0])&&(u=u[0]),u.length<2)throw new n("streams");var p=u.map(function(t,s){var n,o,l,c,f,m,y=s<u.length-1;return n=s>0,l=o=function(t){e||(e=t),t&&p.forEach(h),y||(p.forEach(h),d(e))},c=!1,o=function(){c||(c=!0,l.apply(void 0,arguments))},f=!1,t.on("close",function(){f=!0}),void 0===i&&(i=r(134)),i(t,{readable:y,writable:n},function(t){if(t)return o(t);f=!0,o()}),m=!1,function(e){if(!f&&!m){if(m=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();o(e||new a("pipe"))}}});return u.reduce(l)}},771:function(t,e,r){"use strict";var i=r(329).F.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,s){var n=null!=e.highWaterMark?e.highWaterMark:s?e[r]:null;if(null!=n){if(!(isFinite(n)&&Math.floor(n)===n)||n<0)throw new i(s?r:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}}},120:function(t,e,r){t.exports=r(203)},56:function(t,e,r){var i=r(181),s=i.Buffer;function n(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return s(t,e,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(n(i,e),e.Buffer=a),a.prototype=Object.create(s.prototype),n(s,a),a.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return s(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var i=s(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return s(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i.SlowBuffer(t)}},854:function(t,e,r){t.exports=s;var i=r(434).EventEmitter;function s(){i.call(this)}r(638)(s,i),s.Readable=r(276),s.Writable=r(732),s.Duplex=r(686),s.Transform=r(586),s.PassThrough=r(512),s.finished=r(134),s.pipeline=r(694),s.Stream=s,s.prototype.pipe=function(t,e){var r=this;function s(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",s),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",o),r.on("close",h));var a=!1;function o(){a||(a=!0,t.end())}function h(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){r.removeListener("data",s),t.removeListener("drain",n),r.removeListener("end",o),r.removeListener("close",h),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("error",l),t.on("error",l),r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t}},319:function(t,e,r){"use strict";var i=r(56).Buffer,s=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===s||!s(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=l,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=u,this.end=c,e=3;break;default:this.write=d,this.end=p;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.I=n,n.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var s=a(e[i]);return s>=0?(s>0&&(t.lastNeed=s-1),s):--i<r||-2===s?0:(s=a(e[i]))>=0?(s>0&&(t.lastNeed=s-2),s):--i<r||-2===s?0:(s=a(e[i]))>=0?(s>0&&(2===s?s=0:t.lastNeed=s-3),s):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},774:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},181:function(e){"use strict";e.exports=t.r(43943)},434:function(e){"use strict";e.exports=t.r(30662)},203:function(e){"use strict";e.exports=t.r(30662).EventEmitter},23:function(e){"use strict";e.exports=t.r(77398)}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}},i=!0;try{s[t](r,r.exports,a),i=!1}finally{i&&delete n[t]}return r.exports}a.ab="/ROOT/node_modules/next/dist/compiled/stream-browserify/",e.exports=a(854)},43954,(t,e,r)=>{!function(){"use strict";var t={922:function(t){t.exports=function(t,r,i,s){r=r||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var a=/\+/g;t=t.split(r);var o=1e3;s&&"number"==typeof s.maxKeys&&(o=s.maxKeys);var h=t.length;o>0&&h>o&&(h=o);for(var l=0;l<h;++l){var u,c,d,p,f=t[l].replace(a,"%20"),m=f.indexOf(i);(m>=0?(u=f.substr(0,m),c=f.substr(m+1)):(u=f,c=""),d=decodeURIComponent(u),p=decodeURIComponent(c),Object.prototype.hasOwnProperty.call(n,d))?e(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n};var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},790:function(t){var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,n,a,o){return(n=n||"&",a=a||"=",null===t&&(t=void 0),"object"==typeof t)?i(s(t),function(s){var o=encodeURIComponent(e(s))+a;return r(t[s])?i(t[s],function(t){return o+encodeURIComponent(e(t))}).join(n):o+encodeURIComponent(e(t[s]))}).join(n):o?encodeURIComponent(e(o))+a+encodeURIComponent(e(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}}},r={};function i(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}},a=!0;try{t[e](n,n.exports,i),a=!1}finally{a&&delete r[e]}return n.exports}i.ab="/ROOT/node_modules/next/dist/compiled/querystring-es3/";var s={};s.decode=s.parse=i(922),s.encode=s.stringify=i(790),e.exports=s}()},21342,(t,e,r)=>{var i={221:function(e){"use strict";e.exports=t.r(43954)}},s={};function n(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}},a=!0;try{i[t](r,r.exports,n),a=!1}finally{a&&delete s[t]}return r.exports}n.ab="/ROOT/node_modules/next/dist/compiled/native-url/";var a={};!function(){var t,e=(t=n(221))&&"object"==typeof t&&"default"in t?t.default:t,r=/https?|ftp|gopher|file/;function i(t){"string"==typeof t&&(t=g(t));var i,s,n,a,o,h,l,u,c,d=(s=(i=t).auth,n=i.hostname,a=i.protocol||"",o=i.pathname||"",h=i.hash||"",l=i.query||"",u=!1,s=s?encodeURIComponent(s).replace(/%3A/i,":")+"@":"",i.host?u=s+i.host:n&&(u=s+(~n.indexOf(":")?"["+n+"]":n),i.port&&(u+=":"+i.port)),l&&"object"==typeof l&&(l=e.encode(l)),c=i.search||l&&"?"+l||"",a&&":"!==a.substr(-1)&&(a+=":"),i.slashes||(!a||r.test(a))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),h&&"#"!==h[0]&&(h="#"+h),c&&"?"!==c[0]&&(c="?"+c),{protocol:a,host:u,pathname:o=o.replace(/[?#]/g,encodeURIComponent),search:c=c.replace("#","%23"),hash:h});return""+d.protocol+d.host+d.pathname+d.search+d.hash}var s="http://",o=s+"w.w",h=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,l=/https?|ftp|gopher|file/;function u(t,e){var r="string"==typeof t?g(t):t;t="object"==typeof t?i(t):t;var n=g(e),a="";r.protocol&&!r.slashes&&(a=r.protocol,t=t.replace(r.protocol,""),a+="/"===e[0]||"/"===t[0]?"/":""),a&&n.protocol&&(a="",n.slashes||(a=n.protocol,e=e.replace(n.protocol,"")));var u=t.match(h);u&&!n.protocol&&(t=t.substr((a=u[1]+(u[2]||"")).length),/^\/\/[^/]/.test(e)&&(a=a.slice(0,-1)));var c=new URL(t,o+"/"),d=new URL(e,c).toString().replace(o,""),p=n.protocol||r.protocol;return p+=r.slashes||n.slashes?"//":"",!a&&p?d=d.replace(s,p):a&&(d=d.replace(s,"")),l.test(d)||~e.indexOf(".")||"/"===t.slice(-1)||"/"===e.slice(-1)||"/"!==d.slice(-1)||(d=d.slice(0,-1)),a&&(d=a+("/"===d[0]?d.substr(1):d)),d}function c(){}c.prototype.parse=g,c.prototype.format=i,c.prototype.resolve=u,c.prototype.resolveObject=u;var d=/^https?|ftp|gopher|file/,p=/^(.*?)([#?].*)/,f=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,m=/^([a-z0-9.+-]*:)?\/\/\/*/i,y=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function g(t,r,s){if(void 0===r&&(r=!1),void 0===s&&(s=!1),t&&"object"==typeof t&&t instanceof c)return t;var n=(t=t.trim()).match(p);t=n?n[1].replace(/\\/g,"/")+n[2]:t.replace(/\\/g,"/"),y.test(t)&&"/"!==t.slice(-1)&&(t+="/");var a=!/(^javascript)/.test(t)&&t.match(f),h=m.test(t),l="";a&&(d.test(a[1])||(l=a[1].toLowerCase(),t=""+a[2]+a[3]),a[2]||(h=!1,d.test(a[1])?(l=a[1],t=""+a[3]):t="//"+a[3]),3!==a[2].length&&1!==a[2].length||(l=a[1],t="/"+a[3]));var u,g=(n?n[1]:t).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),b=g&&g[1],v=new c,x="",w="";try{u=new URL(t)}catch(e){x=e,l||s||!/^\/\//.test(t)||/^\/\/.+[@.]/.test(t)||(w="/",t=t.substr(1));try{u=new URL(t,o)}catch(t){return v.protocol=l,v.href=l,v}}v.slashes=h&&!w,v.host="w.w"===u.host?"":u.host,v.hostname="w.w"===u.hostname?"":u.hostname.replace(/(\[|\])/g,""),v.protocol=x?l||null:u.protocol,v.search=u.search.replace(/\\/g,"%5C"),v.hash=u.hash.replace(/\\/g,"%5C");var S=t.split("#");!v.search&&~S[0].indexOf("?")&&(v.search="?"),v.hash||""!==S[1]||(v.hash="#"),v.query=r?e.decode(u.search.substr(1)):v.search.substr(1),v.pathname=w+(a?u.pathname.replace(/['^|`]/g,function(t){return"%"+t.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(t,e){try{return decodeURIComponent(e).split("").map(function(t){var e=t.charCodeAt();return e>256||/^[a-z0-9]$/i.test(t)?t:"%"+e.toString(16).toUpperCase()}).join("")}catch(t){return e}}):u.pathname),"about:"===v.protocol&&"blank"===v.pathname&&(v.protocol="",v.pathname=""),x&&"/"!==t[0]&&(v.pathname=v.pathname.substr(1)),l&&!d.test(l)&&"/"!==t.slice(-1)&&"/"===v.pathname&&(v.pathname=""),v.path=v.pathname+v.search,v.auth=[u.username,u.password].map(decodeURIComponent).filter(Boolean).join(":"),v.port=u.port,b&&!v.host.endsWith(b)&&(v.host+=b,v.port=b.slice(1)),v.href=w?""+v.pathname+v.search+v.hash:i(v);var M=/^(file)/.test(v.href)?["host","hostname"]:[];return Object.keys(v).forEach(function(t){~M.indexOf(t)||(v[t]=v[t]||null)}),v}a.parse=g,a.format=i,a.resolve=u,a.resolveObject=function(t,e){return g(u(t,e))},a.Url=c}(),e.exports=a},22184,(t,e,r)=>{var i=t.i(47167),s=t.i(67034),n={514:function(t){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},638:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},329:function(t){"use strict";let e={};function r(t,r,i){i||(i=Error);class s extends i{constructor(t,e,i){super(function(t,e,i){return"string"==typeof r?r:r(t,e,i)}(t,e,i))}}s.prototype.name=i.name,s.prototype.code=t,e[t]=s}function i(t,e){if(!Array.isArray(t))return`of ${e} ${String(t)}`;{let r=t.length;return(t=t.map(t=>String(t)),r>2)?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,r){var s,n,a,o;let h,l;if("string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(h="must not be",e=e.replace(/^not /,"")):h="must be",n=" argument",(void 0===a||a>t.length)&&(a=t.length),t.substring(a-n.length,a)===n)l=`The ${t} ${h} ${i(e,"type")}`;else{let r=("number"!=typeof o&&(o=0),o+1>t.length||-1===t.indexOf(".",o))?"argument":"property";l=`The "${t}" ${r} ${h} ${i(e,"type")}`}return l+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.F=e},686:function(t,e,r){"use strict";var s=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var n=r(276),a=r(732);r(638)(u,n);for(var o=s(a.prototype),h=0;h<o.length;h++){var l=o[h];u.prototype[l]||(u.prototype[l]=a.prototype[l])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),a.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||i.default.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},512:function(t,e,r){"use strict";t.exports=s;var i=r(586);function s(t){if(!(this instanceof s))return new s(t);i.call(this,t)}r(638)(s,i),s.prototype._transform=function(t,e,r){r(null,t)}},276:function(e,r,s){"use strict";e.exports=T,T.ReadableState=A,s(434).EventEmitter;var n,a,o,h,l,u=function(t,e){return t.listeners(e).length},c=s(120),d=s(181).Buffer,p=t.g.Uint8Array||function(){},f=s(23);a=f&&f.debuglog?f.debuglog("stream"):function(){};var m=s(137),y=s(528),g=s(771).getHighWaterMark,b=s(329).F,v=b.ERR_INVALID_ARG_TYPE,x=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;s(638)(T,c);var M=y.errorOrDestroy,_=["error","close","destroy","pause","resume"];function A(t,e,r){n=n||s(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof n),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(o||(o=s(319).I),this.decoder=new o(t.encoding),this.encoding=t.encoding)}function T(t){if(n=n||s(686),!(this instanceof T))return new T(t);var e=this instanceof n;this._readableState=new A(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),c.call(this)}function C(t,e,r,i,s){a("readableAddChunk",e);var n,o,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(a("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,h);else if(s||(o=function(t,e){var r;return d.isBuffer(e)||e instanceof p||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e)),r}(h,e)),o)M(t,o);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===d.prototype||(n=e,e=d.from(n)),i)h.endEmitted?M(t,new S):E(t,h,e,!0);else if(h.ended)M(t,new x);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?E(t,h,e,!1):k(t,h)):E(t,h,e,!1)}else i||(h.reading=!1,k(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function E(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),k(t,e)}function R(t,e){var r;if(t<=0||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length;return(t>e.highWaterMark&&((r=t)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r),t<=e.length)?t:e.ended?e.length:(e.needReadable=!0,0)}function O(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,i.default.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function k(t,e){e.readingMore||(e.readingMore=!0,i.default.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(a("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){a("readable nexttick read 0"),t.read(0)}function z(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){var r;return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r)}function j(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.default.nextTick(U,e,t))}function U(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return -1}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=d.from(t,e),e=""),r=!0),C(this,t,e,!1,r)},T.prototype.unshift=function(t){return C(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){o||(o=s(319).I);var e=new o(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},T.prototype.read=function(t){a("read",t),t=parseInt(t,10);var e,r=this._readableState,i=t;if(0!==t&&(r.emittedReadable=!1),0===t&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?j(this):O(this),null;if(0===(t=R(t,r))&&r.ended)return 0===r.length&&j(this),null;var s=r.needReadable;return a("need readable",s),(0===r.length||r.length-t<r.highWaterMark)&&a("length less than watermark",s=!0),r.ended||r.reading?a("reading or ended",s=!1):s&&(a("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(t=R(i,r))),null===(e=t>0?F(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),i!==t&&r.ended&&j(this)),null!==e&&this.emit("data",e),e},T.prototype._read=function(t){M(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r,s=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,e);var o=e&&!1===e.end||t===i.default.stdout||t===i.default.stderr?y:h;function h(){a("onend"),t.end()}n.endEmitted?i.default.nextTick(o):s.once("end",o),t.on("unpipe",function e(r,i){a("onunpipe"),r===s&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,a("cleanup"),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("drain",l),t.removeListener("error",p),t.removeListener("unpipe",e),s.removeListener("end",h),s.removeListener("end",y),s.removeListener("data",d),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l())});var l=(r=s,function(){var t=r._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(r,"data")&&(t.flowing=!0,N(r))});t.on("drain",l);var c=!1;function d(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==D(n.pipes,t))&&!c&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),s.pause())}function p(e){a("onerror",e),y(),t.removeListener("error",p),0===u(t,"error")&&M(t,e)}function f(){t.removeListener("finish",m),y()}function m(){a("onfinish"),t.removeListener("close",f),y()}function y(){a("unpipe"),s.unpipe(t)}return s.on("data",d),!function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",f),t.once("finish",m),t.emit("pipe",s),n.flowing||(a("pipe resume"),s.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var i=e.pipes,s=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n<s;n++)i[n].emit("unpipe",this,{hasUnpiped:!1});return this}var a=D(e.pipes,t);return -1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=c.prototype.on.call(this,t,e),s=this._readableState;return"data"===t?(s.readableListening=this.listenerCount("readable")>0,!1!==s.flowing&&this.resume()):"readable"!==t||s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,a("on readable",s.length,s.reading),s.length?O(this):s.reading||i.default.nextTick(L,this)),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=c.prototype.removeListener.call(this,t,e);return"readable"===t&&i.default.nextTick(B,this),r},T.prototype.removeAllListeners=function(t){var e=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&i.default.nextTick(B,this),e},T.prototype.resume=function(){var t,e,r=this._readableState;return r.flowing||(a("resume"),r.flowing=!r.readableListening,t=this,(e=r).resumeScheduled||(e.resumeScheduled=!0,i.default.nextTick(z,t,e))),r.paused=!1,this},T.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var s in t.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(s){a("wrapped data"),r.decoder&&(s=r.decoder.write(s)),r.objectMode&&null==s||(r.objectMode||s&&s.length)&&(e.push(s)||(i=!0,t.pause()))}),t)void 0===this[s]&&"function"==typeof t[s]&&(this[s]=function(e){return function(){return t[e].apply(t,arguments)}}(s));for(var n=0;n<_.length;n++)t.on(_[n],this.emit.bind(this,_[n]));return this._read=function(e){a("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=s(531)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=F,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===l&&(l=s(812)),l(T,t,e)})},586:function(t,e,r){"use strict";t.exports=u;var i=r(329).F,s=i.ERR_METHOD_NOT_IMPLEMENTED,n=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=i.ERR_TRANSFORM_WITH_LENGTH_0,h=r(686);function l(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);h.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(e,r){d(t,e,r)})}function d(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new o;if(t._transformState.transforming)throw new a;return t.push(null)}r(638)(u,h),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,h.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,r){r(new s("_transform()"))},u.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var s=this._readableState;(i.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){h.prototype._destroy.call(this,t,function(t){e(t)})}},732:function(e,r,s){"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){var r=e,i=t,s=r.entry;for(r.entry=null;s;){var n=s.callback;i.pendingcb--,n(void 0),s=s.next}i.corkedRequestsFree.next=r}}e.exports=T,T.WritableState=A;var a,o,h={deprecate:s(774)},l=s(120),u=s(181).Buffer,c=t.g.Uint8Array||function(){},d=s(528),p=s(771).getHighWaterMark,f=s(329).F,m=f.ERR_INVALID_ARG_TYPE,y=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,v=f.ERR_STREAM_DESTROYED,x=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,M=d.errorOrDestroy;function _(){}function A(t,e,r){a=a||s(686),t=t||{},"boolean"!=typeof r&&(r=e instanceof a),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=p(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,s=r.sync,n=r.writecb;if("function"!=typeof n)throw new g;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e)--r.pendingcb,s?(i.default.nextTick(n,e),i.default.nextTick(k,t,r),t._writableState.errorEmitted=!0,M(t,e)):(n(e),t._writableState.errorEmitted=!0,M(t,e),k(t,r));else{var a=O(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),s?i.default.nextTick(E,t,r,a,n):E(t,r,a,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}s(638)(T,l),A.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};try{Object.defineProperty(A.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}function T(t){var e=this instanceof(a=a||s(686));if(!e&&!o.call(T,this))return new T(t);this._writableState=new A(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function C(t,e,r,i,s,n,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v("write")):r?t._writev(s,e.onwrite):t._write(s,n,e.onwrite),e.sync=!1}function E(t,e,r,i){var s,n;r||(s=t,0===(n=e).length&&n.needDrain&&(n.needDrain=!1,s.emit("drain"))),e.pendingcb--,i(),k(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=Array(e.bufferedRequestCount),s=e.corkedRequestsFree;s.entry=r;for(var a=0,o=!0;r;)i[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;i.allBuffers=o,C(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,l=r.encoding,u=r.callback,c=e.objectMode?1:h.length;if(C(t,e,!1,c,h,l,u),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final(function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=O(e);if(r&&(e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.default.nextTick(I,t,e))),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var s=t._readableState;(!s||s.autoDestroy&&s.endEmitted)&&t.destroy()}return r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===T&&t&&t._writableState instanceof A}})):o=function(t){return t instanceof this},T.prototype.pipe=function(){M(this,new b)},T.prototype.write=function(t,e,r){var s,n,a,o,h,l,d,p=this._writableState,f=!1,y=!p.objectMode&&(s=t,u.isBuffer(s)||s instanceof c);return(y&&!u.isBuffer(t)&&(n=t,t=u.from(n)),"function"==typeof e&&(r=e,e=null),y?e="buffer":e||(e=p.defaultEncoding),"function"!=typeof r&&(r=_),p.ending)?(a=r,M(this,o=new w),i.default.nextTick(a,o)):(y||(h=t,l=r,null===h?d=new x:"string"==typeof h||p.objectMode||(d=new m("chunk",["string","Buffer"],h)),!d||(M(this,d),i.default.nextTick(l,d),0)))&&(p.pendingcb++,f=function(t,e,r,i,s,n){if(!r){var a,o,h=(a=i,o=s,e.objectMode||!1===e.decodeStrings||"string"!=typeof a||(a=u.from(a,o)),a);i!==h&&(r=!0,s="buffer",i=h)}var l=e.objectMode?1:i.length;e.length+=l;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var d=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:s,isBuf:r,callback:n,next:null},d?d.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,l,i,s,n);return c}(this,p,y,t,e,r)),f},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||R(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var s,n,a,o=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),o.corked&&(o.corked=1,this.uncork()),o.ending||(s=this,n=o,a=r,n.ending=!0,k(s,n),a&&(n.finished?i.default.nextTick(a):s.once("finish",a)),n.ended=!0,s.writable=!1),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=d.destroy,T.prototype._undestroy=d.undestroy,T.prototype._destroy=function(t,e){e(t)}},531:function(t,e,r){"use strict";function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var n,a=r(134),o=Symbol("lastResolve"),h=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function f(t,e){return{value:t,done:e}}function m(t){var e=t[o];if(null!==e){var r=t[p].read();null!==r&&(t[c]=null,t[o]=null,t[h]=null,e(f(r,!1)))}}function y(t){i.default.nextTick(m,t)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((s(n={get stream(){return this[p]},next:function(){var t,e,r=this,s=this[l];if(null!==s)return Promise.reject(s);if(this[u])return Promise.resolve(f(void 0,!0));if(this[p].destroyed)return new Promise(function(t,e){i.default.nextTick(function(){r[l]?e(r[l]):t(f(void 0,!0))})});var n=this[c];if(n)e=new Promise((t=this,function(e,r){n.then(function(){t[u]?e(f(void 0,!0)):t[d](e,r)},r)}));else{var a=this[p].read();if(null!==a)return Promise.resolve(f(a,!1));e=new Promise(this[d])}return this[c]=e,e}},Symbol.asyncIterator,function(){return this}),s(n,"return",function(){var t=this;return new Promise(function(e,r){t[p].destroy(null,function(t){t?r(t):e(f(void 0,!0))})})}),n),g);t.exports=function(t){var e,r=Object.create(b,(s(e={},p,{value:t,writable:!0}),s(e,o,{value:null,writable:!0}),s(e,h,{value:null,writable:!0}),s(e,l,{value:null,writable:!0}),s(e,u,{value:t._readableState.endEmitted,writable:!0}),s(e,d,{value:function(t,e){var i=r[p].read();i?(r[c]=null,r[o]=null,r[h]=null,t(f(i,!1))):(r[o]=t,r[h]=e)},writable:!0}),e));return r[c]=null,a(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[h];null!==e&&(r[c]=null,r[o]=null,r[h]=null,e(t)),r[l]=t;return}var i=r[o];null!==i&&(r[c]=null,r[o]=null,r[h]=null,i(f(void 0,!0))),r[u]=!0}),t.on("readable",y.bind(null,r)),r}},137:function(t,e,r){"use strict";function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var s=r(181).Buffer,n=r(23).inspect,a=n&&n.custom||"inspect";t.exports=function(){var t;function e(){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return t=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,i=s.allocUnsafe(t>>>0),n=this.head,a=0;n;)e=n.data,r=a,s.prototype.copy.call(e,i,r),a+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,i=e.data;for(t-=i.length;e=e.next;){var s=e.data,n=t>s.length?s.length:t;if(n===s.length?i+=s:i+=s.slice(0,t),0==(t-=n)){n===s.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=s.slice(n));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var n=r.data,a=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,a),0==(t-=a)){a===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(a));break}++i}return this.length-=i,e}},{key:a,value:function(t,e){return n(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){var i,s,n;i=t,s=e,n=r[e],s in i?Object.defineProperty(i,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[s]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},e,{depth:0,customInspect:!1}))}}],function(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(e.prototype,t),e}()},528:function(t){"use strict";function e(t,e){s(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||(!t._readableState||t._readableState.emitClose)&&t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,n){var a=this,o=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return o||h?n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.default.nextTick(s,this,t)):i.default.nextTick(s,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!n&&t?a._writableState?a._writableState.errorEmitted?i.default.nextTick(r,a):(a._writableState.errorEmitted=!0,i.default.nextTick(e,a,t)):i.default.nextTick(e,a,t):n?(i.default.nextTick(r,a),n(t)):i.default.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}}},134:function(t,e,r){"use strict";var i=r(329).F.ERR_STREAM_PREMATURE_CLOSE;function s(){}t.exports=function t(e,r,n){if("function"==typeof r)return t(e,null,r);r||(r={}),a=n||s,o=!1,n=function(){if(!o){o=!0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];a.apply(this,e)}};var a,o,h=r.readable||!1!==r.readable&&e.readable,l=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||d()},c=e._writableState&&e._writableState.finished,d=function(){l=!1,c=!0,h||n.call(e)},p=e._readableState&&e._readableState.endEmitted,f=function(){h=!1,p=!0,l||n.call(e)},m=function(t){n.call(e,t)},y=function(){var t;return h&&!p?(e._readableState&&e._readableState.ended||(t=new i),n.call(e,t)):l&&!c?(e._writableState&&e._writableState.ended||(t=new i),n.call(e,t)):void 0},g=function(){e.req.on("finish",d)};return e.setHeader&&"function"==typeof e.abort?(e.on("complete",d),e.on("abort",y),e.req?g():e.on("request",g)):l&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",f),e.on("finish",d),!1!==r.error&&e.on("error",m),e.on("close",y),function(){e.removeListener("complete",d),e.removeListener("abort",y),e.removeListener("request",g),e.req&&e.req.removeListener("finish",d),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",d),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",y)}}},812:function(t,e,r){"use strict";function i(t,e,r,i,s,n,a){try{var o=t[n](a),h=o.value}catch(t){r(t);return}o.done?e(h):Promise.resolve(h).then(i,s)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}var n=r(329).F.ERR_INVALID_ARG_TYPE;t.exports=function(t,e,r){if(e&&"function"==typeof e.next)a=e;else if(e&&e[Symbol.asyncIterator])a=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])a=e[Symbol.iterator]();else throw new n("iterable",["Iterable"],e);var a,o=new t(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){var i,s,n;i=t,s=e,n=r[e],s in i?Object.defineProperty(i,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[s]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({objectMode:!0},r)),h=!1;function l(){return u.apply(this,arguments)}function u(){var t;return t=function*(){try{var t=yield a.next(),e=t.value;t.done?o.push(null):o.push((yield e))?l():h=!1}catch(t){o.destroy(t)}},(u=function(){var e=this,r=arguments;return new Promise(function(s,n){var a=t.apply(e,r);function o(t){i(a,s,n,o,h,"next",t)}function h(t){i(a,s,n,o,h,"throw",t)}o(void 0)})}).apply(this,arguments)}return o._read=function(){h||(h=!0,l())},o}},694:function(t,e,r){"use strict";var i,s=r(329).F,n=s.ERR_MISSING_ARGS,a=s.ERR_STREAM_DESTROYED;function o(t){if(t)throw t}function h(t){t()}function l(t,e){return t.pipe(e)}t.exports=function(){for(var t,e,s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=(t=u).length&&"function"==typeof t[t.length-1]?t.pop():o;if(Array.isArray(u[0])&&(u=u[0]),u.length<2)throw new n("streams");var p=u.map(function(t,s){var n,o,l,c,f,m,y=s<u.length-1;return n=s>0,l=o=function(t){e||(e=t),t&&p.forEach(h),y||(p.forEach(h),d(e))},c=!1,o=function(){c||(c=!0,l.apply(void 0,arguments))},f=!1,t.on("close",function(){f=!0}),void 0===i&&(i=r(134)),i(t,{readable:y,writable:n},function(t){if(t)return o(t);f=!0,o()}),m=!1,function(e){if(!f&&!m){if(m=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();o(e||new a("pipe"))}}});return u.reduce(l)}},771:function(t,e,r){"use strict";var i=r(329).F.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,s){var n=null!=e.highWaterMark?e.highWaterMark:s?e[r]:null;if(null!=n){if(!(isFinite(n)&&Math.floor(n)===n)||n<0)throw new i(s?r:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}}},120:function(t,e,r){t.exports=r(203)},486:function(t,e,r){var s=r(203);"disable"===i.default.env.READABLE_STREAM&&s?(t.exports=s.Readable,Object.assign(t.exports,s),t.exports.Stream=s):((e=t.exports=r(276)).Stream=s||e,e.Readable=e,e.Writable=r(732),e.Duplex=r(686),e.Transform=r(586),e.PassThrough=r(512),e.finished=r(134),e.pipeline=r(694))},56:function(t,e,r){var i=r(181),s=i.Buffer;function n(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return s(t,e,r)}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(n(i,e),e.Buffer=a),a.prototype=Object.create(s.prototype),n(s,a),a.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return s(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var i=s(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return s(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i.SlowBuffer(t)}},534:function(e,r,i){var s=i(291),n=i(935),a=i(663),o=i(514),h=i(16);r.request=function(e,r){e="string"==typeof e?h.parse(e):a(e);var i=-1===t.g.location.protocol.search(/^https?:$/)?"http:":"",n=e.protocol||i,o=e.hostname||e.host,l=e.port,u=e.path||"/";o&&-1!==o.indexOf(":")&&(o="["+o+"]"),e.url=(o?n+"//"+o:"")+(l?":"+l:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new s(e);return r&&c.on("response",r),c},r.get=function(t,e){var i=r.request(t,e);return i.end(),i},r.ClientRequest=s,r.IncomingMessage=n.IncomingMessage,r.Agent=function(){},r.Agent.defaultMaxSockets=4,r.globalAgent=new r.Agent,r.STATUS_CODES=o,r.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},102:function(e,r){var i;function s(){if(void 0!==i)return i;if(t.g.XMLHttpRequest){i=new t.g.XMLHttpRequest;try{i.open("GET",t.g.XDomainRequest?"/":"https://example.com")}catch(t){i=null}}else i=null;return i}function n(t){var e=s();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function a(t){return"function"==typeof t}r.fetch=a(t.g.fetch)&&a(t.g.ReadableStream),r.writableStream=a(t.g.WritableStream),r.abortController=a(t.g.AbortController),r.arraybuffer=r.fetch||n("arraybuffer"),r.msstream=!r.fetch&&n("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&n("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!s()&&a(s().overrideMimeType),i=null},291:function(e,r,n){var a=n(102),o=n(638),h=n(935),l=n(486),u=h.IncomingMessage,c=h.readyStates,d=e.exports=function(t){var e,r,i,n=this;l.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+s.Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){n.setHeader(e,t.headers[e])});var o=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!a.abortController)o=!1,i=!0;else if("prefer-streaming"===t.mode)i=!1;else if("allow-wrong-content-type"===t.mode)i=!a.overrideMimeType;else if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw Error("Invalid value for opts.mode");else i=!0;e=i,r=o,n._mode=a.fetch&&r?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":"text",n._fetchTimer=null,n.on("finish",function(){n._onFinish()})};o(d,l.Writable),d.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===p.indexOf(r)&&(this._headers[r]={name:t,value:e})},d.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},d.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},d.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts,s=e._headers,n=null;"GET"!==r.method&&"HEAD"!==r.method&&(n=new Blob(e._body,{type:(s["content-type"]||{}).value||""}));var o=[];if(Object.keys(s).forEach(function(t){var e=s[t].name,r=s[t].value;Array.isArray(r)?r.forEach(function(t){o.push([e,t])}):o.push([e,r])}),"fetch"===e._mode){var h=null;if(a.abortController){var l=new AbortController;h=l.signal,e._fetchAbortController=l,"requestTimeout"in r&&0!==r.requestTimeout&&(e._fetchTimer=t.g.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},r.requestTimeout))}t.g.fetch(e._opts.url,{method:e._opts.method,headers:o,body:n||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:h}).then(function(t){e._fetchResponse=t,e._connect()},function(r){t.g.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",r)})}else{var u=e._xhr=new t.g.XMLHttpRequest;try{u.open(e._opts.method,e._opts.url,!0)}catch(t){i.default.nextTick(function(){e.emit("error",t)});return}"responseType"in u&&(u.responseType=e._mode),"withCredentials"in u&&(u.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(u.timeout=r.requestTimeout,u.ontimeout=function(){e.emit("requestTimeout")}),o.forEach(function(t){u.setRequestHeader(t[0],t[1])}),e._response=null,u.onreadystatechange=function(){switch(u.readyState){case c.LOADING:case c.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(u.onprogress=function(){e._onXHRProgress()}),u.onerror=function(){e._destroyed||e.emit("error",Error("XHR error"))};try{u.send(n)}catch(t){i.default.nextTick(function(){e.emit("error",t)});return}}}},d.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},d.prototype._connect=function(){var t=this;t._destroyed||(t._response=new u(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))},d.prototype._write=function(t,e,r){this._body.push(t),r()},d.prototype.abort=d.prototype.destroy=function(){this._destroyed=!0,t.g.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},d.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),l.Writable.prototype.end.call(this,t,e,r)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},935:function(e,r,n){var a=n(102),o=n(638),h=n(486),l=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=r.IncomingMessage=function(e,r,n,o){var l=this;if(h.Readable.call(l),l._mode=n,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",function(){i.default.nextTick(function(){l.emit("close")})}),"fetch"===n){if(l._fetchResponse=r,l.url=r.url,l.statusCode=r.status,l.statusMessage=r.statusText,r.headers.forEach(function(t,e){l.headers[e.toLowerCase()]=t,l.rawHeaders.push(e,t)}),a.writableStream){var u=new WritableStream({write:function(t){return new Promise(function(e,r){l._destroyed?r():l.push(s.Buffer.from(t))?e():l._resumeFetch=e})},close:function(){t.g.clearTimeout(o),l._destroyed||l.push(null)},abort:function(t){l._destroyed||l.emit("error",t)}});try{r.body.pipeTo(u).catch(function(e){t.g.clearTimeout(o),l._destroyed||l.emit("error",e)});return}catch(t){}}var c=r.body.getReader();!function e(){c.read().then(function(r){if(!l._destroyed){if(r.done){t.g.clearTimeout(o),l.push(null);return}l.push(s.Buffer.from(r.value)),e()}}).catch(function(e){t.g.clearTimeout(o),l._destroyed||l.emit("error",e)})}()}else if(l._xhr=e,l._pos=0,l.url=e.responseURL,l.statusCode=e.status,l.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===l.headers[r]&&(l.headers[r]=[]),l.headers[r].push(e[2])):void 0!==l.headers[r]?l.headers[r]+=", "+e[2]:l.headers[r]=e[2],l.rawHeaders.push(e[1],e[2])}}),l._charset="x-user-defined",!a.overrideMimeType){var d=l.rawHeaders["mime-type"];if(d){var p=d.match(/;\s*charset=([^;])(;|$)/);p&&(l._charset=p[1].toLowerCase())}l._charset||(l._charset="utf-8")}};o(u,h.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(){var e=this,r=e._xhr,i=null;switch(e._mode){case"text":if((i=r.responseText).length>e._pos){var n=i.substr(e._pos);if("x-user-defined"===e._charset){for(var a=s.Buffer.alloc(n.length),o=0;o<n.length;o++)a[o]=255&n.charCodeAt(o);e.push(a)}else e.push(n,e._charset);e._pos=i.length}break;case"arraybuffer":if(r.readyState!==l.DONE||!r.response)break;i=r.response,e.push(s.Buffer.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==l.LOADING||!i)break;e.push(s.Buffer.from(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==l.LOADING)break;var h=new t.g.MSStreamReader;h.onprogress=function(){h.result.byteLength>e._pos&&(e.push(s.Buffer.from(new Uint8Array(h.result.slice(e._pos)))),e._pos=h.result.byteLength)},h.onload=function(){e.push(null)},h.readAsArrayBuffer(i)}e._xhr.readyState===l.DONE&&"ms-stream"!==e._mode&&e.push(null)}},319:function(t,e,r){"use strict";var i=r(56).Buffer,s=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(t){var e;switch(this.encoding=function(t){var e=function(t){var e;if(!t)return"utf8";for(;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===s||!s(t)))throw Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=h,this.end=l,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=u,this.end=c,e=3;break;default:this.write=d,this.end=p;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length)}function h(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.I=n,n.prototype.write=function(t){var e,r;if(0===t.length)return"";if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var s=a(e[i]);return s>=0?(s>0&&(t.lastNeed=s-1),s):--i<r||-2===s?0:(s=a(e[i]))>=0?(s>0&&(t.lastNeed=s-2),s):--i<r||-2===s?0:(s=a(e[i]))>=0?(s>0&&(2===s?s=0:t.lastNeed=s-3),s):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},774:function(e){e.exports=function(t,e){if(r("noDeprecation"))return t;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}};function r(e){try{if(!t.g.localStorage)return!1}catch(t){return!1}var r=t.g.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}},663:function(t){t.exports=function(){for(var t={},r=0;r<arguments.length;r++){var i=arguments[r];for(var s in i)e.call(i,s)&&(t[s]=i[s])}return t};var e=Object.prototype.hasOwnProperty},181:function(e){"use strict";e.exports=t.r(43943)},434:function(e){"use strict";e.exports=t.r(30662)},203:function(e){"use strict";e.exports=t.r(12569)},16:function(e){"use strict";e.exports=t.r(21342)},23:function(e){"use strict";e.exports=t.r(77398)}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={exports:{}},i=!0;try{n[t](r,r.exports,o),i=!1}finally{i&&delete a[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/stream-http/",e.exports=o(534)},92542,(t,e,r)=>{var i={572:function(t,e,r){var i=r(611),s=r(16),n=t.exports;for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a]);function o(t){if("string"==typeof t&&(t=s.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}n.request=function(t,e){return t=o(t),i.request.call(this,t,e)},n.get=function(t,e){return t=o(t),i.get.call(this,t,e)}},611:function(e){"use strict";e.exports=t.r(22184)},16:function(e){"use strict";e.exports=t.r(21342)}},s={};function n(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}},a=!0;try{i[t](r,r.exports,n),a=!1}finally{a&&delete s[t]}return r.exports}n.ab="/ROOT/node_modules/next/dist/compiled/https-browserify/",e.exports=n(572)},8153,(t,e,r)=>{"use strict";var i=t.i(47167);Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.SUPPORTED_STREAM_BEHAVIOUR=r.SUPPORTED_SEND_META=void 0;var s=l(t.r(78492)),n=l(t.r(58033)),a=l(t.r(20502)),o=l(t.r(48450)),h=l(t.r(92542));function l(t){return t&&t.__esModule?t:{default:t}}let u=(0,o.default)("signalk-js-sdk/Connection"),c=void 0!==i.default&&null!=i.default.versions&&null!=i.default.versions.node,d=r.SUPPORTED_STREAM_BEHAVIOUR={self:"self",all:"all",none:"none"},p=r.SUPPORTED_SEND_META={all:"all"};class f extends s.default{constructor(t,e=[]){super(),this.options=t,this.httpURI=this.buildURI("http"),this.wsURI=this.buildURI("ws"),this.shouldDisconnect=!1,this.connected=!1,this.socket=null,this.lastMessage=-1,this.isConnecting=!1,this.wsKeepaliveIntervalMs=1e3*this.options.wsKeepaliveInterval,this._fetchReady=!1,this._bearerTokenPrefix=this.options.bearerTokenPrefix||"Bearer",this._authenticated=!1,this._retries=0,this._connection=null,this._self="",this._subscriptions=e,this.sendKeepaliveWithReschedule=this.sendKeepaliveWithReschedule.bind(this),this.onWSMessage=this._onWSMessage.bind(this),this.onWSOpen=this._onWSOpen.bind(this),this.onWSClose=this._onWSClose.bind(this),this.onWSError=this._onWSError.bind(this),this._token={kind:"",token:""},this.reconnect(!0)}get retries(){return this._retries}set self(t){null!==t&&this.emit("self",t),this._self=t}get self(){return this._self}set connectionInfo(t){null!==t&&this.emit("connectionInfo",t),this._connection=t,this.self=t.self}get connectionInfo(){return this._connection}buildURI(t){let{useTLS:e,hostname:r,port:i,version:s,deltaStreamBehaviour:n,sendMeta:a}=this.options,o=!0===e?`${t}s://`:`${t}://`;if(o+=r,o+=80===i?"":`:${i}`,o+="/signalk/",o+=s,"ws"===t){o+="/stream";let t=[];n&&d.hasOwnProperty(n)&&""!==d[n]&&t.push(`subscribe=${d[n]}`),a&&p.hasOwnProperty(a)&&""!==p[a]&&t.push(`sendMeta=${p[a]}`),o+="?"+t.join("&")}return"http"===t&&(o+="/api"),o}state(){return{connecting:this.isConnecting,connected:this.connected,ready:this.fetchReady}}disconnect(){u("[disconnect] called"),this.shouldDisconnect=!0,this.reconnect()}backOffAndReconnect(){if(!0===this.isConnecting)return;let{maxTimeBetweenRetries:t}=this.options,e=this._retries<Math.round(t/250)?250*this._retries:t;if(0===e)return this.reconnect();this.emit("backOffBeforeReconnect",e),u(`[backOffAndReconnect] waiting ${e} ms before reconnecting`),setTimeout(()=>this.reconnect(),e)}reconnect(t=!1){if(!0===this.isConnecting)return;if(null!==this.socket){u("[reconnect] closing socket"),this.socket.close();return}if(!1===t&&(this._retries+=1),!0!==t&&this._retries===this.options.maxRetries){this.emit("hitMaxRetries"),this.cleanupListeners();return}if(!0!==t&&!1===this.options.reconnect){u("[reconnect] Not reconnecting, for reconnect is false"),this.cleanupListeners();return}if(!0!==t&&!0===this.shouldDisconnect){u("[reconnect] not reconnecting, shouldDisconnect is true"),this.cleanupListeners();return}if(u(`[reconnect] socket is ${null===this.socket?"":"not "}NULL`),this._fetchReady=!1,this.shouldDisconnect=!1,this.isConnecting=!0,!1===this.options.useAuthentication){this._fetchReady=!0,this.emit("fetchReady"),this.initiateSocket();return}let e={method:"POST",mode:"cors",credentials:"same-origin",body:JSON.stringify({username:String(this.options.username||""),password:String(this.options.password||"")})};return this.fetch("/auth/login",e).then(t=>{if(!t||"object"!=typeof t||!t.hasOwnProperty("token"))throw Error(`Unexpected response from auth endpoint: ${JSON.stringify(t)}`);u(`[reconnect] successful auth request: ${JSON.stringify(t,null,2)}`),this._authenticated=!0,this._token={kind:"string"==typeof t.type&&""!==t.type.trim()?t.type:this._bearerTokenPrefix,token:t.token},this._fetchReady=!0,this.emit("fetchReady"),this.initiateSocket()}).catch(t=>(u(`[reconnect] error logging in: ${t.message}, reconnecting`),this.emit("error",t),this._retries+=1,this.isConnecting=!1,this.backOffAndReconnect()))}setAuthenticated(t,e="JWT"){this.emit("fetchReady"),this._authenticated=!0,this._token={kind:e,token:t}}initiateSocket(){c&&this.options.useTLS&&!1===this.options.rejectUnauthorized?this.socket=new n.default(this.wsURI,{rejectUnauthorized:!1}):this.socket=new n.default(this.wsURI),this.socket.addEventListener("message",this.onWSMessage),this.socket.addEventListener("open",this.onWSOpen),this.socket.addEventListener("error",this.onWSError),this.socket.addEventListener("close",this.onWSClose)}cleanupListeners(){u("[cleanupListeners] resetting auth and removing listeners"),this._authenticated=!1,this._token={kind:"",token:""},this.removeAllListeners()}sendKeepaliveWithReschedule(){!0===this.connected&&(this.lastMessage<Date.now()-this.wsKeepaliveIntervalMs&&this.socket.send("{}"),setTimeout(this.sendKeepaliveWithReschedule,this.wsKeepaliveIntervalMs))}_onWSMessage(t){this.lastMessage=Date.now();let e=t.data;try{"string"==typeof e&&(e=JSON.parse(e))}catch(t){console.error(`[Connection: ${this.options.hostname}] Error parsing data: ${t.message}`)}e&&"object"==typeof e&&e.hasOwnProperty("name")&&e.hasOwnProperty("version")&&e.hasOwnProperty("roles")&&(this.connectionInfo=e),this.emit("message",e)}_onWSOpen(){if(this.connected=!0,this.isConnecting=!1,this._subscriptions.length>0){let t=m(this._subscriptions);this.subscribe(t)}this._retries=0,this.options.wsKeepaliveInterval>0&&this.sendKeepaliveWithReschedule(),this.emit("connect")}_onWSError(t){u("[_onWSError] WS error",t.message||""),this.emit("error",t),this.backOffAndReconnect()}_onWSClose(t){u("[_onWSClose] called with wsURI:",this.wsURI),this.socket.removeEventListener("message",this.onWSMessage),this.socket.removeEventListener("open",this.onWSOpen),this.socket.removeEventListener("error",this.onWSError),this.socket.removeEventListener("close",this.onWSClose),this.connected=!1,this.isConnecting=!1,this.socket=null,this.emit("disconnect",t),this.backOffAndReconnect()}unsubscribe(){!0!==this.connected||null===this.socket?u("Not connected to socket"):this.send(JSON.stringify({context:"*",unsubscribe:[{path:"*"}]}))}subscribe(t=[]){!Array.isArray(t)&&t&&"object"==typeof t&&t.hasOwnProperty("subscribe")&&(t=[t]),t.forEach(t=>{this.send(JSON.stringify(t))})}send(t){if(!0!==this.connected||null===this.socket)return Promise.reject(Error("Not connected to WebSocket"));if("string"==typeof t)try{t=JSON.parse(t)}catch(t){u(`[send] data is string but not valid JSON: ${t.message}`)}let e=t&&"object"==typeof t;try{e&&(t=JSON.stringify(t))}catch(t){return Promise.reject(t)}return u(`Sending data to socket: ${t}`),Promise.resolve(this.socket.send(t))}fetch(t,e){"/"!==t.charAt(0)&&(t=`/${t}`),e&&"object"==typeof e||(e={method:"GET"}),e.headers&&"object"==typeof e.headers||(e.headers={Accept:"application/json","Content-Type":"application/json"}),!0!==this._authenticated||t.includes("auth/login")||(e.headers={...e.headers,Authorization:`${this._token.kind} ${this._token.token}`},e.credentials="same-origin",e.mode="cors",u("[fetch] enriching fetch options with in-memory token")),c&&this.options.useTLS&&!1===this.options.rejectUnauthorized&&(e.agent=new h.default.Agent({rejectUnauthorized:!1}));let r=`${this.httpURI}${t}`;return r.includes("/api/auth/login")&&(r=r.replace("/api/auth/login","/auth/login")),r.includes("/api/access/requests")&&(r=r.replace("/api/access/requests","/access/requests")),r.includes("/signalk/v1/api/security")&&(r=r.replace("/signalk/v1/api/security","/security")),u(`[fetch] ${e.method||"GET"} ${r} ${JSON.stringify(e,null,2)}`),(0,a.default)(r,e).then(t=>{if(!t.ok)throw Error(`Error fetching ${r}: ${t.status} ${t.statusText}`);return t.headers.get("content-type").includes("application/json")?t.json():t.text()})}}r.default=f;let m=t=>{let e={};return t.forEach(t=>{Array.isArray(e[t.context])||(e[t.context]=[]),e[t.context]=e[t.context].concat(t.subscribe)}),Object.keys(e).map(t=>{let r={context:t,subscribe:e[t]};if(r.subscribe.length>0){let t=[];r.subscribe=r.subscribe.reduce((e,r)=>{if(t.includes(r.path)){let t=e.findIndex(t=>t.path===r.path);-1!==t&&e.splice(t,1)}else t.push(r.path);return e.push(r),e},[])}return r})}},37342,t=>{"use strict";t.s([],48636),t.i(48636);var e,r,i,s=new Uint8Array(16);function n(){if(!e&&!(e="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(s)}let a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,o=function(t){return"string"==typeof t&&a.test(t)};for(var h=[],l=0;l<256;++l)h.push((l+256).toString(16).substr(1));let u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(h[t[e+0]]+h[t[e+1]]+h[t[e+2]]+h[t[e+3]]+"-"+h[t[e+4]]+h[t[e+5]]+"-"+h[t[e+6]]+h[t[e+7]]+"-"+h[t[e+8]]+h[t[e+9]]+"-"+h[t[e+10]]+h[t[e+11]]+h[t[e+12]]+h[t[e+13]]+h[t[e+14]]+h[t[e+15]]).toLowerCase();if(!o(r))throw TypeError("Stringified UUID is invalid");return r};var c=0,d=0;let p=function(t){if(!o(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/0x10000000000&255,r[11]=e/0x100000000&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r};function f(t,e,r){function i(t,i,s,n){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof i&&(i=p(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+t.length);if(a.set(i),a.set(t,i.length),(a=r(a))[6]=15&a[6]|e,a[8]=63&a[8]|128,s){n=n||0;for(var o=0;o<16;++o)s[n+o]=a[o];return s}return u(a)}try{i.name=t}catch(t){}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}function m(t){return(t+64>>>9<<4)+14+1}function y(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function g(t,e,r,i,s,n){var a;return y((a=y(y(e,t),y(i,n)))<<s|a>>>32-s,r)}function b(t,e,r,i,s,n,a){return g(e&r|~e&i,t,e,s,n,a)}function v(t,e,r,i,s,n,a){return g(e&i|r&~i,t,e,s,n,a)}function x(t,e,r,i,s,n,a){return g(e^r^i,t,e,s,n,a)}function w(t,e,r,i,s,n,a){return g(r^(e|~i),t,e,s,n,a)}var S=f("v3",48,function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){for(var e=[],r=32*t.length,i="0123456789abcdef",s=0;s<r;s+=8){var n=t[s>>5]>>>s%32&255,a=parseInt(i.charAt(n>>>4&15)+i.charAt(15&n),16);e.push(a)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[m(e)-1]=e;for(var r=0x67452301,i=-0x10325477,s=-0x67452302,n=0x10325476,a=0;a<t.length;a+=16){var o=r,h=i,l=s,u=n;r=b(r,i,s,n,t[a],7,-0x28955b88),n=b(n,r,i,s,t[a+1],12,-0x173848aa),s=b(s,n,r,i,t[a+2],17,0x242070db),i=b(i,s,n,r,t[a+3],22,-0x3e423112),r=b(r,i,s,n,t[a+4],7,-0xa83f051),n=b(n,r,i,s,t[a+5],12,0x4787c62a),s=b(s,n,r,i,t[a+6],17,-0x57cfb9ed),i=b(i,s,n,r,t[a+7],22,-0x2b96aff),r=b(r,i,s,n,t[a+8],7,0x698098d8),n=b(n,r,i,s,t[a+9],12,-0x74bb0851),s=b(s,n,r,i,t[a+10],17,-42063),i=b(i,s,n,r,t[a+11],22,-0x76a32842),r=b(r,i,s,n,t[a+12],7,0x6b901122),n=b(n,r,i,s,t[a+13],12,-0x2678e6d),s=b(s,n,r,i,t[a+14],17,-0x5986bc72),i=b(i,s,n,r,t[a+15],22,0x49b40821),r=v(r,i,s,n,t[a+1],5,-0x9e1da9e),n=v(n,r,i,s,t[a+6],9,-0x3fbf4cc0),s=v(s,n,r,i,t[a+11],14,0x265e5a51),i=v(i,s,n,r,t[a],20,-0x16493856),r=v(r,i,s,n,t[a+5],5,-0x29d0efa3),n=v(n,r,i,s,t[a+10],9,0x2441453),s=v(s,n,r,i,t[a+15],14,-0x275e197f),i=v(i,s,n,r,t[a+4],20,-0x182c0438),r=v(r,i,s,n,t[a+9],5,0x21e1cde6),n=v(n,r,i,s,t[a+14],9,-0x3cc8f82a),s=v(s,n,r,i,t[a+3],14,-0xb2af279),i=v(i,s,n,r,t[a+8],20,0x455a14ed),r=v(r,i,s,n,t[a+13],5,-0x561c16fb),n=v(n,r,i,s,t[a+2],9,-0x3105c08),s=v(s,n,r,i,t[a+7],14,0x676f02d9),i=v(i,s,n,r,t[a+12],20,-0x72d5b376),r=x(r,i,s,n,t[a+5],4,-378558),n=x(n,r,i,s,t[a+8],11,-0x788e097f),s=x(s,n,r,i,t[a+11],16,0x6d9d6122),i=x(i,s,n,r,t[a+14],23,-0x21ac7f4),r=x(r,i,s,n,t[a+1],4,-0x5b4115bc),n=x(n,r,i,s,t[a+4],11,0x4bdecfa9),s=x(s,n,r,i,t[a+7],16,-0x944b4a0),i=x(i,s,n,r,t[a+10],23,-0x41404390),r=x(r,i,s,n,t[a+13],4,0x289b7ec6),n=x(n,r,i,s,t[a],11,-0x155ed806),s=x(s,n,r,i,t[a+3],16,-0x2b10cf7b),i=x(i,s,n,r,t[a+6],23,0x4881d05),r=x(r,i,s,n,t[a+9],4,-0x262b2fc7),n=x(n,r,i,s,t[a+12],11,-0x1924661b),s=x(s,n,r,i,t[a+15],16,0x1fa27cf8),i=x(i,s,n,r,t[a+2],23,-0x3b53a99b),r=w(r,i,s,n,t[a],6,-0xbd6ddbc),n=w(n,r,i,s,t[a+7],10,0x432aff97),s=w(s,n,r,i,t[a+14],15,-0x546bdc59),i=w(i,s,n,r,t[a+5],21,-0x36c5fc7),r=w(r,i,s,n,t[a+12],6,0x655b59c3),n=w(n,r,i,s,t[a+3],10,-0x70f3336e),s=w(s,n,r,i,t[a+10],15,-1051523),i=w(i,s,n,r,t[a+1],21,-0x7a7ba22f),r=w(r,i,s,n,t[a+8],6,0x6fa87e4f),n=w(n,r,i,s,t[a+15],10,-0x1d31920),s=w(s,n,r,i,t[a+6],15,-0x5cfebcec),i=w(i,s,n,r,t[a+13],21,0x4e0811a1),r=w(r,i,s,n,t[a+4],6,-0x8ac817e),n=w(n,r,i,s,t[a+11],10,-0x42c50dcb),s=w(s,n,r,i,t[a+2],15,0x2ad7d2bb),i=w(i,s,n,r,t[a+9],21,-0x14792c6f),r=y(r,o),i=y(i,h),s=y(s,l),n=y(n,u)}return[r,i,s,n]}(function(t){if(0===t.length)return[];for(var e=8*t.length,r=new Uint32Array(m(e)),i=0;i<e;i+=8)r[i>>5]|=(255&t[i/8])<<i%32;return r}(t),8*t.length))});function M(t,e){return t<<e|t>>>32-e}var _=f("v5",80,function(t){var e=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var s=0;s<i.length;++s)t.push(i.charCodeAt(s))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var n=Math.ceil((t.length/4+2)/16),a=Array(n),o=0;o<n;++o){for(var h=new Uint32Array(16),l=0;l<16;++l)h[l]=t[64*o+4*l]<<24|t[64*o+4*l+1]<<16|t[64*o+4*l+2]<<8|t[64*o+4*l+3];a[o]=h}a[n-1][14]=(t.length-1)*8/0x100000000,a[n-1][14]=Math.floor(a[n-1][14]),a[n-1][15]=(t.length-1)*8|0;for(var u=0;u<n;++u){for(var c=new Uint32Array(80),d=0;d<16;++d)c[d]=a[u][d];for(var p=16;p<80;++p)c[p]=M(c[p-3]^c[p-8]^c[p-14]^c[p-16],1);for(var f=r[0],m=r[1],y=r[2],g=r[3],b=r[4],v=0;v<80;++v){var x=Math.floor(v/20),w=M(f,5)+function(t,e,r,i){switch(t){case 0:return e&r^~e&i;case 1:case 3:return e^r^i;case 2:return e&r^e&i^r&i}}(x,m,y,g)+b+e[x]+c[v]>>>0;b=g,g=y,y=M(m,30)>>>0,m=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+g>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});t.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,p,"stringify",0,u,"v1",0,function(t,e,s){var a=e&&s||0,o=e||Array(16),h=(t=t||{}).node||r,l=void 0!==t.clockseq?t.clockseq:i;if(null==h||null==l){var p=t.random||(t.rng||n)();null==h&&(h=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==l&&(l=i=(p[6]<<8|p[7])&16383)}var f=void 0!==t.msecs?t.msecs:Date.now(),m=void 0!==t.nsecs?t.nsecs:d+1,y=f-c+(m-d)/1e4;if(y<0&&void 0===t.clockseq&&(l=l+1&16383),(y<0||f>c)&&void 0===t.nsecs&&(m=0),m>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,d=m,i=l;var g=((0xfffffff&(f+=122192928e5))*1e4+m)%0x100000000;o[a++]=g>>>24&255,o[a++]=g>>>16&255,o[a++]=g>>>8&255,o[a++]=255&g;var b=f/0x100000000*1e4&0xfffffff;o[a++]=b>>>8&255,o[a++]=255&b,o[a++]=b>>>24&15|16,o[a++]=b>>>16&255,o[a++]=l>>>8|128,o[a++]=255&l;for(var v=0;v<6;++v)o[a+v]=h[v];return e||u(o)},"v3",0,S,"v4",0,function(t,e,r){var i=(t=t||{}).random||(t.rng||n)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=i[s];return e}return u(i)},"v5",0,_,"validate",0,o,"version",0,function(t){if(!o(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}],37342)},30980,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=a(t.r(78492)),s=a(t.r(48450)),n=t.r(37342);function a(t){return t&&t.__esModule?t:{default:t}}let o=(0,s.default)("signalk-js-sdk/Request");class h extends i.default{constructor(t,e,r){super(),this.connection=t,this.requestId=(0,n.v4)(),this.name=e,this.body=r,this.responses=[],this.sent=!1,this.connection.on("message",t=>{t&&"object"==typeof t&&t.hasOwnProperty("requestId")&&t.requestId===this.requestId&&this.addResponse(t)})}query(){let t={requestId:this.requestId,query:!0};o(`Sending query: ${JSON.stringify(t,null,2)}`),this.connection.send(t)}send(){if(!0===this.sent)return;let t={requestId:this.requestId,...this.body};o(`Sending request: ${JSON.stringify(t,null,2)}`),this.connection.send(t)}addResponse(t){o(`Got response for request "${this.name}": ${JSON.stringify(t,null,2)}`);let e=new Date().toISOString();this.responses.push({response:t,receivedAt:e}),this.emit("response",{...t,request:{receivedAt:e,name:this.name,requestId:this.requestId}})}getRequestId(){return this.requestId}}r.default=h},5526,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=class{constructor(t){this.connection=t,this.selfMRN=this.connection.self}get(t){return t.includes(".")&&(t=t.replace(/\./g,"/")),("string"!=typeof t||""===t.trim())&&(t="/"),"/"!==t.charAt(0)&&(t=`/${t}`),this.connection.fetch(t)}put(t,e){return t.includes(".")&&(t=t.replace(/\./g,"/")),("string"!=typeof t||""===t.trim())&&(t="/"),"/"!==t.charAt(0)&&(t=`/${t}`),this.connection.fetch(t,{method:"PUT",mode:"cors",body:e&&"object"==typeof e?JSON.stringify(e):e})}getMeta(t){return this.get(t).then(t=>t&&"object"==typeof t&&t.hasOwnProperty("meta")?t.meta:null)}sources(){return this.get("/sources")}resources(){return this.get("/resources")}mrn(){return this.get("/self")}vessels(){return this.get("/vessels")}aircraft(){return this.get("/aircraft")}aton(){return this.get("/aton")}sar(){return this.get("/sar")}version(){return this.get("/version")}self(t){return("string"!=typeof t||"/"!==t.charAt(0))&&(t=""),this.connection.fetch(`/vessels/self${t}`)}vessel(t,e){return("string"!=typeof e||"/"!==e.charAt(0))&&(e=""),this.connection.fetch(`/vessels/${t}${e}`)}name(){return this.self("/name")}getGroup(t,e,r="self"){return(("string"!=typeof e||"/"!==e.charAt(0))&&(e=""),"self"===r)?this.self(`/${t}${e}`):this.vessel(r,`/${t}${e}`)}communication(t="",e="self"){return this.getGroup("communication",t,e)}design(t="",e="self"){return this.getGroup("design",t,e)}electrical(t="",e="self"){return this.getGroup("electrical",t,e)}environment(t="",e="self"){return this.getGroup("environment",t,e)}navigation(t="",e="self"){return this.getGroup("navigation",t,e)}notifications(t="",e="self"){return this.getGroup("notifications",t,e)}performance(t="",e="self"){return this.getGroup("performance",t,e)}propulsion(t="",e="self"){return this.getGroup("propulsion",t,e)}sails(t="",e="self"){return this.getGroup("sails",t,e)}sensors(t="",e="self"){return this.getGroup("sensors",t,e)}steering(t="",e="self"){return this.getGroup("steering",t,e)}tanks(t="",e="self"){return this.getGroup("tanks",t,e)}}},74392,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.PERMISSIONS_READWRITE=r.PERMISSIONS_READONLY=r.PERMISSIONS_DENY=r.AUTHENTICATION_REQUEST=void 0;var i=l(t.r(78492)),s=l(t.r(8153)),n=l(t.r(30980)),a=l(t.r(5526)),o=l(t.r(48450)),h=t.r(37342);function l(t){return t&&t.__esModule?t:{default:t}}let u=(0,o.default)("signalk-js-sdk/Client"),c=r.AUTHENTICATION_REQUEST="__AUTHENTICATION_REQUEST__";r.PERMISSIONS_READWRITE="readwrite",r.PERMISSIONS_READONLY="readonly",r.PERMISSIONS_DENY="denied";class d extends i.default{constructor(t={}){super(),this.options={hostname:"localhost",port:3e3,useTLS:!0,useAuthentication:!1,notifications:!0,version:"v1",autoConnect:!1,reconnect:!0,maxRetries:1/0,maxTimeBetweenRetries:2500,mdns:null,username:null,password:null,deltaStreamBehaviour:"none",subscriptions:[],wsKeepaliveInterval:0,...t},this.api=null,this.connection=null,this.services=[],this.notifications={},this.requests={},this.fetchReady=null,Array.isArray(this.options.subscriptions)&&(this.subscribeCommands=this.options.subscriptions.filter(t=>f(t))),!0===this.options.notifications&&this.subscribeCommands.push({context:"vessels.self",subscribe:[{path:"notifications.*",policy:"instant"}]}),!0===this.options.autoConnect&&this.connect().catch(t=>this.emit("error",t))}get self(){return null===this.connection?null:this.connection.self}set(t,e){return this.options[t]=e,this}get(t){return this.options[t]||null}get retries(){return null===this.connection?0:this.connection.retries}requestDeviceAccess(t,e){let r="string"==typeof e?e:(0,h.v4)();return this.connection.fetch("/access/requests",{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:r,description:t})}).then(t=>({clientId:r,response:t}))}respondToAccessRequest(t,e,r="1y"){return this.connection.fetch(`/security/access/requests/${t}/${"denied"===e?"denied":"approved"}`,{method:"PUT",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({expiration:r,permissions:e})})}authenticate(t,e){let r=this.request(c,{login:{username:t,password:e}});r.on("response",t=>{if(200===t.statusCode&&t.hasOwnProperty("login")&&"object"==typeof t.login&&t.login.hasOwnProperty("token"))return this.connection.setAuthenticated(t.login.token),this.emit("authenticated",{token:t.login.token});this.emit("error",Error(`Error authenticating: status ${t.statusCode}`))}),r.send()}request(t,e={}){return this.requests.hasOwnProperty(t)||(this.requests[t]=new n.default(this.connection,t,e),u(`Registered request "${t}" with ID ${this.requests[t].getRequestId()}`)),this.requests[t]}subscribe(t=[]){if(null===this.connection)throw Error("Not connected");t&&!Array.isArray(t)&&"object"==typeof t&&t.hasOwnProperty("subscribe")&&(t=[t]),(t=t.filter(t=>f(t))).forEach(t=>{this.subscribeCommands.push(t)}),this.connection.subscribe(t)}unsubscribe(){if(null===this.connection)throw Error("Not connected");let{notifications:t}=this.options;this.subscribeCommands=!0===t?[{context:"vessels.self",subscribe:[{path:"notifications.*",policy:"instant"}]}]:[],this.connection.unsubscribe(),this.subscribeCommands.length>0&&this.connection.subscribe(this.subscribeCommands)}connect(){return null!==this.connection?(this.connection.reconnect(!0),Promise.resolve(this.connection)):new Promise((t,e)=>{this.connection=new s.default(this.options,this.subscribeCommands),this.connection.on("disconnect",t=>this.emit("disconnect",t)),this.connection.on("message",t=>this.processWSMessage(t)),this.connection.on("connectionInfo",t=>this.emit("connectionInfo",t)),this.connection.on("self",t=>this.emit("self",t)),this.connection.on("hitMaxRetries",()=>this.emit("hitMaxRetries")),this.connection.on("backOffBeforeReconnect",t=>this.emit("backOffBeforeReconnect",t)),this.connection.on("connect",()=>{this.getInitialNotifications(),this.emit("connect"),t(this.connection)}),this.connection.on("fetchReady",()=>{this.fetchReady=!0}),this.connection.on("error",t=>{this.emit("error",t),e(t)})})}disconnect(t=!1){return(null!==this.connection?(this.connection.on("disconnect",()=>{this.cleanupListeners(),this.connection=null}),this.connection.unsubscribe(),this.connection.disconnect()):this.cleanupListeners(),null!==this.api&&(this.api=null),!0===t)?Promise.resolve(this):this}cleanupListeners(){this.removeAllListeners("self"),this.removeAllListeners("connectionInfo"),this.removeAllListeners("message"),this.removeAllListeners("delta"),this.removeAllListeners("connect"),this.removeAllListeners("error"),this.removeAllListeners("hitMaxRetries"),this.removeAllListeners("backOffBeforeReconnect"),this.removeAllListeners("disconnect"),this.removeAllListeners("unsubscribe"),this.removeAllListeners("subscribe")}API(){return null===this.connection?Promise.reject(Error("There are no available connections. Please connect before you use the REST API.")):null!==this.api?Promise.resolve(this.api):new Promise(t=>{if(this.api=new a.default(this.connection),!0===this.fetchReady||!1===this.options.useAuthentication)return t(this.api);this.connection.on("fetchReady",()=>{t(this.api)})})}processWSMessage(t){this.emit("message",t),t&&"object"==typeof t&&t.hasOwnProperty("updates")&&(this.checkAndEmitNotificationsInDelta(t),this.emit("delta",t))}checkAndEmitNotificationsInDelta(t){if(!1===this.options.notifications||!t||"object"!=typeof t||!Array.isArray(t.updates))return;let e={};t.updates.forEach(t=>{(t.values||[]).forEach(t=>{"string"==typeof t.path&&t.path.includes("notifications.")&&(e[t.path.replace("notifications.","")]={...t.value})})}),Object.keys(e).forEach(t=>{if(!this.notifications.hasOwnProperty(t)||this.notifications[t].timestamp!==e[t].timestamp){this.notifications[t]={...e[t]};let r={path:t,...this.notifications[t]};u(`[checkAndEmitNotificationsInDelta] emitting notification: ${JSON.stringify(r,null,2)}`),this.emit("notification",r)}})}getInitialNotifications(){!1===this.options.notifications||null!==this.connection&&(null===this.api&&(this.api=new a.default(this.connection)),this.api.notifications().then(t=>(this.notifications={...this.notifications,...p(t)},Object.keys(this.notifications).forEach(t=>{let e={path:t,...this.notifications[t]};u(`[getInitialNotifications] emitting notification: ${JSON.stringify(e,null,2)}`),this.emit("notification",e)}),this.notifications)).catch(t=>{console.error(`[getInitialNotifications] error getting notifications: ${t.message}`)}))}}r.default=d;let p=t=>{let e={},r=t,i="",s=t=>{i+=`${""===i?"":"."}${t}`,(r=r[t])&&"object"==typeof r&&(r&&"object"==typeof r&&r.hasOwnProperty("value")?e[i]=Object.assign({},r.value):Object.keys(r).forEach(s))};return Object.keys(r).forEach(t=>s(t)),e},f=t=>!!t&&"object"==typeof t&&!!t.hasOwnProperty("context")&&!!Array.isArray(t.subscribe)},33079,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.SKServer=void 0;var i=n(t.r(78492)),s=n(t.r(74392));function n(t){return t&&t.__esModule?t:{default:t}}class a{constructor(t){this._roles=t.roles||["master","main"],this._self=t.self||"",this._version=t.version||"0.0.0",this._hostname=t.hostname,this._port=t.port}get roles(){return this._roles}get self(){return this._self}get version(){return this._version}get hostname(){return this._hostname}get port(){return this._port}isMain(){return this._roles.includes("main")}isMaster(){return this._roles.includes("master")}createClient(t={}){return new s.default({...t,hostname:this._hostname,port:this._port})}}r.SKServer=a;class o extends i.default{constructor(t,e=6e4){if(super(),this.found=[],!t||"object"!=typeof t)throw Error("No mDNS provider given");if(Object.keys(t).join(",").startsWith("_server,_registry"))return this.discoverWithBonjour(t,e);if(Object.keys(t).join(",").startsWith("dns_sd,Advertisement,createAdvertisement,Browser"))return this.discoverWithMdns(t,e);throw Error("Unrecognized mDNS provider given")}discoverWithBonjour(t,e){let r=t.find({type:"signalk-http"});r.on("up",t=>this.handleDiscoveredService(t,{...t.txt,name:t.name||"",hostname:t.host||"",port:parseInt(t.port,10),provider:"bonjour"})),setTimeout(()=>{0===this.found.length&&this.emit("timeout"),r.stop()},e),r.start()}discoverWithMdns(t,e){let r=t.createBrowser(t.tcp("_signalk-http"));r.on("serviceUp",t=>this.handleDiscoveredService(t,{...t.txtRecord,hostname:t.host||"",port:parseInt(t.port,10),provider:"mdns"})),r.on("error",t=>this.handleDiscoveryError(t)),setTimeout(()=>{0===this.found.length&&this.emit("timeout"),r.stop()},e),r.start()}handleDiscoveryError(t){console.error(`Error during discovery: ${t.message}`)}handleDiscoveredService(t,e){"string"==typeof e.roles&&(e.roles=e.roles.split(",").map(t=>t.trim().toLowerCase())),e.roles=Array.isArray(e.roles)?e.roles:[];let r=e.hostname;Array.isArray(t.addresses)&&(r=t.addresses.reduce((t,e)=>(e&&"string"==typeof e&&e.includes(".")&&(t=e),t),e.hostname)),""!==r.trim()&&(e.hostname=r);let i=new a(e);this.found.push(i),this.emit("found",i)}}r.default=o},28020,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Discovery=r.Client=void 0;var i=n(t.r(74392)),s=n(t.r(33079));function n(t){return t&&t.__esModule?t:{default:t}}r.Client=i.default,r.Discovery=s.default,r.default=i.default},49018,(t,e,r)=>{e.exports=t.r(28020)},90072,t=>{"use strict";let e,r,i,s,n,a,o,h,l,u="attached",c="detached",d="srgb",p="srgb-linear",f="linear",m="srgb",y={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function g(t,e){return new y[t](e)}function b(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function v(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}let x={},w=null;function S(...t){let e="THREE."+t.shift();w?w("log",e,...t):console.log(e,...t)}function M(t){let e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){let e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function _(...t){let e="THREE."+(t=M(t)).shift();if(w)w("warn",e,...t);else{let r=t[0];r&&r.isStackTrace?console.warn(r.getError(e)):console.warn(e,...t)}}function A(...t){let e="THREE."+(t=M(t)).shift();if(w)w("error",e,...t);else{let r=t[0];r&&r.isStackTrace?console.error(r.getError(e)):console.error(e,...t)}}function T(...t){let e=t.join(" ");e in x||(x[e]=!0,_(...t))}class C{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[t]&&(r[t]=[]),-1===r[t].indexOf(e)&&r[t].push(e)}hasEventListener(t,e){let r=this._listeners;return void 0!==r&&void 0!==r[t]&&-1!==r[t].indexOf(e)}removeEventListener(t,e){let r=this._listeners;if(void 0===r)return;let i=r[t];if(void 0!==i){let t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let r=e[t.type];if(void 0!==r){t.target=this;let e=r.slice(0);for(let r=0,i=e.length;r<i;r++)e[r].call(this,t);t.target=null}}}let E=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],R=1234567,O=Math.PI/180,I=180/Math.PI;function k(){let t=0xffffffff*Math.random()|0,e=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0;return(E[255&t]+E[t>>8&255]+E[t>>16&255]+E[t>>24&255]+"-"+E[255&e]+E[e>>8&255]+"-"+E[e>>16&15|64]+E[e>>24&255]+"-"+E[63&r|128]+E[r>>8&255]+"-"+E[r>>16&255]+E[r>>24&255]+E[255&i]+E[i>>8&255]+E[i>>16&255]+E[i>>24&255]).toLowerCase()}function P(t,e,r){return Math.max(e,Math.min(r,t))}function B(t,e){return(t%e+e)%e}function L(t,e,r){return(1-r)*t+r*e}function z(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/0xffffffff;case Uint16Array:return t/65535;case Uint8Array:case Uint8ClampedArray:return t/255;case Int32Array:return Math.max(t/0x7fffffff,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("THREE.MathUtils: Invalid component type.")}}function N(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(0xffffffff*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:case Uint8ClampedArray:return Math.round(255*t);case Int32Array:return Math.round(0x7fffffff*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("THREE.MathUtils: Invalid component type.")}}class F{static{F.prototype.isVector2=!0}constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("THREE.Vector2: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("THREE.Vector2: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,r=this.y,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6],this.y=i[1]*e+i[4]*r+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=P(this.x,t.x,e.x),this.y=P(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=P(this.x,t,e),this.y=P(this.y,t,e),this}clampLength(t,e){let r=this.length();return this.divideScalar(r||1).multiplyScalar(P(r,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(P(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,r=this.y-t.y;return e*e+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let r=Math.cos(e),i=Math.sin(e),s=this.x-t.x,n=this.y-t.y;return this.x=s*r-n*i+t.x,this.y=s*i+n*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class j{constructor(t=0,e=0,r=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=r,this._w=i}static slerpFlat(t,e,r,i,s,n,a){let o=r[i+0],h=r[i+1],l=r[i+2],u=r[i+3],c=s[n+0],d=s[n+1],p=s[n+2],f=s[n+3];if(u!==f||o!==c||h!==d||l!==p){let t=o*c+h*d+l*p+u*f;t<0&&(c=-c,d=-d,p=-p,f=-f,t=-t);let e=1-a;if(t<.9995){let r=Math.acos(t),i=Math.sin(r);o=o*(e=Math.sin(e*r)/i)+c*(a=Math.sin(a*r)/i),h=h*e+d*a,l=l*e+p*a,u=u*e+f*a}else{let t=1/Math.sqrt((o=o*e+c*a)*o+(h=h*e+d*a)*h+(l=l*e+p*a)*l+(u=u*e+f*a)*u);o*=t,h*=t,l*=t,u*=t}}t[e]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,r,i,s,n){let a=r[i],o=r[i+1],h=r[i+2],l=r[i+3],u=s[n],c=s[n+1],d=s[n+2],p=s[n+3];return t[e]=a*p+l*u+o*d-h*c,t[e+1]=o*p+l*c+h*u-a*d,t[e+2]=h*p+l*d+a*c-o*u,t[e+3]=l*p-a*u-o*c-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let r=t._x,i=t._y,s=t._z,n=t._order,a=Math.cos,o=Math.sin,h=a(r/2),l=a(i/2),u=a(s/2),c=o(r/2),d=o(i/2),p=o(s/2);switch(n){case"XYZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"YXZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"ZXY":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"ZYX":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"YZX":this._x=c*l*u+h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u-c*d*p;break;case"XZY":this._x=c*l*u-h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u+c*d*p;break;default:_("Quaternion: .setFromEuler() encountered an unknown order: "+n)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let r=e/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,r=e[0],i=e[4],s=e[8],n=e[1],a=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=r+a+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-o)*t,this._y=(s-h)*t,this._z=(n-i)*t}else if(r>a&&r>u){let t=2*Math.sqrt(1+r-a-u);this._w=(l-o)/t,this._x=.25*t,this._y=(i+n)/t,this._z=(s+h)/t}else if(a>u){let t=2*Math.sqrt(1+a-r-u);this._w=(s-h)/t,this._x=(i+n)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-r-a);this._w=(n-i)/t,this._x=(s+h)/t,this._y=(o+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return r<1e-8?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=r,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(P(this.dot(t),-1,1)))}rotateTowards(t,e){let r=this.angleTo(t);if(0===r)return this;let i=Math.min(1,e/r);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let r=t._x,i=t._y,s=t._z,n=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=r*l+n*a+i*h-s*o,this._y=i*l+n*o+s*a-r*h,this._z=s*l+n*h+r*o-i*a,this._w=n*l-r*a-i*o-s*h,this._onChangeCallback(),this}slerp(t,e){let r=t._x,i=t._y,s=t._z,n=t._w,a=this.dot(t);a<0&&(r=-r,i=-i,s=-s,n=-n,a=-a);let o=1-e;if(a<.9995){let t=Math.acos(a),h=Math.sin(t);o=Math.sin(o*t)/h,e=Math.sin(e*t)/h,this._x=this._x*o+r*e,this._y=this._y*o+i*e,this._z=this._z*o+s*e,this._w=this._w*o+n*e,this._onChangeCallback()}else this._x=this._x*o+r*e,this._y=this._y*o+i*e,this._z=this._z*o+s*e,this._w=this._w*o+n*e,this.normalize();return this}slerpQuaternions(t,e,r){return this.copy(t).slerp(e,r)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),s=Math.sqrt(r);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class U{static{U.prototype.isVector3=!0}constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.z=r}set(t,e,r){return void 0===r&&(r=this.z),this.x=t,this.y=e,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("THREE.Vector3: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("THREE.Vector3: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(V.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(V.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,r=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*r+s[6]*i,this.y=s[1]*e+s[4]*r+s[7]*i,this.z=s[2]*e+s[5]*r+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,r=this.y,i=this.z,s=t.elements,n=1/(s[3]*e+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*r+s[8]*i+s[12])*n,this.y=(s[1]*e+s[5]*r+s[9]*i+s[13])*n,this.z=(s[2]*e+s[6]*r+s[10]*i+s[14])*n,this}applyQuaternion(t){let e=this.x,r=this.y,i=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*i-a*r),l=2*(a*e-s*i),u=2*(s*r-n*e);return this.x=e+o*h+n*u-a*l,this.y=r+o*l+a*h-s*u,this.z=i+o*u+s*l-n*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,r=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*r+s[8]*i,this.y=s[1]*e+s[5]*r+s[9]*i,this.z=s[2]*e+s[6]*r+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=P(this.x,t.x,e.x),this.y=P(this.y,t.y,e.y),this.z=P(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=P(this.x,t,e),this.y=P(this.y,t,e),this.z=P(this.z,t,e),this}clampLength(t,e){let r=this.length();return this.divideScalar(r||1).multiplyScalar(P(r,t,e))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let r=t.x,i=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=i*o-s*a,this.y=s*n-r*o,this.z=r*a-i*n,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let r=t.dot(this)/e;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return D.copy(this).projectOnVector(t),this.sub(D)}reflect(t){return this.sub(D.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(P(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return e*e+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,r){let i=Math.sin(e)*t;return this.x=i*Math.sin(r),this.y=Math.cos(e)*t,this.z=i*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,r){return this.x=t*Math.sin(e),this.y=r,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=2*Math.random()-1,r=Math.sqrt(1-e*e);return this.x=r*Math.cos(t),this.y=e,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let D=new U,V=new j;class W{static{W.prototype.isMatrix3=!0}constructor(t,e,r,i,s,n,a,o,h){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,r,i,s,n,a,o,h)}set(t,e,r,i,s,n,a,o,h){let l=this.elements;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=s,l[5]=o,l[6]=r,l[7]=n,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}extractBasis(t,e,r){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let r=t.elements,i=e.elements,s=this.elements,n=r[0],a=r[3],o=r[6],h=r[1],l=r[4],u=r[7],c=r[2],d=r[5],p=r[8],f=i[0],m=i[3],y=i[6],g=i[1],b=i[4],v=i[7],x=i[2],w=i[5],S=i[8];return s[0]=n*f+a*g+o*x,s[3]=n*m+a*b+o*w,s[6]=n*y+a*v+o*S,s[1]=h*f+l*g+u*x,s[4]=h*m+l*b+u*w,s[7]=h*y+l*v+u*S,s[2]=c*f+d*g+p*x,s[5]=c*m+d*b+p*w,s[8]=c*y+d*v+p*S,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],r=t[1],i=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*n*l-e*a*h-r*s*l+r*a*o+i*s*h-i*n*o}invert(){let t=this.elements,e=t[0],r=t[1],i=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=a*o-l*s,d=h*s-n*o,p=e*u+r*c+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return t[0]=u*f,t[1]=(i*h-l*r)*f,t[2]=(a*r-i*n)*f,t[3]=c*f,t[4]=(l*e-i*o)*f,t[5]=(i*s-a*e)*f,t[6]=d*f,t[7]=(r*o-h*e)*f,t[8]=(n*e-r*s)*f,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,r,i,s,n,a){let o=Math.cos(s),h=Math.sin(s);return this.set(r*o,r*h,-r*(o*n+h*a)+n+t,-i*h,i*o,-i*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return T("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(q.makeScale(t,e)),this}rotate(t){return T("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(q.makeRotation(-t)),this}translate(t,e){return T("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(q.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,r,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,r=t.elements;for(let t=0;t<9;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<9;r++)this.elements[r]=t[r+e];return this}toArray(t=[],e=0){let r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let q=new W,G=new W().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),H=new W().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),J=(o=[.64,.33,.3,.6,.15,.06],h=[.2126,.7152,.0722],l=[.3127,.329],(a={enabled:!0,workingColorSpace:p,spaces:{},convert:function(t,e,r){return!1!==this.enabled&&e!==r&&e&&r&&(this.spaces[e].transfer===m&&(t.r=$(t.r),t.g=$(t.g),t.b=$(t.b)),this.spaces[e].primaries!==this.spaces[r].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===m&&(t.r=Y(t.r),t.g=Y(t.g),t.b=Y(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?f:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,r){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[r].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,e){return T("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(t,e)},toWorkingColorSpace:function(t,e){return T("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(t,e)}}).define({[p]:{primaries:o,whitePoint:l,transfer:f,toXYZ:G,fromXYZ:H,luminanceCoefficients:h,workingColorSpaceConfig:{unpackColorSpace:d},outputColorSpaceConfig:{drawingBufferColorSpace:d}},[d]:{primaries:o,whitePoint:l,transfer:m,toXYZ:G,fromXYZ:H,luminanceCoefficients:h,outputColorSpaceConfig:{drawingBufferColorSpace:d}}}),a);function $(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Y(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class X{static getDataURL(t,r="image/png"){let i;if(/^data:/i.test(t.src)||"u"<typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)i=t;else{void 0===e&&(e=v("canvas")),e.width=t.width,e.height=t.height;let r=e.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=e}return i.toDataURL(r)}static sRGBToLinear(t){if("u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap){let e=v("canvas");e.width=t.width,e.height=t.height;let r=e.getContext("2d");r.drawImage(t,0,0,t.width,t.height);let i=r.getImageData(0,0,t.width,t.height),s=i.data;for(let t=0;t<s.length;t++)s[t]=255*$(s[t]/255);return r.putImageData(i,0,0),e}if(!t.data)return _("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t;{let e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*$(e[t]/255)):e[t]=$(e[t]);return{data:e,width:t.width,height:t.height}}}}let Z=0;class K{constructor(t=null){this.isTextureSource=!0,Object.defineProperty(this,"id",{value:Z++}),this.uuid=k(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return"u">typeof HTMLVideoElement&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):"u">typeof VideoFrame&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let r={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,r=i.length;e<r;e++)i[e].isDataTexture?t.push(Q(i[e].image)):t.push(Q(i[e]))}else t=Q(i);r.url=t}return e||(t.images[this.uuid]=r),r}}function Q(t){return"u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap?X.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(_("Texture: Unable to serialize Texture."),{})}let tt=0,te=new U;class tr extends C{constructor(t=tr.DEFAULT_IMAGE,e=tr.DEFAULT_MAPPING,r=1001,i=1001,s=1006,n=1008,a=1023,o=1009,h=tr.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:tt++}),this.uuid=k(),this.name="",this.source=new K(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new F(0,0),this.repeat=new F(1,1),this.center=new F(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new W,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(te).x}get height(){return this.source.getSize(te).y}get depth(){return this.source.getSize(te).z}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.normalized=t.normalized,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let r=t[e];if(void 0===r){_(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let i=this[e];if(void 0===i){_(`Texture.setValues(): property '${e}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[e]=r}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),e||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}tr.DEFAULT_IMAGE=null,tr.DEFAULT_MAPPING=300,tr.DEFAULT_ANISOTROPY=1;class ti{static{ti.prototype.isVector4=!0}constructor(t=0,e=0,r=0,i=1){this.x=t,this.y=e,this.z=r,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("THREE.Vector4: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("THREE.Vector4: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,r=this.y,i=this.z,s=this.w,n=t.elements;return this.x=n[0]*e+n[4]*r+n[8]*i+n[12]*s,this.y=n[1]*e+n[5]*r+n[9]*i+n[13]*s,this.z=n[2]*e+n[6]*r+n[10]*i+n[14]*s,this.w=n[3]*e+n[7]*r+n[11]*i+n[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,r,i,s,n=t.elements,a=n[0],o=n[4],h=n[8],l=n[1],u=n[5],c=n[9],d=n[2],p=n[6],f=n[10];if(.01>Math.abs(o-l)&&.01>Math.abs(h-d)&&.01>Math.abs(c-p)){if(.1>Math.abs(o+l)&&.1>Math.abs(h+d)&&.1>Math.abs(c+p)&&.1>Math.abs(a+u+f-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(a+1)/2,n=(u+1)/2,m=(f+1)/2,y=(o+l)/4,g=(h+d)/4,b=(c+p)/4;return t>n&&t>m?t<.01?(r=0,i=.707106781,s=.707106781):(i=y/(r=Math.sqrt(t)),s=g/r):n>m?n<.01?(r=.707106781,i=0,s=.707106781):(r=y/(i=Math.sqrt(n)),s=b/i):m<.01?(r=.707106781,i=.707106781,s=0):(r=g/(s=Math.sqrt(m)),i=b/s),this.set(r,i,s,e),this}let m=Math.sqrt((p-c)*(p-c)+(h-d)*(h-d)+(l-o)*(l-o));return .001>Math.abs(m)&&(m=1),this.x=(p-c)/m,this.y=(h-d)/m,this.z=(l-o)/m,this.w=Math.acos((a+u+f-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=P(this.x,t.x,e.x),this.y=P(this.y,t.y,e.y),this.z=P(this.z,t.z,e.z),this.w=P(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=P(this.x,t,e),this.y=P(this.y,t,e),this.z=P(this.z,t,e),this.w=P(this.w,t,e),this}clampLength(t,e){let r=this.length();return this.divideScalar(r||1).multiplyScalar(P(r,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this.w=t.w+(e.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ts extends C{constructor(t=1,e=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveColorBuffer:!0,resolveDepthBuffer:!0,resolveStencilBuffer:!0,storeMultisampledColorBuffer:!0,storeMultisampledDepthBuffer:!0,storeMultisampledStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},r),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=r.depth,this.scissor=new ti(0,0,t,e),this.scissorTest=!1,this.viewport=new ti(0,0,t,e),this.textures=[];const i=new tr({width:t,height:e,depth:r.depth}),s=r.count;for(let t=0;t<s;t++)this.textures[t]=i.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(r),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.resolveColorBuffer=r.resolveColorBuffer,this.resolveDepthBuffer=r.resolveDepthBuffer,this.resolveStencilBuffer=r.resolveStencilBuffer,this.storeMultisampledColorBuffer=r.storeMultisampledColorBuffer,this.storeMultisampledDepthBuffer=r.storeMultisampledDepthBuffer,this.storeMultisampledStencilBuffer=r.storeMultisampledStencilBuffer,this._depthTexture=null,this.depthTexture=r.depthTexture,this.samples=r.samples,this.multiview=r.multiview,this.useArrayDepthTexture=r.useArrayDepthTexture}_setTextureOptions(t={}){let e={minFilter:1006,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==t.mapping&&(e.mapping=t.mapping),void 0!==t.wrapS&&(e.wrapS=t.wrapS),void 0!==t.wrapT&&(e.wrapT=t.wrapT),void 0!==t.wrapR&&(e.wrapR=t.wrapR),void 0!==t.magFilter&&(e.magFilter=t.magFilter),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.anisotropy&&(e.anisotropy=t.anisotropy),void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),void 0!==t.internalFormat&&(e.internalFormat=t.internalFormat);for(let t=0;t<this.textures.length;t++)this.textures[t].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&this._depthTexture.renderTarget===this&&(this._depthTexture.renderTarget=null),null!==t&&null===t.renderTarget&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,r=1){if(this.width!==t||this.height!==e||this.depth!==r){this.width=t,this.height=e,this.depth=r;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=r,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,r=t.textures.length;e<r;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let r=Object.assign({},t.textures[e].image);this.textures[e].source=new K(r)}if(this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveColorBuffer=t.resolveColorBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,this.storeMultisampledColorBuffer=t.storeMultisampledColorBuffer,this.storeMultisampledDepthBuffer=t.storeMultisampledDepthBuffer,this.storeMultisampledStencilBuffer=t.storeMultisampledStencilBuffer,null!==t.depthTexture)if(t.depthTexture.renderTarget===t){let e=t.depthTexture.clone();e.renderTarget=null,this.depthTexture=e}else this.depthTexture=t.depthTexture;return this.samples=t.samples,this.multiview=t.multiview,this.useArrayDepthTexture=t.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class tn extends ts{constructor(t=1,e=1,r={}){super(t,e,r),this.isWebGLRenderTarget=!0}}class ta extends tr{constructor(t=null,e=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:r,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class to extends tr{constructor(t=null,e=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:r,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}}class th{static{th.prototype.isMatrix4=!0}constructor(t,e,r,i,s,n,a,o,h,l,u,c,d,p,f,m){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,i,s,n,a,o,h,l,u,c,d,p,f,m)}set(t,e,r,i,s,n,a,o,h,l,u,c,d,p,f,m){let y=this.elements;return y[0]=t,y[4]=e,y[8]=r,y[12]=i,y[1]=s,y[5]=n,y[9]=a,y[13]=o,y[2]=h,y[6]=l,y[10]=u,y[14]=c,y[3]=d,y[7]=p,y[11]=f,y[15]=m,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 th().fromArray(this.elements)}copy(t){let e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this}copyPosition(t){let e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,r){return 0===this.determinantAffine()?(t.set(1,0,0),e.set(0,1,0),r.set(0,0,1)):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2)),this}makeBasis(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinantAffine())return this.identity();let e=this.elements,r=t.elements,i=1/tl.setFromMatrixColumn(t,0).length(),s=1/tl.setFromMatrixColumn(t,1).length(),n=1/tl.setFromMatrixColumn(t,2).length();return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=0,e[4]=r[4]*s,e[5]=r[5]*s,e[6]=r[6]*s,e[7]=0,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,r=t.x,i=t.y,s=t.z,n=Math.cos(r),a=Math.sin(r),o=Math.cos(i),h=Math.sin(i),l=Math.cos(s),u=Math.sin(s);if("XYZ"===t.order){let t=n*l,r=n*u,i=a*l,s=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=r+i*h,e[5]=t-s*h,e[9]=-a*o,e[2]=s-t*h,e[6]=i+r*h,e[10]=n*o}else if("YXZ"===t.order){let t=o*l,r=o*u,i=h*l,s=h*u;e[0]=t+s*a,e[4]=i*a-r,e[8]=n*h,e[1]=n*u,e[5]=n*l,e[9]=-a,e[2]=r*a-i,e[6]=s+t*a,e[10]=n*o}else if("ZXY"===t.order){let t=o*l,r=o*u,i=h*l,s=h*u;e[0]=t-s*a,e[4]=-n*u,e[8]=i+r*a,e[1]=r+i*a,e[5]=n*l,e[9]=s-t*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if("ZYX"===t.order){let t=n*l,r=n*u,i=a*l,s=a*u;e[0]=o*l,e[4]=i*h-r,e[8]=t*h+s,e[1]=o*u,e[5]=s*h+t,e[9]=r*h-i,e[2]=-h,e[6]=a*o,e[10]=n*o}else if("YZX"===t.order){let t=n*o,r=n*h,i=a*o,s=a*h;e[0]=o*l,e[4]=s-t*u,e[8]=i*u+r,e[1]=u,e[5]=n*l,e[9]=-a*l,e[2]=-h*l,e[6]=r*u+i,e[10]=t-s*u}else if("XZY"===t.order){let t=n*o,r=n*h,i=a*o,s=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+s,e[5]=n*l,e[9]=r*u-i,e[2]=i*u-r,e[6]=a*l,e[10]=s*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(tc,t,td)}lookAt(t,e,r){let i=this.elements;return tm.subVectors(t,e),0===tm.lengthSq()&&(tm.z=1),tm.normalize(),tp.crossVectors(r,tm),0===tp.lengthSq()&&(1===Math.abs(r.z)?tm.x+=1e-4:tm.z+=1e-4,tm.normalize(),tp.crossVectors(r,tm)),tp.normalize(),tf.crossVectors(tm,tp),i[0]=tp.x,i[4]=tf.x,i[8]=tm.x,i[1]=tp.y,i[5]=tf.y,i[9]=tm.y,i[2]=tp.z,i[6]=tf.z,i[10]=tm.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let r=t.elements,i=e.elements,s=this.elements,n=r[0],a=r[4],o=r[8],h=r[12],l=r[1],u=r[5],c=r[9],d=r[13],p=r[2],f=r[6],m=r[10],y=r[14],g=r[3],b=r[7],v=r[11],x=r[15],w=i[0],S=i[4],M=i[8],_=i[12],A=i[1],T=i[5],C=i[9],E=i[13],R=i[2],O=i[6],I=i[10],k=i[14],P=i[3],B=i[7],L=i[11],z=i[15];return s[0]=n*w+a*A+o*R+h*P,s[4]=n*S+a*T+o*O+h*B,s[8]=n*M+a*C+o*I+h*L,s[12]=n*_+a*E+o*k+h*z,s[1]=l*w+u*A+c*R+d*P,s[5]=l*S+u*T+c*O+d*B,s[9]=l*M+u*C+c*I+d*L,s[13]=l*_+u*E+c*k+d*z,s[2]=p*w+f*A+m*R+y*P,s[6]=p*S+f*T+m*O+y*B,s[10]=p*M+f*C+m*I+y*L,s[14]=p*_+f*E+m*k+y*z,s[3]=g*w+b*A+v*R+x*P,s[7]=g*S+b*T+v*O+x*B,s[11]=g*M+b*C+v*I+x*L,s[15]=g*_+b*E+v*k+x*z,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],r=t[4],i=t[8],s=t[12],n=t[1],a=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],d=t[14],p=t[3],f=t[7],m=t[11],y=t[15],g=o*d-h*c,b=a*d-h*u,v=a*c-o*u,x=n*d-h*l,w=n*c-o*l,S=n*u-a*l;return e*(f*g-m*b+y*v)-r*(p*g-m*x+y*w)+i*(p*b-f*x+y*S)-s*(p*v-f*w+m*S)}determinantAffine(){let t=this.elements,e=t[0],r=t[4],i=t[8],s=t[1],n=t[5],a=t[9],o=t[2],h=t[6],l=t[10];return e*(n*l-a*h)-r*(s*l-a*o)+i*(s*h-n*o)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,r){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=r),this}invert(){let t=this.elements,e=t[0],r=t[1],i=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],y=t[15],g=e*a-r*n,b=e*o-i*n,v=e*h-s*n,x=r*o-i*a,w=r*h-s*a,S=i*h-s*o,M=l*f-u*p,_=l*m-c*p,A=l*y-d*p,T=u*m-c*f,C=u*y-d*f,E=c*y-d*m,R=g*E-b*C+v*T+x*A-w*_+S*M;if(0===R)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let O=1/R;return t[0]=(a*E-o*C+h*T)*O,t[1]=(i*C-r*E-s*T)*O,t[2]=(f*S-m*w+y*x)*O,t[3]=(c*w-u*S-d*x)*O,t[4]=(o*A-n*E-h*_)*O,t[5]=(e*E-i*A+s*_)*O,t[6]=(m*v-p*S-y*b)*O,t[7]=(l*S-c*v+d*b)*O,t[8]=(n*C-a*A+h*M)*O,t[9]=(r*A-e*C-s*M)*O,t[10]=(p*w-f*v+y*g)*O,t[11]=(u*v-l*w-d*g)*O,t[12]=(a*_-n*T-o*M)*O,t[13]=(e*T-r*_+i*M)*O,t[14]=(f*b-p*x-m*g)*O,t[15]=(l*x-u*b+c*g)*O,this}scale(t){let e=this.elements,r=t.x,i=t.y,s=t.z;return e[0]*=r,e[4]*=i,e[8]*=s,e[1]*=r,e[5]*=i,e[9]*=s,e[2]*=r,e[6]*=i,e[10]*=s,e[3]*=r,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))}makeTranslation(t,e,r){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let r=Math.cos(e),i=Math.sin(e),s=1-r,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.set(h*n+r,h*a-i*o,h*o+i*a,0,h*a+i*o,l*a+r,l*o-i*n,0,h*o-i*a,l*o+i*n,s*o*o+r,0,0,0,0,1),this}makeScale(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,e,r,i,s,n){return this.set(1,r,s,0,t,1,n,0,e,i,1,0,0,0,0,1),this}compose(t,e,r){let i=this.elements,s=e._x,n=e._y,a=e._z,o=e._w,h=s+s,l=n+n,u=a+a,c=s*h,d=s*l,p=s*u,f=n*l,m=n*u,y=a*u,g=o*h,b=o*l,v=o*u,x=r.x,w=r.y,S=r.z;return i[0]=(1-(f+y))*x,i[1]=(d+v)*x,i[2]=(p-b)*x,i[3]=0,i[4]=(d-v)*w,i[5]=(1-(c+y))*w,i[6]=(m+g)*w,i[7]=0,i[8]=(p+b)*S,i[9]=(m-g)*S,i[10]=(1-(c+f))*S,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,r){let i=this.elements;t.x=i[12],t.y=i[13],t.z=i[14];let s=this.determinantAffine();if(0===s)return r.set(1,1,1),e.identity(),this;let n=tl.set(i[0],i[1],i[2]).length(),a=tl.set(i[4],i[5],i[6]).length(),o=tl.set(i[8],i[9],i[10]).length();s<0&&(n=-n),tu.copy(this);let h=1/n,l=1/a,u=1/o;return tu.elements[0]*=h,tu.elements[1]*=h,tu.elements[2]*=h,tu.elements[4]*=l,tu.elements[5]*=l,tu.elements[6]*=l,tu.elements[8]*=u,tu.elements[9]*=u,tu.elements[10]*=u,e.setFromRotationMatrix(tu),r.x=n,r.y=a,r.z=o,this}makePerspective(t,e,r,i,s,n,a=2e3,o=!1){let h,l,u=this.elements;if(o)h=s/(n-s),l=n*s/(n-s);else if(2e3===a)h=-(n+s)/(n-s),l=-2*n*s/(n-s);else if(2001===a)h=-n/(n-s),l=-n*s/(n-s);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return u[0]=2*s/(e-t),u[4]=0,u[8]=(e+t)/(e-t),u[12]=0,u[1]=0,u[5]=2*s/(r-i),u[9]=(r+i)/(r-i),u[13]=0,u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(t,e,r,i,s,n,a=2e3,o=!1){let h,l,u=this.elements;if(o)h=1/(n-s),l=n/(n-s);else if(2e3===a)h=-2/(n-s),l=-(n+s)/(n-s);else if(2001===a)h=-1/(n-s),l=-s/(n-s);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return u[0]=2/(e-t),u[4]=0,u[8]=0,u[12]=-(e+t)/(e-t),u[1]=0,u[5]=2/(r-i),u[9]=0,u[13]=-(r+i)/(r-i),u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,r=t.elements;for(let t=0;t<16;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<16;r++)this.elements[r]=t[r+e];return this}toArray(t=[],e=0){let r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}}let tl=new U,tu=new th,tc=new U(0,0,0),td=new U(1,1,1),tp=new U,tf=new U,tm=new U,ty=new th,tg=new j;class tb{constructor(t=0,e=0,r=0,i=tb.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=r,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,r,i=this._order){return this._x=t,this._y=e,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,r=!0){let i=t.elements,s=i[0],n=i[4],a=i[8],o=i[1],h=i[5],l=i[9],u=i[2],c=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(P(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-n,s)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-P(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(P(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,s));break;case"ZYX":this._y=Math.asin(-P(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,s)):(this._x=0,this._z=Math.atan2(-n,h));break;case"YZX":this._z=Math.asin(P(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-P(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-l,d),this._y=0);break;default:_("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===r&&this._onChangeCallback(),this}setFromQuaternion(t,e,r){return ty.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ty,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return tg.setFromEuler(this),this.setFromQuaternion(tg,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}tb.DEFAULT_ORDER="XYZ";class tv{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&1<<t)!=0}}let tx=0,tw=new U,tS=new j,tM=new th,t_=new U,tA=new U,tT=new U,tC=new j,tE=new U(1,0,0),tR=new U(0,1,0),tO=new U(0,0,1),tI={type:"added"},tk={type:"removed"},tP={type:"childadded",child:null},tB={type:"childremoved",child:null};class tL extends C{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tx++}),this.uuid=k(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=tL.DEFAULT_UP.clone();const t=new U,e=new tb,r=new j,i=new U(1,1,1);e._onChange(function(){r.setFromEuler(e,!1)}),r._onChange(function(){e.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new th},normalMatrix:{value:new W}}),this.matrix=new th,this.matrixWorld=new th,this.matrixAutoUpdate=tL.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=tL.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new tv,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return tS.setFromAxisAngle(t,e),this.quaternion.multiply(tS),this}rotateOnWorldAxis(t,e){return tS.setFromAxisAngle(t,e),this.quaternion.premultiply(tS),this}rotateX(t){return this.rotateOnAxis(tE,t)}rotateY(t){return this.rotateOnAxis(tR,t)}rotateZ(t){return this.rotateOnAxis(tO,t)}translateOnAxis(t,e){return tw.copy(t).applyQuaternion(this.quaternion),this.position.add(tw.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(tE,t)}translateY(t){return this.translateOnAxis(tR,t)}translateZ(t){return this.translateOnAxis(tO,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(tM.copy(this.matrixWorld).invert())}lookAt(t,e,r){t.isVector3?t_.copy(t):t_.set(t,e,r);let i=this.parent;this.updateWorldMatrix(!0,!1),tA.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?tM.lookAt(tA,t_,this.up):tM.lookAt(t_,tA,this.up),this.quaternion.setFromRotationMatrix(tM),i&&(tM.extractRotation(i.matrixWorld),tS.setFromRotationMatrix(tM),this.quaternion.premultiply(tS.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?A("Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(tI),tP.child=t,this.dispatchEvent(tP),tP.child=null):A("Object3D.add: object not an instance of THREE.Object3D.",t),this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}let e=this.children.indexOf(t);return -1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(tk),tB.child=t,this.dispatchEvent(tB),tB.child=null),this}removeFromParent(){let t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),tM.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),tM.multiply(t.parent.matrixWorld)),t.applyMatrix4(tM),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(tI),tP.child=t,this.dispatchEvent(tP),tP.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let r=0,i=this.children.length;r<i;r++){let i=this.children[r].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,r=[]){this[t]===e&&r.push(this);let i=this.children;for(let s=0,n=i.length;s<n;s++)i[s].getObjectsByProperty(t,e,r);return r}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tA,t,tT),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tA,tC,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}intersectsFrustum(){}traverse(t){t(this);let e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}traverseAncestors(t){let e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let t=this.pivot;if(null!==t){let e=t.x,r=t.y,i=t.z,s=this.matrix.elements;s[12]+=e-s[0]*e-s[4]*r-s[8]*i,s[13]+=r-s[1]*e-s[5]*r-s[9]*i,s[14]+=i-s[2]*e-s[6]*r-s[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].updateMatrixWorld(t)}updateWorldMatrix(t,e,r=!1){let i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||r)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,r=!0),!0===e){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0,r)}}toJSON(t){let e=void 0===t||"string"==typeof t,r={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};function s(e,r){return void 0===e[r.uuid]&&(e[r.uuid]=r.toJSON(t)),r.uuid}if(i.uuid=this.uuid,i.type=this.type,i.name=this.name,i.castShadow=this.castShadow,i.receiveShadow=this.receiveShadow,i.visible=this.visible,i.frustumCulled=this.frustumCulled,i.renderOrder=this.renderOrder,i.static=this.static,i.matrixAutoUpdate=this.matrixAutoUpdate,Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),null!==this.pivot&&(i.pivot=this.pivot.toArray()),void 0!==this.morphTargetDictionary&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(t=>({...t})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(t),i.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let r=e.shapes;if(Array.isArray(r))for(let e=0,i=r.length;e<i;e++){let i=r[e];s(t.shapes,i)}else s(t.shapes,r)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let r=0,i=this.material.length;r<i;r++)e.push(s(t.materials,this.material[r]));i.material=e}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){let r=this.animations[e];i.animations.push(s(t.animations,r))}}if(e){let e=n(t.geometries),i=n(t.materials),s=n(t.textures),a=n(t.images),o=n(t.shapes),h=n(t.skeletons),l=n(t.animations),u=n(t.nodes);e.length>0&&(r.geometries=e),i.length>0&&(r.materials=i),s.length>0&&(r.textures=s),a.length>0&&(r.images=a),o.length>0&&(r.shapes=o),h.length>0&&(r.skeletons=h),l.length>0&&(r.animations=l),u.length>0&&(r.nodes=u)}return r.object=i,r;function n(t){let e=[];for(let r in t){let i=t[r];delete i.metadata,e.push(i)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.pivot=null!==t.pivot?t.pivot.clone():null,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let r=t.children[e];this.add(r.clone())}return this}dispose(){this.dispatchEvent({type:"dispose"})}}tL.DEFAULT_UP=new U(0,1,0),tL.DEFAULT_MATRIX_AUTO_UPDATE=!0,tL.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class tz extends tL{constructor(){super(),this.isGroup=!0,this.type="Group"}}let tN={type:"move"},tF={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},tj={h:0,s:0,l:0},tU={h:0,s:0,l:0};function tD(t,e,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?t+(e-t)*6*r:r<.5?e:r<2/3?t+(e-t)*6*(2/3-r):t}class tV{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,r)}set(t,e,r){return void 0===e&&void 0===r?t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t):this.setRGB(t,e,r),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=d){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,J.colorSpaceToWorking(this,e),this}setRGB(t,e,r,i=J.workingColorSpace){return this.r=t,this.g=e,this.b=r,J.colorSpaceToWorking(this,i),this}setHSL(t,e,r,i=J.workingColorSpace){if(t=B(t,1),e=P(e,0,1),r=P(r,0,1),0===e)this.r=this.g=this.b=r;else{let i=r<=.5?r*(1+e):r+e-r*e,s=2*r-i;this.r=tD(s,i,t+1/3),this.g=tD(s,i,t),this.b=tD(s,i,t-1/3)}return J.colorSpaceToWorking(this,i),this}setStyle(t,e=d){let r;function i(e){void 0!==e&&1>parseFloat(e)&&_("Color: Alpha component of "+t+" will be ignored.")}if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,n=r[1],a=r[2];switch(n){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:_("Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){let i=r[1],s=i.length;if(3===s)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,e);if(6===s)return this.setHex(parseInt(i,16),e);_("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=d){let r=tF[t.toLowerCase()];return void 0!==r?this.setHex(r,e):_("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=$(t.r),this.g=$(t.g),this.b=$(t.b),this}copyLinearToSRGB(t){return this.r=Y(t.r),this.g=Y(t.g),this.b=Y(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=d){return J.workingToColorSpace(tW.copy(this),t),65536*Math.round(P(255*tW.r,0,255))+256*Math.round(P(255*tW.g,0,255))+Math.round(P(255*tW.b,0,255))}getHexString(t=d){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=J.workingColorSpace){let r,i;J.workingToColorSpace(tW.copy(this),e);let s=tW.r,n=tW.g,a=tW.b,o=Math.max(s,n,a),h=Math.min(s,n,a),l=(h+o)/2;if(h===o)r=0,i=0;else{let t=o-h;switch(i=l<=.5?t/(o+h):t/(2-o-h),o){case s:r=(n-a)/t+6*(n<a);break;case n:r=(a-s)/t+2;break;case a:r=(s-n)/t+4}r/=6}return t.h=r,t.s=i,t.l=l,t}getRGB(t,e=J.workingColorSpace){return J.workingToColorSpace(tW.copy(this),e),t.r=tW.r,t.g=tW.g,t.b=tW.b,t}getStyle(t=d){J.workingToColorSpace(tW.copy(this),t);let e=tW.r,r=tW.g,i=tW.b;return t!==d?`color(${t} ${e.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*r)},${Math.round(255*i)})`}offsetHSL(t,e,r){return this.getHSL(tj),this.setHSL(tj.h+t,tj.s+e,tj.l+r)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,r){return this.r=t.r+(e.r-t.r)*r,this.g=t.g+(e.g-t.g)*r,this.b=t.b+(e.b-t.b)*r,this}lerpHSL(t,e){this.getHSL(tj),t.getHSL(tU);let r=L(tj.h,tU.h,e),i=L(tj.s,tU.s,e),s=L(tj.l,tU.l,e);return this.setHSL(r,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,r=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*r+s[6]*i,this.g=s[1]*e+s[4]*r+s[7]*i,this.b=s[2]*e+s[5]*r+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let tW=new tV;tV.NAMES=tF;class tq{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new tV(t),this.density=e}clone(){return new tq(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class tG{constructor(t,e=1,r=1e3){this.isFog=!0,this.name="",this.color=new tV(t),this.near=e,this.far=r}clone(){return new tG(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class tH extends tL{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new tb,this.environmentIntensity=1,this.environmentRotation=new tb,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e.object.backgroundBlurriness=this.backgroundBlurriness,e.object.backgroundIntensity=this.backgroundIntensity,e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentIntensity=this.environmentIntensity,e.object.environmentRotation=this.environmentRotation.toArray(),e}}let tJ=new U,t$=new U,tY=new U,tX=new U,tZ=new U,tK=new U,tQ=new U,t0=new U,t1=new U,t2=new U,t3=new ti,t5=new ti,t4=new ti;class t6{constructor(t=new U,e=new U,r=new U){this.a=t,this.b=e,this.c=r}static getNormal(t,e,r,i){i.subVectors(r,e),tJ.subVectors(t,e),i.cross(tJ);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,r,i,s){tJ.subVectors(i,e),t$.subVectors(r,e),tY.subVectors(t,e);let n=tJ.dot(tJ),a=tJ.dot(t$),o=tJ.dot(tY),h=t$.dot(t$),l=t$.dot(tY),u=n*h-a*a;if(0===u)return s.set(0,0,0),null;let c=1/u,d=(h*o-a*l)*c,p=(n*l-a*o)*c;return s.set(1-d-p,p,d)}static containsPoint(t,e,r,i){return null!==this.getBarycoord(t,e,r,i,tX)&&tX.x>=0&&tX.y>=0&&tX.x+tX.y<=1}static getInterpolation(t,e,r,i,s,n,a,o){return null===this.getBarycoord(t,e,r,i,tX)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(s,tX.x),o.addScaledVector(n,tX.y),o.addScaledVector(a,tX.z),o)}static getInterpolatedAttribute(t,e,r,i,s,n){return t3.setScalar(0),t5.setScalar(0),t4.setScalar(0),t3.fromBufferAttribute(t,e),t5.fromBufferAttribute(t,r),t4.fromBufferAttribute(t,i),n.setScalar(0),n.addScaledVector(t3,s.x),n.addScaledVector(t5,s.y),n.addScaledVector(t4,s.z),n}static isFrontFacing(t,e,r,i){return tJ.subVectors(r,e),t$.subVectors(t,e),0>tJ.cross(t$).dot(i)}set(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this}setFromPointsAndIndices(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,r,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return tJ.subVectors(this.c,this.b),t$.subVectors(this.a,this.b),.5*tJ.cross(t$).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return t6.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return t6.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,r,i,s){return t6.getInterpolation(t,this.a,this.b,this.c,e,r,i,s)}containsPoint(t){return t6.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return t6.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let r,i,s=this.a,n=this.b,a=this.c;tZ.subVectors(n,s),tK.subVectors(a,s),t0.subVectors(t,s);let o=tZ.dot(t0),h=tK.dot(t0);if(o<=0&&h<=0)return e.copy(s);t1.subVectors(t,n);let l=tZ.dot(t1),u=tK.dot(t1);if(l>=0&&u<=l)return e.copy(n);let c=o*u-l*h;if(c<=0&&o>=0&&l<=0)return r=o/(o-l),e.copy(s).addScaledVector(tZ,r);t2.subVectors(t,a);let d=tZ.dot(t2),p=tK.dot(t2);if(p>=0&&d<=p)return e.copy(a);let f=d*h-o*p;if(f<=0&&h>=0&&p<=0)return i=h/(h-p),e.copy(s).addScaledVector(tK,i);let m=l*p-d*u;if(m<=0&&u-l>=0&&d-p>=0)return tQ.subVectors(a,n),i=(u-l)/(u-l+(d-p)),e.copy(n).addScaledVector(tQ,i);let y=1/(m+f+c);return r=f*y,i=c*y,e.copy(s).addScaledVector(tZ,r).addScaledVector(tK,i)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class t8{constructor(t=new U(Infinity,Infinity,Infinity),e=new U(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e+=3)this.expandByPoint(t7.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,r=t.count;e<r;e++)this.expandByPoint(t7.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let r=t7.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let r=t.geometry;if(void 0!==r){let i=r.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,r=i.count;e<r;e++)!0===t.isMesh?t.getVertexPosition(e,t7):t7.fromBufferAttribute(i,e),t7.applyMatrix4(t.matrixWorld),this.expandByPoint(t7);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),et.copy(t.boundingBox)):(null===r.boundingBox&&r.computeBoundingBox(),et.copy(r.boundingBox)),et.applyMatrix4(t.matrixWorld),this.union(et)}let i=t.children;for(let t=0,r=i.length;t<r;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,t7),t7.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(eo),eh.subVectors(this.max,eo),ee.subVectors(t.a,eo),er.subVectors(t.b,eo),ei.subVectors(t.c,eo),es.subVectors(er,ee),en.subVectors(ei,er),ea.subVectors(ee,ei);let e=[0,-es.z,es.y,0,-en.z,en.y,0,-ea.z,ea.y,es.z,0,-es.x,en.z,0,-en.x,ea.z,0,-ea.x,-es.y,es.x,0,-en.y,en.x,0,-ea.y,ea.x,0];return!!ec(e,ee,er,ei,eh)&&!!ec(e=[1,0,0,0,1,0,0,0,1],ee,er,ei,eh)&&(el.crossVectors(es,en),ec(e=[el.x,el.y,el.z],ee,er,ei,eh))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,t7).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(t7).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(t9[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),t9[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),t9[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),t9[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),t9[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),t9[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),t9[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),t9[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(t9)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}let t9=[new U,new U,new U,new U,new U,new U,new U,new U],t7=new U,et=new t8,ee=new U,er=new U,ei=new U,es=new U,en=new U,ea=new U,eo=new U,eh=new U,el=new U,eu=new U;function ec(t,e,r,i,s){for(let n=0,a=t.length-3;n<=a;n+=3){eu.fromArray(t,n);let a=s.x*Math.abs(eu.x)+s.y*Math.abs(eu.y)+s.z*Math.abs(eu.z),o=e.dot(eu),h=r.dot(eu),l=i.dot(eu);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}let ed=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),r=new Uint32Array(t),i=new Uint32Array(512),s=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(i[t]=0,i[256|t]=32768,s[t]=24,s[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,s[t]=-e-1,s[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,s[t]=13,s[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,s[t]=24,s[256|t]=24):(i[t]=31744,i[256|t]=64512,s[t]=13,s[256|t]=13)}let n=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,r=0;for(;(8388608&e)==0;)e<<=1,r-=8388608;e&=-8388609,r+=0x38800000,n[t]=e|r}for(let t=1024;t<2048;++t)n[t]=0x38000000+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=0x47800000,a[32]=0x80000000;for(let t=33;t<63;++t)a[t]=0x80000000+(t-32<<23);a[63]=0xc7800000;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:s,mantissaTable:n,exponentTable:a,offsetTable:o}}();function ep(t){Math.abs(t)>65504&&_("DataUtils.toHalfFloat(): Value out of range."),t=P(t,-65504,65504),ed.floatView[0]=t;let e=ed.uint32View[0],r=e>>23&511;return ed.baseTable[r]+((8388607&e)>>ed.shiftTable[r])}function ef(t){let e=t>>10;return ed.uint32View[0]=ed.mantissaTable[ed.offsetTable[e]+(1023&t)]+ed.exponentTable[e],ed.floatView[0]}let em=new U,ey=new F,eg=0;class eb extends C{constructor(t,e,r=!1){if(super(),Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:eg++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=r,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[r+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,r=this.count;e<r;e++)ey.fromBufferAttribute(this,e),ey.applyMatrix3(t),this.setXY(e,ey.x,ey.y);else if(3===this.itemSize)for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.applyMatrix3(t),this.setXYZ(e,em.x,em.y,em.z);return this}applyMatrix4(t){for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.applyMatrix4(t),this.setXYZ(e,em.x,em.y,em.z);return this}applyNormalMatrix(t){for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.applyNormalMatrix(t),this.setXYZ(e,em.x,em.y,em.z);return this}transformDirection(t){for(let e=0,r=this.count;e<r;e++)em.fromBufferAttribute(this,e),em.transformDirection(t),this.setXYZ(e,em.x,em.y,em.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let r=this.array[t*this.itemSize+e];return this.normalized&&(r=z(r,this.array)),r}setComponent(t,e,r){return this.normalized&&(r=N(r,this.array)),this.array[t*this.itemSize+e]=r,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=z(e,this.array)),e}setX(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=z(e,this.array)),e}setY(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=z(e,this.array)),e}setZ(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=z(e,this.array)),e}setW(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,r){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array)),this.array[t+0]=e,this.array[t+1]=r,this}setXYZ(t,e,r,i){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array)),this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this}setXYZW(t,e,r,i,s){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array),s=N(s,this.array)),this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return t.name=this.name,t.usage=this.usage,t.gpuType=this.gpuType,t}dispose(){this.dispatchEvent({type:"dispose"})}}class ev extends eb{constructor(t,e,r){super(new Uint16Array(t),e,r)}}class ex extends eb{constructor(t,e,r){super(new Uint32Array(t),e,r)}}class ew extends eb{constructor(t,e,r){super(new Float32Array(t),e,r)}}let eS=new t8,eM=new U,e_=new U;class eA{constructor(t=new U,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let r=this.center;void 0!==e?r.copy(e):eS.setFromPoints(t).getCenter(r);let i=0;for(let e=0,s=t.length;e<s;e++)i=Math.max(i,r.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let r=this.center.distanceToSquared(t);return e.copy(t),r>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;eM.subVectors(t,this.center);let e=eM.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),r=(t-this.radius)*.5;this.center.addScaledVector(eM,r/t),this.radius+=r}return this}union(t){return t.isEmpty()||(this.isEmpty()?this.copy(t):!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(e_.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(eM.copy(t.center).add(e_)),this.expandByPoint(eM.copy(t.center).sub(e_)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let eT=0,eC=new th,eE=new tL,eR=new U,eO=new t8,eI=new t8,ek=new U;class eP extends C{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:eT++}),this.uuid=k(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(!function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?ev:ex)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,r=0){this.groups.push({start:t,count:e,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let r=this.attributes.normal;if(void 0!==r){let e=new W().getNormalMatrix(t);r.applyNormalMatrix(e),r.needsUpdate=!0}let i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(t){return eC.makeRotationFromQuaternion(t),this.applyMatrix4(eC),this}rotateX(t){return eC.makeRotationX(t),this.applyMatrix4(eC),this}rotateY(t){return eC.makeRotationY(t),this.applyMatrix4(eC),this}rotateZ(t){return eC.makeRotationZ(t),this.applyMatrix4(eC),this}translate(t,e,r){return eC.makeTranslation(t,e,r),this.applyMatrix4(eC),this}scale(t,e,r){return eC.makeScale(t,e,r),this.applyMatrix4(eC),this}lookAt(t){return eE.lookAt(t),eE.updateMatrix(),this.applyMatrix4(eE.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(eR).negate(),this.translate(eR.x,eR.y,eR.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];e.push(i.x,i.y,i.z||0)}this.setAttribute("position",new ew(e,3))}else{let r=Math.min(t.length,e.count);for(let i=0;i<r;i++){let r=t[i];e.setXYZ(i,r.x,r.y,r.z||0)}t.length>e.count&&_("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t8);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){A("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(Infinity,Infinity,Infinity));return}if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){let r=e[t];eO.setFromBufferAttribute(r),this.morphTargetsRelative?(ek.addVectors(this.boundingBox.min,eO.min),this.boundingBox.expandByPoint(ek),ek.addVectors(this.boundingBox.max,eO.max),this.boundingBox.expandByPoint(ek)):(this.boundingBox.expandByPoint(eO.min),this.boundingBox.expandByPoint(eO.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&A('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eA);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){A("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new U,1/0);return}if(t){let r=this.boundingSphere.center;if(eO.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){let r=e[t];eI.setFromBufferAttribute(r),this.morphTargetsRelative?(ek.addVectors(eO.min,eI.min),eO.expandByPoint(ek),ek.addVectors(eO.max,eI.max),eO.expandByPoint(ek)):(eO.expandByPoint(eI.min),eO.expandByPoint(eI.max))}eO.getCenter(r);let i=0;for(let e=0,s=t.count;e<s;e++)ek.fromBufferAttribute(t,e),i=Math.max(i,r.distanceToSquared(ek));if(e)for(let s=0,n=e.length;s<n;s++){let n=e[s],a=this.morphTargetsRelative;for(let e=0,s=n.count;e<s;e++)ek.fromBufferAttribute(n,e),a&&(eR.fromBufferAttribute(t,e),ek.add(eR)),i=Math.max(i,r.distanceToSquared(ek))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&A('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void A("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let r=e.position,i=e.normal,s=e.uv,n=this.getAttribute("tangent");(void 0===n||n.count!==r.count)&&(n=new eb(new Float32Array(4*r.count),4),this.setAttribute("tangent",n));let a=[],o=[];for(let t=0;t<r.count;t++)a[t]=new U,o[t]=new U;let h=new U,l=new U,u=new U,c=new F,d=new F,p=new F,f=new U,m=new U,y=this.groups;0===y.length&&(y=[{start:0,count:t.count}]);for(let e=0,i=y.length;e<i;++e){let i=y[e],n=i.start,g=i.count;for(let e=n,i=n+g;e<i;e+=3)!function(t,e,i){h.fromBufferAttribute(r,t),l.fromBufferAttribute(r,e),u.fromBufferAttribute(r,i),c.fromBufferAttribute(s,t),d.fromBufferAttribute(s,e),p.fromBufferAttribute(s,i),l.sub(h),u.sub(h),d.sub(c),p.sub(c);let n=1/(d.x*p.y-p.x*d.y);isFinite(n)&&(f.copy(l).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(n),m.copy(u).multiplyScalar(d.x).addScaledVector(l,-p.x).multiplyScalar(n),a[t].add(f),a[e].add(f),a[i].add(f),o[t].add(m),o[e].add(m),o[i].add(m))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new U,b=new U,v=new U,x=new U;function w(t){v.fromBufferAttribute(i,t),x.copy(v);let e=a[t];g.copy(e),g.sub(v.multiplyScalar(v.dot(e))).normalize(),b.crossVectors(x,e);let r=b.dot(o[t]);n.setXYZW(t,g.x,g.y,g.z,r<0?-1:1)}for(let e=0,r=y.length;e<r;++e){let r=y[e],i=r.start,s=r.count;for(let e=i,r=i+s;e<r;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}this._transformed=!0}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let r=this.getAttribute("normal");if(void 0===r||r.count!==e.count)r=new eb(new Float32Array(3*e.count),3),this.setAttribute("normal",r);else for(let t=0,e=r.count;t<e;t++)r.setXYZ(t,0,0,0);let i=new U,s=new U,n=new U,a=new U,o=new U,h=new U,l=new U,u=new U;if(t)for(let c=0,d=t.count;c<d;c+=3){let d=t.getX(c+0),p=t.getX(c+1),f=t.getX(c+2);i.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),n.fromBufferAttribute(e,f),l.subVectors(n,s),u.subVectors(i,s),l.cross(u),a.fromBufferAttribute(r,d),o.fromBufferAttribute(r,p),h.fromBufferAttribute(r,f),a.add(l),o.add(l),h.add(l),r.setXYZ(d,a.x,a.y,a.z),r.setXYZ(p,o.x,o.y,o.z),r.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,a=e.count;t<a;t+=3)i.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),n.fromBufferAttribute(e,t+2),l.subVectors(n,s),u.subVectors(i,s),l.cross(u),r.setXYZ(t+0,l.x,l.y,l.z),r.setXYZ(t+1,l.x,l.y,l.z),r.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,r=t.count;e<r;e++)ek.fromBufferAttribute(t,e),ek.normalize(),t.setXYZ(e,ek.x,ek.y,ek.z)}toNonIndexed(){function t(t,e){let r=t.array,i=t.itemSize,s=t.normalized,n=new r.constructor(e.length*i),a=0,o=0;for(let s=0,h=e.length;s<h;s++){a=t.isInterleavedBufferAttribute?e[s]*t.data.stride+t.offset:e[s]*i;for(let t=0;t<i;t++)n[o++]=r[a++]}return new eb(n,i,s)}if(null===this.index)return _("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new eP,r=this.index.array,i=this.attributes;for(let s in i){let n=t(i[s],r);e.setAttribute(s,n)}let s=this.morphAttributes;for(let i in s){let n=[],a=s[i];for(let e=0,i=a.length;e<i;e++){let i=t(a[e],r);n.push(i)}e.morphAttributes[i]=n}e.morphTargetsRelative=this.morphTargetsRelative;let n=this.groups;for(let t=0,r=n.length;t<r;t++){let r=n[t];e.addGroup(r.start,r.count,r.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,t.name=this.name,Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){let e=this.parameters;for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let r=this.attributes;for(let e in r){let i=r[e];t.data.attributes[e]=i.toJSON(t.data)}let i={},s=!1;for(let e in this.morphAttributes){let r=this.morphAttributes[e],n=[];for(let e=0,i=r.length;e<i;e++){let i=r[e];n.push(i.toJSON(t.data))}n.length>0&&(i[e]=n,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let n=this.groups;n.length>0&&(t.data.groups=JSON.parse(JSON.stringify(n)));let a=this.boundingSphere;return null!==a&&(t.data.boundingSphere=a.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let r=t.index;null!==r&&this.setIndex(r.clone());let i=t.attributes;for(let t in i){let r=i[t];this.setAttribute(t,r.clone(e))}let s=t.morphAttributes;for(let t in s){let r=[],i=s[t];for(let t=0,s=i.length;t<s;t++)r.push(i[t].clone(e));this.morphAttributes[t]=r}this.morphTargetsRelative=t.morphTargetsRelative;let n=t.groups;for(let t=0,e=n.length;t<e;t++){let e=n[t];this.addGroup(e.start,e.count,e.materialIndex)}let a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());let o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this._transformed=t._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}class eB{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=k()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,r){t*=this.stride,r*=e.stride;for(let i=0,s=this.stride;i<s;i++)this.array[t+i]=e.array[r+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(e,this.stride);return r.setUsage(this.usage),r}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer)));let e={uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride};return e.usage=this.usage,e}}let eL=new U;class ez{constructor(t,e,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,r=this.data.count;e<r;e++)eL.fromBufferAttribute(this,e),eL.applyMatrix4(t),this.setXYZ(e,eL.x,eL.y,eL.z);return this}applyNormalMatrix(t){for(let e=0,r=this.count;e<r;e++)eL.fromBufferAttribute(this,e),eL.applyNormalMatrix(t),this.setXYZ(e,eL.x,eL.y,eL.z);return this}transformDirection(t){for(let e=0,r=this.count;e<r;e++)eL.fromBufferAttribute(this,e),eL.transformDirection(t),this.setXYZ(e,eL.x,eL.y,eL.z);return this}getComponent(t,e){let r=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(r=z(r,this.array)),r}setComponent(t,e,r){return this.normalized&&(r=N(r,this.array)),this.data.array[t*this.data.stride+this.offset+e]=r,this}setX(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=N(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=z(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=z(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=z(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=z(e,this.array)),e}setXY(t,e,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=N(e,this.array),r=N(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this}setXYZ(t,e,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this}setXYZW(t,e,r,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array),s=N(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this.data.array[t+3]=s,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new ez(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{S("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let r=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[r+e])}return new eb(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{S("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let r=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[r+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}let eN=new U,eF=new U,ej=new W;class eU{constructor(t=new U(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,r,i){return this.normal.set(t,e,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,r){let i=eN.subVectors(r,e).cross(eF.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e,r=!0){let i=t.delta(eN),s=this.normal.dot(i);if(0===s)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let n=-(t.start.dot(this.normal)+this.constant)/s;return!0===r&&(n<0||n>1)?null:e.copy(t.start).addScaledVector(i,n)}intersectsLine(t){let e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let r=e||ej.getNormalMatrix(t),i=this.coplanarPoint(eN).applyMatrix4(t),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}toJSON(){return{normal:this.normal.toArray(),constant:this.constant}}fromJSON(t){return this.normal.fromArray(t.normal),this.constant=t.constant,this}}let eD=0;class eV extends C{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:eD++}),this.uuid=k(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tV(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let r=t[e];if(void 0===r){_(`Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(void 0===i){_(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector2&&r&&r.isVector2||i&&i.isEuler&&r&&r.isEuler||i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[e]=r}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(t){let e=[];for(let r in t){let i=t[r];delete i.metadata,e.push(i)}return e}if(r.uuid=this.uuid,r.type=this.type,r.blending=this.blending,r.side=this.side,r.shadowSide=this.shadowSide,r.vertexColors=this.vertexColors,r.opacity=this.opacity,r.transparent=this.transparent,r.blendSrc=this.blendSrc,r.blendDst=this.blendDst,r.blendEquation=this.blendEquation,r.blendSrcAlpha=this.blendSrcAlpha,r.blendDstAlpha=this.blendDstAlpha,r.blendEquationAlpha=this.blendEquationAlpha,r.blendColor=this.blendColor.getHex(),r.blendAlpha=this.blendAlpha,r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.clipIntersection=this.clipIntersection,r.clipShadows=this.clipShadows,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,r.stencilWrite=this.stencilWrite,r.polygonOffset=this.polygonOffset,r.polygonOffsetFactor=this.polygonOffsetFactor,r.polygonOffsetUnits=this.polygonOffsetUnits,r.dithering=this.dithering,r.alphaTest=this.alphaTest,r.alphaHash=this.alphaHash,r.alphaToCoverage=this.alphaToCoverage,r.premultipliedAlpha=this.premultipliedAlpha,r.forceSinglePass=this.forceSinglePass,r.allowOverride=this.allowOverride,r.visible=this.visible,r.toneMapped=this.toneMapped,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()),void 0!==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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(r.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(r.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(r.dispersion=this.dispersion),void 0!==this.retroreflectivity&&(r.retroreflectivity=this.retroreflectivity),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(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapRotation&&(r.envMapRotation=this.envMapRotation.toArray()),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(t).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),Array.isArray(this.clippingPlanes)&&this.clippingPlanes.length>0&&(r.clippingPlanes=this.clippingPlanes.map(t=>t.toJSON())),void 0!==this.rotation&&(r.rotation=this.rotation),void 0!==this.depthPacking&&(r.depthPacking=this.depthPacking),void 0!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.linecap&&(r.linecap=this.linecap),void 0!==this.linejoin&&(r.linejoin=this.linejoin),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),void 0!==this.wireframe&&(r.wireframe=this.wireframe),void 0!==this.wireframeLinewidth&&(r.wireframeLinewidth=this.wireframeLinewidth),void 0!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),void 0!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),void 0!==this.flatShading&&(r.flatShading=this.flatShading),void 0!==this.fog&&(r.fog=this.fog),Object.keys(this.userData).length>0&&(r.userData=this.userData),e){let e=i(t.textures),s=i(t.images);e.length>0&&(r.textures=e),s.length>0&&(r.images=s)}return r}fromJSON(t,e){if(void 0!==t.uuid&&(this.uuid=t.uuid),void 0!==t.name&&(this.name=t.name),void 0!==t.color&&void 0!==this.color&&this.color.setHex(t.color),void 0!==t.roughness&&(this.roughness=t.roughness),void 0!==t.metalness&&(this.metalness=t.metalness),void 0!==t.sheen&&(this.sheen=t.sheen),void 0!==t.sheenColor&&(this.sheenColor=new tV().setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(this.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==this.emissive&&this.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==this.specular&&this.specular.setHex(t.specular),void 0!==t.specularIntensity&&(this.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(this.shininess=t.shininess),void 0!==t.clearcoat&&(this.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(this.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(this.dispersion=t.dispersion),void 0!==t.retroreflectivity&&(this.retroreflectivity=t.retroreflectivity),void 0!==t.iridescence&&(this.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(this.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(this.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(this.transmission=t.transmission),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.attenuationDistance&&(this.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(this.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(this.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(this.fog=t.fog),void 0!==t.flatShading&&(this.flatShading=t.flatShading),void 0!==t.blending&&(this.blending=t.blending),void 0!==t.combine&&(this.combine=t.combine),void 0!==t.side&&(this.side=t.side),void 0!==t.shadowSide&&(this.shadowSide=t.shadowSide),void 0!==t.opacity&&(this.opacity=t.opacity),void 0!==t.transparent&&(this.transparent=t.transparent),void 0!==t.alphaTest&&(this.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(this.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(this.depthFunc=t.depthFunc),void 0!==t.depthTest&&(this.depthTest=t.depthTest),void 0!==t.depthWrite&&(this.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(this.colorWrite=t.colorWrite),void 0!==t.clippingPlanes&&(this.clippingPlanes=t.clippingPlanes.map(t=>new eU().fromJSON(t))),void 0!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection),void 0!==t.clipShadows&&(this.clipShadows=t.clipShadows),void 0!==t.depthPacking&&(this.depthPacking=t.depthPacking),void 0!==t.blendSrc&&(this.blendSrc=t.blendSrc),void 0!==t.blendDst&&(this.blendDst=t.blendDst),void 0!==t.blendEquation&&(this.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(this.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(this.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(this.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(this.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(this.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(this.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(this.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(this.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(this.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(this.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(this.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(this.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(this.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(this.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(this.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(this.rotation=t.rotation),void 0!==t.linewidth&&(this.linewidth=t.linewidth),void 0!==t.linecap&&(this.linecap=t.linecap),void 0!==t.linejoin&&(this.linejoin=t.linejoin),void 0!==t.dashSize&&(this.dashSize=t.dashSize),void 0!==t.gapSize&&(this.gapSize=t.gapSize),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.polygonOffset&&(this.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(this.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(this.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(this.dithering=t.dithering),void 0!==t.alphaToCoverage&&(this.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(this.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(this.forceSinglePass=t.forceSinglePass),void 0!==t.allowOverride&&(this.allowOverride=t.allowOverride),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.toneMapped&&(this.toneMapped=t.toneMapped),void 0!==t.userData&&(this.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?this.vertexColors=t.vertexColors>0:this.vertexColors=t.vertexColors),void 0!==t.size&&(this.size=t.size),void 0!==t.sizeAttenuation&&(this.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(this.map=e[t.map]||null),void 0!==t.matcap&&(this.matcap=e[t.matcap]||null),void 0!==t.alphaMap&&(this.alphaMap=e[t.alphaMap]||null),void 0!==t.bumpMap&&(this.bumpMap=e[t.bumpMap]||null),void 0!==t.bumpScale&&(this.bumpScale=t.bumpScale),void 0!==t.normalMap&&(this.normalMap=e[t.normalMap]||null),void 0!==t.normalMapType&&(this.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),this.normalScale=new F().fromArray(e)}return void 0!==t.displacementMap&&(this.displacementMap=e[t.displacementMap]||null),void 0!==t.displacementScale&&(this.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(this.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(this.roughnessMap=e[t.roughnessMap]||null),void 0!==t.metalnessMap&&(this.metalnessMap=e[t.metalnessMap]||null),void 0!==t.emissiveMap&&(this.emissiveMap=e[t.emissiveMap]||null),void 0!==t.emissiveIntensity&&(this.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(this.specularMap=e[t.specularMap]||null),void 0!==t.specularIntensityMap&&(this.specularIntensityMap=e[t.specularIntensityMap]||null),void 0!==t.specularColorMap&&(this.specularColorMap=e[t.specularColorMap]||null),void 0!==t.envMap&&(this.envMap=e[t.envMap]||null),void 0!==t.envMapRotation&&this.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(this.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(this.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(this.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(this.lightMap=e[t.lightMap]||null),void 0!==t.lightMapIntensity&&(this.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(this.aoMap=e[t.aoMap]||null),void 0!==t.aoMapIntensity&&(this.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(this.gradientMap=e[t.gradientMap]||null),void 0!==t.clearcoatMap&&(this.clearcoatMap=e[t.clearcoatMap]||null),void 0!==t.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=e[t.clearcoatRoughnessMap]||null),void 0!==t.clearcoatNormalMap&&(this.clearcoatNormalMap=e[t.clearcoatNormalMap]||null),void 0!==t.clearcoatNormalScale&&(this.clearcoatNormalScale=new F().fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(this.iridescenceMap=e[t.iridescenceMap]||null),void 0!==t.iridescenceThicknessMap&&(this.iridescenceThicknessMap=e[t.iridescenceThicknessMap]||null),void 0!==t.transmissionMap&&(this.transmissionMap=e[t.transmissionMap]||null),void 0!==t.thicknessMap&&(this.thicknessMap=e[t.thicknessMap]||null),void 0!==t.anisotropyMap&&(this.anisotropyMap=e[t.anisotropyMap]||null),void 0!==t.sheenColorMap&&(this.sheenColorMap=e[t.sheenColorMap]||null),void 0!==t.sheenRoughnessMap&&(this.sheenRoughnessMap=e[t.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,r=null;if(null!==e){let t=e.length;r=Array(t);for(let i=0;i!==t;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class eW extends eV{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tV(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let eq=new U,eG=new U,eH=new U,eJ=new F,e$=new F,eY=new th,eX=new U,eZ=new U,eK=new U,eQ=new F,e0=new F,e1=new F;class e2 extends tL{constructor(t=new eW){if(super(),this.isSprite=!0,this.type="Sprite",void 0===r){r=new eP;const t=new eB(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);r.setIndex([0,1,2,0,2,3]),r.setAttribute("position",new ez(t,3,0,!1)),r.setAttribute("uv",new ez(t,2,3,!1))}this.geometry=r,this.material=t,this.center=new F(.5,.5),this.count=1}intersectsFrustum(t){return t.intersectsSprite(this)}raycast(t,e){let r,i;null===t.camera&&A('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),eG.setFromMatrixScale(this.matrixWorld),eY.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),eH.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&eG.multiplyScalar(-eH.z);let s=this.material.rotation;0!==s&&(i=Math.cos(s),r=Math.sin(s));let n=this.center;e3(eX.set(-.5,-.5,0),eH,n,eG,r,i),e3(eZ.set(.5,-.5,0),eH,n,eG,r,i),e3(eK.set(.5,.5,0),eH,n,eG,r,i),eQ.set(0,0),e0.set(1,0),e1.set(1,1);let a=t.ray.intersectTriangle(eX,eZ,eK,!1,eq);if(null===a&&(e3(eZ.set(-.5,.5,0),eH,n,eG,r,i),e0.set(0,1),null===(a=t.ray.intersectTriangle(eX,eK,eZ,!1,eq))))return;let o=t.ray.origin.distanceTo(eq);o<t.near||o>t.far||e.push({distance:o,point:eq.clone(),uv:t6.getInterpolation(eq,eX,eZ,eK,eQ,e0,e1,new F),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function e3(t,e,r,i,s,n){eJ.subVectors(t,r).addScalar(.5).multiply(i),void 0!==s?(e$.x=n*eJ.x-s*eJ.y,e$.y=s*eJ.x+n*eJ.y):e$.copy(eJ),t.copy(e),t.x+=e$.x,t.y+=e$.y,t.applyMatrix4(eY)}let e5=new U,e4=new U;class e6 extends tL{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);let e=t.levels;for(let t=0,r=e.length;t<r;t++){let r=e[t];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,r=0){let i;e=Math.abs(e);let s=this.levels;for(i=0;i<s.length&&!(e<s[i].distance);i++);return s.splice(i,0,{distance:e,hysteresis:r,object:t}),this.add(t),this}removeLevel(t){let e=this.levels;for(let r=0;r<e.length;r++)if(e[r].distance===t){let t=e.splice(r,1);return this.remove(t[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){let e=this.levels;if(e.length>0){let r,i;for(r=1,i=e.length;r<i;r++){let i=e[r].distance;if(e[r].object.visible&&(i-=i*e[r].hysteresis),t<i)break}return e[r-1].object}return null}raycast(t,e){if(this.levels.length>0){e5.setFromMatrixPosition(this.matrixWorld);let r=t.ray.origin.distanceTo(e5);this.getObjectForDistance(r).raycast(t,e)}}update(t){let e=this.levels;if(e.length>1){let r,i;e5.setFromMatrixPosition(t.matrixWorld),e4.setFromMatrixPosition(this.matrixWorld);let s=e5.distanceTo(e4)/t.zoom;for(e[0].object.visible=!0,r=1,i=e.length;r<i;r++){let t=e[r].distance;if(e[r].object.visible&&(t-=t*e[r].hysteresis),s>=t)e[r-1].object.visible=!1,e[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<i;r++)e[r].object.visible=!1}}toJSON(t){let e=super.toJSON(t);e.object.autoUpdate=this.autoUpdate,e.object.levels=[];let r=this.levels;for(let t=0,i=r.length;t<i;t++){let i=r[t];e.object.levels.push({object:i.object.uuid,distance:i.distance,hysteresis:i.hysteresis})}return e}}let e8=new U,e9=new U,e7=new U,rt=new U;class re{constructor(t=new U,e=new U(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,e8)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=e8.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(e8.copy(this.origin).addScaledVector(this.direction,e),e8.distanceToSquared(t))}distanceSqToSegment(t,e,r,i){let s,n,a,o;e9.copy(t).add(e).multiplyScalar(.5),e7.copy(e).sub(t).normalize(),rt.copy(this.origin).sub(e9);let h=.5*t.distanceTo(e),l=-this.direction.dot(e7),u=rt.dot(this.direction),c=-rt.dot(e7),d=rt.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(s=l*c-u,n=l*u-c,o=h*p,s>=0)if(n>=-o)if(n<=o){let t=1/p;s*=t,n*=t,a=s*(s+l*n+2*u)+n*(l*s+n+2*c)+d}else a=-(s=Math.max(0,-(l*(n=h)+u)))*s+n*(n+2*c)+d;else a=-(s=Math.max(0,-(l*(n=-h)+u)))*s+n*(n+2*c)+d;else n<=-o?(n=(s=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),a=-s*s+n*(n+2*c)+d):n<=o?(s=0,a=(n=Math.min(Math.max(-h,-c),h))*(n+2*c)+d):(n=(s=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),a=-s*s+n*(n+2*c)+d);else n=l>0?-h:h,a=-(s=Math.max(0,-(l*n+u)))*s+n*(n+2*c)+d;return r&&r.copy(this.origin).addScaledVector(this.direction,s),i&&i.copy(e9).addScaledVector(e7,n),a}intersectSphere(t,e){if(t.radius<0)return null;e8.subVectors(t.center,this.origin);let r=e8.dot(this.direction),i=e8.dot(e8)-r*r,s=t.radius*t.radius;if(i>s)return null;let n=Math.sqrt(s-i),a=r-n,o=r+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null}intersectPlane(t,e){let r=this.distanceToPlane(t);return null===r?null:this.at(r,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let r,i,s,n,a,o,h=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(h>=0?(r=(t.min.x-c.x)*h,i=(t.max.x-c.x)*h):(r=(t.max.x-c.x)*h,i=(t.min.x-c.x)*h),l>=0?(s=(t.min.y-c.y)*l,n=(t.max.y-c.y)*l):(s=(t.max.y-c.y)*l,n=(t.min.y-c.y)*l),r>n||s>i||((s>r||isNaN(r))&&(r=s),(n<i||isNaN(i))&&(i=n),u>=0?(a=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(a=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),r>o||a>i||((a>r||r!=r)&&(r=a),(o<i||i!=i)&&(i=o),i<0)))?null:this.at(r>=0?r:i,e)}intersectsBox(t){return null!==this.intersectBox(t,e8)}intersectTriangle(t,e,r,i,s){let n,a,o,h,l,u,c,d,p,f,m,y,g=this.origin,b=this.direction,v=b.x,x=b.y,w=b.z,S=t.x-g.x,M=t.y-g.y,_=t.z-g.z,A=e.x-g.x,T=e.y-g.y,C=e.z-g.z,E=r.x-g.x,R=r.y-g.y,O=r.z-g.z,I=Math.abs(v),k=Math.abs(x),P=Math.abs(w);if(I>=k&&I>=P?(o=v,u=S,p=A,y=E,v>=0?(n=x,a=w,h=M,l=_,c=T,d=C,f=R,m=O):(n=w,a=x,h=_,l=M,c=C,d=T,f=O,m=R)):k>=P?(o=x,u=M,p=T,y=R,x>=0?(n=w,a=v,h=_,l=S,c=C,d=A,f=O,m=E):(n=v,a=w,h=S,l=_,c=A,d=C,f=E,m=O)):(o=w,u=_,p=C,y=O,w>=0?(n=v,a=x,h=S,l=M,c=A,d=T,f=E,m=R):(n=x,a=v,h=M,l=S,c=T,d=A,f=R,m=E)),0===o)return null;let B=n/o,L=a/o,z=1/o,N=h-B*u,F=l-L*u,j=c-B*p,U=d-L*p,D=f-B*y,V=m-L*y,W=D*U-V*j,q=N*V-F*D,G=j*F-U*N;if(i){if(W<0||q<0||G<0)return null}else if((W<0||q<0||G<0)&&(W>0||q>0||G>0))return null;let H=W+q+G;if(0===H)return null;let J=z*(W*u+q*p+G*y);return(H>0?J<0:J>0)?null:this.at(J/H,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rr extends eV{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tV(0xffffff),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.envMapRotation=new tb,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}let ri=new th,rs=new re,rn=new eA,ra=new U,ro=new U,rh=new U,rl=new U,ru=new U,rc=new U,rd=new U,rp=new U;class rf extends tL{constructor(t=new eP,e=new rr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t<e;t++){let e=r[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,n=r.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){rc.set(0,0,0);for(let r=0,i=s.length;r<i;r++){let i=a[r],o=s[r];0!==i&&(ru.fromBufferAttribute(o,t),n?rc.addScaledVector(ru,i):rc.addScaledVector(ru.sub(e),i))}e.add(rc)}return e}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let r=this.geometry,i=this.material,s=this.matrixWorld;void 0===i||(null===r.boundingSphere&&r.computeBoundingSphere(),rn.copy(r.boundingSphere),rn.applyMatrix4(s),rs.copy(t.ray).recast(t.near),!1===rn.containsPoint(rs.origin)&&(null===rs.intersectSphere(rn,ra)||rs.origin.distanceToSquared(ra)>(t.far-t.near)**2)||(ri.copy(s).invert(),rs.copy(t.ray).applyMatrix4(ri),(null===r.boundingBox||!1!==rs.intersectsBox(r.boundingBox))&&this._computeIntersections(t,e,rs)))}_computeIntersections(t,e,r){let i,s=this.geometry,n=this.material,a=s.index,o=s.attributes.position,h=s.attributes.uv,l=s.attributes.uv1,u=s.attributes.normal,c=s.groups,d=s.drawRange;if(null!==a)if(Array.isArray(n))for(let s=0,o=c.length;s<o;s++){let o=c[s],p=n[o.materialIndex],f=Math.max(o.start,d.start),m=Math.min(a.count,Math.min(o.start+o.count,d.start+d.count));for(let s=f;s<m;s+=3)(i=rm(this,p,t,r,h,l,u,a.getX(s),a.getX(s+1),a.getX(s+2)))&&(i.faceIndex=Math.floor(s/3),i.face.materialIndex=o.materialIndex,e.push(i))}else{let s=Math.max(0,d.start),o=Math.min(a.count,d.start+d.count);for(let c=s;c<o;c+=3)(i=rm(this,n,t,r,h,l,u,a.getX(c),a.getX(c+1),a.getX(c+2)))&&(i.faceIndex=Math.floor(c/3),e.push(i))}else if(void 0!==o)if(Array.isArray(n))for(let s=0,a=c.length;s<a;s++){let a=c[s],p=n[a.materialIndex],f=Math.max(a.start,d.start),m=Math.min(o.count,Math.min(a.start+a.count,d.start+d.count));for(let s=f;s<m;s+=3)(i=rm(this,p,t,r,h,l,u,s,s+1,s+2))&&(i.faceIndex=Math.floor(s/3),i.face.materialIndex=a.materialIndex,e.push(i))}else{let s=Math.max(0,d.start),a=Math.min(o.count,d.start+d.count);for(let o=s;o<a;o+=3)(i=rm(this,n,t,r,h,l,u,o,o+1,o+2))&&(i.faceIndex=Math.floor(o/3),e.push(i))}}}function rm(t,e,r,i,s,n,a,o,h,l){t.getVertexPosition(o,ro),t.getVertexPosition(h,rh),t.getVertexPosition(l,rl);let u=function(t,e,r,i,s,n,a,o){if(null===(1===e.side?i.intersectTriangle(a,n,s,!0,o):i.intersectTriangle(s,n,a,0===e.side,o)))return null;rp.copy(o),rp.applyMatrix4(t.matrixWorld);let h=r.ray.origin.distanceTo(rp);return h<r.near||h>r.far?null:{distance:h,point:rp.clone(),object:t}}(t,e,r,i,ro,rh,rl,rd);if(u){let t=new U;t6.getBarycoord(rd,ro,rh,rl,t),s&&(u.uv=t6.getInterpolatedAttribute(s,o,h,l,t,new F)),n&&(u.uv1=t6.getInterpolatedAttribute(n,o,h,l,t,new F)),a&&(u.normal=t6.getInterpolatedAttribute(a,o,h,l,t,new U),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new U,materialIndex:0};t6.getNormal(ro,rh,rl,e.normal),u.face=e,u.barycoord=t}return u}let ry=new ti,rg=new ti,rb=new ti,rv=new ti,rx=new th,rw=new U,rS=new eA,rM=new th,r_=new re;class rA extends rf{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=u,this.bindMatrix=new th,this.bindMatrixInverse=new th,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let t=this.geometry;null===this.boundingBox&&(this.boundingBox=new t8),this.boundingBox.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,rw),this.boundingBox.expandByPoint(rw)}computeBoundingSphere(){let t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new eA),this.boundingSphere.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,rw),this.boundingSphere.expandByPoint(rw)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){let r=this.material,i=this.matrixWorld;void 0===r||(null===this.boundingSphere&&this.computeBoundingSphere(),rS.copy(this.boundingSphere),rS.applyMatrix4(i),!1===t.ray.intersectsSphere(rS)||(rM.copy(i).invert(),r_.copy(t.ray).applyMatrix4(rM),(null===this.boundingBox||!1!==r_.intersectsBox(this.boundingBox))&&this._computeIntersections(t,e,r_)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new ti,e=this.geometry.attributes.skinWeight;for(let r=0,i=e.count;r<i;r++){t.fromBufferAttribute(e,r);let i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(r,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===u?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===c?this.bindMatrixInverse.copy(this.bindMatrix).invert():_("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){let r=this.skeleton,i=this.geometry;rg.fromBufferAttribute(i.attributes.skinIndex,t),rb.fromBufferAttribute(i.attributes.skinWeight,t),e.isVector4?(ry.copy(e),e.set(0,0,0,0)):(ry.set(...e,1),e.set(0,0,0)),ry.applyMatrix4(this.bindMatrix);for(let t=0;t<4;t++){let i=rb.getComponent(t);if(0!==i){let s=rg.getComponent(t);rx.multiplyMatrices(r.bones[s].matrixWorld,r.boneInverses[s]),e.addScaledVector(rv.copy(ry).applyMatrix4(rx),i)}}return e.isVector4&&(e.w=ry.w),e.applyMatrix4(this.bindMatrixInverse)}}class rT extends tL{constructor(){super(),this.isBone=!0,this.type="Bone"}}class rC extends tr{constructor(t=null,e=1,r=1,i,s,n,a,o,h=1003,l=1003,u,c){super(null,n,a,o,h,l,i,s,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let rE=new th,rR=new th;class rO{constructor(t=[],e=[]){this.uuid=k(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){_("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new th)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let e=new th;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){let t=this.bones,e=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let i=0,s=t.length;i<s;i++){let s=t[i]?t[i].matrixWorld:rR;rE.multiplyMatrices(s,e[i]),rE.toArray(r,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new rO(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length),e=new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4);e.set(this.boneMatrices);let r=new rC(e,t,t,1023,1015);return r.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=r,this}getBoneByName(t){for(let e=0,r=this.bones.length;e<r;e++){let r=this.bones[e];if(r.name===t)return r}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let r=0,i=t.bones.length;r<i;r++){let i=t.bones[r],s=e[i];void 0===s&&(_("Skeleton: No bone found with UUID:",i),s=new rT),this.bones.push(s),this.boneInverses.push(new th().fromArray(t.boneInverses[r]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,r=this.boneInverses;for(let i=0,s=e.length;i<s;i++){let s=e[i];t.bones.push(s.uuid);let n=r[i];t.boneInverses.push(n.toArray())}return t}}class rI extends eb{constructor(t,e,r,i=1){super(t,e,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}let rk=new th,rP=new th,rB=[],rL=new t8,rz=new th,rN=new rf,rF=new eA;class rj extends rf{constructor(t,e,r){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new rI(new Float32Array(16*r),16),this.instanceColor=null,this.morphTexture=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<r;t++)this.setMatrixAt(t,rz)}computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new t8),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<e;r++)this.getMatrixAt(r,rk),rL.copy(t.boundingBox).applyMatrix4(rk),this.boundingBox.union(rL)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new eA),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<e;r++)this.getMatrixAt(r,rk),rF.copy(t.boundingSphere).applyMatrix4(rk),this.boundingSphere.union(rF)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return null===this.instanceColor?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let r=e.morphTargetInfluences,i=this.morphTexture.source.data.data,s=t*(r.length+1)+1;for(let t=0;t<r.length;t++)r[t]=i[s+t]}raycast(t,e){let r=this.matrixWorld,i=this.count;if((rN.geometry=this.geometry,rN.material=this.material,void 0!==rN.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),rF.copy(this.boundingSphere),rF.applyMatrix4(r),!1!==t.ray.intersectsSphere(rF)))for(let s=0;s<i;s++){this.getMatrixAt(s,rk),rP.multiplyMatrices(r,rk),rN.matrixWorld=rP,rN.raycast(t,rB);for(let t=0,r=rB.length;t<r;t++){let r=rB[t];r.instanceId=s,r.object=this,e.push(r)}rB.length=0}}setColorAt(t,e){return null===this.instanceColor&&(this.instanceColor=new rI(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,16*t),this}setMorphAt(t,e){let r=e.morphTargetInfluences,i=r.length+1;null===this.morphTexture&&(this.morphTexture=new rC(new Float32Array(i*this.count),i,this.count,1028,1015));let s=this.morphTexture.source.data.data,n=0;for(let t=0;t<r.length;t++)n+=r[t];let a=this.geometry.morphTargetsRelative?1:1-n,o=i*t;return s[o]=a,s.set(r,o+1),this}updateMorphTargets(){}dispose(){super.dispose(),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let rU=new eA,rD=new F(.5,.5),rV=new U;class rW{constructor(t=new eU,e=new eU,r=new eU,i=new eU,s=new eU,n=new eU){this.planes=[t,e,r,i,s,n]}set(t,e,r,i,s,n){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(n),this}copy(t){let e=this.planes;for(let r=0;r<6;r++)e[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t,e=2e3,r=!1){let i=this.planes,s=t.elements,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],p=s[8],f=s[9],m=s[10],y=s[11],g=s[12],b=s[13],v=s[14],x=s[15];if(i[0].setComponents(h-n,d-l,y-p,x-g).normalize(),i[1].setComponents(h+n,d+l,y+p,x+g).normalize(),i[2].setComponents(h+a,d+u,y+f,x+b).normalize(),i[3].setComponents(h-a,d-u,y-f,x-b).normalize(),r)i[4].setComponents(o,c,m,v).normalize(),i[5].setComponents(h-o,d-c,y-m,x-v).normalize();else if(i[4].setComponents(h-o,d-c,y-m,x-v).normalize(),2e3===e)i[5].setComponents(h+o,d+c,y+m,x+v).normalize();else if(2001===e)i[5].setComponents(o,c,m,v).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),rU.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),rU.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(rU)}intersectsSprite(t){return rU.center.set(0,0,0),rU.radius=.7071067811865476+rD.distanceTo(t.center),rU.applyMatrix4(t.matrixWorld),this.intersectsSphere(rU)}intersectsSphere(t){let e=this.planes,r=t.center,i=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(r)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let r=0;r<6;r++){let i=e[r];if(rV.x=i.normal.x>0?t.max.x:t.min.x,rV.y=i.normal.y>0?t.max.y:t.min.y,rV.z=i.normal.z>0?t.max.z:t.min.z,0>i.distanceToPoint(rV))return!1}return!0}containsPoint(t){let e=this.planes;for(let r=0;r<6;r++)if(0>e[r].distanceToPoint(t))return!1;return!0}clone(){return new this.constructor().copy(this)}}let rq=new th;class rG{constructor(){this.coordinateSystem=2e3,this._frustums=[],this._count=0}setFromArrayCamera(t){let e=t.cameras,r=this._frustums;for(let t=0;t<e.length;t++){let i=e[t];rq.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),void 0===r[t]&&(r[t]=new rW),r[t].setFromProjectionMatrix(rq,i.coordinateSystem,i.reversedDepth)}return this._count=e.length,this}intersectsObject(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsObject(t))return!0;return!1}intersectsSprite(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsSprite(t))return!0;return!1}intersectsSphere(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsSphere(t))return!0;return!1}intersectsBox(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].intersectsBox(t))return!0;return!1}containsPoint(t){let e=this._frustums;for(let r=0;r<this._count;r++)if(e[r].containsPoint(t))return!0;return!1}copy(t){this.coordinateSystem=t.coordinateSystem;let e=this._frustums,r=t._frustums;for(let i=0;i<t._count;i++)void 0===e[i]&&(e[i]=new rW),e[i].copy(r[i]);return this._count=t._count,this}clone(){return new rG().copy(this)}}function rH(t,e){return t-e}function rJ(t,e){return t.z-e.z}function r$(t,e){return e.z-t.z}let rY=new th,rX=new tV(1,1,1),rZ=new rW,rK=new rG,rQ=new t8,r0=new eA,r1=new U,r2=new U,r3=new U,r5=new class{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,r,i){let s=this.pool,n=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});let a=s[this.index];n.push(a),this.index++,a.start=t,a.count=e,a.z=r,a.index=i}reset(){this.list.length=0,this.index=0}},r4=new rf,r6=[];function r8(t,e){if(t.constructor!==e.constructor){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)e[i]=t[i]}else{let r=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,r))}}class r9 extends rf{constructor(t,e,r=2*e,i){super(new eP,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=t,this._maxVertexCount=e,this._maxIndexCount=r,this._multiDrawCounts=new Int32Array(t),this._multiDrawStarts=new Int32Array(t),this._multiDrawCount=0,this._multiDrawBytesPerElement=1,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let t=Math.sqrt(4*this._maxInstanceCount),e=new rC(new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4),t,t,1023,1015);this._matricesTexture=e}_initIndirectTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new rC(new Uint32Array((t=Math.ceil(t))*t),t,t,1029,1014);this._indirectTexture=e}_initColorsTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new rC(new Float32Array((t=Math.ceil(t))*t*4).fill(1),t,t,1023,1015);e.colorSpace=J.workingColorSpace,this._colorsTexture=e}_initializeGeometry(t){let e=this.geometry,r=this._maxVertexCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(let i in t.attributes){let{array:s,itemSize:n,normalized:a}=t.getAttribute(i),o=new eb(new s.constructor(r*n),n,a);e.setAttribute(i,o)}if(null!==t.getIndex()){let t=r>65535?new Uint32Array(i):new Uint16Array(i);e.setIndex(new eb(t,1))}this._geometryInitialized=!0}}_validateGeometry(t){let e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let r in e.attributes){if(!t.hasAttribute(r))throw Error(`THREE.BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);let i=t.getAttribute(r),s=e.getAttribute(r);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){let e=this._instanceInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){let e=this._geometryInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t8);let t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let r=0,i=e.length;r<i;r++){if(!1===e[r].active)continue;let i=e[r].geometryIndex;this.getMatrixAt(r,rY),this.getBoundingBoxAt(i,rQ).applyMatrix4(rY),t.union(rQ)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eA);let t=this.boundingSphere,e=this._instanceInfo;t.makeEmpty();for(let r=0,i=e.length;r<i;r++){if(!1===e[r].active)continue;let i=e[r].geometryIndex;this.getMatrixAt(r,rY),this.getBoundingSphereAt(i,r0).applyMatrix4(rY),t.union(r0)}}addInstance(t){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let e={visible:!0,active:!0,geometryIndex:t},r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(rH),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=e):(r=this._instanceInfo.length,this._instanceInfo.push(e));let i=this._matricesTexture;rY.identity().toArray(i.image.data,16*r),i.needsUpdate=!0;let s=this._colorsTexture;return s&&(rX.toArray(s.image.data,4*r),s.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(t,e=-1,r=-1){let i;this._initializeGeometry(t),this._validateGeometry(t);let s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},n=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=-1===e?t.getAttribute("position").count:e;let a=t.getIndex();if(null!==a&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=-1===r?a.count:r),-1!==s.indexStart&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(rH),n[i=this._availableGeometryIds.shift()]=s):(i=this._geometryCount,this._geometryCount++,n.push(s)),this.setGeometryAt(i,t),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,i}setGeometryAt(t,e){if(t>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);let r=this.geometry,i=null!==r.getIndex(),s=r.getIndex(),n=e.getIndex(),a=this._geometryInfo[t];if(i&&n.count>a.reservedIndexCount||e.attributes.position.count>a.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=a.vertexStart,h=a.reservedVertexCount;for(let t in a.vertexCount=e.getAttribute("position").count,r.attributes){let i=e.getAttribute(t),s=r.getAttribute(t);!function(t,e,r=0){let i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){let s=t.count;for(let n=0;n<s;n++)for(let s=0;s<i;s++)e.setComponent(n+r,s,t.getComponent(n,s))}else e.array.set(t.array,r*i);e.needsUpdate=!0}(i,s,o);let n=i.itemSize;for(let t=i.count;t<h;t++){let e=o+t;for(let t=0;t<n;t++)s.setComponent(e,t,0)}s.needsUpdate=!0,s.addUpdateRange(o*n,h*n)}if(i){let t=a.indexStart,r=a.reservedIndexCount;a.indexCount=e.getIndex().count;for(let e=0;e<n.count;e++)s.setX(t+e,o+n.getX(e));for(let e=n.count;e<r;e++)s.setX(t+e,o);s.needsUpdate=!0,s.addUpdateRange(t,a.reservedIndexCount)}return a.start=i?a.indexStart:a.vertexStart,a.count=i?a.indexCount:a.vertexCount,a.boundingBox=null,null!==e.boundingBox&&(a.boundingBox=e.boundingBox.clone()),a.boundingSphere=null,null!==e.boundingSphere&&(a.boundingSphere=e.boundingSphere.clone()),this._visibilityChanged=!0,t}deleteGeometry(t){let e=this._geometryInfo;if(t>=e.length||!1===e[t].active)return this;let r=this._instanceInfo;for(let e=0,i=r.length;e<i;e++)r[e].active&&r[e].geometryIndex===t&&this.deleteInstance(e);return e[t].active=!1,this._availableGeometryIds.push(t),this._visibilityChanged=!0,this}deleteInstance(t){return this.validateInstanceId(t),this._instanceInfo[t].active=!1,this._availableInstanceIds.push(t),this._visibilityChanged=!0,this}optimize(){let t=0,e=0,r=this._geometryInfo,i=r.map((t,e)=>e).sort((t,e)=>r[t].vertexStart-r[e].vertexStart),s=this.geometry;for(let n=0,a=r.length;n<a;n++){let a=r[i[n]];if(!1!==a.active){if(null!==s.index){if(a.indexStart!==e){let{indexStart:r,vertexStart:i,reservedIndexCount:n}=a,o=s.index,h=o.array,l=t-i;for(let t=r;t<r+n;t++)h[t]=h[t]+l;o.array.copyWithin(e,r,r+n),o.addUpdateRange(e,n),o.needsUpdate=!0,a.indexStart=e}e+=a.reservedIndexCount}if(a.vertexStart!==t){let{vertexStart:e,reservedVertexCount:r}=a,i=s.attributes;for(let s in i){let n=i[s],{array:a,itemSize:o}=n;a.copyWithin(t*o,e*o,(e+r)*o),n.addUpdateRange(t*o,r*o),n.needsUpdate=!0}a.vertexStart=t}t+=a.reservedVertexCount,a.start=s.index?a.indexStart:a.vertexStart}}return this._nextIndexStart=e,this._nextVertexStart=t,this._visibilityChanged=!0,this}getBoundingBoxAt(t,e){if(t>=this._geometryCount)return null;let r=this.geometry,i=this._geometryInfo[t];if(null===i.boundingBox){let t=new t8,e=r.index,s=r.attributes.position;for(let r=i.start,n=i.start+i.count;r<n;r++){let i=r;e&&(i=e.getX(i)),t.expandByPoint(r1.fromBufferAttribute(s,i))}i.boundingBox=t}return e.copy(i.boundingBox),e}getBoundingSphereAt(t,e){if(t>=this._geometryCount)return null;let r=this.geometry,i=this._geometryInfo[t];if(null===i.boundingSphere){let e=new eA;this.getBoundingBoxAt(t,rQ),rQ.getCenter(e.center);let s=r.index,n=r.attributes.position,a=0;for(let t=i.start,r=i.start+i.count;t<r;t++){let r=t;s&&(r=s.getX(r)),r1.fromBufferAttribute(n,r),a=Math.max(a,e.center.distanceToSquared(r1))}e.radius=Math.sqrt(a),i.boundingSphere=e}return e.copy(i.boundingSphere),e}setMatrixAt(t,e){this.validateInstanceId(t);let r=this._matricesTexture,i=this._matricesTexture.image.data;return e.toArray(i,16*t),r.needsUpdate=!0,this}getMatrixAt(t,e){return this.validateInstanceId(t),e.fromArray(this._matricesTexture.image.data,16*t)}setColorAt(t,e){return this.validateInstanceId(t),null===this._colorsTexture&&this._initColorsTexture(),e.toArray(this._colorsTexture.image.data,4*t),this._colorsTexture.needsUpdate=!0,this}getColorAt(t,e){return(this.validateInstanceId(t),null!==this._colorsTexture)?e.fromArray(this._colorsTexture.image.data,4*t):e.isVector4?e.set(1,1,1,1):e.setRGB(1,1,1)}setVisibleAt(t,e){return this.validateInstanceId(t),this._instanceInfo[t].visible===e||(this._instanceInfo[t].visible=e,this._visibilityChanged=!0),this}getVisibleAt(t){return this.validateInstanceId(t),this._instanceInfo[t].visible}setGeometryIdAt(t,e){return this.validateInstanceId(t),this.validateGeometryId(e),this._instanceInfo[t].geometryIndex=e,this._visibilityChanged=!0,this}getGeometryIdAt(t){return this.validateInstanceId(t),this._instanceInfo[t].geometryIndex}getGeometryRangeAt(t,e={}){this.validateGeometryId(t);let r=this._geometryInfo[t];return e.vertexStart=r.vertexStart,e.vertexCount=r.vertexCount,e.reservedVertexCount=r.reservedVertexCount,e.indexStart=r.indexStart,e.indexCount=r.indexCount,e.reservedIndexCount=r.reservedIndexCount,e.start=r.start,e.count=r.count,e}setInstanceCount(t){let e=this._availableInstanceIds,r=this._instanceInfo;for(e.sort(rH);e[e.length-1]===r.length-1;)r.pop(),e.pop();if(t<r.length)throw Error(`THREE.BatchedMesh: Instance ids outside the range ${t} are being used. Cannot shrink instance count.`);let i=new Int32Array(t),s=new Int32Array(t);r8(this._multiDrawCounts,i),r8(this._multiDrawStarts,s),this._multiDrawCounts=i,this._multiDrawStarts=s,this._maxInstanceCount=t;let n=this._indirectTexture,a=this._matricesTexture,o=this._colorsTexture;n.dispose(),this._initIndirectTexture(),r8(n.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),r8(a.image.data,this._matricesTexture.image.data),o&&(o.dispose(),this._initColorsTexture(),r8(o.image.data,this._colorsTexture.image.data))}setGeometrySize(t,e){let r=[...this._geometryInfo].filter(t=>t.active);if(Math.max(...r.map(t=>t.vertexStart+t.reservedVertexCount))>t)throw Error(`THREE.BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...r.map(t=>t.indexStart+t.reservedIndexCount))>e)throw Error(`THREE.BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);let i=this.geometry;i.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new eP,this._initializeGeometry(i));let s=this.geometry;for(let t in i.index&&r8(i.index.array,s.index.array),i.attributes)r8(i.attributes[t].array,s.attributes[t].array)}raycast(t,e){let r=this._instanceInfo,i=this._geometryInfo,s=this.matrixWorld,n=this.geometry;r4.material=this.material,r4.geometry.index=n.index,r4.geometry.attributes=n.attributes,null===r4.geometry.boundingBox&&(r4.geometry.boundingBox=new t8),null===r4.geometry.boundingSphere&&(r4.geometry.boundingSphere=new eA);for(let n=0,a=r.length;n<a;n++){if(!r[n].visible||!r[n].active)continue;let a=r[n].geometryIndex,o=i[a];r4.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(n,r4.matrixWorld).premultiply(s),this.getBoundingBoxAt(a,r4.geometry.boundingBox),this.getBoundingSphereAt(a,r4.geometry.boundingSphere),r4.raycast(t,r6);for(let t=0,r=r6.length;t<r;t++){let r=r6[t];r.object=this,r.batchId=n,e.push(r)}r6.length=0}r4.material=null,r4.geometry.index=null,r4.geometry.attributes={},r4.geometry.setDrawRange(0,1/0)}copy(t){return super.copy(t),this.geometry=t.geometry.clone(),this.perObjectFrustumCulled=t.perObjectFrustumCulled,this.sortObjects=t.sortObjects,this.boundingBox=null!==t.boundingBox?t.boundingBox.clone():null,this.boundingSphere=null!==t.boundingSphere?t.boundingSphere.clone():null,this._geometryInfo=t._geometryInfo.map(t=>({...t,boundingBox:null!==t.boundingBox?t.boundingBox.clone():null,boundingSphere:null!==t.boundingSphere?t.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(t=>({...t})),this._availableInstanceIds=t._availableInstanceIds.slice(),this._availableGeometryIds=t._availableGeometryIds.slice(),this._nextIndexStart=t._nextIndexStart,this._nextVertexStart=t._nextVertexStart,this._geometryCount=t._geometryCount,this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._multiDrawBytesPerElement=t._multiDrawBytesPerElement,this._indirectTexture=t._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){super.dispose(),this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(t,e,r,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let n=i.getIndex(),a=null===n?1:n.array.BYTES_PER_ELEMENT,o=1;s.wireframe&&(o=2,a=i.attributes.position.count>65535?4:2);let h=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,c=this._geometryInfo,d=this.perObjectFrustumCulled,p=this._indirectTexture,f=p.image.data,m=r.isArrayCamera?rK:rZ;d&&(r.isArrayCamera?m.setFromArrayCamera(r):(rY.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),m.setFromProjectionMatrix(rY,r.coordinateSystem,r.reversedDepth)));let y=0;if(this.sortObjects){rY.copy(this.matrixWorld).invert(),r1.setFromMatrixPosition(r.matrixWorld).applyMatrix4(rY),r2.set(0,0,-1).transformDirection(r.matrixWorld).transformDirection(rY);for(let t=0,e=h.length;t<e;t++)if(h[t].visible&&h[t].active){let e=h[t].geometryIndex;this.getMatrixAt(t,rY),this.getBoundingSphereAt(e,r0).applyMatrix4(rY);let r=!1;if(d&&(r=!m.intersectsSphere(r0)),!r){let r=c[e],i=r3.subVectors(r0.center,r1).dot(r2);r5.push(r.start,r.count,i,t)}}let t=r5.list,e=this.customSort;null===e?t.sort(s.transparent?r$:rJ):e.call(this,t,r);for(let e=0,r=t.length;e<r;e++){let r=t[e];l[y]=r.start*a*o,u[y]=r.count*o,f[y]=r.index,y++}r5.reset()}else for(let t=0,e=h.length;t<e;t++)if(h[t].visible&&h[t].active){let e=h[t].geometryIndex,r=!1;if(d&&(this.getMatrixAt(t,rY),this.getBoundingSphereAt(e,r0).applyMatrix4(rY),r=!m.intersectsSphere(r0)),!r){let r=c[e];l[y]=r.start*a*o,u[y]=r.count*o,f[y]=t,y++}}p.needsUpdate=!0,this._multiDrawCount=y,this._multiDrawBytesPerElement=a,this._visibilityChanged=!1}onBeforeShadow(t,e,r,i,s,n){this.onBeforeRender(t,null,i,s,n)}}class r7 extends eV{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tV(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}let it=new U,ie=new U,ir=new th,ii=new re,is=new eA,ia=new U,io=new U;class ih extends tL{constructor(t=new eP,e=new r7){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,r=[0];for(let t=1,i=e.count;t<i;t++)it.fromBufferAttribute(e,t-1),ie.fromBufferAttribute(e,t),r[t]=r[t-1],r[t]+=it.distanceTo(ie);t.setAttribute("lineDistance",new ew(r,1))}else _("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let r=this.geometry,i=this.matrixWorld,s=t.params.Line.threshold,n=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),is.copy(r.boundingSphere),is.applyMatrix4(i),is.radius+=s,!1===t.ray.intersectsSphere(is))return;ir.copy(i).invert(),ii.copy(t.ray).applyMatrix4(ir);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,h=this.isLineSegments?2:1,l=r.index,u=r.attributes.position;if(null!==l){let r=Math.max(0,n.start),i=Math.min(l.count,n.start+n.count);for(let s=r,n=i-1;s<n;s+=h){let r=il(this,t,ii,o,l.getX(s),l.getX(s+1),s);r&&e.push(r)}if(this.isLineLoop){let s=il(this,t,ii,o,l.getX(i-1),l.getX(r),i-1);s&&e.push(s)}}else{let r=Math.max(0,n.start),i=Math.min(u.count,n.start+n.count);for(let s=r,n=i-1;s<n;s+=h){let r=il(this,t,ii,o,s,s+1,s);r&&e.push(r)}if(this.isLineLoop){let s=il(this,t,ii,o,i-1,r,i-1);s&&e.push(s)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t<e;t++){let e=r[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function il(t,e,r,i,s,n,a){let o=t.geometry.attributes.position;if(it.fromBufferAttribute(o,s),ie.fromBufferAttribute(o,n),r.distanceSqToSegment(it,ie,ia,io)>i)return;ia.applyMatrix4(t.matrixWorld);let h=e.ray.origin.distanceTo(ia);if(!(h<e.near)&&!(h>e.far))return{distance:h,point:io.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}let iu=new U,ic=new U;class id extends ih{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,r=[];for(let t=0,i=e.count;t<i;t+=2)iu.fromBufferAttribute(e,t),ic.fromBufferAttribute(e,t+1),r[t]=0===t?0:r[t-1],r[t+1]=r[t]+iu.distanceTo(ic);t.setAttribute("lineDistance",new ew(r,1))}else _("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ip extends ih{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class im extends eV{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tV(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let iy=new th,ig=new re,ib=new eA,iv=new U;class ix extends tL{constructor(t=new eP,e=new im){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let r=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,n=r.drawRange;if(null===r.boundingSphere&&r.computeBoundingSphere(),ib.copy(r.boundingSphere),ib.applyMatrix4(i),ib.radius+=s,!1===t.ray.intersectsSphere(ib))return;iy.copy(i).invert(),ig.copy(t.ray).applyMatrix4(iy);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,h=r.index,l=r.attributes.position;if(null!==h){let r=Math.max(0,n.start),s=Math.min(h.count,n.start+n.count);for(let n=r;n<s;n++){let r=h.getX(n);iv.fromBufferAttribute(l,r),iw(iv,r,o,i,t,e,this)}}else{let r=Math.max(0,n.start),s=Math.min(l.count,n.start+n.count);for(let n=r;n<s;n++)iv.fromBufferAttribute(l,n),iw(iv,n,o,i,t,e,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t<e;t++){let e=r[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function iw(t,e,r,i,s,n,a){let o=ig.distanceSqToPoint(t);if(o<r){let r=new U;ig.closestPointToPoint(t,r),r.applyMatrix4(i);let h=s.ray.origin.distanceTo(r);if(h<s.near||h>s.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:r,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class iS extends tr{constructor(t,e,r,i,s=1006,n=1006,a,o,h){super(t,e,r,i,s,n,a,o,h),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const l=this;"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class iM extends tr{constructor(t,e,r,i,s,n,a,o,h,l,u,c){super(null,n,a,o,h,l,i,s,u,c),this.isCompressedTexture=!0,this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class i_ extends tr{constructor(t=[],e=301,r,i,s,n,a,o,h,l){super(t,e,r,i,s,n,a,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class iA extends tr{constructor(t,e,r=1014,i,s,n,a=1003,o=1003,h,l=1026,u=1){if(1026!==l&&1027!==l)throw Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},i,s,n,a,o,l,r,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new K(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return e.compareFunction=this.compareFunction,e}}class iT extends eP{constructor(t=1,e=1,r=1,i=1,s=1,n=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:s,depthSegments:n};const a=this;i=Math.floor(i),s=Math.floor(s);const o=[],h=[],l=[],u=[];let c=0,d=0;function p(t,e,r,i,s,n,p,f,m,y,g){let b=n/m,v=p/y,x=n/2,w=p/2,S=f/2,M=m+1,_=y+1,A=0,T=0,C=new U;for(let n=0;n<_;n++){let a=n*v-w;for(let o=0;o<M;o++){let c=o*b-x;C[t]=c*i,C[e]=a*s,C[r]=S,h.push(C.x,C.y,C.z),C[t]=0,C[e]=0,C[r]=f>0?1:-1,l.push(C.x,C.y,C.z),u.push(o/m),u.push(1-n/y),A+=1}}for(let t=0;t<y;t++)for(let e=0;e<m;e++){let r=c+e+M*t,i=c+e+M*(t+1),s=c+(e+1)+M*(t+1),n=c+(e+1)+M*t;o.push(r,i,n),o.push(i,s,n),T+=6}a.addGroup(d,T,g),d+=T,c+=A}p("z","y","x",-1,-1,r,e,t,n=Math.floor(n),s,0),p("z","y","x",1,-1,r,e,-t,n,s,1),p("x","z","y",1,1,t,r,e,i,n,2),p("x","z","y",1,-1,t,r,-e,i,n,3),p("x","y","z",1,-1,t,e,r,i,s,4),p("x","y","z",-1,-1,t,e,-r,i,s,5),this.setIndex(o),this.setAttribute("position",new ew(h,3)),this.setAttribute("normal",new ew(l,3)),this.setAttribute("uv",new ew(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iT(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}class iC extends eP{constructor(t=1,e=1,r=4,i=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:t,height:e,capSegments:r,radialSegments:i,heightSegments:s},e=Math.max(0,e),r=Math.max(1,Math.floor(r)),i=Math.max(3,Math.floor(i));const n=[],a=[],o=[],h=[],l=e/2,u=Math.PI/2*t,c=e,d=2*u+c,p=2*r+(s=Math.max(1,Math.floor(s))),f=i+1,m=new U,y=new U;for(let g=0;g<=p;g++){let b=0,v=0,x=0,w=0;if(g<=r){const e=g/r,i=e*Math.PI/2;v=-l-t*Math.cos(i),x=t*Math.sin(i),w=-t*Math.cos(i),b=e*u}else if(g<=r+s){const i=(g-r)/s;v=-l+i*e,x=t,w=0,b=u+i*c}else{const e=(g-r-s)/r,i=e*Math.PI/2;v=l+t*Math.sin(i),x=t*Math.cos(i),w=t*Math.sin(i),b=u+c+e*u}const S=Math.max(0,Math.min(1,b/d));let M=0;0===g?M=.5/i:g===p&&(M=-.5/i);for(let t=0;t<=i;t++){const e=t/i,r=e*Math.PI*2,s=Math.sin(r),n=Math.cos(r);y.x=-x*n,y.y=v,y.z=x*s,a.push(y.x,y.y,y.z),m.set(-x*n,w,x*s),m.normalize(),o.push(m.x,m.y,m.z),h.push(e+M,S)}if(g>0){const t=(g-1)*f;for(let e=0;e<i;e++){const r=t+e,i=t+e+1,s=g*f+e,a=g*f+e+1;n.push(r,i,s),n.push(i,a,s)}}}this.setIndex(n),this.setAttribute("position",new ew(a,3)),this.setAttribute("normal",new ew(o,3)),this.setAttribute("uv",new ew(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iC(t.radius,t.height,t.capSegments,t.radialSegments,t.heightSegments)}}class iE extends eP{constructor(t=1,e=32,r=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},e=Math.max(3,e);const s=[],n=[],a=[],o=[],h=new U,l=new F;n.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let s=0,u=3;s<=e;s++,u+=3){const c=r+s/e*i;h.x=t*Math.cos(c),h.y=t*Math.sin(c),n.push(h.x,h.y,h.z),a.push(0,0,1),l.x=(n[u]/t+1)/2,l.y=(n[u+1]/t+1)/2,o.push(l.x,l.y)}for(let t=1;t<=e;t++)s.push(t,t+1,0);this.setIndex(s),this.setAttribute("position",new ew(n,3)),this.setAttribute("normal",new ew(a,3)),this.setAttribute("uv",new ew(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iE(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class iR extends eP{constructor(t=1,e=1,r=1,i=32,s=1,n=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:i,heightSegments:s,openEnded:n,thetaStart:a,thetaLength:o};const h=this;i=Math.floor(i),s=Math.floor(s);const l=[],u=[],c=[],d=[];let p=0;const f=[],m=r/2;let y=0;function g(r){let s=p,n=new F,f=new U,g=0,b=!0===r?t:e,v=!0===r?1:-1;for(let t=1;t<=i;t++)u.push(0,m*v,0),c.push(0,v,0),d.push(.5,.5),p++;let x=p;for(let t=0;t<=i;t++){let e=t/i*o+a,r=Math.cos(e),s=Math.sin(e);f.x=b*s,f.y=m*v,f.z=b*r,u.push(f.x,f.y,f.z),c.push(0,v,0),n.x=.5*r+.5,n.y=.5*s*v+.5,d.push(n.x,n.y),p++}for(let t=0;t<i;t++){let e=s+t,i=x+t;!0===r?l.push(i,i+1,e):l.push(i+1,i,e),g+=3}h.addGroup(y,g,!0===r?1:2),y+=g}(function(){let n=new U,g=new U,b=0,v=(e-t)/r;for(let h=0;h<=s;h++){let l=[],y=h/s,b=y*(e-t)+t;for(let t=0;t<=i;t++){let e=t/i,s=e*o+a,h=Math.sin(s),f=Math.cos(s);g.x=b*h,g.y=-y*r+m,g.z=b*f,u.push(g.x,g.y,g.z),n.set(h,v,f).normalize(),c.push(n.x,n.y,n.z),d.push(e,1-y),l.push(p++)}f.push(l)}for(let r=0;r<i;r++)for(let i=0;i<s;i++){let n=f[i][r],a=f[i+1][r],o=f[i+1][r+1],h=f[i][r+1];(t>0||0!==i)&&(l.push(n,a,h),b+=3),(e>0||i!==s-1)&&(l.push(a,o,h),b+=3)}h.addGroup(y,b,0),y+=b})(),!1===n&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new ew(u,3)),this.setAttribute("normal",new ew(c,3)),this.setAttribute("uv",new ew(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iR(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class iO extends iR{constructor(t=1,e=1,r=32,i=1,s=!1,n=0,a=2*Math.PI){super(0,t,e,r,i,s,n,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:n,thetaLength:a}}static fromJSON(t){return new iO(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class iI extends eP{constructor(t=[],e=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i};const s=[],n=[];function a(t){s.push(t.x,t.y,t.z)}function o(e,r){let i=3*e;r.x=t[i+0],r.y=t[i+1],r.z=t[i+2]}function h(t,e,r,i){i<0&&1===t.x&&(n[e]=t.x-1),0===r.x&&0===r.z&&(n[e]=i/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}(function(t){let r=new U,i=new U,s=new U;for(let n=0;n<e.length;n+=3)o(e[n+0],r),o(e[n+1],i),o(e[n+2],s),function(t,e,r,i){let s=i+1,n=[];for(let i=0;i<=s;i++){n[i]=[];let a=t.clone().lerp(r,i/s),o=e.clone().lerp(r,i/s),h=s-i;for(let t=0;t<=h;t++)0===t&&i===s?n[i][t]=a:n[i][t]=a.clone().lerp(o,t/h)}for(let t=0;t<s;t++)for(let e=0;e<2*(s-t)-1;e++){let r=Math.floor(e/2);e%2==0?(a(n[t][r+1]),a(n[t+1][r]),a(n[t][r])):(a(n[t][r+1]),a(n[t+1][r+1]),a(n[t+1][r]))}}(r,i,s,t)})(i),function(t){let e=new U;for(let r=0;r<s.length;r+=3)e.x=s[r+0],e.y=s[r+1],e.z=s[r+2],e.normalize().multiplyScalar(t),s[r+0]=e.x,s[r+1]=e.y,s[r+2]=e.z}(r),function(){let t=new U;for(let r=0;r<s.length;r+=3){var e;t.x=s[r+0],t.y=s[r+1],t.z=s[r+2];let i=l(t)/2/Math.PI+.5,a=Math.atan2(-(e=t).y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;n.push(i,1-a)}(function(){let t=new U,e=new U,r=new U,i=new U,a=new F,o=new F,u=new F;for(let c=0,d=0;c<s.length;c+=9,d+=6){t.set(s[c+0],s[c+1],s[c+2]),e.set(s[c+3],s[c+4],s[c+5]),r.set(s[c+6],s[c+7],s[c+8]),a.set(n[d+0],n[d+1]),o.set(n[d+2],n[d+3]),u.set(n[d+4],n[d+5]),i.copy(t).add(e).add(r).divideScalar(3);let p=l(i);h(a,d+0,t,p),h(o,d+2,e,p),h(u,d+4,r,p)}})(),function(){for(let t=0;t<n.length;t+=6){let e=n[t+0],r=n[t+2],i=n[t+4],s=Math.max(e,r,i),a=Math.min(e,r,i);s>.9&&a<.1&&(e<.2&&(n[t+0]+=1),r<.2&&(n[t+2]+=1),i<.2&&(n[t+4]+=1))}}()}(),this.setAttribute("position",new ew(s,3)),this.setAttribute("normal",new ew(s.slice(),3)),this.setAttribute("uv",new ew(n,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new iI(t.vertices,t.indices,t.radius,t.detail)}}class ik extends iI{constructor(t=1,e=0){const 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],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new ik(t.radius,t.detail)}}let iP=new U,iB=new U,iL=new U,iz=new t6;class iN extends eP{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const r=Math.cos(O*e),i=t.getIndex(),s=t.getAttribute("position"),n=i?i.count:s.count,a=[0,0,0],o=["a","b","c"],h=[,,,],l={},u=[];for(let t=0;t<n;t+=3){i?(a[0]=i.getX(t),a[1]=i.getX(t+1),a[2]=i.getX(t+2)):(a[0]=t,a[1]=t+1,a[2]=t+2);const{a:e,b:n,c}=iz;if(e.fromBufferAttribute(s,a[0]),n.fromBufferAttribute(s,a[1]),c.fromBufferAttribute(s,a[2]),iz.getNormal(iL),h[0]=`${Math.round(1e4*e.x)},${Math.round(1e4*e.y)},${Math.round(1e4*e.z)}`,h[1]=`${Math.round(1e4*n.x)},${Math.round(1e4*n.y)},${Math.round(1e4*n.z)}`,h[2]=`${Math.round(1e4*c.x)},${Math.round(1e4*c.y)},${Math.round(1e4*c.z)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){const e=(t+1)%3,i=h[t],s=h[e],n=iz[o[t]],c=iz[o[e]],d=`${i}_${s}`,p=`${s}_${i}`;p in l&&l[p]?(iL.dot(l[p].normal)<=r&&(u.push(n.x,n.y,n.z),u.push(c.x,c.y,c.z)),l[p]=null):d in l||(l[d]={index0:a[t],index1:a[e],normal:iL.clone()})}}for(const t in l)if(l[t]){const{index0:e,index1:r}=l[t];iP.fromBufferAttribute(s,e),iB.fromBufferAttribute(s,r),u.push(iP.x,iP.y,iP.z),u.push(iB.x,iB.y,iB.z)}this.setAttribute("position",new ew(u,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class iF{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){_("Curve: .getPoint() not implemented.")}getPointAt(t,e){let r=this.getUtoTmapping(t);return this.getPoint(r,e)}getPoints(t=5){let e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}getSpacedPoints(t=5){let e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],r,i=this.getPoint(0),s=0;e.push(0);for(let n=1;n<=t;n++)e.push(s+=(r=this.getPoint(n/t)).distanceTo(i)),i=r;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){let r,i=this.getLengths(),s=0,n=i.length;r=e||t*i[n-1];let a=0,o=n-1,h;for(;a<=o;)if((h=i[s=Math.floor(a+(o-a)/2)]-r)<0)a=s+1;else if(h>0)o=s-1;else{o=s;break}if(i[s=o]===r)return s/(n-1);let l=i[s],u=i[s+1];return(s+(r-l)/(u-l))/(n-1)}getTangent(t,e){let r=t-1e-4,i=t+1e-4;r<0&&(r=0),i>1&&(i=1);let s=this.getPoint(r),n=this.getPoint(i),a=e||(s.isVector2?new F:new U);return a.copy(n).sub(s).normalize(),a}getTangentAt(t,e){let r=this.getUtoTmapping(t);return this.getTangent(r,e)}computeFrenetFrames(t,e=!1){let r=new U,i=[],s=[],n=[],a=new U,o=new th;for(let e=0;e<=t;e++){let r=e/t;i[e]=this.getTangentAt(r,new U)}s[0]=new U,n[0]=new U;let h=Number.MAX_VALUE,l=Math.abs(i[0].x),u=Math.abs(i[0].y),c=Math.abs(i[0].z);l<=h&&(h=l,r.set(1,0,0)),u<=h&&(h=u,r.set(0,1,0)),c<=h&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),n[0].crossVectors(i[0],s[0]);for(let e=1;e<=t;e++){if(s[e]=s[e-1].clone(),n[e]=n[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();let t=Math.acos(P(i[e-1].dot(i[e]),-1,1));s[e].applyMatrix4(o.makeRotationAxis(a,t))}n[e].crossVectors(i[e],s[e])}if(!0===e){let e=Math.acos(P(s[0].dot(s[t]),-1,1));e/=t,i[0].dot(a.crossVectors(s[0],s[t]))>0&&(e=-e);for(let r=1;r<=t;r++)s[r].applyMatrix4(o.makeRotationAxis(i[r],e*r)),n[r].crossVectors(i[r],s[r])}return{tangents:i,normals:s,binormals:n}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ij extends iF{constructor(t=0,e=0,r=1,i=1,s=0,n=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=n,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new F){let r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);let n=this.aStartAngle+t*i,a=this.aX+this.xRadius*Math.cos(n),o=this.aY+this.yRadius*Math.sin(n);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),r=a-this.aX,i=o-this.aY;a=r*t-i*e+this.aX,o=r*e+i*t+this.aY}return e.set(a,o)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class iU extends ij{constructor(t,e,r,i,s,n){super(t,e,r,r,i,s,n),this.isArcCurve=!0,this.type="ArcCurve"}}function iD(){let t=0,e=0,r=0,i=0;function s(s,n,a,o){t=s,e=a,r=-3*s+3*n-2*a-o,i=2*s-2*n+a+o}return{initCatmullRom:function(t,e,r,i,n){s(e,r,n*(r-t),n*(i-e))},initNonuniformCatmullRom:function(t,e,r,i,n,a,o){let h=(e-t)/n-(r-t)/(n+a)+(r-e)/a,l=(r-e)/a-(i-e)/(a+o)+(i-r)/o;s(e,r,h*=a,l*=a)},calc:function(s){let n=s*s;return t+e*s+r*n+n*s*i}}}let iV=new U,iW=new U,iq=new iD,iG=new iD,iH=new iD;class iJ extends iF{constructor(t=[],e=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=r,this.tension=i}getPoint(t,e=new U){let r,i,s=this.points,n=s.length,a=(n-!this.closed)*t,o=Math.floor(a),h=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/n)+1)*n:0===h&&o===n-1&&(o=n-2,h=1),this.closed||o>0?r=s[(o-1)%n]:(iW.subVectors(s[0],s[1]).add(s[0]),r=iW);let l=s[o%n],u=s[(o+1)%n];if(this.closed||o+2<n?i=s[(o+2)%n]:(iV.subVectors(s[n-1],s[n-2]).add(s[n-1]),i=iV),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(r.distanceToSquared(l),t),s=Math.pow(l.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(i),t);s<1e-4&&(s=1),e<1e-4&&(e=s),n<1e-4&&(n=s),iq.initNonuniformCatmullRom(r.x,l.x,u.x,i.x,e,s,n),iG.initNonuniformCatmullRom(r.y,l.y,u.y,i.y,e,s,n),iH.initNonuniformCatmullRom(r.z,l.z,u.z,i.z,e,s,n)}else"catmullrom"===this.curveType&&(iq.initCatmullRom(r.x,l.x,u.x,i.x,this.tension),iG.initCatmullRom(r.y,l.y,u.y,i.y,this.tension),iH.initCatmullRom(r.z,l.z,u.z,i.z,this.tension));return e.set(iq.calc(h),iG.calc(h),iH.calc(h)),e}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,r=this.points.length;e<r;e++){let r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(new U().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function i$(t,e,r,i,s){let n=(i-e)*.5,a=(s-r)*.5,o=t*t;return t*o*(2*r-2*i+n+a)+(-3*r+3*i-2*n-a)*o+n*t+r}function iY(t,e,r,i){let s;return(s=1-t)*s*e+2*(1-t)*t*r+t*t*i}function iX(t,e,r,i,s){let n,a;return(n=1-t)*n*n*e+3*(a=1-t)*a*t*r+3*(1-t)*t*t*i+t*t*t*s}class iZ extends iF{constructor(t=new F,e=new F,r=new F,i=new F){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=r,this.v3=i}getPoint(t,e=new F){let r=this.v0,i=this.v1,s=this.v2,n=this.v3;return e.set(iX(t,r.x,i.x,s.x,n.x),iX(t,r.y,i.y,s.y,n.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class iK extends iF{constructor(t=new U,e=new U,r=new U,i=new U){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=r,this.v3=i}getPoint(t,e=new U){let r=this.v0,i=this.v1,s=this.v2,n=this.v3;return e.set(iX(t,r.x,i.x,s.x,n.x),iX(t,r.y,i.y,s.y,n.y),iX(t,r.z,i.z,s.z,n.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class iQ extends iF{constructor(t=new F,e=new F){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new F){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new F){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i0 extends iF{constructor(t=new U,e=new U){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new U){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new U){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i1 extends iF{constructor(t=new F,e=new F,r=new F){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=r}getPoint(t,e=new F){let r=this.v0,i=this.v1,s=this.v2;return e.set(iY(t,r.x,i.x,s.x),iY(t,r.y,i.y,s.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i2 extends iF{constructor(t=new U,e=new U,r=new U){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=r}getPoint(t,e=new U){let r=this.v0,i=this.v1,s=this.v2;return e.set(iY(t,r.x,i.x,s.x),iY(t,r.y,i.y,s.y),iY(t,r.z,i.z,s.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class i3 extends iF{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new F){let r=this.points,i=(r.length-1)*t,s=Math.floor(i),n=i-s,a=r[0===s?s:s-1],o=r[s],h=r[s>r.length-2?r.length-1:s+1],l=r[s>r.length-3?r.length-1:s+2];return e.set(i$(n,a.x,o.x,h.x,l.x),i$(n,a.y,o.y,h.y,l.y)),e}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(r.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,r=this.points.length;e<r;e++){let r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++){let r=t.points[e];this.points.push(new F().fromArray(r))}return this}}var i5=Object.freeze({__proto__:null,ArcCurve:iU,CatmullRomCurve3:iJ,CubicBezierCurve:iZ,CubicBezierCurve3:iK,EllipseCurve:ij,LineCurve:iQ,LineCurve3:i0,QuadraticBezierCurve:i1,QuadraticBezierCurve3:i2,SplineCurve:i3});class i4 extends iF{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let r=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new i5[r](e,t))}return this}getPoint(t,e){let r=t*this.getLength(),i=this.getCurveLengths(),s=0;for(;s<i.length;){if(i[s]>=r){let t=i[s]-r,n=this.curves[s],a=n.getLength(),o=0===a?0:1-t/a;return n.getPointAt(o,e)}s++}return null}getLength(){let t=this.getCurveLengths();return t[t.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 t=[],e=0;for(let r=0,i=this.curves.length;r<i;r++)t.push(e+=this.curves[r].getLength());return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e,r=[];for(let i=0,s=this.curves;i<s.length;i++){let n=s[i],a=n.isEllipseCurve?2*t:n.isLineCurve||n.isLineCurve3?1:n.isSplineCurve?t*n.points.length:t,o=n.getPoints(a);for(let t=0;t<o.length;t++){let i=o[t];e&&e.equals(i)||(r.push(i),e=i)}}return this.autoClose&&r.length>1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e<r;e++){let r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,r=this.curves.length;e<r;e++){let r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,r=t.curves.length;e<r;e++){let r=t.curves[e];this.curves.push(new i5[r.type]().fromJSON(r))}return this}}class i6 extends i4{constructor(t){super(),this.type="Path",this.currentPoint=new F,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let r=new iQ(this.currentPoint.clone(),new F(t,e));return this.curves.push(r),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,r,i){let s=new i1(this.currentPoint.clone(),new F(t,e),new F(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}bezierCurveTo(t,e,r,i,s,n){let a=new iZ(this.currentPoint.clone(),new F(t,e),new F(r,i),new F(s,n));return this.curves.push(a),this.currentPoint.set(s,n),this}splineThru(t){let e=new i3([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,r,i,s,n){let a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,r,i,s,n),this}absarc(t,e,r,i,s,n){return this.absellipse(t,e,r,r,i,s,n),this}ellipse(t,e,r,i,s,n,a,o){let h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,r,i,s,n,a,o),this}absellipse(t,e,r,i,s,n,a,o){let h=new ij(t,e,r,i,s,n,a,o);if(this.curves.length>0){let t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);let l=h.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class i8 extends i6{constructor(t){super(t),this.uuid=k(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let r=0,i=this.holes.length;r<i;r++)e[r]=this.holes[r].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,r=t.holes.length;e<r;e++){let r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,r=this.holes.length;e<r;e++){let r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,r=t.holes.length;e<r;e++){let r=t.holes[e];this.holes.push(new i6().fromJSON(r))}return this}}function i9(t,e,r,i,s){let n;if(s===function(t,e,r,i){let s=0;for(let n=e,a=r-i;n<r;n+=i)s+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return s}(t,e,r,i)>0)for(let s=e;s<r;s+=i)n=sc(s/i|0,t[s],t[s+1],n);else for(let s=r-i;s>=e;s-=i)n=sc(s/i|0,t[s],t[s+1],n);return n&&sn(n,n.next)&&(sd(n),n=n.next),n}function i7(t,e){if(!t)return t;e||(e=t);let r=t,i;do if(i=!1,!r.steiner&&(sn(r,r.next)||0===ss(r.prev,r,r.next))){if(sd(r),(r=e=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==e)return e}function st(t,e){let r=t.x-e.x;return 0===r&&0==(r=t.y-e.y)&&(r=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),r}function se(t,e,r,i,s){return(t=((t=((t=((t=((t=(t-r)*s|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(e=((e=((e=((e=((e=(e-i)*s|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)<<1}function sr(t,e,r,i,s,n,a,o){return(s-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(i-o)>=(r-a)*(e-o)&&(r-a)*(n-o)>=(s-a)*(i-o)}function si(t,e,r,i,s,n,a,o){return(t!==a||e!==o)&&sr(t,e,r,i,s,n,a,o)}function ss(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function sn(t,e){return t.x===e.x&&t.y===e.y}function sa(t,e,r,i){let s=sh(ss(t,e,r)),n=sh(ss(t,e,i)),a=sh(ss(r,i,t)),o=sh(ss(r,i,e));return!!(s!==n&&a!==o||0===s&&so(t,r,e)||0===n&&so(t,i,e)||0===a&&so(r,t,i)||0===o&&so(r,e,i))}function so(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function sh(t){return t>0?1:t<0?-1:0}function sl(t,e){return 0>ss(t.prev,t,t.next)?ss(t,e,t.next)>=0&&ss(t,t.prev,e)>=0:0>ss(t,e,t.prev)||0>ss(t,t.next,e)}function su(t,e){let r=sp(t.i,t.x,t.y),i=sp(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=s,s.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function sc(t,e,r,i){let s=sp(t,e,r);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function sd(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sp(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class sf{static triangulate(t,e,r=2){return function(t,e,r=2){let i,s,n,a=e&&e.length,o=a?e[0]*r:t.length,h=i9(t,0,o,r,!0),l=[];if(!h||h.next===h.prev)return l;if(a&&(h=function(t,e,r,i){let s=[];for(let r=0,n=e.length;r<n;r++){let a=e[r]*i,o=r<n-1?e[r+1]*i:t.length,h=i9(t,a,o,i,!1);h===h.next&&(h.steiner=!0),s.push(function(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t)return r}(h))}s.sort(st);for(let t=0;t<s.length;t++)r=function(t,e){let r=function(t,e){let r,i=e,s=t.x,n=t.y,a=-1/0;if(sn(t,i))return i;do{if(sn(t,i.next))return i.next;if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){let t=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>a&&(a=t,r=i.x<i.next.x?i:i.next,t===s))return r}i=i.next}while(i!==e)if(!r)return null;let o=r,h=r.x,l=r.y,u=1/0;i=r;do{if(s>=i.x&&i.x>=h&&s!==i.x&&sr(n<l?s:a,n,h,l,n<l?a:s,n,i.x,i.y)){var c,d;let e=Math.abs(n-i.y)/(s-i.x);sl(i,t)&&(e<u||e===u&&(i.x>r.x||i.x===r.x&&(c=r,d=i,0>ss(c.prev,c,d.prev)&&0>ss(d.next,c,c.next))))&&(r=i,u=e)}i=i.next}while(i!==o)return r}(t,e);if(!r)return e;let i=su(r,t);return i7(i,i.next),i7(r,r.next)}(s[t],r);return r}(t,e,h,r)),t.length>80*r){i=t[0],s=t[1];let e=i,a=s;for(let n=r;n<o;n+=r){let r=t[n],o=t[n+1];r<i&&(i=r),o<s&&(s=o),r>e&&(e=r),o>a&&(a=o)}n=0!==(n=Math.max(e-i,a-s))?32767/n:0}return function t(e,r,i,s,n,a,o){if(!e)return;!o&&a&&function(t,e,r,i){let s=t;do 0===s.z&&(s.z=se(s.x,s.y,e,r,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==t)s.prevZ.nextZ=null,s.prevZ=null,function(t){let e,r=1;do{let i,s=t;t=null;let n=null;for(e=0;s;){e++;let a=s,o=0;for(let t=0;t<r&&(o++,a=a.nextZ);t++);let h=r;for(;o>0||h>0&&a;)0!==o&&(0===h||!a||s.z<=a.z)?(i=s,s=s.nextZ,o--):(i=a,a=a.nextZ,h--),n?n.nextZ=i:t=i,i.prevZ=n,n=i;s=a}n.nextZ=null,r*=2}while(e>1)}(s)}(e,s,n,a);let h=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(a?function(t,e,r,i){let s=t.prev,n=t.next;if(ss(s,t,n)>=0)return!1;let a=s.x,o=t.x,h=n.x,l=s.y,u=t.y,c=n.y,d=Math.min(a,o,h),p=Math.min(l,u,c),f=Math.max(a,o,h),m=Math.max(l,u,c),y=se(d,p,e,r,i),g=se(f,m,e,r,i),b=t.prevZ,v=t.nextZ;for(;b&&b.z>=y&&v&&v.z<=g;){if(b.x>=d&&b.x<=f&&b.y>=p&&b.y<=m&&b!==s&&b!==n&&si(a,l,o,u,h,c,b.x,b.y)&&ss(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==s&&v!==n&&si(a,l,o,u,h,c,v.x,v.y)&&ss(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=y;){if(b.x>=d&&b.x<=f&&b.y>=p&&b.y<=m&&b!==s&&b!==n&&si(a,l,o,u,h,c,b.x,b.y)&&ss(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==s&&v!==n&&si(a,l,o,u,h,c,v.x,v.y)&&ss(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}(e,s,n,a):function(t){let e=t.prev,r=t.next;if(ss(e,t,r)>=0)return!1;let i=e.x,s=t.x,n=r.x,a=e.y,o=t.y,h=r.y,l=Math.min(i,s,n),u=Math.min(a,o,h),c=Math.max(i,s,n),d=Math.max(a,o,h),p=r.next;for(;p!==e;){if(p.x>=l&&p.x<=c&&p.y>=u&&p.y<=d&&si(i,a,s,o,n,h,p.x,p.y)&&ss(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(e)){r.push(l.i,e.i,u.i),sd(e),e=u.next,h=u.next;continue}if((e=u)===h){o?1===o?t(e=function(t,e){let r=t;do{let i=r.prev,s=r.next.next;!sn(i,s)&&sa(i,r,r.next,s)&&sl(i,s)&&sl(s,i)&&(e.push(i.i,r.i,s.i),sd(r),sd(r.next),r=t=s),r=r.next}while(r!==t)return i7(r)}(i7(e),r),r,i,s,n,a,2):2===o&&function(e,r,i,s,n,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var h,l;if(o.i!==e.i&&(h=o,l=e,h.next.i!==l.i&&h.prev.i!==l.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&sa(r,r.next,t,e))return!0;r=r.next}while(r!==t)return!1}(h,l)&&(sl(h,l)&&sl(l,h)&&function(t,e){let r=t,i=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do r.y>n!=r.next.y>n&&r.next.y!==r.y&&s<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t)return i}(h,l)&&(ss(h.prev,h,l.prev)||ss(h,l.prev,l))||sn(h,l)&&ss(h.prev,h,h.next)>0&&ss(l.prev,l,l.next)>0))){let h=su(o,e);o=i7(o,o.next),h=i7(h,h.next),t(o,r,i,s,n,a,0),t(h,r,i,s,n,a,0);return}e=e.next}o=o.next}while(o!==e)}(e,r,i,s,n,a):t(i7(e),r,i,s,n,a,1);break}}}(h,l,r,i,s,n,0),l}(t,e,r)}}class sm{static area(t){let e=t.length,r=0;for(let i=e-1,s=0;s<e;i=s++)r+=t[i].x*t[s].y-t[s].x*t[i].y;return .5*r}static isClockWise(t){return 0>sm.area(t)}static triangulateShape(t,e){let r=[],i=[],s=[];sy(t),sg(r,t);let n=t.length;e.forEach(sy);for(let t=0;t<e.length;t++)i.push(n),n+=e[t].length,sg(r,e[t]);let a=sf.triangulate(r,i);for(let t=0;t<a.length;t+=3)s.push(a.slice(t,t+3));return s}}function sy(t){let e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function sg(t,e){for(let r=0;r<e.length;r++)t.push(e[r].x),t.push(e[r].y)}class sb extends eP{constructor(t=new i8([new F(.5,.5),new F(-.5,.5),new F(-.5,-.5),new F(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const r=this,i=[],s=[];for(let n=0,a=t.length;n<a;n++)!function(t){let n,a,o,h,l,u=[],c=void 0!==e.curveSegments?e.curveSegments:12,d=void 0!==e.steps?e.steps:1,p=void 0!==e.depth?e.depth:1,f=void 0===e.bevelEnabled||e.bevelEnabled,m=void 0!==e.bevelThickness?e.bevelThickness:.2,y=void 0!==e.bevelSize?e.bevelSize:m-.1,g=void 0!==e.bevelOffset?e.bevelOffset:0,b=void 0!==e.bevelSegments?e.bevelSegments:3,v=e.extrudePath,x=void 0!==e.UVGenerator?e.UVGenerator:sv,w,S=!1;if(v){w=v.getSpacedPoints(d),S=!0,f=!1;let t=!!v.isCatmullRomCurve3&&v.closed;n=v.computeFrenetFrames(d,t),a=new U,o=new U,h=new U}f||(b=0,m=0,y=0,g=0);let M=t.extractPoints(c),_=M.shape,T=M.holes;if(!sm.isClockWise(_)){_=_.reverse();for(let t=0,e=T.length;t<e;t++){let e=T[t];sm.isClockWise(e)&&(T[t]=e.reverse())}}function C(t){let e=1e-10*1e-10,r=t[0];for(let i=1;i<=t.length;i++){let s=i%t.length,n=t[s],a=n.x-r.x,o=n.y-r.y,h=a*a+o*o,l=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(r.x),Math.abs(r.y));if(h<=e*l*l){t.splice(s,1),i--;continue}r=n}}C(_),T.forEach(C);let E=T.length,R=_;for(let t=0;t<E;t++){let e=T[t];_=_.concat(e)}function O(t,e,r){return e||A("ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,r)}let I=_.length;function k(t,e,r){let i,s,n,a=t.x-e.x,o=t.y-e.y,h=r.x-t.x,l=r.y-t.y,u=a*a+o*o;if(Math.abs(a*l-o*h)>Number.EPSILON){let c=Math.sqrt(u),d=Math.sqrt(h*h+l*l),p=e.x-o/c,f=e.y+a/c,m=((r.x-l/d-p)*l-(r.y+h/d-f)*h)/(a*l-o*h),y=(i=p+a*m-t.x)*i+(s=f+o*m-t.y)*s;if(y<=2)return new F(i,s);n=Math.sqrt(y/2)}else{let t=!1;a>Number.EPSILON?h>Number.EPSILON&&(t=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(l)&&(t=!0),t?(i=-o,s=a,n=Math.sqrt(u)):(i=a,s=o,n=Math.sqrt(u/2))}return new F(i/n,s/n)}let P=[];for(let t=0,e=R.length,r=e-1,i=t+1;t<e;t++,r++,i++)r===e&&(r=0),i===e&&(i=0),P[t]=k(R[t],R[r],R[i]);let B=[],L,z=P.concat();for(let t=0;t<E;t++){let e=T[t];L=[];for(let t=0,r=e.length,i=r-1,s=t+1;t<r;t++,i++,s++)i===r&&(i=0),s===r&&(s=0),L[t]=k(e[t],e[i],e[s]);B.push(L),z=z.concat(L)}if(0===b)l=sm.triangulateShape(R,T);else{let t=[],e=[];for(let r=0;r<b;r++){let i=r/b,s=m*Math.cos(i*Math.PI/2),n=y*Math.sin(i*Math.PI/2)+g;for(let e=0,r=R.length;e<r;e++){let r=O(R[e],P[e],n);V(r.x,r.y,-s),0===i&&t.push(r)}for(let t=0;t<E;t++){let r=T[t];L=B[t];let a=[];for(let t=0,e=r.length;t<e;t++){let e=O(r[t],L[t],n);V(e.x,e.y,-s),0===i&&a.push(e)}0===i&&e.push(a)}}l=sm.triangulateShape(t,e)}let N=l.length,j=y+g;for(let t=0;t<I;t++){let e=f?O(_[t],z[t],j):_[t];S?(o.copy(n.normals[0]).multiplyScalar(e.x),a.copy(n.binormals[0]).multiplyScalar(e.y),h.copy(w[0]).add(o).add(a),V(h.x,h.y,h.z)):V(e.x,e.y,0)}for(let t=1;t<=d;t++)for(let e=0;e<I;e++){let r=f?O(_[e],z[e],j):_[e];S?(o.copy(n.normals[t]).multiplyScalar(r.x),a.copy(n.binormals[t]).multiplyScalar(r.y),h.copy(w[t]).add(o).add(a),V(h.x,h.y,h.z)):V(r.x,r.y,p/d*t)}for(let t=b-1;t>=0;t--){let e=t/b,r=m*Math.cos(e*Math.PI/2),i=y*Math.sin(e*Math.PI/2)+g;for(let t=0,e=R.length;t<e;t++){let e=O(R[t],P[t],i);V(e.x,e.y,p+r)}for(let t=0,e=T.length;t<e;t++){let e=T[t];L=B[t];for(let t=0,s=e.length;t<s;t++){let s=O(e[t],L[t],i);S?V(s.x,s.y+w[d-1].y,w[d-1].x+r):V(s.x,s.y,p+r)}}}function D(t,e){let s=t.length;for(;--s>=0;){let n=s,a=s-1;a<0&&(a=t.length-1);for(let t=0,s=d+2*b;t<s;t++){let s=I*t,o=I*(t+1);!function(t,e,s,n){q(t),q(e),q(n),q(e),q(s),q(n);let a=i.length/3,o=x.generateSideWallUV(r,i,a-6,a-3,a-2,a-1);G(o[0]),G(o[1]),G(o[3]),G(o[1]),G(o[2]),G(o[3])}(e+n+s,e+a+s,e+a+o,e+n+o)}}}function V(t,e,r){u.push(t),u.push(e),u.push(r)}function W(t,e,s){q(t),q(e),q(s);let n=i.length/3,a=x.generateTopUV(r,i,n-3,n-2,n-1);G(a[0]),G(a[1]),G(a[2])}function q(t){i.push(u[3*t+0]),i.push(u[3*t+1]),i.push(u[3*t+2])}function G(t){s.push(t.x),s.push(t.y)}(function(){let t=i.length/3;if(f){let t=0*I;for(let e=0;e<N;e++){let r=l[e];W(r[2]+t,r[1]+t,r[0]+t)}t=I*(d+2*b);for(let e=0;e<N;e++){let r=l[e];W(r[0]+t,r[1]+t,r[2]+t)}}else{for(let t=0;t<N;t++){let e=l[t];W(e[2],e[1],e[0])}for(let t=0;t<N;t++){let e=l[t];W(e[0]+I*d,e[1]+I*d,e[2]+I*d)}}r.addGroup(t,i.length/3-t,0)})(),function(){let t=i.length/3,e=0;D(R,0),e+=R.length;for(let t=0,r=T.length;t<r;t++){let r=T[t];D(r,e),e+=r.length}r.addGroup(t,i.length/3-t,1)}()}(t[n]);this.setAttribute("position",new ew(i,3)),this.setAttribute("uv",new ew(s,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e,r){if(r.shapes=[],Array.isArray(t))for(let e=0,i=t.length;e<i;e++){let i=t[e];r.shapes.push(i.uuid)}else r.shapes.push(t.uuid);return r.options=Object.assign({},e),void 0!==e.extrudePath&&(r.options.extrudePath=e.extrudePath.toJSON()),r}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){let r=[];for(let i=0,s=t.shapes.length;i<s;i++){let s=e[t.shapes[i]];r.push(s)}let i=t.options.extrudePath;return void 0!==i&&(t.options.extrudePath=new i5[i.type]().fromJSON(i)),new sb(r,t.options)}}let sv={generateTopUV:function(t,e,r,i,s){let n=e[3*r],a=e[3*r+1],o=e[3*i],h=e[3*i+1],l=e[3*s],u=e[3*s+1];return[new F(n,a),new F(o,h),new F(l,u)]},generateSideWallUV:function(t,e,r,i,s,n){let a=e[3*r],o=e[3*r+1],h=e[3*r+2],l=e[3*i],u=e[3*i+1],c=e[3*i+2],d=e[3*s],p=e[3*s+1],f=e[3*s+2],m=e[3*n],y=e[3*n+1],g=e[3*n+2];return Math.abs(o-u)<Math.abs(a-l)?[new F(a,1-h),new F(l,1-c),new F(d,1-f),new F(m,1-g)]:[new F(o,1-h),new F(u,1-c),new F(p,1-f),new F(y,1-g)]}};class sx extends iI{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2;super([-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new sx(t.radius,t.detail)}}class sw extends eP{constructor(t=[new F(0,-.5),new F(.5,0),new F(0,.5)],e=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e),i=P(i,0,2*Math.PI);const s=[],n=[],a=[],o=[],h=[],l=1/e,u=new U,c=new F,d=new U,p=new U,f=new U;let m=0,y=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,d.x=+(y=t[e+1].y-t[e].y),d.y=-m,d.z=0*y,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,d.x=+(y=t[e+1].y-t[e].y),d.y=-m,d.z=0*y,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let s=0;s<=e;s++){const d=r+s*l*i,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=t.length-1;r++){u.x=t[r].x*p,u.y=t[r].y,u.z=t[r].x*f,n.push(u.x,u.y,u.z),c.x=s/e,c.y=r/(t.length-1),a.push(c.x,c.y);const i=o[3*r+0]*p,l=o[3*r+1],d=o[3*r+0]*f;h.push(i,l,d)}}for(let r=0;r<e;r++)for(let e=0;e<t.length-1;e++){const i=e+r*t.length,n=i+t.length,a=i+t.length+1,o=i+1;s.push(i,n,o),s.push(a,o,n)}this.setIndex(s),this.setAttribute("position",new ew(n,3)),this.setAttribute("uv",new ew(a,2)),this.setAttribute("normal",new ew(h,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sw(t.points,t.segments,t.phiStart,t.phiLength)}}class sS extends iI{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new sS(t.radius,t.detail)}}class sM extends eP{constructor(t=1,e=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i};const s=t/2,n=e/2,a=Math.floor(r),o=Math.floor(i),h=a+1,l=o+1,u=t/a,c=e/o,d=[],p=[],f=[],m=[];for(let t=0;t<l;t++){const e=t*c-n;for(let r=0;r<h;r++){const i=r*u-s;p.push(i,-e,0),f.push(0,0,1),m.push(r/a),m.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){const r=e+h*t,i=e+h*(t+1),s=e+1+h*(t+1),n=e+1+h*t;d.push(r,i,n),d.push(i,s,n)}this.setIndex(d),this.setAttribute("position",new ew(p,3)),this.setAttribute("normal",new ew(f,3)),this.setAttribute("uv",new ew(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sM(t.width,t.height,t.widthSegments,t.heightSegments)}}class s_ extends eP{constructor(t=.5,e=1,r=32,i=1,s=0,n=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:i,thetaStart:s,thetaLength:n},r=Math.max(3,r);const a=[],o=[],h=[],l=[];let u=t;const c=(e-t)/(i=Math.max(1,i)),d=new U,p=new F;for(let t=0;t<=i;t++){for(let t=0;t<=r;t++){const i=s+t/r*n;d.x=u*Math.cos(i),d.y=u*Math.sin(i),o.push(d.x,d.y,d.z),h.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,l.push(p.x,p.y)}u+=c}for(let t=0;t<i;t++){const e=t*(r+1);for(let t=0;t<r;t++){const i=t+e,s=i+r+1,n=i+r+2,o=i+1;a.push(i,s,o),a.push(s,n,o)}}this.setIndex(a),this.setAttribute("position",new ew(o,3)),this.setAttribute("normal",new ew(h,3)),this.setAttribute("uv",new ew(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new s_(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class sA extends eP{constructor(t=new i8([new F(0,.5),new F(-.5,-.5),new F(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const r=[],i=[],s=[],n=[];let a=0,o=0;if(!1===Array.isArray(t))h(t);else for(let e=0;e<t.length;e++)h(t[e]),this.addGroup(a,o,e),a+=o,o=0;function h(t){let a=i.length/3,h=t.extractPoints(e),l=h.shape,u=h.holes;!1===sm.isClockWise(l)&&(l=l.reverse());for(let t=0,e=u.length;t<e;t++){let e=u[t];!0===sm.isClockWise(e)&&(u[t]=e.reverse())}let c=sm.triangulateShape(l,u);for(let t=0,e=u.length;t<e;t++){let e=u[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){let e=l[t];i.push(e.x,e.y,0),s.push(0,0,1),n.push(e.x,e.y)}for(let t=0,e=c.length;t<e;t++){let e=c[t],i=e[0]+a,s=e[1]+a,n=e[2]+a;r.push(i,s,n),o+=3}}this.setIndex(r),this.setAttribute("position",new ew(i,3)),this.setAttribute("normal",new ew(s,3)),this.setAttribute("uv",new ew(n,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let r=0,i=t.length;r<i;r++){let i=t[r];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){let r=[];for(let i=0,s=t.shapes.length;i<s;i++){let s=e[t.shapes[i]];r.push(s)}return new sA(r,t.curveSegments)}}class sT extends eP{constructor(t=1,e=32,r=16,i=0,s=2*Math.PI,n=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:s,thetaStart:n,thetaLength:a},e=Math.max(3,Math.floor(e)),r=Math.max(2,Math.floor(r));const o=Math.min(n+a,Math.PI);let h=0;const l=[],u=new U,c=new U,d=[],p=[],f=[],m=[];for(let d=0;d<=r;d++){const y=[],g=d/r,b=t*Math.cos(n+g*a),v=Math.sqrt(t*t-b*b);let x=0;0===d&&0===n?x=.5/e:d===r&&o===Math.PI&&(x=-.5/e);for(let t=0;t<=e;t++){const r=t/e,n=i+r*s;u.x=-v*Math.cos(n),u.y=b,u.z=v*Math.sin(n),p.push(u.x,u.y,u.z),c.copy(u).normalize(),f.push(c.x,c.y,c.z),m.push(r+x,1-g),y.push(h++)}l.push(y)}for(let t=0;t<r;t++)for(let i=0;i<e;i++){const e=l[t][i+1],s=l[t][i],a=l[t+1][i],h=l[t+1][i+1];(0!==t||n>0)&&d.push(e,s,h),(t!==r-1||o<Math.PI)&&d.push(s,a,h)}this.setIndex(d),this.setAttribute("position",new ew(p,3)),this.setAttribute("normal",new ew(f,3)),this.setAttribute("uv",new ew(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sT(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class sC extends iI{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new sC(t.radius,t.detail)}}class sE extends eP{constructor(t=1,e=.4,r=12,i=48,s=2*Math.PI,n=0,a=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,arc:s,thetaStart:n,thetaLength:a},r=Math.floor(r),i=Math.floor(i);const o=[],h=[],l=[],u=[],c=new U,d=new U,p=new U;for(let o=0;o<=r;o++){const f=n+o/r*a;for(let n=0;n<=i;n++){const a=n/i*s;d.x=(t+e*Math.cos(f))*Math.cos(a),d.y=(t+e*Math.cos(f))*Math.sin(a),d.z=e*Math.sin(f),h.push(d.x,d.y,d.z),c.x=t*Math.cos(a),c.y=t*Math.sin(a),p.subVectors(d,c).normalize(),l.push(p.x,p.y,p.z),u.push(n/i),u.push(o/r)}}for(let t=1;t<=r;t++)for(let e=1;e<=i;e++){const r=(i+1)*t+e-1,s=(i+1)*(t-1)+e-1,n=(i+1)*(t-1)+e,a=(i+1)*t+e;o.push(r,s,a),o.push(s,n,a)}this.setIndex(o),this.setAttribute("position",new ew(h,3)),this.setAttribute("normal",new ew(l,3)),this.setAttribute("uv",new ew(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sE(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc,t.thetaStart,t.thetaLength)}}class sR extends eP{constructor(t=1,e=.4,r=64,i=8,s=2,n=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:i,p:s,q:n},r=Math.floor(r),i=Math.floor(i);const a=[],o=[],h=[],l=[],u=new U,c=new U,d=new U,p=new U,f=new U,m=new U,y=new U;for(let a=0;a<=r;++a){const b=a/r*s*Math.PI*2;g(b,s,n,t,d),g(b+.01,s,n,t,p),m.subVectors(p,d),y.addVectors(p,d),f.crossVectors(m,y),y.crossVectors(f,m),f.normalize(),y.normalize();for(let t=0;t<=i;++t){const s=t/i*Math.PI*2,n=-e*Math.cos(s),p=e*Math.sin(s);u.x=d.x+(n*y.x+p*f.x),u.y=d.y+(n*y.y+p*f.y),u.z=d.z+(n*y.z+p*f.z),o.push(u.x,u.y,u.z),c.subVectors(u,d).normalize(),h.push(c.x,c.y,c.z),l.push(a/r),l.push(t/i)}}for(let t=1;t<=r;t++)for(let e=1;e<=i;e++){const r=(i+1)*(t-1)+(e-1),s=(i+1)*t+(e-1),n=(i+1)*t+e,o=(i+1)*(t-1)+e;a.push(r,s,o),a.push(s,n,o)}function g(t,e,r,i,s){let n=Math.cos(t),a=Math.sin(t),o=r/e*t,h=Math.cos(o);s.x=i*(2+h)*.5*n,s.y=i*(2+h)*a*.5,s.z=i*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new ew(o,3)),this.setAttribute("normal",new ew(h,3)),this.setAttribute("uv",new ew(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sR(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class sO extends eP{constructor(t=new i2(new U(-1,-1,0),new U(-1,1,0),new U(1,1,0)),e=64,r=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:i,closed:s};const n=t.computeFrenetFrames(e,s);this.tangents=n.tangents,this.normals=n.normals,this.binormals=n.binormals;const a=new U,o=new U,h=new F;let l=new U;const u=[],c=[],d=[],p=[];function f(s){l=t.getPointAt(s/e,l);let h=n.normals[s],d=n.binormals[s];for(let t=0;t<=i;t++){let e=t/i*Math.PI*2,s=Math.sin(e),n=-Math.cos(e);o.x=n*h.x+s*d.x,o.y=n*h.y+s*d.y,o.z=n*h.z+s*d.z,o.normalize(),c.push(o.x,o.y,o.z),a.x=l.x+r*o.x,a.y=l.y+r*o.y,a.z=l.z+r*o.z,u.push(a.x,a.y,a.z)}}(function(){for(let t=0;t<e;t++)f(t);f(!1===s?e:0),function(){for(let t=0;t<=e;t++)for(let r=0;r<=i;r++)h.x=t/e,h.y=r/i,d.push(h.x,h.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){let r=(i+1)*(t-1)+(e-1),s=(i+1)*t+(e-1),n=(i+1)*t+e,a=(i+1)*(t-1)+e;p.push(r,s,a),p.push(s,n,a)}}()})(),this.setIndex(p),this.setAttribute("position",new ew(u,3)),this.setAttribute("normal",new ew(c,3)),this.setAttribute("uv",new ew(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new sO(new i5[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class sI extends eP{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],r=new Set,i=new U,s=new U;if(null!==t.index){const n=t.attributes.position,a=t.index;let o=t.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let t=0,h=o.length;t<h;++t){const h=o[t],l=h.start,u=h.count;for(let t=l,o=l+u;t<o;t+=3)for(let o=0;o<3;o++){const h=a.getX(t+o),l=a.getX(t+(o+1)%3);i.fromBufferAttribute(n,h),s.fromBufferAttribute(n,l),!0===sk(i,s,r)&&(e.push(i.x,i.y,i.z),e.push(s.x,s.y,s.z))}}}else{const n=t.attributes.position;for(let t=0,a=n.count/3;t<a;t++)for(let a=0;a<3;a++){const o=3*t+a,h=3*t+(a+1)%3;i.fromBufferAttribute(n,o),s.fromBufferAttribute(n,h),!0===sk(i,s,r)&&(e.push(i.x,i.y,i.z),e.push(s.x,s.y,s.z))}}this.setAttribute("position",new ew(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function sk(t,e,r){let i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,s=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==r.has(i)&&!0!==r.has(s)&&(r.add(i),r.add(s),!0)}var sP=Object.freeze({__proto__:null,BoxGeometry:iT,CapsuleGeometry:iC,CircleGeometry:iE,ConeGeometry:iO,CylinderGeometry:iR,DodecahedronGeometry:ik,EdgesGeometry:iN,ExtrudeGeometry:sb,IcosahedronGeometry:sx,LatheGeometry:sw,OctahedronGeometry:sS,PlaneGeometry:sM,PolyhedronGeometry:iI,RingGeometry:s_,ShapeGeometry:sA,SphereGeometry:sT,TetrahedronGeometry:sC,TorusGeometry:sE,TorusKnotGeometry:sR,TubeGeometry:sO,WireframeGeometry:sI});class sB extends eV{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new tV(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}function sL(t){let e={};for(let r in t)for(let i in e[r]={},t[r]){let s=t[r][i];if(sN(s))s.isRenderTargetTexture?(_("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[r][i]=null):e[r][i]=s.clone();else if(Array.isArray(s))if(sN(s[0])){let t=[];for(let e=0,r=s.length;e<r;e++)t[e]=s[e].clone();e[r][i]=t}else e[r][i]=s.slice();else e[r][i]=s}return e}function sz(t){let e={};for(let r=0;r<t.length;r++){let i=sL(t[r]);for(let t in i)e[t]=i[t]}return e}function sN(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}class sF extends eV{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=sL(t.uniforms),this.uniformsGroups=function(t){let e=[];for(let r=0;r<t.length;r++)e.push(t[r].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);for(let r in e.glslVersion=this.glslVersion,e.uniforms={},this.uniforms){let i=this.uniforms[r].value;i&&i.isTexture?e.uniforms[r]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[r]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[r]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[r]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[r]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[r]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[r]={type:"m4",value:i.toArray()}:e.uniforms[r]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let r={};for(let t in this.extensions)!0===this.extensions[t]&&(r[t]=!0);return Object.keys(r).length>0&&(e.extensions=r),e}fromJSON(t,e){if(super.fromJSON(t,e),void 0!==t.uniforms)for(let r in t.uniforms){let i=t.uniforms[r];switch(this.uniforms[r]={},i.type){case"t":this.uniforms[r].value=e[i.value]||null;break;case"c":this.uniforms[r].value=new tV().setHex(i.value);break;case"v2":this.uniforms[r].value=new F().fromArray(i.value);break;case"v3":this.uniforms[r].value=new U().fromArray(i.value);break;case"v4":this.uniforms[r].value=new ti().fromArray(i.value);break;case"m3":this.uniforms[r].value=new W().fromArray(i.value);break;case"m4":this.uniforms[r].value=new th().fromArray(i.value);break;default:this.uniforms[r].value=i.value}}if(void 0!==t.defines&&(this.defines=t.defines),void 0!==t.vertexShader&&(this.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(this.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(this.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)this.extensions[e]=t.extensions[e];return void 0!==t.lights&&(this.lights=t.lights),void 0!==t.clipping&&(this.clipping=t.clipping),this}}class sj extends sF{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class sU extends eV{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new tV(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class sD extends sU{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new F(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return P(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new tV(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new tV(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tV(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._retroreflectivity=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get retroreflectivity(){return this._retroreflectivity}set retroreflectivity(t){this._retroreflectivity>0!=t>0&&this.version++,this._retroreflectivity=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.retroreflectivity=t.retroreflectivity,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class sV extends eV{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tV(0xffffff),this.specular=new tV(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class sW extends eV{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tV(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class sq extends eV{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class sG extends eV{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tV(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tV(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tb,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class sH extends eV{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class sJ extends eV{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class s$ extends eV{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tV(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this.fog=t.fog,this}}class sY extends r7{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function sX(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function sZ(t){return void 0!==t&&void 0!==t.inTangents&&void 0!==t.outTangents}function sK(t){let e=t.length,r=Array(e);for(let t=0;t!==e;++t)r[t]=t;return r.sort(function(e,r){return t[e]-t[r]}),r}function sQ(t,e,r){let i=t.length,s=new t.constructor(i);for(let n=0,a=0;a!==i;++n){let i=r[n]*e;for(let r=0;r!==e;++r)s[a++]=t[i+r]}return s}function s0(t,e,r,i){let s=1,n=t[0];for(;void 0!==n&&void 0===n[i];)n=t[s++];if(void 0===n)return;let a=n[i];if(void 0!==a)if(Array.isArray(a))do void 0!==(a=n[i])&&(e.push(n.time),r.push(...a)),n=t[s++];while(void 0!==n)else if(void 0!==a.toArray)do void 0!==(a=n[i])&&(e.push(n.time),a.toArray(r,r.length)),n=t[s++];while(void 0!==n)else do void 0!==(a=n[i])&&(e.push(n.time),r.push(a)),n=t[s++];while(void 0!==n)}class s1{constructor(t,e,r,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(r),this.sampleValues=e,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,r=this._cachedIndex,i=e[r],s=e[r-1];t:{e:{let n;r:{i:if(!(t<i)){for(let n=r+2;;){if(void 0===i){if(t<s)break i;return r=e.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===n)break;if(s=i,t<(i=e[++r]))break e}n=e.length;break r}if(!(t>=s)){let a=e[1];t<a&&(r=2,s=a);for(let n=r-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(r===n)break;if(i=s,t>=(s=e[--r-1]))break e}n=r,r=0;break r}break t}for(;r<n;){let i=r+n>>>1;t<e[i]?n=i:r=i+1}if(i=e[r],void 0===(s=e[r-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return r=e.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,s,i)}return this.interpolate_(r,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=t*i;for(let t=0;t!==i;++t)e[t]=r[s+t];return e}interpolate_(){throw Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}}class s2 extends s1{constructor(t,e,r,i){super(t,e,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,r){let i=this.parameterPositions,s=t-2,n=t+1,a=i[s],o=i[n];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-r;break;case 2402:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=r}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:n=t,o=2*r-e;break;case 2402:n=1,o=r+i[1]-i[0];break;default:n=t-1,o=e}let h=(r-e)*.5,l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-r),this._offsetPrev=s*l,this._offsetNext=n*l}interpolate_(t,e,r,i){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(r-e)/(i-e),f=p*p,m=f*p,y=-c*m+2*c*f-c*p,g=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,b=(-1-d)*m+(1.5+d)*f+.5*p,v=d*m-d*f;for(let t=0;t!==a;++t)s[t]=y*n[l+t]+g*n[h+t]+b*n[o+t]+v*n[u+t];return s}}class s3 extends s1{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=(r-e)/(i-e),u=1-l;for(let t=0;t!==a;++t)s[t]=n[h+t]*u+n[o+t]*l;return s}}class s5 extends s1{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class s4 extends s1{interpolate_(t,e,r,i){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this.inTangents,u=this.outTangents;if(!l||!u){let t=(r-e)/(i-e),l=1-t;for(let e=0;e!==a;++e)s[e]=n[h+e]*l+n[o+e]*t;return s}let c=2*a,d=t-1;for(let p=0;p!==a;++p){let a=n[h+p],f=n[o+p],m=d*c+2*p,y=u[m],g=u[m+1],b=t*c+2*p,v=l[b],x=l[b+1],w=function(t,e,r,i,s){let n=(t-e)/(s-e);for(let a=0;a<8;a++){let a=s6(n,e,r,i,s)-t;if(1e-10>Math.abs(a))break;let o=function(t,e,r,i,s){let n=1-t;return 3*n*n*(r-e)+6*n*t*(i-r)+3*t*t*(s-i)}(n,e,r,i,s);if(1e-10>Math.abs(o))break;n=Math.max(0,Math.min(1,n-a/o))}return n}(r,e,y,v,i);s[p]=s6(w,a,g,x,f)}return s}}function s6(t,e,r,i,s){let n=1-t;return n*n*n*e+3*n*n*t*r+3*n*t*t*i+t*t*t*s}class s8{constructor(t,e,r,i){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=sX(e,this.TimeBufferType),this.values=sX(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e,r=t.constructor;if(r.toJSON!==this.toJSON)e=r.toJSON(t);else{e={name:t.name,times:sX(t.times,Array),values:sX(t.values,Array)};let r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r),sZ(t.settings)&&(e.settings={inTangents:sX(t.settings.inTangents,Array),outTangents:sX(t.settings.outTangents,Array)})}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new s5(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new s3(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new s2(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new s4(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.inTangents=this.settings.inTangents,e.outTangents=this.settings.outTangents),e}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth;break;case 2303:e=this.InterpolantFactoryMethodBezier}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(e);return _("KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let r=0,i=e.length;r!==i;++r)e[r]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let r=0,i=e.length;r!==i;++r)e[r]*=t;sZ(this.settings)&&(s9(this.settings.inTangents,t),s9(this.settings.outTangents,t))}return this}trim(t,e){let r=this.times,i=r.length,s=0,n=i-1;for(;s!==i&&r[s]<t;)++s;for(;-1!==n&&r[n]>e;)--n;if(++n,0!==s||n!==i){s>=n&&(s=(n=Math.max(n,1))-1);let t=this.getValueSize();this.times=r.slice(s,n),this.values=this.values.slice(s*t,n*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(A("KeyframeTrack: Invalid value size in track.",this),t=!1);let r=this.times,i=this.values,s=r.length;0===s&&(A("KeyframeTrack: Track is empty.",this),t=!1);let n=null;for(let e=0;e!==s;e++){let i=r[e];if("number"==typeof i&&isNaN(i)){A("KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==n&&n>i){A("KeyframeTrack: Out of order keys.",this,e,i,n),t=!1;break}n=i}if(void 0!==i&&b(i))for(let e=0,r=i.length;e!==r;++e){let r=i[e];if(isNaN(r)){A("KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),r=this.getValueSize(),i=2302===this.getInterpolation(),s=t.length-1,n=1;for(let a=1;a<s;++a){let s=!1,o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(i)s=!0;else{let t=a*r,i=t-r,n=t+r;for(let a=0;a!==r;++a){let r=e[t+a];if(r!==e[i+a]||r!==e[n+a]){s=!0;break}}}if(s){if(a!==n){t[n]=t[a];let i=a*r,s=n*r;for(let t=0;t!==r;++t)e[s+t]=e[i+t]}++n}}if(s>0){t[n]=t[s];for(let t=s*r,i=n*r,a=0;a!==r;++a)e[i+a]=e[t+a];++n}return n!==t.length?(this.times=t.slice(0,n),this.values=e.slice(0,n*r)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),r=new this.constructor(this.name,t,e);return r.createInterpolant=this.createInterpolant,sZ(this.settings)&&(r.settings={inTangents:this.settings.inTangents.slice(),outTangents:this.settings.outTangents.slice()}),r}}function s9(t,e){for(let r=0,i=t.length;r!==i;r+=2)t[r]*=e}s8.prototype.ValueTypeName="",s8.prototype.TimeBufferType=Float32Array,s8.prototype.ValueBufferType=Float32Array,s8.prototype.DefaultInterpolation=2301;class s7 extends s8{constructor(t,e,r){super(t,e,r)}}s7.prototype.ValueTypeName="bool",s7.prototype.ValueBufferType=Array,s7.prototype.DefaultInterpolation=2300,s7.prototype.InterpolantFactoryMethodLinear=void 0,s7.prototype.InterpolantFactoryMethodSmooth=void 0;class nt extends s8{constructor(t,e,r,i){super(t,e,r,i)}}nt.prototype.ValueTypeName="color";class ne extends s8{constructor(t,e,r,i){super(t,e,r,i)}}ne.prototype.ValueTypeName="number";class nr extends s1{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=(r-e)/(i-e),h=t*a;for(let t=h+a;h!==t;h+=4)j.slerpFlat(s,0,n,h-a,n,h,o);return s}}class ni extends s8{constructor(t,e,r,i){super(t,e,r,i)}InterpolantFactoryMethodLinear(t){return new nr(this.times,this.values,this.getValueSize(),t)}}ni.prototype.ValueTypeName="quaternion",ni.prototype.InterpolantFactoryMethodSmooth=void 0;class ns extends s8{constructor(t,e,r){super(t,e,r)}}ns.prototype.ValueTypeName="string",ns.prototype.ValueBufferType=Array,ns.prototype.DefaultInterpolation=2300,ns.prototype.InterpolantFactoryMethodLinear=void 0,ns.prototype.InterpolantFactoryMethodSmooth=void 0;class nn extends s8{constructor(t,e,r,i){super(t,e,r,i)}}nn.prototype.ValueTypeName="vector";class na{constructor(t="",e=-1,r=[],i=2500){this.name=t,this.tracks=r,this.duration=e,this.blendMode=i,this.uuid=k(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,s=r.length;t!==s;++t)e.push((function(t){let e;if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let r=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ne;case"vector":case"vector2":case"vector3":case"vector4":return nn;case"color":return nt;case"quaternion":return ni;case"bool":case"boolean":return s7;case"string":return ns}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],r=[];s0(t.keys,e,r,"value"),t.times=e,t.values=r}return e=void 0!==r.parse?r.parse(t):new r(t.name,t.times,t.values,t.interpolation),sZ(t.settings)&&(e.settings={inTangents:sX(t.settings.inTangents,Float32Array),outTangents:sX(t.settings.outTangents,Float32Array)}),e})(r[t]).scale(i));let s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s.userData=JSON.parse(t.userData||"{}"),s}static toJSON(t){let e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let t=0,i=r.length;t!==i;++t)e.push(s8.toJSON(r[t]));return i}static CreateFromMorphTargetSequence(t,e,r,i){let s=e.length,n=[];for(let t=0;t<s;t++){let a=[],o=[];a.push((t+s-1)%s,t,(t+1)%s),o.push(0,1,0);let h=sK(a);a=sQ(a,1,h),o=sQ(o,1,h),i||0!==a[0]||(a.push(s),o.push(o[0])),n.push(new ne(".morphTargetInfluences["+e[t].name+"]",a,o).scale(1/r))}return new this(t,-1,n)}static findByName(t,e){let r=t;Array.isArray(t)||(r=t.geometry&&t.geometry.animations||t.animations);for(let t=0;t<r.length;t++)if(r[t].name===e)return r[t];return null}static CreateClipsFromMorphTargetSequences(t,e,r){let i={},s=/^([\w-]*?)([\d]+)$/;for(let e=0,r=t.length;e<r;e++){let r=t[e],n=r.name.match(s);if(n&&n.length>1){let t=n[1],e=i[t];e||(i[t]=e=[]),e.push(r)}}let n=[];for(let t in i)n.push(this.CreateFromMorphTargetSequence(t,i[t],e,r));return n}resetDuration(){let t=this.tracks,e=0;for(let r=0,i=t.length;r!==i;++r){let t=this.tracks[r];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());let e=new this.constructor(this.name,this.duration,t,this.blendMode);return e.userData=JSON.parse(JSON.stringify(this.userData)),e}toJSON(){return this.constructor.toJSON(this)}}let no={enabled:!1,files:{},add:function(t,e){!1===this.enabled||nh(t)||(this.files[t]=e)},get:function(t){if(!1!==this.enabled&&!nh(t))return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function nh(t){try{let e=t.slice(t.indexOf(":")+1),r=new URL(e);return"blob:"===r.protocol}catch(t){return!1}}class nl{constructor(t,e,r){let i;const s=this;let n=!1,a=0,o=0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this._abortController=null,this.itemStart=function(t){o++,!1===n&&void 0!==s.onStart&&s.onStart(t,a,o),n=!0},this.itemEnd=function(t){a++,void 0!==s.onProgress&&s.onProgress(t,a,o),a===o&&(n=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(t){void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return(t=t.normalize("NFC"),i)?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){let e=h.indexOf(t);return -1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,r=h.length;e<r;e+=2){let r=h[e],i=h[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}let nu=new nl;class nc{constructor(t){this.manager=void 0!==t?t:nu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){let r=this;return new Promise(function(i,s){r.load(t,i,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}}nc.DEFAULT_MATERIAL_NAME="__DEFAULT";let nd={};class np extends Error{constructor(t,e){super(t),this.response=e}}class nf extends nc{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,r,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=no.get(`file:${t}`);if(void 0!==s){this.manager.itemStart(t),setTimeout(()=>{e&&e(s),this.manager.itemEnd(t)},0);return}if(void 0!==nd[t])return void nd[t].push({onLoad:e,onProgress:r,onError:i});nd[t]=[],nd[t].push({onLoad:e,onProgress:r,onError:i});let n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),a=this.mimeType,o=this.responseType;fetch(n).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&_("FileLoader: HTTP Status 0 received."),"u"<typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;let r=nd[t],i=e.body.getReader(),s=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),n=s?parseInt(s):0,a=0!==n,o=0;return new Response(new ReadableStream({start(t){!function e(){i.read().then(({done:i,value:s})=>{if(i)t.close();else{let i=new ProgressEvent("progress",{lengthComputable:a,loaded:o+=s.byteLength,total:n});for(let t=0,e=r.length;t<e;t++){let e=r[t];e.onProgress&&e.onProgress(i)}t.enqueue(s),e()}},e=>{t.error(e)})}()}}))}throw new np(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>new DOMParser().parseFromString(t,a));case"json":return t.json();default:if(""===a)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(a),r=new TextDecoder(e&&e[1]?e[1].toLowerCase():void 0);return t.arrayBuffer().then(t=>r.decode(t))}}}).then(e=>{no.add(`file:${t}`,e);let r=nd[t];delete nd[t];for(let t=0,i=r.length;t<i;t++){let i=r[t];i.onLoad&&i.onLoad(e)}}).catch(e=>{let r=nd[t];if(void 0===r)throw this.manager.itemError(t),e;delete nd[t];for(let t=0,i=r.length;t<i;t++){let i=r[t];i.onError&&i.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let nm=new WeakMap;class ny extends nc{constructor(t){super(t)}load(t,e,r,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=this,n=no.get(`image:${t}`);if(void 0!==n){if(!0===n.complete)s.manager.itemStart(t),setTimeout(function(){e&&e(n),s.manager.itemEnd(t)},0);else{let t=nm.get(n);void 0===t&&(t=[],nm.set(n,t)),t.push({onLoad:e,onError:i})}return n}let a=v("img");function o(){l(),e&&e(this);let r=nm.get(this)||[];for(let t=0;t<r.length;t++){let e=r[t];e.onLoad&&e.onLoad(this)}nm.delete(this),s.manager.itemEnd(t)}function h(e){l(),i&&i(e),no.remove(`image:${t}`);let r=nm.get(this)||[];for(let t=0;t<r.length;t++){let i=r[t];i.onError&&i.onError(e)}nm.delete(this),s.manager.itemError(t),s.manager.itemEnd(t)}function l(){a.removeEventListener("load",o,!1),a.removeEventListener("error",h,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),no.add(`image:${t}`,a),s.manager.itemStart(t),a.src=t,a}}class ng extends tL{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new tV(t),this.intensity=e}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,e}}class nb extends ng{constructor(t,e,r){super(t,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(tL.DEFAULT_UP),this.updateMatrix(),this.groundColor=new tV(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}toJSON(t){let e=super.toJSON(t);return e.object.groundColor=this.groundColor.getHex(),e}}let nv=new th,nx=new U,nw=new U;class nS{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new F(512,512),this.mapType=1009,this.map=null,this.mapPass=null,this.matrix=new th,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new rW,this._frameExtents=new F(1,1),this._viewportCount=1,this._viewports=[new ti(0,0,1,1)]}getViewportCount(){return this._viewportCount}getCamera(){return this.camera}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera;nx.setFromMatrixPosition(t.matrixWorld),e.position.copy(nx),nw.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(nw),e.updateMatrixWorld(),this._updateMatrix(e,this.matrix,this._frustum)}_updateMatrix(t,e,r,i){nv.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),r.setFromProjectionMatrix(nv,t.coordinateSystem,t.reversedDepth);let s=this._frameExtents,n=i?i.z/s.x:1,a=i?i.w/s.y:1,o=i?i.x/s.x:0,h=i?i.y/s.y:0;2001===t.coordinateSystem||t.reversedDepth?e.set(.5*n,0,0,.5*n+o,0,.5*a,0,.5*a+h,0,0,1,0,0,0,0,1):e.set(.5*n,0,0,.5*n+o,0,.5*a,0,.5*a+h,0,0,.5,.5,0,0,0,1),e.multiply(nv)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return t.intensity=this.intensity,t.bias=this.bias,t.normalBias=this.normalBias,t.radius=this.radius,t.blurSamples=this.blurSamples,t.mapSize=this.mapSize.toArray(),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}let nM=new U,n_=new j,nA=new U;class nT extends tL{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new th,this.projectionMatrix=new th,this.projectionMatrixInverse=new th,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(nM,n_,nA),1===nA.x&&1===nA.y&&1===nA.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(nM,n_,nA.set(1,1,1)).invert()}updateWorldMatrix(t,e,r=!1){super.updateWorldMatrix(t,e,r),this.matrixWorld.decompose(nM,n_,nA),1===nA.x&&1===nA.y&&1===nA.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(nM,n_,nA.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}let nC=new U,nE=new F,nR=new F;class nO extends nT{constructor(t=50,e=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=2*I*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*O*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*I*Math.atan(Math.tan(.5*O*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,r){nC.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(nC.x,nC.y).multiplyScalar(-t/nC.z),nC.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(nC.x,nC.y).multiplyScalar(-t/nC.z)}getViewSize(t,e){return this.getViewBounds(t,nE,nR),e.subVectors(nR,nE)}setViewOffset(t,e,r,i,s,n){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*O*this.fov)/this.zoom,r=2*e,i=this.aspect*r,s=-.5*i,n=this.view;if(null!==this.view&&this.view.enabled){let t=n.fullWidth,a=n.fullHeight;s+=n.offsetX*i/t,e-=n.offsetY*r/a,i*=n.width/t,r*=n.height/a}let a=this.filmOffset;0!==a&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-r,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}class nI extends nS{constructor(){super(new nO(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,r=2*I*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,s=t.distance||e.far;(r!==e.fov||i!==e.aspect||s!==e.far)&&(e.fov=r,e.aspect=i,e.far=s,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this.aspect=t.aspect,this}toJSON(){let t=super.toJSON();return t.focus=this.focus,t.aspect=this.aspect,t}}class nk extends ng{constructor(t,e,r=0,i=Math.PI/3,s=0,n=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(tL.DEFAULT_UP),this.updateMatrix(),this.target=new tL,this.distance=r,this.angle=i,this.penumbra=s,this.decay=n,this.map=null,this.shadow=new nI}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.angle=this.angle,e.object.decay=this.decay,e.object.penumbra=this.penumbra,e.object.target=this.target.uuid,this.map&&this.map.isTexture&&(e.object.map=this.map.toJSON(t).uuid),e.object.shadow=this.shadow.toJSON(),e}}class nP extends nS{constructor(){super(new nO(90,1,.5,500)),this.isPointLightShadow=!0}}class nB extends ng{constructor(t,e,r=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new nP}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.decay=this.decay,e.object.shadow=this.shadow.toJSON(),e}}class nL extends nT{constructor(t=-1,e=1,r=1,i=-1,s=.1,n=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=s,this.far=n,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,r,i,s,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=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=r-t,n=r+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=t*this.view.offsetX,n=s+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(s,n,a,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class nz extends nS{constructor(){super(new nL(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class nN extends ng{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(tL.DEFAULT_UP),this.updateMatrix(),this.target=new tL,this.shadow=new nz}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.shadow=this.shadow.toJSON(),e.object.target=this.target.uuid,e}}class nF extends ng{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class nj extends ng{constructor(t,e,r=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){let e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class nU{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new U)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){let r=t.x,i=t.y,s=t.z,n=this.coefficients;return e.copy(n[0]).multiplyScalar(.282095),e.addScaledVector(n[1],.488603*i),e.addScaledVector(n[2],.488603*s),e.addScaledVector(n[3],.488603*r),e.addScaledVector(n[4],r*i*1.092548),e.addScaledVector(n[5],i*s*1.092548),e.addScaledVector(n[6],.315392*(3*s*s-1)),e.addScaledVector(n[7],r*s*1.092548),e.addScaledVector(n[8],.546274*(r*r-i*i)),e}getIrradianceAt(t,e){let r=t.x,i=t.y,s=t.z,n=this.coefficients;return e.copy(n[0]).multiplyScalar(.886227),e.addScaledVector(n[1],1.023328*i),e.addScaledVector(n[2],1.023328*s),e.addScaledVector(n[3],1.023328*r),e.addScaledVector(n[4],.858086*r*i),e.addScaledVector(n[5],.858086*i*s),e.addScaledVector(n[6],.743125*s*s-.247708),e.addScaledVector(n[7],.858086*r*s),e.addScaledVector(n[8],.429043*(r*r-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(t.coefficients[r],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let r=0;r<9;r++)this.coefficients[r].lerp(t.coefficients[r],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){let r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){let r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){let r=t.x,i=t.y,s=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*s,e[3]=.488603*r,e[4]=1.092548*r*i,e[5]=1.092548*i*s,e[6]=.315392*(3*s*s-1),e[7]=1.092548*r*s,e[8]=.546274*(r*r-i*i)}}class nD extends ng{constructor(t=new nU,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}toJSON(t){let e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}let nV={};class nW extends nc{constructor(t){super(t),this.textures={}}load(t,e,r,i){let s=this,n=new nf(s.manager);n.setPath(s.path),n.setRequestHeader(s.requestHeader),n.setWithCredentials(s.withCredentials),n.load(t,function(r){try{e(s.parse(JSON.parse(r)))}catch(e){i?i(e):A(e),s.manager.itemError(t)}},r,i)}parse(t){let e=this.createMaterialFromType(t.type);return e.fromJSON(t,this.textures),e}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return nW.createMaterialFromType(t)}static createMaterialFromType(t){let e,r={ShadowMaterial:sB,SpriteMaterial:eW,RawShaderMaterial:sj,ShaderMaterial:sF,PointsMaterial:im,MeshPhysicalMaterial:sD,MeshStandardMaterial:sU,MeshPhongMaterial:sV,MeshToonMaterial:sW,MeshNormalMaterial:sq,MeshLambertMaterial:sG,MeshDepthMaterial:sH,MeshDistanceMaterial:sJ,MeshBasicMaterial:rr,MeshMatcapMaterial:s$,LineDashedMaterial:sY,LineBasicMaterial:r7,Material:eV,...nV}[t];return void 0===r?(T(`MaterialLoader: Unknown material type "${t}". Use .registerMaterial() before starting the deserialization process.`),e=new eV):e=new r,e}static registerMaterial(t,e){nV[t]=e}}class nq{static extractUrlBase(t){let e=t.lastIndexOf("/");return -1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t))?t:e+t}}class nG extends eP{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class nH extends nc{constructor(t){super(t)}load(t,e,r,i){let s=this,n=new nf(s.manager);n.setPath(s.path),n.setRequestHeader(s.requestHeader),n.setWithCredentials(s.withCredentials),n.load(t,function(r){try{e(s.parse(JSON.parse(r)))}catch(e){i?i(e):A(e),s.manager.itemError(t)}},r,i)}parse(t){let e={},r={};function i(t,i){if(void 0!==e[i])return e[i];let s=t.interleavedBuffers[i],n=function(t,e){if(void 0!==r[e])return r[e];let i=new Uint32Array(t.arrayBuffers[e]).buffer;return r[e]=i,i}(t,s.buffer),a=new eB(g(s.type,n),s.stride);return a.uuid=s.uuid,void 0!==s.usage&&a.setUsage(s.usage),e[i]=a,a}let s=t.isInstancedBufferGeometry?new nG:new eP,n=t.data.index;if(void 0!==n){let t=g(n.type,n.array);s.setIndex(new eb(t,1))}let a=t.data.attributes;for(let e in a){let r,n=a[e];if(n.isInterleavedBufferAttribute)r=new ez(i(t.data,n.data),n.itemSize,n.offset,n.normalized);else{let t=g(n.type,n.array);r=new(n.isInstancedBufferAttribute?rI:eb)(t,n.itemSize,n.normalized)}void 0!==n.name&&(r.name=n.name),void 0!==n.usage&&r.setUsage(n.usage),void 0!==n.gpuType&&(r.gpuType=n.gpuType),s.setAttribute(e,r)}let o=t.data.morphAttributes;if(o)for(let e in o){let r=o[e],n=[];for(let e=0,s=r.length;e<s;e++){let s,a=r[e];s=a.isInterleavedBufferAttribute?new ez(i(t.data,a.data),a.itemSize,a.offset,a.normalized):new eb(g(a.type,a.array),a.itemSize,a.normalized),void 0!==a.name&&(s.name=a.name),void 0!==a.usage&&s.setUsage(a.usage),void 0!==a.gpuType&&(s.gpuType=a.gpuType),n.push(s)}s.morphAttributes[e]=n}t.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);let h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let t=0,e=h.length;t!==e;++t){let e=h[t];s.addGroup(e.start,e.count,e.materialIndex)}let l=t.data.boundingSphere;return void 0!==l&&(s.boundingSphere=new eA().fromJSON(l)),t.name&&(s.name=t.name),t.userData&&(s.userData=t.userData),s}}let nJ={},n$={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},nY={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},nX={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008},nZ=new WeakMap;class nK{static getContext(){return void 0===i&&(i=new(window.AudioContext||window.webkitAudioContext)),i}static setContext(t){i=t}}let nQ=new th,n0=new th,n1=new th;class n2{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(t){this._document=t,void 0!==t.hidden&&(this._pageVisibilityHandler=n3.bind(this),t.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(t){return this._timescale=t,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(t){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==t?t:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function n3(){!1===this._document.hidden&&this.reset()}let n5=new U,n4=new j,n6=new U,n8=new U,n9=new U;class n7 extends tL{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void _("Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void _("Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;let e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)}stop(t=0){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this)}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){return this.detune=t,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return!1===this.hasPlaybackControl?(_("Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){return!1===this.hasPlaybackControl?void _("Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}copy(t,e){return(super.copy(t,e),"buffer"!==t.sourceType)?_("Audio: Audio source type cannot be copied."):(this.autoplay=t.autoplay,this.buffer=t.buffer,this.detune=t.detune,this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this.offset=t.offset,this.duration=t.duration,this.playbackRate=t.playbackRate,this.hasPlaybackControl=t.hasPlaybackControl,this.sourceType=t.sourceType,this.filters=t.filters.slice()),this}clone(t){return new this.constructor(this.listener).copy(this,t)}}let at=new U,ae=new j,ar=new U,ai=new U;class as{constructor(t,e,r){let i,s,n;switch(this.binding=t,this.valueSize=r,e){case"quaternion":i=this._slerp,s=this._slerpAdditive,n=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,n=this._setAdditiveIdentityOther,this.buffer=Array(5*r);break;default:i=this._lerp,s=this._lerpAdditive,n=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=n,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){let r=this.buffer,i=this.valueSize,s=t*i+i,n=this.cumulativeWeight;if(0===n){for(let t=0;t!==i;++t)r[s+t]=r[t];n=e}else{n+=e;let t=e/n;this._mixBufferRegion(r,s,0,t,i)}this.cumulativeWeight=n}accumulateAdditive(t){let e=this.buffer,r=this.valueSize,i=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,i,0,t,r),this.cumulativeWeightAdditive+=t}apply(t){let e=this.valueSize,r=this.buffer,i=t*e+e,s=this.cumulativeWeight,n=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){let t=e*this._origIndex;this._mixBufferRegion(r,i,t,1-s,e)}n>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,s=e+e;t!==s;++t)if(r[t]!==r[t+e]){a.setValue(r,i);break}}saveOriginalState(){let t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r;t!==i;++t)e[t]=e[i+t%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let r=t;r<e;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[e+r]=this.buffer[t+r]}_select(t,e,r,i,s){if(i>=.5)for(let i=0;i!==s;++i)t[e+i]=t[r+i]}_slerp(t,e,r,i){j.slerpFlat(t,e,t,e,t,r,i)}_slerpAdditive(t,e,r,i,s){let n=this._workIndex*s;j.multiplyQuaternionsFlat(t,n,t,e,t,r),j.slerpFlat(t,e,t,e,t,n,i)}_lerp(t,e,r,i,s){let n=1-i;for(let a=0;a!==s;++a){let s=e+a;t[s]=t[s]*n+t[r+a]*i}}_lerpAdditive(t,e,r,i,s){for(let n=0;n!==s;++n){let s=e+n;t[s]=t[s]+t[r+n]*i}}}let an="\\[\\]\\.:\\/",aa=RegExp("["+an+"]","g"),ao="[^"+an+"]",ah="[^"+an.replace("\\.","")+"]",al=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",ao)+/(WCOD+)?/.source.replace("WCOD",ah)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ao)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ao)+"$"),au=["material","materials","bones","map"];class ac{constructor(t,e,r){this.path=e,this.parsedPath=r||ac.parseTrackName(e),this.node=ac.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,r){return t&&t.isAnimationObjectGroup?new ac.Composite(t,e,r):new ac(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(aa,"")}static parseTrackName(t){let e=al.exec(t);if(null===e)throw Error("THREE.PropertyBinding: Cannot parse trackName: "+t);let r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let t=r.nodeName.substring(i+1);-1!==au.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||0===r.propertyName.length)throw Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let r=t.skeleton.getBoneByName(e);if(void 0!==r)return r}if(t.children){let r=function(t){for(let i=0;i<t.length;i++){let s=t[i];if(s.name===e||s.uuid===e)return s;let n=r(s.children);if(n)return n}return null},i=r(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)t[e++]=r[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,r=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=ac.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void _("PropertyBinding: No target node found for track: "+this.path+".");if(r){let i=e.objectIndex;switch(r){case"materials":if(!t.material)return void A("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void A("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void A("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===i){i=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void A("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void A("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[r])return void A("PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[r]}if(void 0!==i){if(void 0===t[i])return void A("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}let n=t[i];if(void 0===n)return void A("PropertyBinding: Trying to update property for track: "+e.nodeName+"."+i+" but it wasn't found.",t);let a=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?a=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===i){if(!t.geometry)return void A("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void A("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[s]&&(s=t.morphTargetDictionary[s])}o=this.BindingType.ArrayElement,this.resolvedProperty=n,this.propertyIndex=s}else void 0!==n.fromArray&&void 0!==n.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=n):Array.isArray(n)?(o=this.BindingType.EntireArray,this.resolvedProperty=n):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}ac.Composite=class{constructor(t,e,r){const i=r||ac.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(t,e)}setValue(t,e){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}},ac.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},ac.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},ac.prototype.GetterByBindingType=[ac.prototype._getValue_direct,ac.prototype._getValue_array,ac.prototype._getValue_arrayElement,ac.prototype._getValue_toArray],ac.prototype.SetterByBindingTypeAndVersioning=[[ac.prototype._setValue_direct,ac.prototype._setValue_direct_setNeedsUpdate,ac.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ac.prototype._setValue_array,ac.prototype._setValue_array_setNeedsUpdate,ac.prototype._setValue_array_setMatrixWorldNeedsUpdate],[ac.prototype._setValue_arrayElement,ac.prototype._setValue_arrayElement_setNeedsUpdate,ac.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ac.prototype._setValue_fromArray,ac.prototype._setValue_fromArray_setNeedsUpdate,ac.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class ad{constructor(t,e,r=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const s=e.tracks,n=s.length,a=Array(n),o={endingStart:2400,endingEnd:2400};for(let t=0;t!==n;++t){const e=s[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._restoreTimeScale=null,this._weightInterpolant=null,this.loop=2201,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(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,r=!1){if(t.fadeOut(e),this.fadeIn(e),!0===r){let r=this._clip.duration,i=t._clip.duration;t._restoreTimeScale=t.timeScale,this._restoreTimeScale=this.timeScale,t.warp(1,i/r,e),this.warp(r/i,1,e)}return this}crossFadeTo(t,e,r=!1){return t.crossFadeFrom(this,e,r)}stopFading(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,r){let i=this._mixer,s=i.time,n=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);let o=a.parameterPositions,h=a.sampleValues;return o[0]=s,o[1]=s+r,h[0]=t/n,h[1]=e/n,this}stopWarping(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this._restoreTimeScale=null,this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,r,i){if(!this.enabled)return void this._updateWeight(t);let s=this._startTime;if(null!==s){let i=(t-s)*r;i<0||0===r?e=0:(this._startTime=null,e=r*i)}e*=this._updateTimeScale(t);let n=this._updateTime(e),a=this._updateWeight(t);if(a>0){let t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(n),e[r].accumulateAdditive(a);else for(let r=0,s=t.length;r!==s;++r)t[r].evaluate(n),e[r].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;let r=this._weightInterpolant;if(null!==r){let i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;let r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(0===e?this.paused=!0:(null!==this._restoreTimeScale&&(e=this._restoreTimeScale),this.timeScale=e),this.stopWarping()))}return this._effectiveTimeScale=e,e}_updateTime(t){let e=this._clip.duration,r=this.loop,i=this.time+t,s=this._loopCount,n=2202===r;if(0===t)return -1===s?i:n&&(1&s)==1?e-i:i;if(2200===r){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));s:{if(i>=e)i=e;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:t<0?-1:1})}}else{if(-1===s&&(t>=0?(s=0,this._setEndings(!0,0===this.repetitions,n)):this._setEndings(0===this.repetitions,!0,n)),i>=e||i<0){let r=Math.floor(i/e);i-=e*r,s+=Math.abs(r);let a=this.repetitions-s;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){let e=t<0;this._setEndings(e,!e,n)}else this._setEndings(!1,!1,n);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this._loopCount=s,this.time=i;if(n&&(1&s)==1)return e-i}return i}_setEndings(t,e,r){let i=this._interpolantSettings;r?(i.endingStart=2401,i.endingEnd=2401):(t?i.endingStart=this.zeroSlopeAtStart?2401:2400:i.endingStart=2402,e?i.endingEnd=this.zeroSlopeAtEnd?2401:2400:i.endingEnd=2402)}_scheduleFading(t,e,r){let i=this._mixer,s=i.time,n=this._weightInterpolant;null===n&&(n=i._lendControlInterpolant(),this._weightInterpolant=n);let a=n.parameterPositions,o=n.sampleValues;return a[0]=s,o[0]=e,a[1]=s+t,o[1]=r,this}}let ap=new Float32Array(1),af=0,am=new th;function ay(t,e){return t.distance-e.distance}function ag(t,e,r,i){let s=!0;if(t.layers.test(e.layers)&&!1===t.raycast(e,r)&&(s=!1),!0===s&&!0===i){let i=t.children;for(let t=0,s=i.length;t<s;t++)ag(i[t],e,r,!0)}}class ab{static{ab.prototype.isMatrix2=!0}constructor(t,e,r,i){this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,r,i)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let r=0;r<4;r++)this.elements[r]=t[r+e];return this}set(t,e,r,i){let s=this.elements;return s[0]=t,s[2]=e,s[1]=r,s[3]=i,this}}let av=new F;class ax{constructor(t=new F(Infinity,Infinity),e=new F(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let r=av.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,av).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}let aw=new U,aS=new U,aM=new U,a_=new U,aA=new U,aT=new U,aC=new U,aE=new U,aR=new U,aO=new th,aI=new th,ak=new U,aP=new tV,aB=new tV,aL=new U,az=new U,aN=new U,aF=new U,aj=new nT;function aU(t,e,r,i,s,n,a){aF.set(s,n,a).unproject(i);let o=e[t];if(void 0!==o){let t=r.getAttribute("position");for(let e=0,r=o.length;e<r;e++)t.setXYZ(o[e],aF.x,aF.y,aF.z)}}let aD=new t8,aV=new U;function aW(t,e,r,i){let s=function(t){switch(t){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${t}.`)}(i);switch(r){case 1021:return t*e;case 1028:case 1029:return t*e/s.components*s.byteLength;case 1030:case 1031:return t*e*2/s.components*s.byteLength;case 1022:return t*e*3/s.components*s.byteLength;case 1023:case 1033:return t*e*4/s.components*s.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case 35841:case 35843:return Math.max(t,16)*Math.max(e,8)/4;case 35840:case 35842:return Math.max(t,8)*Math.max(e,8)/2;case 37809:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case 37810:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case 37811:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case 37812:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case 37813:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case 37814:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case 37815:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case 37816:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case 37817:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case 37818:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case 37819:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case 37820:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case 37821:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(t/4)*Math.ceil(e/4)*16;case 36283:case 36284:return Math.ceil(t/4)*Math.ceil(e/4)*8}throw Error(`Unable to determine texture byte length for ${r} format.`)}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"186"}})),"u">typeof window&&(window.__THREE__?_("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="186"),t.s(["ACESFilmicToneMapping",0,4,"AddEquation",0,100,"AddOperation",0,2,"AdditiveAnimationBlendMode",0,2501,"AdditiveBlending",0,2,"AgXToneMapping",0,6,"AlphaFormat",0,1021,"AlwaysCompare",0,519,"AlwaysDepth",0,1,"AlwaysStencilFunc",0,519,"AmbientLight",0,nF,"AnimationAction",0,ad,"AnimationClip",0,na,"AnimationLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=this,n=new nf(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,function(r){try{e(s.parse(JSON.parse(r)))}catch(e){i?i(e):A(e),s.manager.itemError(t)}},r,i)}parse(t){let e=[];for(let r=0;r<t.length;r++){let i=na.parse(t[r]);e.push(i)}return e}},"AnimationMixer",0,class extends C{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(t,e){let r=t._localRoot||this._root,i=t._clip.tracks,s=i.length,n=t._propertyBindings,a=t._interpolants,o=r.uuid,h=this._bindingsByRootAndName,l=h[o];void 0===l&&(l={},h[o]=l);for(let t=0;t!==s;++t){let s=i[t],h=s.name,u=l[h];if(void 0!==u)++u.referenceCount,n[t]=u;else{if(void 0!==(u=n[t])){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,h));continue}let i=e&&e._propertyBindings[t].binding.parsedPath;u=new as(ac.create(r,h,i),s.ValueTypeName,s.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,o,h),n[t]=u}a[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){let e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}let e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){let r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){let r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,r){let i=this._actions,s=this._actionsByClip,n=s[e];if(void 0===n)n={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,s[e]=n;else{let e=n.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=i.length,i.push(t),n.actionByRoot[r]=t}_removeInactiveAction(t){let e=this._actions,r=e[e.length-1],i=t._cacheIndex;r._cacheIndex=i,e[i]=r,e.pop(),t._cacheIndex=null;let s=t._clip.uuid,n=this._actionsByClip,a=n[s],o=a.knownActions,h=o[o.length-1],l=t._byClipCacheIndex;h._byClipCacheIndex=l,o[l]=h,o.pop(),t._byClipCacheIndex=null;let u=a.actionByRoot,c=(t._localRoot||this._root).uuid;delete u[c],0===o.length&&delete n[s],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){let e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){let r=e[t];0==--r.referenceCount&&this._removeInactiveBinding(r)}}_lendAction(t){let e=this._actions,r=t._cacheIndex,i=this._nActiveActions++,s=e[i];t._cacheIndex=i,e[i]=t,s._cacheIndex=r,e[r]=s}_takeBackAction(t){let e=this._actions,r=t._cacheIndex,i=--this._nActiveActions,s=e[i];t._cacheIndex=i,e[i]=t,s._cacheIndex=r,e[r]=s}_addInactiveBinding(t,e,r){let i=this._bindingsByRootAndName,s=this._bindings,n=i[e];void 0===n&&(n={},i[e]=n),n[r]=t,t._cacheIndex=s.length,s.push(t)}_removeInactiveBinding(t){let e=this._bindings,r=t.binding,i=r.rootNode.uuid,s=r.path,n=this._bindingsByRootAndName,a=n[i],o=e[e.length-1],h=t._cacheIndex;o._cacheIndex=h,e[h]=o,e.pop(),delete a[s],0===Object.keys(a).length&&delete n[i]}_lendBinding(t){let e=this._bindings,r=t._cacheIndex,i=this._nActiveBindings++,s=e[i];t._cacheIndex=i,e[i]=t,s._cacheIndex=r,e[r]=s}_takeBackBinding(t){let e=this._bindings,r=t._cacheIndex,i=--this._nActiveBindings,s=e[i];t._cacheIndex=i,e[i]=t,s._cacheIndex=r,e[r]=s}_lendControlInterpolant(){let t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&((r=new s3(new Float32Array(2),new Float32Array(2),1,ap)).__cacheIndex=e,t[e]=r),r}_takeBackControlInterpolant(t){let e=this._controlInterpolants,r=t.__cacheIndex,i=--this._nActiveControlInterpolants,s=e[i];t.__cacheIndex=i,e[i]=t,s.__cacheIndex=r,e[r]=s}clipAction(t,e,r){let i=e||this._root,s=i.uuid,n="string"==typeof t?na.findByName(i,t):t,a=null!==n?n.uuid:t,o=this._actionsByClip[a],h=null;if(void 0===r&&(r=null!==n?n.blendMode:2500),void 0!==o){let t=o.actionByRoot[s];if(void 0!==t&&t.blendMode===r)return t;h=o.knownActions[0],null===n&&(n=h._clip)}if(null===n)return null;let l=new ad(this,n,e,r);return this._bindAction(l,h),this._addInactiveAction(l,a,s),l}existingAction(t,e){let r=e||this._root,i=r.uuid,s="string"==typeof t?na.findByName(r,t):t,n=s?s.uuid:t,a=this._actionsByClip[n];return void 0!==a&&a.actionByRoot[i]||null}stopAllAction(){let t=this._actions,e=this._nActiveActions;for(let r=e-1;r>=0;--r)t[r].stop();return this}update(t){t*=this.timeScale;let e=this._actions,r=this._nActiveActions,i=this.time+=t,s=Math.sign(t),n=this._accuIndex^=1;for(let a=0;a!==r;++a)e[a]._update(i,t,s,n);let a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(n);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){let e=this._actions,r=t.uuid,i=this._actionsByClip,s=i[r];if(void 0!==s){let t=s.knownActions;for(let r=0,i=t.length;r!==i;++r){let i=t[r];this._deactivateAction(i);let s=i._cacheIndex,n=e[e.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,n._cacheIndex=s,e[s]=n,e.pop(),this._removeInactiveBindingsForAction(i)}delete i[r]}}uncacheRoot(t){let e=t.uuid,r=this._actionsByClip;for(let t in r){let i=r[t].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}let i=this._bindingsByRootAndName[e];if(void 0!==i)for(let t in i){let e=i[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){let r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}},"AnimationObjectGroup",0,class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=k(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,r=arguments.length;e!==r;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){let t=this._objects,e=this._indicesByUUID,r=this._paths,i=this._parsedPaths,s=this._bindings,n=s.length,a,o=t.length,h=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){let u=arguments[l],c=u.uuid,d=e[c];if(void 0===d){d=o++,e[c]=d,t.push(u);for(let t=0;t!==n;++t)s[t].push(new ac(u,r[t],i[t]))}else if(d<h){a=t[d];let o=--h,l=t[o];e[l.uuid]=d,t[d]=l,e[c]=o,t[o]=u;for(let t=0;t!==n;++t){let e=s[t],n=e[o],a=e[d];e[d]=n,void 0===a&&(a=new ac(u,r[t],i[t])),e[o]=a}}else t[d]!==a&&A("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){let t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length,s=this.nCachedObjects_;for(let n=0,a=arguments.length;n!==a;++n){let a=arguments[n],o=a.uuid,h=e[o];if(void 0!==h&&h>=s){let n=s++,l=t[n];e[l.uuid]=h,t[h]=l,e[o]=n,t[n]=a;for(let t=0;t!==i;++t){let e=r[t],i=e[n],s=e[h];e[h]=i,e[n]=s}}}this.nCachedObjects_=s}uncache(){let t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length,s=this.nCachedObjects_,n=t.length;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a],h=o.uuid,l=e[h];if(void 0!==l)if(delete e[h],l<s){let a=--s,o=t[a],h=--n,u=t[h];l!==a&&(e[o.uuid]=l),t[l]=o,a!==h&&(e[u.uuid]=a),t[a]=u,t.pop();for(let t=0;t!==i;++t){let e=r[t],i=e[a],s=e[h];e[l]=i,e[a]=s,e.pop()}}else{let s=--n,a=t[s];l!==s&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0;t!==i;++t){let e=r[t];e[l]=e[s],e.pop()}}}this.nCachedObjects_=s}subscribe_(t,e){let r=this._bindingsIndicesByPath,i=r[t],s=this._bindings;if(void 0!==i)return s[i];let n=this._paths,a=this._parsedPaths,o=this._objects,h=o.length,l=this.nCachedObjects_,u=Array(h);i=s.length,r[t]=i,n.push(t),a.push(e),s.push(u);for(let r=l,i=o.length;r!==i;++r){let i=o[r];u[r]=new ac(i,t,e)}return u}unsubscribe_(t){let e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){let t=this._paths,i=this._parsedPaths,s=this._bindings,n=s.length-1,a=s[n];e[t[n]]=r,s[r]=a,s.pop(),i[r]=i[n],i.pop(),t[r]=t[n],t.pop()}}},"AnimationUtils",0,class{static convertArray(t,e){return sX(t,e)}static isTypedArray(t){return b(t)}static hasTangents(t){return sZ(t)}static getKeyframeOrder(t){return sK(t)}static sortedArray(t,e,r){return sQ(t,e,r)}static flattenJSON(t,e,r,i){s0(t,e,r,i)}static subclip(t,e,r,i,s=30){return function(t,e,r,i,s=30){let n=t.clone();n.name=e;let a=[];for(let t=0;t<n.tracks.length;++t){let e=n.tracks[t],o=e.getValueSize(),h=[],l=[];for(let t=0;t<e.times.length;++t){let n=e.times[t]*s;if(!(n<r)&&!(n>=i)){h.push(e.times[t]);for(let r=0;r<o;++r)l.push(e.values[t*o+r])}}0!==h.length&&(e.times=sX(h,e.times.constructor),e.values=sX(l,e.values.constructor),a.push(e))}n.tracks=a;let o=1/0;for(let t=0;t<n.tracks.length;++t)o>n.tracks[t].times[0]&&(o=n.tracks[t].times[0]);for(let t=0;t<n.tracks.length;++t)n.tracks[t].shift(-1*o);return n.resetDuration(),n}(t,e,r,i,s)}static makeClipAdditive(t,e=0,r=t,i=30){return function(t,e=0,r=t,i=30){i<=0&&(i=30);let s=r.tracks.length,n=e/i;for(let e=0;e<s;++e){let i,s=r.tracks[e],a=s.ValueTypeName;if("bool"===a||"string"===a)continue;let o=t.tracks.find(function(t){return t.name===s.name&&t.ValueTypeName===a});if(void 0===o)continue;let h=0,l=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=l/3);let u=0,c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=c/3);let d=s.times.length-1;if(n<=s.times[0]){let t=h,e=l-h;i=s.values.slice(t,e)}else if(n>=s.times[d]){let t=d*l+h,e=t+l-h;i=s.values.slice(t,e)}else{let t=s.createInterpolant(),e=h,r=l-h;t.evaluate(n),i=t.resultBuffer.slice(e,r)}"quaternion"===a&&new j().fromArray(i).normalize().conjugate().toArray(i);let p=o.times.length;for(let t=0;t<p;++t){let e=t*c+u;if("quaternion"===a)j.multiplyQuaternionsFlat(o.values,e,i,0,o.values,e);else{let t=c-2*u;for(let r=0;r<t;++r)o.values[e+r]-=i[r]}}}return t.blendMode=2501,t}(t,e,r,i)}},"ArcCurve",0,iU,"ArrayCamera",0,class extends nO{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}},"ArrowHelper",0,class extends tL{constructor(t=new U(0,0,1),e=new U(0,0,0),r=1,i=0xffff00,a=.2*r,o=.2*a){super(),this.type="ArrowHelper",void 0===s&&((s=new eP).setAttribute("position",new ew([0,0,0,0,1,0],3)),(n=new iO(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new ih(s,new r7({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new rf(n,new rr({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(r,a,o)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{aV.set(t.z,0,-t.x).normalize();let e=Math.acos(t.y);this.quaternion.setFromAxisAngle(aV,e)}}setLength(t,e=.2*t,r=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){super.dispose(),this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},"AttachedBindMode",0,u,"Audio",0,n7,"AudioAnalyser",0,class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0,e=this.getFrequencyData();for(let r=0;r<e.length;r++)t+=e[r];return t/e.length}},"AudioContext",0,nK,"AudioListener",0,class extends tL{constructor(){super(),this.type="AudioListener",this.context=nK.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new n2}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t),this._timer.update();let e=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(n5,n4,n6),n8.set(0,0,-1).applyQuaternion(n4),n9.set(0,1,0).applyQuaternion(n4),e.positionX){let t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(n5.x,t),e.positionY.linearRampToValueAtTime(n5.y,t),e.positionZ.linearRampToValueAtTime(n5.z,t),e.forwardX.linearRampToValueAtTime(n8.x,t),e.forwardY.linearRampToValueAtTime(n8.y,t),e.forwardZ.linearRampToValueAtTime(n8.z,t),e.upX.linearRampToValueAtTime(n9.x,t),e.upY.linearRampToValueAtTime(n9.y,t),e.upZ.linearRampToValueAtTime(n9.z,t)}else e.setPosition(n5.x,n5.y,n5.z),e.setOrientation(n8.x,n8.y,n8.z,n9.x,n9.y,n9.z)}},"AudioLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=this,n=new nf(this.manager);function a(e){i?i(e):A(e),s.manager.itemError(t)}n.setResponseType("arraybuffer"),n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,function(r){try{let i=r.slice(0),n=nK.getContext(),o=t+"#decode";s.manager.itemStart(o),n.decodeAudioData(i,function(t){e(t),s.manager.itemEnd(o)}).catch(function(t){a(t),s.manager.itemEnd(o)})}catch(t){a(t)}},r,i)}},"AxesHelper",0,class extends id{constructor(t=1){const e=new eP;e.setAttribute("position",new ew([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],3)),e.setAttribute("color",new ew([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(e,new r7({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,r){let i=new tV,s=this.geometry.attributes.color.array;return i.set(t),i.toArray(s,0),i.toArray(s,3),i.set(e),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"BackSide",0,1,"BasicDepthPacking",0,3200,"BasicShadowMap",0,0,"BatchedMesh",0,r9,"BezierInterpolant",0,s4,"Bone",0,rT,"BooleanKeyframeTrack",0,s7,"Box2",0,ax,"Box3",0,t8,"Box3Helper",0,class extends id{constructor(t,e=0xffff00){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new eP;i.setIndex(new eb(r,1)),i.setAttribute("position",new ew([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new r7({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){let e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"BoxGeometry",0,iT,"BoxHelper",0,class extends id{constructor(t,e=0xffff00){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),s=new eP;s.setIndex(new eb(r,1)),s.setAttribute("position",new eb(i,3)),super(s,new r7({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(void 0!==this.object&&aD.setFromObject(this.object),aD.isEmpty())return;let t=aD.min,e=aD.max,r=this.geometry.attributes.position,i=r.array;i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=t.x,i[4]=e.y,i[5]=e.z,i[6]=t.x,i[7]=t.y,i[8]=e.z,i[9]=e.x,i[10]=t.y,i[11]=e.z,i[12]=e.x,i[13]=e.y,i[14]=t.z,i[15]=t.x,i[16]=e.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=e.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"BufferAttribute",0,eb,"BufferGeometry",0,eP,"BufferGeometryLoader",0,nH,"ByteType",0,1010,"Cache",0,no,"Camera",0,nT,"CameraHelper",0,class extends id{constructor(t){const e=new eP,r=new r7({color:0xffffff,vertexColors:!0,toneMapped:!1}),i=[],s=[],n={};function a(t,e){o(t),o(e)}function o(t){i.push(0,0,0),s.push(0,0,0),void 0===n[t]&&(n[t]=[]),n[t].push(i.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),e.setAttribute("position",new ew(i,3)),e.setAttribute("color",new ew(s,3)),super(e,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=n,this.update();const h=new tV(0xffaa00),l=new tV(0xff0000),u=new tV(43775),c=new tV(0xffffff),d=new tV(3355443);this.setColors(h,l,u,c,d)}setColors(t,e,r,i,s){let n=this.geometry.getAttribute("color");return n.setXYZ(0,t.r,t.g,t.b),n.setXYZ(1,t.r,t.g,t.b),n.setXYZ(2,t.r,t.g,t.b),n.setXYZ(3,t.r,t.g,t.b),n.setXYZ(4,t.r,t.g,t.b),n.setXYZ(5,t.r,t.g,t.b),n.setXYZ(6,t.r,t.g,t.b),n.setXYZ(7,t.r,t.g,t.b),n.setXYZ(8,t.r,t.g,t.b),n.setXYZ(9,t.r,t.g,t.b),n.setXYZ(10,t.r,t.g,t.b),n.setXYZ(11,t.r,t.g,t.b),n.setXYZ(12,t.r,t.g,t.b),n.setXYZ(13,t.r,t.g,t.b),n.setXYZ(14,t.r,t.g,t.b),n.setXYZ(15,t.r,t.g,t.b),n.setXYZ(16,t.r,t.g,t.b),n.setXYZ(17,t.r,t.g,t.b),n.setXYZ(18,t.r,t.g,t.b),n.setXYZ(19,t.r,t.g,t.b),n.setXYZ(20,t.r,t.g,t.b),n.setXYZ(21,t.r,t.g,t.b),n.setXYZ(22,t.r,t.g,t.b),n.setXYZ(23,t.r,t.g,t.b),n.setXYZ(24,e.r,e.g,e.b),n.setXYZ(25,e.r,e.g,e.b),n.setXYZ(26,e.r,e.g,e.b),n.setXYZ(27,e.r,e.g,e.b),n.setXYZ(28,e.r,e.g,e.b),n.setXYZ(29,e.r,e.g,e.b),n.setXYZ(30,e.r,e.g,e.b),n.setXYZ(31,e.r,e.g,e.b),n.setXYZ(32,r.r,r.g,r.b),n.setXYZ(33,r.r,r.g,r.b),n.setXYZ(34,r.r,r.g,r.b),n.setXYZ(35,r.r,r.g,r.b),n.setXYZ(36,r.r,r.g,r.b),n.setXYZ(37,r.r,r.g,r.b),n.setXYZ(38,i.r,i.g,i.b),n.setXYZ(39,i.r,i.g,i.b),n.setXYZ(40,s.r,s.g,s.b),n.setXYZ(41,s.r,s.g,s.b),n.setXYZ(42,s.r,s.g,s.b),n.setXYZ(43,s.r,s.g,s.b),n.setXYZ(44,s.r,s.g,s.b),n.setXYZ(45,s.r,s.g,s.b),n.setXYZ(46,s.r,s.g,s.b),n.setXYZ(47,s.r,s.g,s.b),n.setXYZ(48,s.r,s.g,s.b),n.setXYZ(49,s.r,s.g,s.b),n.needsUpdate=!0,this}update(){let t,e,r=this.geometry,i=this.pointMap;if(aj.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)t=1,e=0;else if(2e3===this.camera.coordinateSystem)t=-1,e=1;else if(2001===this.camera.coordinateSystem)t=0,e=1;else throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);aU("c",i,r,aj,0,0,t),aU("t",i,r,aj,0,0,e),aU("n1",i,r,aj,-1,-1,t),aU("n2",i,r,aj,1,-1,t),aU("n3",i,r,aj,-1,1,t),aU("n4",i,r,aj,1,1,t),aU("f1",i,r,aj,-1,-1,e),aU("f2",i,r,aj,1,-1,e),aU("f3",i,r,aj,-1,1,e),aU("f4",i,r,aj,1,1,e),aU("u1",i,r,aj,.7,1.1,t),aU("u2",i,r,aj,-.7,1.1,t),aU("u3",i,r,aj,0,2,t),aU("cf1",i,r,aj,-1,0,e),aU("cf2",i,r,aj,1,0,e),aU("cf3",i,r,aj,0,-1,e),aU("cf4",i,r,aj,0,1,e),aU("cn1",i,r,aj,-1,0,t),aU("cn2",i,r,aj,1,0,t),aU("cn3",i,r,aj,0,-1,t),aU("cn4",i,r,aj,0,1,t),r.getAttribute("position").needsUpdate=!0}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"CanvasTexture",0,class extends tr{constructor(t,e,r,i,s,n,a,o,h){super(t,e,r,i,s,n,a,o,h),this.isCanvasTexture=!0,this.needsUpdate=!0}},"CapsuleGeometry",0,iC,"CatmullRomCurve3",0,iJ,"CineonToneMapping",0,3,"CircleGeometry",0,iE,"ClampToEdgeWrapping",0,1001,"Clock",0,class{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,_("Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=performance.now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}},"Color",0,tV,"ColorKeyframeTrack",0,nt,"ColorManagement",0,J,"Compatibility",0,{TEXTURE_COMPARE:"depthTextureCompare"},"CompressedArrayTexture",0,class extends iM{constructor(t,e,r,i,s,n){super(t,e,r,s,n),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=1001,this.layerUpdates=new Set}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}},"CompressedCubeTexture",0,class extends iM{constructor(t,e,r){super(void 0,t[0].width,t[0].height,e,r,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}},"CompressedTexture",0,iM,"CompressedTextureLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=this,n=[],a=new iM,o=new nf(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials);let h=0;if(Array.isArray(t))for(let l=0,u=t.length;l<u;++l)!function(l){o.load(t[l],function(t){let r=s.parse(t,!0);n[l]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},6===(h+=1)&&(1===r.mipmapCount&&(a.minFilter=1006),a.image=n,a.format=r.format,a.needsUpdate=!0,e&&e(a))},r,i)}(l);else o.load(t,function(t){let r=s.parse(t,!0);if(r.isCubemap){let t=r.mipmaps.length/r.mipmapCount;for(let e=0;e<t;e++){n[e]={mipmaps:[]};for(let t=0;t<r.mipmapCount;t++)n[e].mipmaps.push(r.mipmaps[e*r.mipmapCount+t]),n[e].format=r.format,n[e].width=r.width,n[e].height=r.height}a.image=n}else a.image.width=r.width,a.image.height=r.height,a.mipmaps=r.mipmaps;1===r.mipmapCount&&(a.minFilter=1006),a.format=r.format,a.needsUpdate=!0,e&&e(a)},r,i);return a}},"ConeGeometry",0,iO,"ConstantAlphaFactor",0,213,"ConstantColorFactor",0,211,"Controls",0,class extends C{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){null!==this.domElement&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}},"CubeCamera",0,class extends tL{constructor(t,e,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new nO(-90,1,t,e);i.layers=this.layers,this.add(i);const s=new nO(-90,1,t,e);s.layers=this.layers,this.add(s);const n=new nO(-90,1,t,e);n.layers=this.layers,this.add(n);const a=new nO(-90,1,t,e);a.layers=this.layers,this.add(a);const o=new nO(-90,1,t,e);o.layers=this.layers,this.add(o);const h=new nO(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[r,i,s,n,a,o]=e;for(let t of e)this.remove(t);if(2e3===t)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),n.up.set(0,0,1),n.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===t)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),n.up.set(0,0,-1),n.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,n,a,o,h,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;let f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1;let m=!1;m=!0===t.isWebGLRenderer?t.state.buffers.depth.getReversed():t.reversedDepthBuffer,t.setRenderTarget(r,0,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,s),t.setRenderTarget(r,1,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,n),t.setRenderTarget(r,2,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,a),t.setRenderTarget(r,3,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,o),t.setRenderTarget(r,4,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,h),r.texture.generateMipmaps=f,t.setRenderTarget(r,5,i),m&&!1===t.autoClear&&t.clearDepth(),t.render(e,l),t.setRenderTarget(u,c,d),t.xr.enabled=p,r.texture.needsPMREMUpdate=!0}},"CubeDepthTexture",0,class extends iA{constructor(t,e=1014,r=301,i,s,n=1003,a=1003,o,h=1026){const l={width:t,height:t,depth:1};super(t,t,e,r,i,s,n,a,o,h),this.image=[l,l,l,l,l,l],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}},"CubeReflectionMapping",0,301,"CubeRefractionMapping",0,302,"CubeTexture",0,i_,"CubeTextureLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=new i_;s.colorSpace=d;let n=new ny(this.manager);n.setCrossOrigin(this.crossOrigin),n.setPath(this.path);let a=0;for(let r=0;r<t.length;++r)!function(r){n.load(t[r],function(t){s.images[r]=t,6==++a&&(s.needsUpdate=!0,e&&e(s))},void 0,i)}(r);return s}},"CubeUVReflectionMapping",0,306,"CubicBezierCurve",0,iZ,"CubicBezierCurve3",0,iK,"CubicInterpolant",0,s2,"CullFaceBack",0,1,"CullFaceFront",0,2,"CullFaceFrontBack",0,3,"CullFaceNone",0,0,"Curve",0,iF,"CurvePath",0,i4,"CustomBlending",0,5,"CustomToneMapping",0,5,"CylinderGeometry",0,iR,"Cylindrical",0,class{constructor(t=1,e=0,r=0){this.radius=t,this.theta=e,this.y=r}set(t,e,r){return this.radius=t,this.theta=e,this.y=r,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,r){return this.radius=Math.sqrt(t*t+r*r),this.theta=Math.atan2(t,r),this.y=e,this}clone(){return new this.constructor().copy(this)}},"Data3DTexture",0,to,"DataArrayTexture",0,ta,"DataTexture",0,rC,"DataTextureLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=this,n=new rC,a=new nf(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(t,function(t){let r;try{r=s.parse(t)}catch(t){void 0!==i?i(t):A(t);return}s._applyTexData(n,r),e&&e(n,r)},r,i),n}createDataTexture(t){let e=new rC;return this._applyTexData(e,this.parse(t)),e}_applyTexData(t,e){void 0!==e.image?t.image=e.image:void 0!==e.data&&(t.image.width=e.width,t.image.height=e.height,t.image.data=e.data),t.wrapS=void 0!==e.wrapS?e.wrapS:1001,t.wrapT=void 0!==e.wrapT?e.wrapT:1001,t.magFilter=void 0!==e.magFilter?e.magFilter:1006,t.minFilter=void 0!==e.minFilter?e.minFilter:1006,t.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.mipmaps&&(t.mipmaps=e.mipmaps,t.minFilter=1008),1===e.mipmapCount&&(t.minFilter=1006),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),t.needsUpdate=!0}},"DataUtils",0,class{static toHalfFloat(t){return ep(t)}static fromHalfFloat(t){return ef(t)}},"DecrementStencilOp",0,7683,"DecrementWrapStencilOp",0,34056,"DefaultLoadingManager",0,nu,"DepthFormat",0,1026,"DepthStencilFormat",0,1027,"DepthTexture",0,iA,"DetachedBindMode",0,c,"DirectionalLight",0,nN,"DirectionalLightHelper",0,class extends tL{constructor(t,e,r){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",void 0===e&&(e=1);let i=new eP;i.setAttribute("position",new ew([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const s=new r7({fog:!1,toneMapped:!1});this.lightPlane=new ih(i,s),this.add(this.lightPlane),(i=new eP).setAttribute("position",new ew([0,0,0,0,0,1],3)),this.targetLine=new ih(i,s),this.add(this.targetLine),this.update()}dispose(){super.dispose(),this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),aL.setFromMatrixPosition(this.light.matrixWorld),az.setFromMatrixPosition(this.light.target.matrixWorld),aN.subVectors(az,aL),this.lightPlane.lookAt(az),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(az),this.targetLine.scale.z=aN.length()}},"DiscreteInterpolant",0,s5,"DodecahedronGeometry",0,ik,"DoubleSide",0,2,"DstAlphaFactor",0,206,"DstColorFactor",0,208,"DynamicCopyUsage",0,35050,"DynamicDrawUsage",0,35048,"DynamicReadUsage",0,35049,"EdgesGeometry",0,iN,"EllipseCurve",0,ij,"EqualCompare",0,514,"EqualDepth",0,4,"EqualStencilFunc",0,514,"EquirectangularReflectionMapping",0,303,"EquirectangularRefractionMapping",0,304,"Euler",0,tb,"EventDispatcher",0,C,"ExternalTexture",0,class extends tr{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}},"ExtrudeGeometry",0,sb,"FileLoader",0,nf,"Float16BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Uint16Array(t),e,r),this.isFloat16BufferAttribute=!0}getX(t){let e=ef(this.array[t*this.itemSize]);return this.normalized&&(e=z(e,this.array)),e}setX(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize]=ep(e),this}getY(t){let e=ef(this.array[t*this.itemSize+1]);return this.normalized&&(e=z(e,this.array)),e}setY(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+1]=ep(e),this}getZ(t){let e=ef(this.array[t*this.itemSize+2]);return this.normalized&&(e=z(e,this.array)),e}setZ(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+2]=ep(e),this}getW(t){let e=ef(this.array[t*this.itemSize+3]);return this.normalized&&(e=z(e,this.array)),e}setW(t,e){return this.normalized&&(e=N(e,this.array)),this.array[t*this.itemSize+3]=ep(e),this}setXY(t,e,r){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array)),this.array[t+0]=ep(e),this.array[t+1]=ep(r),this}setXYZ(t,e,r,i){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array)),this.array[t+0]=ep(e),this.array[t+1]=ep(r),this.array[t+2]=ep(i),this}setXYZW(t,e,r,i,s){return t*=this.itemSize,this.normalized&&(e=N(e,this.array),r=N(r,this.array),i=N(i,this.array),s=N(s,this.array)),this.array[t+0]=ep(e),this.array[t+1]=ep(r),this.array[t+2]=ep(i),this.array[t+3]=ep(s),this}},"Float32BufferAttribute",0,ew,"FloatType",0,1015,"Fog",0,tG,"FogExp2",0,tq,"FramebufferTexture",0,class extends tr{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}},"FrontSide",0,0,"Frustum",0,rW,"FrustumArray",0,rG,"GLBufferAttribute",0,class{constructor(t,e,r,i,s,n=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=t,this.type=e,this.itemSize=r,this.elementSize=i,this.count=s,this.normalized=n,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}},"GLSL1",0,"100","GLSL3",0,"300 es","GreaterCompare",0,516,"GreaterDepth",0,6,"GreaterEqualCompare",0,518,"GreaterEqualDepth",0,5,"GreaterEqualStencilFunc",0,518,"GreaterStencilFunc",0,516,"GridHelper",0,class extends id{constructor(t=10,e=10,r=4473924,i=8947848){r=new tV(r),i=new tV(i);const s=e/2,n=t/e,a=t/2,o=[],h=[];for(let t=0,l=0,u=-a;t<=e;t++,u+=n){o.push(-a,0,u,a,0,u),o.push(u,0,-a,u,0,a);const e=t===s?r:i;e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3}const l=new eP;l.setAttribute("position",new ew(o,3)),l.setAttribute("color",new ew(h,3)),super(l,new r7({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"Group",0,tz,"HTMLTexture",0,class extends tr{constructor(t,e,r,i,s,n,a,o,h){super(t,e,r,i,s,n,a,o,h),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;const l=t?t.parentNode:null;null!==l&&"requestPaint"in l&&(l.onpaint=()=>{this.needsUpdate=!0},l.requestPaint())}dispose(){let t=this.image?this.image.parentNode:null;null!==t&&"onpaint"in t&&(t.onpaint=null),super.dispose()}},"HalfFloatType",0,1016,"HemisphereLight",0,nb,"HemisphereLightHelper",0,class extends tL{constructor(t,e,r){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const i=new sS(e);i.rotateY(.5*Math.PI),this.material=new rr({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const s=new Float32Array(3*i.getAttribute("position").count);i.setAttribute("color",new eb(s,3)),this.add(new rf(i,this.material)),this.update()}dispose(){super.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let e=t.geometry.getAttribute("color");aP.copy(this.light.color),aB.copy(this.light.groundColor);for(let t=0,r=e.count;t<r;t++){let i=t<r/2?aP:aB;e.setXYZ(t,i.r,i.g,i.b)}e.needsUpdate=!0}this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),t.lookAt(ak.setFromMatrixPosition(this.light.matrixWorld).negate())}},"IcosahedronGeometry",0,sx,"ImageBitmapLoader",0,class extends nc{constructor(t){super(t),this.isImageBitmapLoader=!0,"u"<typeof createImageBitmap&&_("ImageBitmapLoader: createImageBitmap() not supported."),"u"<typeof fetch&&_("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(t){return this.options=t,this}load(t,e,r,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=this,n=no.get(`image-bitmap:${t}`);if(void 0!==n)return(s.manager.itemStart(t),n.then)?void n.then(r=>{!0===nZ.has(n)?(i&&i(nZ.get(n)),s.manager.itemError(t)):e&&e(r),s.manager.itemEnd(t)}):void setTimeout(function(){e&&e(n),s.manager.itemEnd(t)},0);let a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,a.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(t,a).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign({},s.options,{colorSpaceConversion:"none"}))}).then(function(r){return no.add(`image-bitmap:${t}`,r),e&&e(r),s.manager.itemEnd(t),r}).catch(function(e){i&&i(e),nZ.set(o,e),no.remove(`image-bitmap:${t}`),s.manager.itemError(t),s.manager.itemEnd(t)});no.add(`image-bitmap:${t}`,o),s.manager.itemStart(t)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},"ImageLoader",0,ny,"ImageUtils",0,X,"IncrementStencilOp",0,7682,"IncrementWrapStencilOp",0,34055,"InstancedBufferAttribute",0,rI,"InstancedBufferGeometry",0,nG,"InstancedInterleavedBuffer",0,class extends eB{constructor(t,e,r=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}},"InstancedMesh",0,rj,"Int16BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Int16Array(t),e,r)}},"Int32BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Int32Array(t),e,r)}},"Int8BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Int8Array(t),e,r)}},"IntType",0,1013,"InterleavedBuffer",0,eB,"InterleavedBufferAttribute",0,ez,"Interpolant",0,s1,"InterpolateBezier",0,2303,"InterpolateDiscrete",0,2300,"InterpolateLinear",0,2301,"InterpolateSmooth",0,2302,"InterpolationSamplingMode",0,{NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},"InterpolationSamplingType",0,{PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},"InvertStencilOp",0,5386,"KeepStencilOp",0,7680,"KeyframeTrack",0,s8,"LOD",0,e6,"LatheGeometry",0,sw,"Layers",0,tv,"LessCompare",0,513,"LessDepth",0,2,"LessEqualCompare",0,515,"LessEqualDepth",0,3,"LessEqualStencilFunc",0,515,"LessStencilFunc",0,513,"Light",0,ng,"LightProbe",0,nD,"LightShadow",0,nS,"Line",0,ih,"Line3",0,class{constructor(t=new U,e=new U){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){aw.subVectors(t,this.start),aS.subVectors(this.end,this.start);let r=aS.dot(aS);if(0===r)return 0;let i=aS.dot(aw)/r;return e&&(i=P(i,0,1)),i}closestPointToPoint(t,e,r){let i=this.closestPointToPointParameter(t,e);return this.delta(r).multiplyScalar(i).add(this.start)}distanceSqToLine3(t,e=aT,r=aC){let i,s,n=1e-8*1e-8,a=this.start,o=t.start,h=this.end,l=t.end;aM.subVectors(h,a),a_.subVectors(l,o),aA.subVectors(a,o);let u=aM.dot(aM),c=a_.dot(a_),d=a_.dot(aA);if(u<=n&&c<=n)return e.copy(a),r.copy(o),e.sub(r),e.dot(e);if(u<=n)i=0,s=P(s=d/c,0,1);else{let t=aM.dot(aA);if(c<=n)s=0,i=P(-t/u,0,1);else{let e=aM.dot(a_),r=u*c-e*e;i=0!==r?P((e*d-t*c)/r,0,1):0,(s=(e*i+d)/c)<0?(s=0,i=P(-t/u,0,1)):s>1&&(s=1,i=P((e-t)/u,0,1))}}return e.copy(a).addScaledVector(aM,i),r.copy(o).addScaledVector(a_,s),e.distanceToSquared(r)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},"LineBasicMaterial",0,r7,"LineCurve",0,iQ,"LineCurve3",0,i0,"LineDashedMaterial",0,sY,"LineLoop",0,ip,"LineSegments",0,id,"LinearFilter",0,1006,"LinearInterpolant",0,s3,"LinearMipMapLinearFilter",0,1008,"LinearMipMapNearestFilter",0,1007,"LinearMipmapLinearFilter",0,1008,"LinearMipmapNearestFilter",0,1007,"LinearSRGBColorSpace",0,p,"LinearToneMapping",0,1,"LinearTransfer",0,f,"Loader",0,nc,"LoaderUtils",0,nq,"LoadingManager",0,nl,"LoopOnce",0,2200,"LoopPingPong",0,2202,"LoopRepeat",0,2201,"MOUSE",0,{LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},"Material",0,eV,"MaterialBlending",0,6,"MaterialLoader",0,nW,"MathUtils",0,{DEG2RAD:O,RAD2DEG:I,generateUUID:k,clamp:P,euclideanModulo:B,mapLinear:function(t,e,r,i,s){return i+(t-e)*(s-i)/(r-e)},inverseLerp:function(t,e,r){return t!==e?(r-t)/(e-t):0},lerp:L,damp:function(t,e,r,i){return L(t,e,1-Math.exp(-r*i))},pingpong:function(t,e=1){return e-Math.abs(B(t,2*e)-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(R=t);let e=R+=0x6d2b79f5;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000},degToRad:function(t){return t*O},radToDeg:function(t){return t*I},isPowerOfTwo:function(t){return t>0&&Number.isInteger(t)&&2**Math.round(Math.log2(t))===t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,r,i,s){let n=Math.cos,a=Math.sin,o=n(r/2),h=a(r/2),l=n((e+i)/2),u=a((e+i)/2),c=n((e-i)/2),d=a((e-i)/2),p=n((i-e)/2),f=a((i-e)/2);switch(s){case"XYX":t.set(o*u,h*c,h*d,o*l);break;case"YZY":t.set(h*d,o*u,h*c,o*l);break;case"ZXZ":t.set(h*c,h*d,o*u,o*l);break;case"XZX":t.set(o*u,h*f,h*p,o*l);break;case"YXY":t.set(h*p,o*u,h*f,o*l);break;case"ZYZ":t.set(h*f,h*p,o*u,o*l);break;default:_("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}},normalize:N,denormalize:z},"Matrix2",0,ab,"Matrix3",0,W,"Matrix4",0,th,"MaxEquation",0,104,"Mesh",0,rf,"MeshBasicMaterial",0,rr,"MeshDepthMaterial",0,sH,"MeshDistanceMaterial",0,sJ,"MeshLambertMaterial",0,sG,"MeshMatcapMaterial",0,s$,"MeshNormalMaterial",0,sq,"MeshPhongMaterial",0,sV,"MeshPhysicalMaterial",0,sD,"MeshStandardMaterial",0,sU,"MeshToonMaterial",0,sW,"MinEquation",0,103,"MirroredRepeatWrapping",0,1002,"MixOperation",0,1,"MultiplyBlending",0,4,"MultiplyOperation",0,0,"NearestFilter",0,1003,"NearestMipMapLinearFilter",0,1005,"NearestMipMapNearestFilter",0,1004,"NearestMipmapLinearFilter",0,1005,"NearestMipmapNearestFilter",0,1004,"NeutralToneMapping",0,7,"NeverCompare",0,512,"NeverDepth",0,0,"NeverStencilFunc",0,512,"NoBlending",0,0,"NoColorSpace",0,"","NoNormalPacking",0,"","NoToneMapping",0,0,"NormalAnimationBlendMode",0,2500,"NormalBlending",0,1,"NormalGAPacking",0,"ga","NormalRGPacking",0,"rg","NotEqualCompare",0,517,"NotEqualDepth",0,7,"NotEqualStencilFunc",0,517,"NumberKeyframeTrack",0,ne,"Object3D",0,tL,"ObjectLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=this,n=""===this.path?nq.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||n;let a=new nf(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(r){let n=null;try{n=JSON.parse(r)}catch(e){void 0!==i&&i(e),A("ObjectLoader: Can't parse "+t+".",e.message);return}let a=n.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase()){void 0!==i&&i(Error("THREE.ObjectLoader: Can't load "+t)),A("ObjectLoader: Can't load "+t);return}s.parse(n,e)},r,i)}async loadAsync(t,e){let r,i=""===this.path?nq.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;let s=new nf(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);let n=await s.loadAsync(t,e);try{r=JSON.parse(n)}catch(e){throw Error("THREE.ObjectLoader: Can't parse "+t+". "+e.message)}let a=r.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(r)}parse(t,e){let r=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),s=this.parseGeometries(t.geometries,i),n=this.parseImages(t.images,function(){void 0!==e&&e(h)}),a=this.parseTextures(t.textures,n),o=this.parseMaterials(t.materials,a),h=this.parseObject(t.object,s,o,a,r),l=this.parseSkeletons(t.skeletons,h);if(this.bindSkeletons(h,l),this.bindLightTargets(h),void 0!==e){let t=!1;for(let e in n)if(n[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(h)}return h}async parseAsync(t){let e=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),i=this.parseGeometries(t.geometries,r),s=await this.parseImagesAsync(t.images),n=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,n),o=this.parseObject(t.object,i,a,n,e),h=this.parseSkeletons(t.skeletons,o);return this.bindSkeletons(o,h),this.bindLightTargets(o),o}static registerGeometry(t,e){nJ[t]=e}parseShapes(t){let e={};if(void 0!==t)for(let r=0,i=t.length;r<i;r++){let i=new i8().fromJSON(t[r]);e[i.uuid]=i}return e}parseSkeletons(t,e){let r={},i={};if(e.traverse(function(t){t.isBone&&(i[t.uuid]=t)}),void 0!==t)for(let e=0,s=t.length;e<s;e++){let s=new rO().fromJSON(t[e],i);r[s.uuid]=s}return r}parseGeometries(t,e){let r={};if(void 0!==t){let i=new nH;for(let s=0,n=t.length;s<n;s++){let n,a=t[s];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":n=i.parse(a);break;default:a.type in sP?n=sP[a.type].fromJSON(a,e):a.type in nJ?n=nJ[a.type].fromJSON(a,e):_(`ObjectLoader: Unknown geometry type "${a.type}". Use .registerGeometry() before starting the deserialization process.`)}n.uuid=a.uuid,void 0!==a.name&&(n.name=a.name),void 0!==a.userData&&(n.userData=a.userData),r[a.uuid]=n}}return r}parseMaterials(t,e){let r={},i={};if(void 0!==t){let s=new nW;s.setTextures(e);for(let e=0,n=t.length;e<n;e++){let n=t[e];void 0===r[n.uuid]&&(r[n.uuid]=s.parse(n)),i[n.uuid]=r[n.uuid]}}return i}parseAnimations(t){let e={};if(void 0!==t)for(let r=0;r<t.length;r++){let i=t[r],s=na.parse(i);e[s.uuid]=s}return e}parseImages(t,e){let r,i=this,s={};function n(t){if("string"==typeof t){var e;return e=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:i.resourcePath+t,e=i.manager.resolveURL(e),i.manager.itemStart(e),r.load(e,function(){i.manager.itemEnd(e)},void 0,function(){i.manager.itemError(e),i.manager.itemEnd(e)})}return t.data?{data:g(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(r=new ny(new nl(e))).setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e<r;e++){let r=t[e],i=r.url;if(Array.isArray(i)){let t=[];for(let e=0,r=i.length;e<r;e++){let r=n(i[e]);null!==r&&(r instanceof HTMLImageElement?t.push(r):t.push(new rC(r.data,r.width,r.height)))}s[r.uuid]=new K(t)}else{let t=n(r.url);s[r.uuid]=new K(t)}}}return s}async parseImagesAsync(t){let e,r=this,i={};async function s(t){if("string"==typeof t){let i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t;return await e.loadAsync(i)}return t.data?{data:g(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(e=new ny(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e<r;e++){let r=t[e],n=r.url;if(Array.isArray(n)){let t=[];for(let e=0,r=n.length;e<r;e++){let r=n[e],i=await s(r);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new rC(i.data,i.width,i.height)))}i[r.uuid]=new K(t)}else{let t=await s(r.url);i[r.uuid]=new K(t)}}}return i}parseTextures(t,e){function r(t,e){return"number"==typeof t?t:(_("ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}let i={};if(void 0!==t)for(let s=0,n=t.length;s<n;s++){let n,a=t[s];void 0===a.image&&_('ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&_("ObjectLoader: Undefined image",a.image);let o=e[a.image],h=o.data;Array.isArray(h)?(n=new i_,6===h.length&&(n.needsUpdate=!0)):(n=h&&h.data?new rC:new tr,h&&(n.needsUpdate=!0)),n.source=o,n.uuid=a.uuid,void 0!==a.name&&(n.name=a.name),void 0!==a.mapping&&(n.mapping=r(a.mapping,n$)),void 0!==a.channel&&(n.channel=a.channel),void 0!==a.offset&&n.offset.fromArray(a.offset),void 0!==a.repeat&&n.repeat.fromArray(a.repeat),void 0!==a.center&&n.center.fromArray(a.center),void 0!==a.rotation&&(n.rotation=a.rotation),void 0!==a.wrap&&(n.wrapS=r(a.wrap[0],nY),n.wrapT=r(a.wrap[1],nY)),void 0!==a.format&&(n.format=a.format),void 0!==a.internalFormat&&(n.internalFormat=a.internalFormat),void 0!==a.type&&(n.type=a.type),void 0!==a.colorSpace&&(n.colorSpace=a.colorSpace),void 0!==a.minFilter&&(n.minFilter=r(a.minFilter,nX)),void 0!==a.magFilter&&(n.magFilter=r(a.magFilter,nX)),void 0!==a.anisotropy&&(n.anisotropy=a.anisotropy),void 0!==a.flipY&&(n.flipY=a.flipY),void 0!==a.generateMipmaps&&(n.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(n.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(n.unpackAlignment=a.unpackAlignment),void 0!==a.compareFunction&&(n.compareFunction=a.compareFunction),void 0!==a.normalized&&(n.normalized=a.normalized),void 0!==a.userData&&(n.userData=a.userData),i[a.uuid]=n}return i}parseObject(t,e,r,i,s){let n,a,o;function h(t){return void 0===e[t]&&_("ObjectLoader: Undefined geometry",t),e[t]}function l(t){if(void 0!==t){if(Array.isArray(t)){let e=[];for(let i=0,s=t.length;i<s;i++){let s=t[i];void 0===r[s]&&_("ObjectLoader: Undefined material",s),e.push(r[s])}return e}return void 0===r[t]&&_("ObjectLoader: Undefined material",t),r[t]}}function u(t){return void 0===i[t]&&_("ObjectLoader: Undefined texture",t),i[t]}switch(t.type){case"Scene":n=new tH,void 0!==t.background&&(Number.isInteger(t.background)?n.background=new tV(t.background):n.background=u(t.background)),void 0!==t.environment&&(n.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new tG(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new tq(t.fog.color,t.fog.density)),""!==t.fog.name&&(n.fog.name=t.fog.name)),void 0!==t.backgroundBlurriness&&(n.backgroundBlurriness=t.backgroundBlurriness),void 0!==t.backgroundIntensity&&(n.backgroundIntensity=t.backgroundIntensity),void 0!==t.backgroundRotation&&n.backgroundRotation.fromArray(t.backgroundRotation),void 0!==t.environmentIntensity&&(n.environmentIntensity=t.environmentIntensity),void 0!==t.environmentRotation&&n.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":n=new nO(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new nL(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new nF(t.color,t.intensity);break;case"DirectionalLight":(n=new nN(t.color,t.intensity)).target=t.target||"";break;case"PointLight":n=new nB(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new nj(t.color,t.intensity,t.width,t.height);break;case"SpotLight":(n=new nk(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay)).target=t.target||"";break;case"HemisphereLight":n=new nb(t.color,t.groundColor,t.intensity);break;case"LightProbe":n=new nD(new nU().fromArray(t.sh),t.intensity);break;case"SkinnedMesh":n=new rA(a=h(t.geometry),o=l(t.material)),void 0!==t.bindMode&&(n.bindMode=t.bindMode),void 0!==t.bindMatrix&&n.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(n.skeleton=t.skeleton);break;case"Mesh":n=new rf(a=h(t.geometry),o=l(t.material));break;case"InstancedMesh":a=h(t.geometry),o=l(t.material);let c=t.count,d=t.instanceMatrix,p=t.instanceColor;(n=new rj(a,o,c)).instanceMatrix=new rI(new Float32Array(d.array),16),void 0!==p&&(n.instanceColor=new rI(new Float32Array(p.array),p.itemSize));break;case"BatchedMesh":a=h(t.geometry),o=l(t.material),(n=new r9(t.maxInstanceCount,t.maxVertexCount,t.maxIndexCount,o)).geometry=a,n.perObjectFrustumCulled=t.perObjectFrustumCulled,n.sortObjects=t.sortObjects,n._drawRanges=t.drawRanges,n._reservedRanges=t.reservedRanges,n._geometryInfo=t.geometryInfo.map(t=>{let e=null,r=null;return void 0!==t.boundingBox&&(e=new t8().fromJSON(t.boundingBox)),void 0!==t.boundingSphere&&(r=new eA().fromJSON(t.boundingSphere)),{...t,boundingBox:e,boundingSphere:r}}),n._instanceInfo=t.instanceInfo,n._availableInstanceIds=t._availableInstanceIds,n._availableGeometryIds=t._availableGeometryIds,n._nextIndexStart=t.nextIndexStart,n._nextVertexStart=t.nextVertexStart,n._geometryCount=t.geometryCount,n._maxInstanceCount=t.maxInstanceCount,n._maxVertexCount=t.maxVertexCount,n._maxIndexCount=t.maxIndexCount,n._geometryInitialized=t.geometryInitialized,n._matricesTexture=u(t.matricesTexture.uuid),n._indirectTexture=u(t.indirectTexture.uuid),void 0!==t.colorsTexture&&(n._colorsTexture=u(t.colorsTexture.uuid)),void 0!==t.boundingSphere&&(n.boundingSphere=new eA().fromJSON(t.boundingSphere)),void 0!==t.boundingBox&&(n.boundingBox=new t8().fromJSON(t.boundingBox));break;case"LOD":n=new e6;break;case"Line":n=new ih(h(t.geometry),l(t.material));break;case"LineLoop":n=new ip(h(t.geometry),l(t.material));break;case"LineSegments":n=new id(h(t.geometry),l(t.material));break;case"PointCloud":case"Points":n=new ix(h(t.geometry),l(t.material));break;case"Sprite":n=new e2(l(t.material));break;case"Group":n=new tz;break;case"Bone":n=new rT;break;default:n=new tL}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.up&&n.up.fromArray(t.up),void 0!==t.pivot&&(n.pivot=new U().fromArray(t.pivot)),void 0!==t.morphTargetDictionary&&(n.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),void 0!==t.morphTargetInfluences&&(n.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.intensity&&(n.shadow.intensity=t.shadow.intensity),void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(n.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.blurSamples&&(n.shadow.blurSamples=t.shadow.blurSamples),void 0!==t.shadow.focus&&(n.shadow.focus=t.shadow.focus),void 0!==t.shadow.aspect&&(n.shadow.aspect=t.shadow.aspect),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.static&&(n.static=t.static),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children){let a=t.children;for(let t=0;t<a.length;t++)n.add(this.parseObject(a[t],e,r,i,s))}if(void 0!==t.animations){let e=t.animations;for(let t=0;t<e.length;t++){let r=e[t];n.animations.push(s[r])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(n.autoUpdate=t.autoUpdate);let e=t.levels;for(let t=0;t<e.length;t++){let r=e[t],i=n.getObjectByProperty("uuid",r.object);void 0!==i&&n.addLevel(i,r.distance,r.hysteresis)}}return n}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){let r=e[t.skeleton];void 0===r?_("ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(r,t.bindMatrix)}})}bindLightTargets(t){t.traverse(function(e){if(e.isDirectionalLight||e.isSpotLight){let r=e.target,i=t.getObjectByProperty("uuid",r);void 0!==i?e.target=i:e.target=new tL}})}},"ObjectSpaceNormalMap",0,1,"OctahedronGeometry",0,sS,"OneFactor",0,201,"OneMinusConstantAlphaFactor",0,214,"OneMinusConstantColorFactor",0,212,"OneMinusDstAlphaFactor",0,207,"OneMinusDstColorFactor",0,209,"OneMinusSrcAlphaFactor",0,205,"OneMinusSrcColorFactor",0,203,"OrthographicCamera",0,nL,"PCFShadowMap",0,1,"PCFSoftShadowMap",0,2,"Path",0,i6,"PerspectiveCamera",0,nO,"Plane",0,eU,"PlaneGeometry",0,sM,"PlaneHelper",0,class extends ih{constructor(t,e=1,r=0xffff00){const i=new eP;i.setAttribute("position",new ew([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere(),super(i,new r7({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new eP;s.setAttribute("position",new ew([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new rf(s,new rr({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(t)}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},"PointLight",0,nB,"PointLightHelper",0,class extends rf{constructor(t,e,r){super(new sT(e,4,2),new rr({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}update(){this.matrixWorldNeedsUpdate=!0,this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},"Points",0,ix,"PointsMaterial",0,im,"PolarGridHelper",0,class extends id{constructor(t=10,e=16,r=8,i=64,s=4473924,n=8947848){s=new tV(s),n=new tV(n);const a=[],o=[];if(e>1)for(let r=0;r<e;r++){const i=r/e*(2*Math.PI),h=Math.sin(i)*t,l=Math.cos(i)*t;a.push(0,0,0),a.push(h,0,l);const u=1&r?s:n;o.push(u.r,u.g,u.b),o.push(u.r,u.g,u.b)}for(let e=0;e<r;e++){const h=1&e?s:n,l=t-t/r*e;for(let t=0;t<i;t++){let e=t/i*(2*Math.PI),r=Math.sin(e)*l,s=Math.cos(e)*l;a.push(r,0,s),o.push(h.r,h.g,h.b),r=Math.sin(e=(t+1)/i*(2*Math.PI))*l,s=Math.cos(e)*l,a.push(r,0,s),o.push(h.r,h.g,h.b)}}const h=new eP;h.setAttribute("position",new ew(a,3)),h.setAttribute("color",new ew(o,3)),super(h,new r7({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"PolyhedronGeometry",0,iI,"PositionalAudio",0,class extends n7{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,r){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=r,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(at,ae,ar),ai.set(0,0,1).applyQuaternion(ae);let e=this.panner;if(e.positionX){let t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(at.x,t),e.positionY.linearRampToValueAtTime(at.y,t),e.positionZ.linearRampToValueAtTime(at.z,t),e.orientationX.linearRampToValueAtTime(ai.x,t),e.orientationY.linearRampToValueAtTime(ai.y,t),e.orientationZ.linearRampToValueAtTime(ai.z,t)}else e.setPosition(at.x,at.y,at.z),e.setOrientation(ai.x,ai.y,ai.z)}},"PropertyBinding",0,ac,"PropertyMixer",0,as,"QuadraticBezierCurve",0,i1,"QuadraticBezierCurve3",0,i2,"Quaternion",0,j,"QuaternionKeyframeTrack",0,ni,"QuaternionLinearInterpolant",0,nr,"R11_EAC_Format",0,37488,"RAD2DEG",0,I,"RED_GREEN_RGTC2_Format",0,36285,"RED_RGTC1_Format",0,36283,"REVISION",0,"186","RG11_EAC_Format",0,37490,"RGBADepthPacking",0,3201,"RGBAFormat",0,1023,"RGBAIntegerFormat",0,1033,"RGBA_ASTC_10x10_Format",0,37819,"RGBA_ASTC_10x5_Format",0,37816,"RGBA_ASTC_10x6_Format",0,37817,"RGBA_ASTC_10x8_Format",0,37818,"RGBA_ASTC_12x10_Format",0,37820,"RGBA_ASTC_12x12_Format",0,37821,"RGBA_ASTC_4x4_Format",0,37808,"RGBA_ASTC_5x4_Format",0,37809,"RGBA_ASTC_5x5_Format",0,37810,"RGBA_ASTC_6x5_Format",0,37811,"RGBA_ASTC_6x6_Format",0,37812,"RGBA_ASTC_8x5_Format",0,37813,"RGBA_ASTC_8x6_Format",0,37814,"RGBA_ASTC_8x8_Format",0,37815,"RGBA_BPTC_Format",0,36492,"RGBA_ETC2_EAC_Format",0,37496,"RGBA_PVRTC_2BPPV1_Format",0,35843,"RGBA_PVRTC_4BPPV1_Format",0,35842,"RGBA_S3TC_DXT1_Format",0,33777,"RGBA_S3TC_DXT3_Format",0,33778,"RGBA_S3TC_DXT5_Format",0,33779,"RGBDepthPacking",0,3202,"RGBFormat",0,1022,"RGBIntegerFormat",0,1032,"RGB_BPTC_SIGNED_Format",0,36494,"RGB_BPTC_UNSIGNED_Format",0,36495,"RGB_ETC1_Format",0,36196,"RGB_ETC2_Format",0,37492,"RGB_PVRTC_2BPPV1_Format",0,35841,"RGB_PVRTC_4BPPV1_Format",0,35840,"RGB_S3TC_DXT1_Format",0,33776,"RGDepthPacking",0,3203,"RGFormat",0,1030,"RGIntegerFormat",0,1031,"RawShaderMaterial",0,sj,"Ray",0,re,"Raycaster",0,class{constructor(t,e,r=0,i=1/0){this.ray=new re(t,e),this.near=r,this.far=i,this.camera=null,this.layers=new tv,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,e.projectionMatrix.elements[14]).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):A("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return am.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(am),this}intersectObject(t,e=!0,r=[]){return ag(t,this,r,e),r.sort(ay),r}intersectObjects(t,e=!0,r=[]){for(let i=0,s=t.length;i<s;i++)ag(t[i],this,r,e);return r.sort(ay),r}},"RectAreaLight",0,nj,"RedFormat",0,1028,"RedIntegerFormat",0,1029,"ReinhardToneMapping",0,2,"RenderObjectRefreshType",0,{NONE:0,SHARED:1,FULL:2},"RenderTarget",0,ts,"RenderTarget3D",0,class extends ts{constructor(t=1,e=1,r=1,i={}){super(t,e,i),this.isRenderTarget3D=!0,this.depth=r;for(let i=0;i<this.textures.length;i++){const s=new to(null,t,e,r);s.isRenderTargetTexture=!0,s.renderTarget=this,this.textures[i]=s}this._setTextureOptions(i)}},"RepeatWrapping",0,1e3,"ReplaceStencilOp",0,7681,"ReverseSubtractEquation",0,102,"ReversedDepthFuncs",0,{0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},"RingGeometry",0,s_,"SIGNED_R11_EAC_Format",0,37489,"SIGNED_RED_GREEN_RGTC2_Format",0,36286,"SIGNED_RED_RGTC1_Format",0,36284,"SIGNED_RG11_EAC_Format",0,37491,"SRGBColorSpace",0,d,"SRGBTransfer",0,m,"Scene",0,tH,"ShaderMaterial",0,sF,"ShadowMaterial",0,sB,"Shape",0,i8,"ShapeGeometry",0,sA,"ShapePath",0,class{constructor(){this.type="ShapePath",this.color=new tV,this.subPaths=[],this.currentPath=null,this.userData={}}moveTo(t,e){return this.currentPath=new i6,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,s,n){return this.currentPath.bezierCurveTo(t,e,r,i,s,n),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(){function t(t,e){let r=!1,i=e.length;for(let s=0,n=i-1;s<i;n=s++){let i=e[s],a=e[n];i.y>t.y!=a.y>t.y&&t.x<(a.x-i.x)*(t.y-i.y)/(a.y-i.y)+i.x&&(r=!r)}return r}let e=this.userData.style&&this.userData.style.fillRule||"nonzero";"nonzero"!==e&&"evenodd"!==e&&(_('Fill-rule "'+e+'" is not supported, falling back to "nonzero".'),e="nonzero");let r="nonzero"===e?t=>0!==t:t=>(1&t)!=0,i=[];for(let e of this.subPaths){let r=e.getPoints();if(r.length<3)continue;let s=sm.area(r);if(0===s)continue;let n=new ax;for(let t=0;t<r.length;t++)n.expandByPoint(r[t]);i.push({subPath:e,points:r,boundingBox:n,interiorPoint:function(e,r){let i=r.getCenter(new F);if(t(i,e))return i;let s=i.y,n=[],a=e.length;for(let t=0;t<a;t++){let r=e[t],i=e[(t+1)%a];if(r.y>s!=i.y>s){let t=r.x+(s-r.y)*(i.x-r.x)/(i.y-r.y);n.push(t)}}return n.length>1&&(n.sort((t,e)=>t-e),i.x=(n[0]+n[1])/2),i}(r,n),absArea:Math.abs(s),winding:s<0?-1:1,container:null,exclude:!1,role:null})}i.sort((t,e)=>e.absArea-t.absArea);for(let e=0;e<i.length;e++){let s=i[e],n=0;for(let r=e-1;r>=0;r--){let e=i[r];if(e.boundingBox.containsBox(s.boundingBox)&&t(s.interiorPoint,e.points)){s.container=e.exclude?e.container:e,n=e.winding,s.winding+=n;break}}r(s.winding)===r(n)&&(s.exclude=!0)}for(let t of i)t.exclude||(t.role=null===t.container||"hole"===t.container.role?"outer":"hole");let s=[],n=new Map;for(let t of i){if(t.exclude||"outer"!==t.role)continue;let e=new i8;e.curves=t.subPath.curves,s.push(e),n.set(t,e)}for(let t of i){if(t.exclude||"hole"!==t.role)continue;let e=n.get(t.container);if(!e)continue;let r=new i6;r.curves=t.subPath.curves,e.holes.push(r)}return s}},"ShapeUtils",0,sm,"ShortType",0,1011,"Skeleton",0,rO,"SkeletonHelper",0,class extends id{constructor(t){const e=function t(e){let r=[];!0===e.isBone&&r.push(e);for(let i=0;i<e.children.length;i++)r.push(...t(e.children[i]));return r}(t),r=new eP,i=[],s=[];for(let t=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(0,0,0),s.push(0,0,0))}r.setAttribute("position",new ew(i,3)),r.setAttribute("color",new ew(s,3)),super(r,new r7({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;const n=new tV(255),a=new tV(65280);this.setColors(n,a)}updateMatrixWorld(t){let e=this.bones,r=this.geometry,i=r.getAttribute("position");aI.copy(this.root.matrixWorld).invert();for(let t=0,r=0;t<e.length;t++){let s=e[t];s.parent&&s.parent.isBone&&(aO.multiplyMatrices(aI,s.matrixWorld),aR.setFromMatrixPosition(aO),i.setXYZ(r,aR.x,aR.y,aR.z),aO.multiplyMatrices(aI,s.parent.matrixWorld),aR.setFromMatrixPosition(aO),i.setXYZ(r+1,aR.x,aR.y,aR.z),r+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}setColors(t,e){let r=this.geometry.getAttribute("color");for(let i=0;i<r.count;i+=2)r.setXYZ(i,t.r,t.g,t.b),r.setXYZ(i+1,e.r,e.g,e.b);return r.needsUpdate=!0,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}},"SkinnedMesh",0,rA,"Source",0,class extends K{constructor(t=null){T('Source: "Source" has been renamed to "TextureSource". Please update your code to use "THREE.TextureSource" instead.'),super(t),this.isSource=!0}},"Sphere",0,eA,"SphereGeometry",0,sT,"Spherical",0,class{constructor(t=1,e=0,r=0){this.radius=t,this.phi=e,this.theta=r}set(t,e,r){return this.radius=t,this.phi=e,this.theta=r,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=P(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,r){return this.radius=Math.sqrt(t*t+e*e+r*r),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,r),this.phi=Math.acos(P(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},"SphericalHarmonics3",0,nU,"SplineCurve",0,i3,"SpotLight",0,nk,"SpotLightHelper",0,class extends tL{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const r=new eP,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 t=0,e=1;t<32;t++,e++){const r=t/32*Math.PI*2,s=e/32*Math.PI*2;i.push(Math.cos(r),Math.sin(r),1,Math.cos(s),Math.sin(s),1)}r.setAttribute("position",new ew(i,3));const s=new r7({fog:!1,toneMapped:!1});this.cone=new id(r,s),this.add(this.cone),this.update()}dispose(){super.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorldNeedsUpdate=!0;let t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),aE.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(aE),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},"Sprite",0,e2,"SpriteMaterial",0,eW,"SrcAlphaFactor",0,204,"SrcAlphaSaturateFactor",0,210,"SrcColorFactor",0,202,"StaticCopyUsage",0,35046,"StaticDrawUsage",0,35044,"StaticReadUsage",0,35045,"StereoCamera",0,class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nO,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nO,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){let e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){let r,i;e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,n1.copy(t.projectionMatrix);let s=e.eyeSep/2,n=s*e.near/e.focus,a=e.near*Math.tan(O*e.fov*.5)/e.zoom;n0.elements[12]=-s,nQ.elements[12]=s,r=-a*e.aspect+n,i=a*e.aspect+n,n1.elements[0]=2*e.near/(i-r),n1.elements[8]=(i+r)/(i-r),this.cameraL.projectionMatrix.copy(n1),r=-a*e.aspect-n,i=a*e.aspect-n,n1.elements[0]=2*e.near/(i-r),n1.elements[8]=(i+r)/(i-r),this.cameraR.projectionMatrix.copy(n1)}this.cameraL.matrix.copy(t.matrixWorld).multiply(n0),this.cameraL.matrixWorldNeedsUpdate=!0,this.cameraR.matrix.copy(t.matrixWorld).multiply(nQ),this.cameraR.matrixWorldNeedsUpdate=!0}},"StreamCopyUsage",0,35042,"StreamDrawUsage",0,35040,"StreamReadUsage",0,35041,"StringKeyframeTrack",0,ns,"SubtractEquation",0,101,"SubtractiveBlending",0,3,"TOUCH",0,{ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},"TangentSpaceNormalMap",0,0,"TetrahedronGeometry",0,sC,"Texture",0,tr,"TextureLoader",0,class extends nc{constructor(t){super(t)}load(t,e,r,i){let s=new tr,n=new ny(this.manager);return n.setCrossOrigin(this.crossOrigin),n.setPath(this.path),n.load(t,function(t){s.image=t,s.needsUpdate=!0,void 0!==e&&e(s)},r,i),s}},"TextureSource",0,K,"TextureUtils",0,class{static contain(t,e){let r;return(r=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=1,t.repeat.y=r/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/r,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}static cover(t,e){let r;return(r=t.image&&t.image.width?t.image.width/t.image.height:1)>e?(t.repeat.x=e/r,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=r/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}static fill(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}static getByteLength(t,e,r,i){return aW(t,e,r,i)}},"Timer",0,n2,"TimestampQuery",0,{COMPUTE:"compute",RENDER:"render"},"TorusGeometry",0,sE,"TorusKnotGeometry",0,sR,"Triangle",0,t6,"TriangleFanDrawMode",0,2,"TriangleStripDrawMode",0,1,"TrianglesDrawMode",0,0,"TubeGeometry",0,sO,"UVMapping",0,300,"Uint16BufferAttribute",0,ev,"Uint32BufferAttribute",0,ex,"Uint8BufferAttribute",0,class extends eb{constructor(t,e,r){super(new Uint8Array(t),e,r)}},"Uint8ClampedBufferAttribute",0,class extends eb{constructor(t,e,r){super(new Uint8ClampedArray(t),e,r)}},"Uniform",0,class t{constructor(t){this.value=t}clone(){return new t(void 0===this.value.clone?this.value:this.value.clone())}},"UniformsGroup",0,class extends C{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:af++}),this.name="",this.usage=35044,this.uniforms=[]}add(t){return this.uniforms.push(t),this}remove(t){let e=this.uniforms.indexOf(t);return -1!==e&&this.uniforms.splice(e,1),this}setName(t){return this.name=t,this}setUsage(t){return this.usage=t,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(t){this.name=t.name,this.usage=t.usage;let e=t.uniforms;this.uniforms.length=0;for(let t=0,r=e.length;t<r;t++){let r=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0;t<r.length;t++)this.uniforms.push(r[t].clone())}return this}clone(){return new this.constructor().copy(this)}},"UniformsUtils",0,{clone:sL,merge:sz},"UnsignedByteType",0,1009,"UnsignedInt101111Type",0,35899,"UnsignedInt248Type",0,1020,"UnsignedInt5999Type",0,35902,"UnsignedIntType",0,1014,"UnsignedShort4444Type",0,1017,"UnsignedShort5551Type",0,1018,"UnsignedShortType",0,1012,"VSMShadowMap",0,3,"Vector2",0,F,"Vector3",0,U,"Vector4",0,ti,"VectorKeyframeTrack",0,nn,"VideoFrameTexture",0,class extends iS{constructor(t,e,r,i,s,n,a,o){super({},t,e,r,i,s,n,a,o),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(t){this.image=t,this.needsUpdate=!0}},"VideoTexture",0,iS,"WebGL3DRenderTarget",0,class extends tn{constructor(t=1,e=1,r=1,i={}){super(t,e,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new to(null,t,e,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}},"WebGLArrayRenderTarget",0,class extends tn{constructor(t=1,e=1,r=1,i={}){super(t,e,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new ta(null,t,e,r),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}},"WebGLCoordinateSystem",0,2e3,"WebGLRenderTarget",0,tn,"WebGPUCoordinateSystem",0,2001,"WebXRController",0,class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new tz,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new tz,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new U,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new U),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new tz,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new U,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new U,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let r of t.hand.values())this._getHandJoint(e,r)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,r){let i=null,s=null,n=null,a=this._targetRay,o=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(h&&t.hand){for(let i of(n=!0,t.hand.values())){let t=e.getJointPose(i,r),s=this._getHandJoint(h,i);null!==t&&(s.matrix.fromArray(t.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,s.jointRadius=t.radius),s.visible=null!==t}let i=h.joints["index-finger-tip"],s=h.joints["thumb-tip"],a=i.position.distanceTo(s.position);h.inputState.pinching&&a>.025?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&a<=.015&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&null!==(s=e.getPose(t.gripSpace,r))&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1,o.eventsEnabled&&o.dispatchEvent({type:"gripUpdated",data:t,target:this}));null!==a&&(null===(i=e.getPose(t.targetRaySpace,r))&&null!==s&&(i=s),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(tN)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==s),null!==h&&(h.visible=null!==n),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let r=new tz;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[e.jointName]=r,t.add(r)}return t.joints[e.jointName]}},"WireframeGeometry",0,sI,"WrapAroundEnding",0,2402,"ZeroCurvatureEnding",0,2400,"ZeroFactor",0,200,"ZeroSlopeEnding",0,2401,"ZeroStencilOp",0,0,"cloneUniforms",0,sL,"createCanvasElement",0,function(){let t=v("canvas");return t.style.display="block",t},"createElementNS",0,v,"error",0,A,"getByteLength",0,aW,"getConsoleFunction",0,function(){return w},"getUnlitUniformColorSpace",0,function(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:J.workingColorSpace},"log",0,S,"mergeUniforms",0,sz,"probeAsync",0,function(t,e,r){return new Promise(function(i,s){setTimeout(function n(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:s();break;case t.TIMEOUT_EXPIRED:setTimeout(n,r);break;default:i()}},r)})},"setConsoleFunction",0,function(t){w=t},"warn",0,_,"warnOnce",0,T])}]);
|