tokentracker-cli 0.81.2 → 0.82.0

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.
Files changed (137) hide show
  1. package/dashboard/dist/assets/AchievementBadge-D6iPEEbz.js +1 -0
  2. package/dashboard/dist/assets/AchievementsPage-Jry355YE.js +2 -0
  3. package/dashboard/dist/assets/AchievementsSection-ah-kG00E.js +1 -0
  4. package/dashboard/dist/assets/BadgeDetailModal-FyvUrVvF.js +1 -0
  5. package/dashboard/dist/assets/Card-C3nLScju.js +1 -0
  6. package/dashboard/dist/assets/ClawdAnimated-CLHhE26z.js +1 -0
  7. package/dashboard/dist/assets/CommunityStatsModal-DA3PHLV5.js +1 -0
  8. package/dashboard/dist/assets/ConfirmModal-CTDarLrD.js +1 -0
  9. package/dashboard/dist/assets/DashboardPage-DZIiWc3Y.js +1 -0
  10. package/dashboard/dist/assets/DevicePage-CyXjUO8W.js +1 -0
  11. package/dashboard/dist/assets/DialogDescription-ahxSNUcB.js +1 -0
  12. package/dashboard/dist/assets/DialogTitle-z86PHHyk.js +1 -0
  13. package/dashboard/dist/assets/FadeIn-BDWtfIsO.js +1 -0
  14. package/dashboard/dist/assets/HeaderGithubStar-DE1USQbb.js +1 -0
  15. package/dashboard/dist/assets/{IpCheckPage-CMf9CHFr.js → IpCheckPage-B2SkgT0P.js} +3 -3
  16. package/dashboard/dist/assets/{LandingPage-BT61_TqT.js → LandingPage-PU5gxsfY.js} +165 -165
  17. package/dashboard/dist/assets/LeaderboardAvatar-CaOV_hFE.js +1 -0
  18. package/dashboard/dist/assets/LeaderboardPage-B0JtEyRP.js +2 -0
  19. package/dashboard/dist/assets/{LeaderboardProfileModal-C_kxqOMn.js → LeaderboardProfileModal-DtNEbVH8.js} +4 -4
  20. package/dashboard/dist/assets/{LeaderboardProfilePage-zgNsE0EQ.js → LeaderboardProfilePage-DRklax3-.js} +3 -3
  21. package/dashboard/dist/assets/LimitsPage-Dg0cJa40.js +4 -0
  22. package/dashboard/dist/assets/LocalOnlyNotice-si9PMKya.js +1 -0
  23. package/dashboard/dist/assets/LoginPage-DgLwhXKo.js +1 -0
  24. package/dashboard/dist/assets/PetPage-DEZbjk99.js +1 -0
  25. package/dashboard/dist/assets/PopoverPopup-DX7v1XfE.js +1 -0
  26. package/dashboard/dist/assets/ResetPasswordPage-C6NvRO-Q.js +1 -0
  27. package/dashboard/dist/assets/Select-CH2xVU8X.js +1 -0
  28. package/dashboard/dist/assets/SelectItemText-CCW6JeeN.js +1 -0
  29. package/dashboard/dist/assets/SettingsPage-Cm3uT11D.js +1 -0
  30. package/dashboard/dist/assets/SkillsPage-CljRL6yF.js +1 -0
  31. package/dashboard/dist/assets/TrendMonitor-DM1_WNfw.js +19 -0
  32. package/dashboard/dist/assets/WidgetsPage-mJ1j6hly.js +1 -0
  33. package/dashboard/dist/assets/WrappedPage-Dz71ln4t.js +1 -0
  34. package/dashboard/dist/assets/__vite-browser-external-C7JwykID.css +1 -0
  35. package/dashboard/dist/assets/__vite-browser-external-Eoyj4eG-.js +1341 -0
  36. package/dashboard/dist/assets/agent-logos-D3K_ZRUj.js +1 -0
  37. package/dashboard/dist/assets/arrow-up-right-CT4-gmOS.js +1 -0
  38. package/dashboard/dist/assets/check-B87_qvAg.js +1 -0
  39. package/dashboard/dist/assets/copy-Dtr68epm.js +1 -0
  40. package/dashboard/dist/assets/download-DaWsA_Gj.js +1 -0
  41. package/dashboard/dist/assets/flame-vLBOq0X0.js +1 -0
  42. package/dashboard/dist/assets/format-tokens-C6Pidz3s.js +1 -0
  43. package/dashboard/dist/assets/icons-BaaYJxUN.js +1 -0
  44. package/dashboard/dist/assets/index-lKnLA6Pd.js +1 -0
  45. package/dashboard/dist/assets/info-B46Qt16h.js +1 -0
  46. package/dashboard/dist/assets/limits-providers-13af4PEg.js +1 -0
  47. package/dashboard/dist/assets/link-2-DeN6MJpT.js +1 -0
  48. package/dashboard/dist/assets/loader-circle-ByEuaaSw.js +1 -0
  49. package/dashboard/dist/assets/provider-display-CKbOKeV4.js +42 -0
  50. package/dashboard/dist/assets/terminal-DyicX7lG.js +1 -0
  51. package/dashboard/dist/assets/trash-2-CVCC3DtQ.js +1 -0
  52. package/dashboard/dist/assets/use-community-stats-CExk3D6G.js +1 -0
  53. package/dashboard/dist/assets/use-limits-display-prefs-CRl4uU95.js +1 -0
  54. package/dashboard/dist/assets/use-native-settings-Bi6E9dsE.js +1 -0
  55. package/dashboard/dist/assets/{use-ordered-list-DPbiKnPc.js → use-ordered-list-Dk0p2otw.js} +2 -2
  56. package/dashboard/dist/assets/use-session-efficiency-pref-YAG-OYIh.js +1 -0
  57. package/dashboard/dist/assets/use-transform-lflyghWN.js +1 -0
  58. package/dashboard/dist/assets/use-usage-limits-DJXvJ25Q.js +1 -0
  59. package/dashboard/dist/assets/useCurrency-BtHtcsO5.js +1 -0
  60. package/dashboard/dist/assets/useScrollLock-C2C-Yazq.js +1 -0
  61. package/dashboard/dist/assets/useTokenFormat-BdD057ih.js +1 -0
  62. package/dashboard/dist/assets/zap-DWWma29E.js +1 -0
  63. package/dashboard/dist/index.html +2 -2
  64. package/dashboard/dist/share.html +2 -2
  65. package/package.json +1 -1
  66. package/src/cli.js +6 -0
  67. package/src/commands/serve.js +8 -6
  68. package/src/commands/sessions.js +29 -0
  69. package/src/commands/status.js +2 -1
  70. package/src/commands/sync.js +164 -36
  71. package/src/lib/codex-context-breakdown.js +330 -13
  72. package/src/lib/codex-rollout-parser.js +323 -42
  73. package/src/lib/context-health.js +124 -0
  74. package/src/lib/cursor-store.js +1289 -0
  75. package/src/lib/diagnostics.js +8 -5
  76. package/src/lib/fs.js +254 -16
  77. package/src/lib/git-outcomes.js +147 -0
  78. package/src/lib/local-api.js +151 -20
  79. package/src/lib/outcomes-engine.js +23 -0
  80. package/src/lib/pricing/index.js +8 -0
  81. package/src/lib/pricing/seed-snapshot.json +1 -1
  82. package/src/lib/rollout.js +101 -9
  83. package/src/lib/session-analytics.js +612 -0
  84. package/src/lib/usage-limits.js +21 -0
  85. package/dashboard/dist/assets/AchievementBadge-DXWHZrAL.js +0 -1
  86. package/dashboard/dist/assets/AchievementsPage-BhrQXniL.js +0 -2
  87. package/dashboard/dist/assets/AchievementsSection-gzP3m1Ml.js +0 -1
  88. package/dashboard/dist/assets/BadgeDetailModal-DGKPuvDU.js +0 -1
  89. package/dashboard/dist/assets/Card-BRtYQ-Ot.js +0 -1
  90. package/dashboard/dist/assets/ClawdAnimated-UsNG-qDv.js +0 -1
  91. package/dashboard/dist/assets/CommunityStatsModal-CJQw-P4t.js +0 -1
  92. package/dashboard/dist/assets/ConfirmModal-ByY4GDsy.js +0 -1
  93. package/dashboard/dist/assets/DashboardPage-CuLVnW98.js +0 -19
  94. package/dashboard/dist/assets/DevicePage-D67CxpmR.js +0 -1
  95. package/dashboard/dist/assets/DialogClose-Ci8hkTw5.js +0 -1
  96. package/dashboard/dist/assets/DialogDescription-C9vXUZU0.js +0 -1
  97. package/dashboard/dist/assets/DialogTitle-sLJxKWjv.js +0 -1
  98. package/dashboard/dist/assets/FadeIn-xVds37w6.js +0 -1
  99. package/dashboard/dist/assets/HeaderGithubStar-kK3omgmB.js +0 -1
  100. package/dashboard/dist/assets/LeaderboardAvatar-DyKz6NdT.js +0 -1
  101. package/dashboard/dist/assets/LeaderboardPage-DJ4zihJJ.js +0 -2
  102. package/dashboard/dist/assets/LimitsPage-BiQpqxj8.js +0 -4
  103. package/dashboard/dist/assets/LocalOnlyNotice-DTrrUVbZ.js +0 -1
  104. package/dashboard/dist/assets/LoginPage-BOM9Q2sI.js +0 -1
  105. package/dashboard/dist/assets/PetPage-BURk7RG-.js +0 -1
  106. package/dashboard/dist/assets/PopoverPopup-BV_aoNBd.js +0 -1
  107. package/dashboard/dist/assets/ResetPasswordPage-SBL2LvXC.js +0 -1
  108. package/dashboard/dist/assets/Select-BsRdHde3.js +0 -1
  109. package/dashboard/dist/assets/SelectItemText-DgkrZxIq.js +0 -1
  110. package/dashboard/dist/assets/SettingsPage-DqxVsfnB.js +0 -1
  111. package/dashboard/dist/assets/SkillsPage-B0VfWkOh.js +0 -1
  112. package/dashboard/dist/assets/WidgetsPage-4QQ8wI_g.js +0 -1
  113. package/dashboard/dist/assets/WrappedPage-BK53khVY.js +0 -1
  114. package/dashboard/dist/assets/agent-logos-DXpW_Wmz.js +0 -1
  115. package/dashboard/dist/assets/arrow-up-right-DCc--V5G.js +0 -1
  116. package/dashboard/dist/assets/check-DqxuosV2.js +0 -1
  117. package/dashboard/dist/assets/copy-qChAT7MY.js +0 -1
  118. package/dashboard/dist/assets/download-W9R3sBph.js +0 -1
  119. package/dashboard/dist/assets/flame-0eyhMnfU.js +0 -1
  120. package/dashboard/dist/assets/format-tokens-CkfBUcoa.js +0 -1
  121. package/dashboard/dist/assets/info-DY1O85-U.js +0 -1
  122. package/dashboard/dist/assets/link-2-B_Z66hFT.js +0 -1
  123. package/dashboard/dist/assets/loader-circle-xH40lon2.js +0 -1
  124. package/dashboard/dist/assets/main-CeaB5N36.js +0 -1259
  125. package/dashboard/dist/assets/main-DAc77vwF.css +0 -1
  126. package/dashboard/dist/assets/provider-display-C_XKZQcF.js +0 -42
  127. package/dashboard/dist/assets/trash-2-DVhNJ74r.js +0 -1
  128. package/dashboard/dist/assets/use-community-stats-CO-nr2Vf.js +0 -1
  129. package/dashboard/dist/assets/use-limits-display-prefs-RRqmyoxt.js +0 -1
  130. package/dashboard/dist/assets/use-native-settings-79piPeET.js +0 -1
  131. package/dashboard/dist/assets/use-quality-per-dollar-pref-DyF49QRF.js +0 -1
  132. package/dashboard/dist/assets/use-transform-BvXyGAtb.js +0 -1
  133. package/dashboard/dist/assets/use-usage-limits-BiZ_I-KE.js +0 -1
  134. package/dashboard/dist/assets/useCurrency-D-C1e7eE.js +0 -1
  135. package/dashboard/dist/assets/useScrollLock-BfU2EMvG.js +0 -1
  136. package/dashboard/dist/assets/useTokenFormat-Cm4EvrQp.js +0 -1
  137. package/dashboard/dist/assets/zap-DlAOTwFs.js +0 -1
@@ -1,10 +1,10 @@
1
- import{r as Fe,j as P,S as Xm,m as Nh,ao as Ac,ap as Ff,aq as Of,ar as Ym,R as qm,P as Hu,L as Ns,_ as $m,Z as Zm,as as Km,at as jm,a8 as Jm,E as Bf,ak as Qm}from"./main-CeaB5N36.js";import{H as eg}from"./HeaderGithubStar-kK3omgmB.js";import{u as tg}from"./use-community-stats-CO-nr2Vf.js";import{C as ng}from"./check-DqxuosV2.js";import{C as ig}from"./copy-qChAT7MY.js";import{D as rg}from"./download-W9R3sBph.js";import{A as kf,L as sg}from"./agent-logos-DXpW_Wmz.js";import{f as Ih}from"./format-tokens-CkfBUcoa.js";function ag(){if(typeof window>"u")return!1;const r=window.location.hostname;return r==="localhost"||r==="127.0.0.1"||r==="::1"}function zf(){return ag()?"/":"/dashboard"}const ln={accent:"#8a7aff",accentSoft:"#b8b3ff",accentFaint:"rgba(138, 122, 255, 0.16)",accentGhost:"rgba(138, 122, 255, 0.06)",glint:"#fbdfff",bg:"#050507",panel:"#0a0a0d",line:"rgba(138, 122, 255, 0.22)",scrim:"rgba(5, 5, 7, 0.62)",orbSurface:"radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0) 55%), radial-gradient(circle at 68% 84%, rgba(138, 122, 255, 0.30), rgba(138, 122, 255, 0) 55%), radial-gradient(circle at 50% 50%, rgba(20, 18, 34, 0.55), rgba(8, 8, 16, 0.82) 78%)",orbShadow:"inset 0 1px 1px rgba(255, 255, 255, 0.30), inset 0 -3px 9px rgba(138, 122, 255, 0.38), inset -5px -7px 14px rgba(0, 0, 0, 0.38), 0 0 30px rgba(138, 122, 255, 0.20), 0 10px 26px rgba(0, 0, 0, 0.5)",orbHighlight:"linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0))",orbGlint:"radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%)"},Il={accent:9075455,accentSoft:12104703,glint:16506879},og={"--lv3-accent":ln.accent,"--lv3-accent-soft":ln.accentSoft,"--lv3-accent-faint":ln.accentFaint,"--lv3-accent-ghost":ln.accentGhost,"--lv3-glint":ln.glint,"--lv3-bg":ln.bg,"--lv3-panel":ln.panel,"--lv3-line":ln.line,"--lv3-scrim":ln.scrim,"--lv3-orb-surface":ln.orbSurface,"--lv3-orb-shadow":ln.orbShadow,"--lv3-orb-highlight":ln.orbHighlight,"--lv3-orb-glint":ln.orbGlint};function qi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Uh(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var ni={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Va={duration:.5,overwrite:!1,delay:0},Wu,hn,Nt,pi=1e8,Tt=1/pi,Rc=Math.PI*2,lg=Rc/4,cg=0,Fh=Math.sqrt,ug=Math.cos,fg=Math.sin,un=function(e){return typeof e=="string"},zt=function(e){return typeof e=="function"},ir=function(e){return typeof e=="number"},Xu=function(e){return typeof e>"u"},zi=function(e){return typeof e=="object"},Bn=function(e){return e!==!1},Yu=function(){return typeof window<"u"},so=function(e){return zt(e)||un(e)},Oh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},En=Array.isArray,dg=/random\([^)]+\)/g,hg=/,\s*/g,Gf=/(?:-?\.?\d|\.)+/gi,Bh=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Os=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ul=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,kh=/[+-]=-?[.\d]+/,pg=/[^,'"\[\]\s]+/gi,mg=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ut,Ci,Cc,qu,ii={},ol={},zh,Gh=function(e){return(ol=Ks(e,ii))&&Wn},$u=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Ha=function(e,t){return!t&&console.warn(e)},Vh=function(e,t){return e&&(ii[e]=t)&&ol&&(ol[e]=t)||ii},Wa=function(){return 0},gg={suppressEvents:!0,isStart:!0,kill:!1},Yo={suppressEvents:!0,kill:!1},_g={suppressEvents:!0},Zu={},Tr=[],Pc={},Hh,Kn={},Fl={},Vf=30,qo=[],Ku="",ju=function(e){var t=e[0],n,i;if(zi(t)||zt(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(i=qo.length;i--&&!qo[i].targetTest(t););n=qo[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new fp(e[i],n)))||e.splice(i,1);return e},jr=function(e){return e._gsap||ju(mi(e))[0]._gsap},Wh=function(e,t,n){return(n=e[t])&&zt(n)?e[t]():Xu(n)&&e.getAttribute&&e.getAttribute(t)||n},kn=function(e,t){return(e=e.split(",")).forEach(t)||e},Wt=function(e){return Math.round(e*1e5)/1e5||0},It=function(e){return Math.round(e*1e7)/1e7||0},zs=function(e,t){var n=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),n==="+"?e+i:n==="-"?e-i:n==="*"?e*i:e/i},xg=function(e,t){for(var n=t.length,i=0;e.indexOf(t[i])<0&&++i<n;);return i<n},ll=function(){var e=Tr.length,t=Tr.slice(0),n,i;for(Pc={},Tr.length=0,n=0;n<e;n++)i=t[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Ju=function(e){return!!(e._initted||e._startAt||e.add)},Xh=function(e,t,n,i){Tr.length&&!hn&&ll(),e.render(t,n,!!(hn&&t<0&&Ju(e))),Tr.length&&!hn&&ll()},Yh=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(pg).length<2?t:un(e)?e.trim():e},qh=function(e){return e},ri=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},vg=function(e){return function(t,n){for(var i in n)i in t||i==="duration"&&e||i==="ease"||(t[i]=n[i])}},Ks=function(e,t){for(var n in t)e[n]=t[n];return e},Hf=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=zi(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},cl=function(e,t){var n={},i;for(i in e)i in t||(n[i]=e[i]);return n},Ra=function(e){var t=e.parent||Ut,n=e.keyframes?vg(En(e.keyframes)):ri;if(Bn(e.inherit))for(;t;)n(e,t.vars.defaults),t=t.parent||t._dp;return e},Mg=function(e,t){for(var n=e.length,i=n===t.length;i&&n--&&e[n]===t[n];);return n<0},$h=function(e,t,n,i,s){var a=e[i],o;if(s)for(o=t[s];a&&a[s]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=a,t.parent=t._dp=e,t},Tl=function(e,t,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=t._prev,a=t._next;s?s._next=a:e[n]===t&&(e[n]=a),a?a._prev=s:e[i]===t&&(e[i]=s),t._next=t._prev=t.parent=null},Rr=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Jr=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},Sg=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Dc=function(e,t,n,i){return e._startAt&&(hn?e._startAt.revert(Yo):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},bg=function r(e){return!e||e._ts&&r(e.parent)},Wf=function(e){return e._repeat?js(e._tTime,e=e.duration()+e._rDelay)*e:0},js=function(e,t){var n=Math.floor(e=It(e/t));return e&&n===e?n-1:n},ul=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},wl=function(e){return e._end=It(e._start+(e._tDur/Math.abs(e._ts||e._rts||Tt)||0))},Al=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=It(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),wl(e),n._dirty||Jr(n,e)),e},Zh=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=ul(e.rawTime(),t),(!t._dur||to(0,t.totalDuration(),n)-t._tTime>Tt)&&t.render(n,!0)),Jr(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-Tt}},Li=function(e,t,n,i){return t.parent&&Rr(t),t._start=It((ir(n)?n:n||e!==Ut?li(e,n,t):e._time)+t._delay),t._end=It(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),$h(e,t,"_first","_last",e._sort?"_start":0),Lc(t)||(e._recent=t),i||Zh(e,t),e._ts<0&&Al(e,e._tTime),e},Kh=function(e,t){return(ii.ScrollTrigger||$u("scrollTrigger",t))&&ii.ScrollTrigger.create(t,e)},jh=function(e,t,n,i,s){if(ef(e,t,s),!e._initted)return 1;if(!n&&e._pt&&!hn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Hh!==Jn.frame)return Tr.push(e),e._lazy=[s,i],1},yg=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},Lc=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},Eg=function(e,t,n,i){var s=e.ratio,a=t<0||!t&&(!e._start&&yg(e)&&!(!e._initted&&Lc(e))||(e._ts<0||e._dp._ts<0)&&!Lc(e))?0:1,o=e._rDelay,l=0,c,u,h;if(o&&e._repeat&&(l=to(0,e._tDur,t),u=js(l,o),e._yoyo&&u&1&&(a=1-a),u!==js(e._tTime,o)&&(s=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==s||hn||i||e._zTime===Tt||!t&&e._zTime){if(!e._initted&&jh(e,t,i,n,l))return;for(h=e._zTime,e._zTime=t||(n?Tt:0),n||(n=t&&!h),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=l,c=e._pt;c;)c.r(a,c.d),c=c._next;t<0&&Dc(e,t,n,!0),e._onUpdate&&!n&&ei(e,"onUpdate"),l&&e._repeat&&!n&&e.parent&&ei(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&Rr(e,1),!n&&!hn&&(ei(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},Tg=function(e,t,n){var i;if(n>t)for(i=e._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<t)return i;i=i._prev}},Js=function(e,t,n,i){var s=e._repeat,a=It(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=a/e._dur),e._dur=a,e._tDur=s?s<0?1e10:It(a*(s+1)+e._rDelay*s):a,o>0&&!i&&Al(e,e._tTime=e._tDur*o),e.parent&&wl(e),n||Jr(e.parent,e),e},Xf=function(e){return e instanceof On?Jr(e):Js(e,e._dur)},wg={_start:0,endTime:Wa,totalDuration:Wa},li=function r(e,t,n){var i=e.labels,s=e._recent||wg,a=e.duration()>=pi?s.endTime(!1):e._dur,o,l,c;return un(t)&&(isNaN(t)||t in i)?(l=t.charAt(0),c=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(c?(o<0?s:n).totalDuration()/100:1)):o<0?(t in i||(i[t]=a),i[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),c&&n&&(l=l/100*(En(n)?n[0]:n).totalDuration()),o>1?r(e,t.substr(0,o-1),n)+l:a+l)):t==null?a:+t},Ca=function(e,t,n){var i=ir(t[1]),s=(i?2:1)+(e<2?0:1),a=t[s],o,l;if(i&&(a.duration=t[1]),a.parent=n,e){for(o=a,l=n;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Bn(l.vars.inherit)&&l.parent;a.immediateRender=Bn(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[s-1]}return new jt(t[0],a,t[s+1])},Nr=function(e,t){return e||e===0?t(e):t},to=function(e,t,n){return n<e?e:n>t?t:n},Sn=function(e,t){return!un(e)||!(t=mg.exec(e))?"":t[1]},Ag=function(e,t,n){return Nr(n,function(i){return to(e,t,i)})},Nc=[].slice,Jh=function(e,t){return e&&zi(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&zi(e[0]))&&!e.nodeType&&e!==Ci},Rg=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(i){var s;return un(i)&&!t||Jh(i,1)?(s=n).push.apply(s,mi(i)):n.push(i)})||n},mi=function(e,t,n){return Nt&&!t&&Nt.selector?Nt.selector(e):un(e)&&!n&&(Cc||!Qs())?Nc.call((t||qu).querySelectorAll(e),0):En(e)?Rg(e,n):Jh(e)?Nc.call(e,0):e?[e]:[]},Ic=function(e){return e=mi(e)[0]||Ha("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return mi(t,n.querySelectorAll?n:n===e?Ha("Invalid scope")||qu.createElement("div"):e)}},Qh=function(e){return e.sort(function(){return .5-Math.random()})},ep=function(e){if(zt(e))return e;var t=zi(e)?e:{each:e},n=Qr(t.ease),i=t.from||0,s=parseFloat(t.base)||0,a={},o=i>0&&i<1,l=isNaN(i)||o,c=t.axis,u=i,h=i;return un(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(u=i[0],h=i[1]),function(f,d,g){var _=(g||t).length,p=a[_],m,b,y,M,E,T,A,v,w;if(!p){if(w=t.grid==="auto"?0:(t.grid||[1,pi])[1],!w){for(A=-pi;A<(A=g[w++].getBoundingClientRect().left)&&w<_;);w<_&&w--}for(p=a[_]=[],m=l?Math.min(w,_)*u-.5:i%w,b=w===pi?0:l?_*h/w-.5:i/w|0,A=0,v=pi,T=0;T<_;T++)y=T%w-m,M=b-(T/w|0),p[T]=E=c?Math.abs(c==="y"?M:y):Fh(y*y+M*M),E>A&&(A=E),E<v&&(v=E);i==="random"&&Qh(p),p.max=A-v,p.min=v,p.v=_=(parseFloat(t.amount)||parseFloat(t.each)*(w>_?_-1:c?c==="y"?_/w:w:Math.max(w,_/w))||0)*(i==="edges"?-1:1),p.b=_<0?s-_:s,p.u=Sn(t.amount||t.each)||0,n=n&&_<0?Gg(n):n}return _=(p[f]-p.min)/p.max||0,It(p.b+(n?n(_):_)*p.v)+p.u}},Uc=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var i=It(Math.round(parseFloat(n)/e)*e*t);return(i-i%1)/t+(ir(n)?0:Sn(n))}},tp=function(e,t){var n=En(e),i,s;return!n&&zi(e)&&(i=n=e.radius||pi,e.values?(e=mi(e.values),(s=!ir(e[0]))&&(i*=i)):e=Uc(e.increment)),Nr(t,n?zt(e)?function(a){return s=e(a),Math.abs(s-a)<=i?s:a}:function(a){for(var o=parseFloat(s?a.x:a),l=parseFloat(s?a.y:0),c=pi,u=0,h=e.length,f,d;h--;)s?(f=e[h].x-o,d=e[h].y-l,f=f*f+d*d):f=Math.abs(e[h]-o),f<c&&(c=f,u=h);return u=!i||c<=i?e[u]:a,s||u===a||ir(a)?u:u+Sn(a)}:Uc(e))},np=function(e,t,n,i){return Nr(En(e)?!t:n===!0?!!(n=0):!i,function(){return En(e)?e[~~(Math.random()*e.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+n*.99))/n)*n*i)/i})},Cg=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(i){return t.reduce(function(s,a){return a(s)},i)}},Pg=function(e,t){return function(n){return e(parseFloat(n))+(t||Sn(n))}},Dg=function(e,t,n){return rp(e,t,0,1,n)},ip=function(e,t,n){return Nr(n,function(i){return e[~~t(i)]})},Lg=function r(e,t,n){var i=t-e;return En(e)?ip(e,r(0,e.length),t):Nr(n,function(s){return(i+(s-e)%i)%i+e})},Ng=function r(e,t,n){var i=t-e,s=i*2;return En(e)?ip(e,r(0,e.length-1),t):Nr(n,function(a){return a=(s+(a-e)%s)%s||0,e+(a>i?s-a:a)})},Xa=function(e){return e.replace(dg,function(t){var n=t.indexOf("[")+1,i=t.substring(n||7,n?t.indexOf("]"):t.length-1).split(hg);return np(n?i:+i[0],n?0:+i[1],+i[2]||1e-5)})},rp=function(e,t,n,i,s){var a=t-e,o=i-n;return Nr(s,function(l){return n+((l-e)/a*o||0)})},Ig=function r(e,t,n,i){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var a=un(e),o={},l,c,u,h,f;if(n===!0&&(i=1)&&(n=null),a)e={p:e},t={p:t};else if(En(e)&&!En(t)){for(u=[],h=e.length,f=h-2,c=1;c<h;c++)u.push(r(e[c-1],e[c]));h--,s=function(g){g*=h;var _=Math.min(f,~~g);return u[_](g-_)},n=t}else i||(e=Ks(En(e)?[]:{},e));if(!u){for(l in t)Qu.call(o,e,l,"get",t[l]);s=function(g){return rf(g,o)||(a?e.p:e)}}}return Nr(n,s)},Yf=function(e,t,n){var i=e.labels,s=pi,a,o,l;for(a in i)o=i[a]-t,o<0==!!n&&o&&s>(o=Math.abs(o))&&(l=a,s=o);return l},ei=function(e,t,n){var i=e.vars,s=i[t],a=Nt,o=e._ctx,l,c,u;if(s)return l=i[t+"Params"],c=i.callbackScope||e,n&&Tr.length&&ll(),o&&(Nt=o),u=l?s.apply(c,l):s.call(c),Nt=a,u},xa=function(e){return Rr(e),e.scrollTrigger&&e.scrollTrigger.kill(!!hn),e.progress()<1&&ei(e,"onInterrupt"),e},Bs,sp=[],ap=function(e){if(e)if(e=!e.name&&e.default||e,Yu()||e.headless){var t=e.name,n=zt(e),i=t&&!n&&e.init?function(){this._props=[]}:e,s={init:Wa,render:rf,add:Qu,kill:jg,modifier:Kg,rawVars:0},a={targetTest:0,get:0,getSetter:nf,aliases:{},register:0};if(Qs(),e!==i){if(Kn[t])return;ri(i,ri(cl(e,s),a)),Ks(i.prototype,Ks(s,cl(e,a))),Kn[i.prop=t]=i,e.targetTest&&(qo.push(i),Zu[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Vh(t,i),e.register&&e.register(Wn,i,zn)}else sp.push(e)},Et=255,va={aqua:[0,Et,Et],lime:[0,Et,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Et],navy:[0,0,128],white:[Et,Et,Et],olive:[128,128,0],yellow:[Et,Et,0],orange:[Et,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Et,0,0],pink:[Et,192,203],cyan:[0,Et,Et],transparent:[Et,Et,Et,0]},Ol=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*Et+.5|0},op=function(e,t,n){var i=e?ir(e)?[e>>16,e>>8&Et,e&Et]:0:va.black,s,a,o,l,c,u,h,f,d,g;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),va[e])i=va[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e="#"+s+s+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&Et,i&Et,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&Et,e&Et]}else if(e.substr(0,3)==="hsl"){if(i=g=e.match(Gf),!t)l=+i[0]%360/360,c=+i[1]/100,u=+i[2]/100,a=u<=.5?u*(c+1):u+c-u*c,s=u*2-a,i.length>3&&(i[3]*=1),i[0]=Ol(l+1/3,s,a),i[1]=Ol(l,s,a),i[2]=Ol(l-1/3,s,a);else if(~e.indexOf("="))return i=e.match(Bh),n&&i.length<4&&(i[3]=1),i}else i=e.match(Gf)||va.transparent;i=i.map(Number)}return t&&!g&&(s=i[0]/Et,a=i[1]/Et,o=i[2]/Et,h=Math.max(s,a,o),f=Math.min(s,a,o),u=(h+f)/2,h===f?l=c=0:(d=h-f,c=u>.5?d/(2-h-f):d/(h+f),l=h===s?(a-o)/d+(a<o?6:0):h===a?(o-s)/d+2:(s-a)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(u*100+.5)),n&&i.length<4&&(i[3]=1),i},lp=function(e){var t=[],n=[],i=-1;return e.split(wr).forEach(function(s){var a=s.match(Os)||[];t.push.apply(t,a),n.push(i+=a.length+1)}),t.c=n,t},qf=function(e,t,n){var i="",s=(e+i).match(wr),a=t?"hsla(":"rgba(",o=0,l,c,u,h;if(!s)return e;if(s=s.map(function(f){return(f=op(f,t,1))&&a+(t?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(u=lp(e),l=n.c,l.join(i)!==u.c.join(i)))for(c=e.replace(wr,"1").split(Os),h=c.length-1;o<h;o++)i+=c[o]+(~l.indexOf(o)?s.shift()||a+"0,0,0,0)":(u.length?u:s.length?s:n).shift());if(!c)for(c=e.split(wr),h=c.length-1;o<h;o++)i+=c[o]+s[o];return i+c[h]},wr=(function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in va)r+="|"+e+"\\b";return new RegExp(r+")","gi")})(),Ug=/hsl[a]?\(/,cp=function(e){var t=e.join(" "),n;if(wr.lastIndex=0,wr.test(t))return n=Ug.test(t),e[1]=qf(e[1],n),e[0]=qf(e[0],n,lp(e[1])),!0},Ya,Jn=(function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,a=s,o=[],l,c,u,h,f,d,g=function _(p){var m=r()-i,b=p===!0,y,M,E,T;if((m>e||m<0)&&(n+=m-t),i+=m,E=i-n,y=E-a,(y>0||b)&&(T=++h.frame,f=E-h.time*1e3,h.time=E=E/1e3,a+=y+(y>=s?4:s-y),M=1),b||(l=c(_)),M)for(d=0;d<o.length;d++)o[d](E,f,T,p)};return h={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(p){return f/(1e3/(p||60))},wake:function(){zh&&(!Cc&&Yu()&&(Ci=Cc=window,qu=Ci.document||{},ii.gsap=Wn,(Ci.gsapVersions||(Ci.gsapVersions=[])).push(Wn.version),Gh(ol||Ci.GreenSockGlobals||!Ci.gsap&&Ci||{}),sp.forEach(ap)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&h.sleep(),c=u||function(p){return setTimeout(p,a-h.time*1e3+1|0)},Ya=1,g(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),Ya=0,c=Wa},lagSmoothing:function(p,m){e=p||1/0,t=Math.min(m||33,e)},fps:function(p){s=1e3/(p||240),a=h.time*1e3+s},add:function(p,m,b){var y=m?function(M,E,T,A){p(M,E,T,A),h.remove(y)}:p;return h.remove(p),o[b?"unshift":"push"](y),Qs(),y},remove:function(p,m){~(m=o.indexOf(p))&&o.splice(m,1)&&d>=m&&d--},_listeners:o},h})(),Qs=function(){return!Ya&&Jn.wake()},dt={},Fg=/^[\d.\-M][\d.\-,\s]/,Og=/["']/g,Bg=function(e){for(var t={},n=e.substr(1,e.length-3).split(":"),i=n[0],s=1,a=n.length,o,l,c;s<a;s++)l=n[s],o=s!==a-1?l.lastIndexOf(","):l.length,c=l.substr(0,o),t[i]=isNaN(c)?c.replace(Og,"").trim():+c,i=l.substr(o+1).trim();return t},kg=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")"),i=e.indexOf("(",t);return e.substring(t,~i&&i<n?e.indexOf(")",n+1):n)},zg=function(e){var t=(e+"").split("("),n=dt[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[Bg(t[1])]:kg(e).split(",").map(Yh)):dt._CE&&Fg.test(e)?dt._CE("",e):n},Gg=function(e){return function(t){return 1-e(1-t)}},Qr=function(e,t){return e&&(zt(e)?e:dt[e]||zg(e))||t},us=function(e,t,n,i){n===void 0&&(n=function(l){return 1-t(1-l)}),i===void 0&&(i=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var s={easeIn:t,easeOut:n,easeInOut:i},a;return kn(e,function(o){dt[o]=ii[o]=s,dt[a=o.toLowerCase()]=n;for(var l in s)dt[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=dt[o+"."+l]=s[l]}),s},up=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},Bl=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),a=s/Rc*(Math.asin(1/i)||0),o=function(u){return u===1?1:i*Math.pow(2,-10*u)*fg((u-a)*s)+1},l=e==="out"?o:e==="in"?function(c){return 1-o(1-c)}:up(o);return s=Rc/s,l.config=function(c,u){return r(e,c,u)},l},kl=function r(e,t){t===void 0&&(t=1.70158);var n=function(a){return a?--a*a*((t+1)*a+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:up(n);return i.config=function(s){return r(e,s)},i};kn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;us(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})});dt.Linear.easeNone=dt.none=dt.Linear.easeIn;us("Elastic",Bl("in"),Bl("out"),Bl());(function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};us("Bounce",function(a){return 1-s(1-a)},s)})(7.5625,2.75);us("Expo",function(r){return Math.pow(2,10*(r-1))*r+r*r*r*r*r*r*(1-r)});us("Circ",function(r){return-(Fh(1-r*r)-1)});us("Sine",function(r){return r===1?1:-ug(r*lg)+1});us("Back",kl("in"),kl("out"),kl());dt.SteppedEase=dt.steps=ii.SteppedEase={config:function(e,t){e===void 0&&(e=1);var n=1/e,i=e+(t?0:1),s=t?1:0,a=1-Tt;return function(o){return((i*to(0,a,o)|0)+s)*n}}};Va.ease=dt["quad.out"];kn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Ku+=r+","+r+"Params,"});var fp=function(e,t){this.id=cg++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:Wh,this.set=t?t.getSetter:nf},qa=(function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Js(this,+t.duration,1,1),this.data=t.data,Nt&&(this._ctx=Nt,Nt.data.push(this)),Ya||Jn.wake()}var e=r.prototype;return e.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},e.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},e.totalDuration=function(n){return arguments.length?(this._dirty=0,Js(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(n,i){if(Qs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(Al(this,n),!s._dp||s.parent||Zh(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&Li(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Tt||!this._initted&&this._dur&&n||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Xh(this,n,i)),this},e.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Wf(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},e.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Wf(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?js(this._tTime,s)+1:1},e.timeScale=function(n,i){if(!arguments.length)return this._rts===-Tt?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?ul(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-Tt?0:this._rts,this.totalTime(to(-Math.abs(this._delay),this.totalDuration(),s),i!==!1),wl(this),Sg(this)},e.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Qs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Tt&&(this._tTime-=Tt)))),this):this._ps},e.startTime=function(n){if(arguments.length){this._start=It(n);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Li(i,this,this._start-this._delay),this}return this._start},e.endTime=function(n){return this._start+(Bn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ul(i.rawTime(n),this):this._tTime:this._tTime},e.revert=function(n){n===void 0&&(n=_g);var i=hn;return hn=n,Ju(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),hn=i,this},e.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},e.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,Xf(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Xf(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},e.seek=function(n,i){return this.totalTime(li(this,n),Bn(i))},e.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Bn(i)),this._dur||(this._zTime=-Tt),this},e.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},e.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-Tt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Tt,this},e.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-Tt)},e.eventCallback=function(n,i,s){var a=this.vars;return arguments.length>1?(i?(a[n]=i,s&&(a[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete a[n],this):a[n]},e.then=function(n){var i=this,s=i._prom;return new Promise(function(a){var o=zt(n)?n:qh,l=function(){var u=i.then;i.then=null,s&&s(),zt(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=u),a(o),i.then=u};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},e.kill=function(){xa(this)},r})();ri(qa.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Tt,_prom:0,_ps:!1,_rts:1});var On=(function(r){Uh(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=Bn(n.sortChildren),Ut&&Li(n.parent||Ut,qi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Kh(qi(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(i,s,a){return Ca(0,arguments,this),this},t.from=function(i,s,a){return Ca(1,arguments,this),this},t.fromTo=function(i,s,a,o){return Ca(2,arguments,this),this},t.set=function(i,s,a){return s.duration=0,s.parent=this,Ra(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new jt(i,s,li(this,a),1),this},t.call=function(i,s,a){return Li(this,jt.delayedCall(0,i,s),a)},t.staggerTo=function(i,s,a,o,l,c,u){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=c,a.onCompleteParams=u,a.parent=this,new jt(i,a,li(this,l)),this},t.staggerFrom=function(i,s,a,o,l,c,u){return a.runBackwards=1,Ra(a).immediateRender=Bn(a.immediateRender),this.staggerTo(i,s,a,o,l,c,u)},t.staggerFromTo=function(i,s,a,o,l,c,u,h){return o.startAt=a,Ra(o).immediateRender=Bn(o.immediateRender),this.staggerTo(i,s,o,l,c,u,h)},t.render=function(i,s,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=i<=0?0:It(i),h=this._zTime<0!=i<0&&(this._initted||!c),f,d,g,_,p,m,b,y,M,E,T,A;if(this!==Ut&&u>l&&i>=0&&(u=l),u!==this._tTime||a||h){if(o!==this._time&&c&&(u+=this._time-o,i+=this._time-o),f=u,M=this._start,y=this._ts,m=!y,h&&(c||(o=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,p=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(p*100+i,s,a);if(f=It(u%p),u===l?(_=this._repeat,f=c):(E=It(u/p),_=~~E,_&&_===E&&(f=c,_--),f>c&&(f=c)),E=js(this._tTime,p),!o&&this._tTime&&E!==_&&this._tTime-E*p-this._dur<=0&&(E=_),T&&_&1&&(f=c-f,A=1),_!==E&&!this._lock){var v=T&&E&1,w=v===(T&&_&1);if(_<E&&(v=!v),o=v?0:u%c?c:u,this._lock=1,this.render(o||(A?0:It(_*p)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&ei(this,"onRepeat"),this.vars.repeatRefresh&&!A&&(this.invalidate()._lock=1,E=_),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,w&&(this._lock=2,o=v?c:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!A&&this.invalidate()),this._lock=0,!this._ts&&!m)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=Tg(this,It(o),It(f)),b&&(u-=f-(f=b._start))),this._tTime=u,this._time=f,this._act=!!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&u&&c&&!s&&!E&&(ei(this,"onStart"),this._tTime!==u))return this;if(f>=o&&i>=0)for(d=this._first;d;){if(g=d._next,(d._act||f>=d._start)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,a);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,s,a),f!==this._time||!this._ts&&!m){b=0,g&&(u+=this._zTime=-Tt);break}}d=g}else{d=this._last;for(var C=i<0?i:f;d;){if(g=d._prev,(d._act||C<=d._end)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,a);if(d.render(d._ts>0?(C-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(C-d._start)*d._ts,s,a||hn&&Ju(d)),f!==this._time||!this._ts&&!m){b=0,g&&(u+=this._zTime=C?-Tt:Tt);break}}d=g}}if(b&&!s&&(this.pause(),b.render(f>=o?0:-Tt)._zTime=f>=o?1:-1,this._ts))return this._start=M,wl(this),this.render(i,s,a);this._onUpdate&&!s&&ei(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&o)&&(M===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&Rr(this,1),!s&&!(i<0&&!o)&&(u||o||!l)&&(ei(this,u===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(i,s){var a=this;if(ir(s)||(s=li(this,s,i)),!(i instanceof qa)){if(En(i))return i.forEach(function(o){return a.add(o,s)}),this;if(un(i))return this.addLabel(i,s);if(zt(i))i=jt.delayedCall(0,i);else return this}return this!==i?Li(this,i,s):this},t.getChildren=function(i,s,a,o){i===void 0&&(i=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-pi);for(var l=[],c=this._first;c;)c._start>=o&&(c instanceof jt?s&&l.push(c):(a&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,a)))),c=c._next;return l},t.getById=function(i){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===i)return s[a]},t.remove=function(i){return un(i)?this.removeLabel(i):zt(i)?this.killTweensOf(i):(i.parent===this&&Tl(this,i),i===this._recent&&(this._recent=this._last),Jr(this))},t.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=It(Jn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},t.addLabel=function(i,s){return this.labels[i]=li(this,s),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,s,a){var o=jt.delayedCall(0,s||Wa,a);return o.data="isPause",this._hasPause=1,Li(this,o,li(this,i))},t.removePause=function(i){var s=this._first;for(i=li(this,i);s;)s._start===i&&s.data==="isPause"&&Rr(s),s=s._next},t.killTweensOf=function(i,s,a){for(var o=this.getTweensOf(i,a),l=o.length;l--;)vr!==o[l]&&o[l].kill(i,s);return this},t.getTweensOf=function(i,s){for(var a=[],o=mi(i),l=this._first,c=ir(s),u;l;)l instanceof jt?xg(l._targets,o)&&(c?(!vr||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&a.push(l):(u=l.getTweensOf(o,s)).length&&a.push.apply(a,u),l=l._next;return a},t.tweenTo=function(i,s){s=s||{};var a=this,o=li(a,i),l=s,c=l.startAt,u=l.onStart,h=l.onStartParams,f=l.immediateRender,d,g=jt.to(a,ri({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(c&&"time"in c?c.time:a._time))/a.timeScale())||Tt,onStart:function(){if(a.pause(),!d){var p=s.duration||Math.abs((o-(c&&"time"in c?c.time:a._time))/a.timeScale());g._dur!==p&&Js(g,p,0,1).render(g._time,!0,!0),d=1}u&&u.apply(g,h||[])}},s));return f?g.render(0):g},t.tweenFromTo=function(i,s,a){return this.tweenTo(s,ri({startAt:{time:li(this,i)}},a))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),Yf(this,li(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),Yf(this,li(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Tt)},t.shiftChildren=function(i,s,a){a===void 0&&(a=0);var o=this._first,l=this.labels,c;for(i=It(i);o;)o._start>=a&&(o._start+=i,o._end+=i),o=o._next;if(s)for(c in l)l[c]>=a&&(l[c]+=i);return Jr(this)},t.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Jr(this)},t.totalDuration=function(i){var s=0,a=this,o=a._last,l=pi,c,u,h;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-i:i));if(a._dirty){for(h=a.parent;o;)c=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,Li(a,o,u-o._delay,1)._lock=0):l=u,u<0&&o._ts&&(s-=u,(!h&&!a._dp||h&&h.smoothChildTiming)&&(a._start+=It(u/a._ts),a._time-=u,a._tTime-=u),a.shiftChildren(-u,!1,-1/0),l=0),o._end>s&&o._ts&&(s=o._end),o=c;Js(a,a===Ut&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(i){if(Ut._ts&&(Xh(Ut,ul(i,Ut)),Hh=Jn.frame),Jn.frame>=Vf){Vf+=ni.autoSleep||120;var s=Ut._first;if((!s||!s._ts)&&ni.autoSleep&&Jn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Jn.sleep()}}},e})(qa);ri(On.prototype,{_lock:0,_hasPause:0,_forcing:0});var Vg=function(e,t,n,i,s,a,o){var l=new zn(this._pt,e,t,0,1,_p,null,s),c=0,u=0,h,f,d,g,_,p,m,b;for(l.b=n,l.e=i,n+="",i+="",(m=~i.indexOf("random("))&&(i=Xa(i)),a&&(b=[n,i],a(b,e,t),n=b[0],i=b[1]),f=n.match(Ul)||[];h=Ul.exec(i);)g=h[0],_=i.substring(c,h.index),d?d=(d+1)%5:_.substr(-5)==="rgba("&&(d=1),g!==f[u++]&&(p=parseFloat(f[u-1])||0,l._pt={_next:l._pt,p:_||u===1?_:",",s:p,c:g.charAt(1)==="="?zs(p,g)-p:parseFloat(g)-p,m:d&&d<4?Math.round:0},c=Ul.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=o,(kh.test(i)||m)&&(l.e=0),this._pt=l,l},Qu=function(e,t,n,i,s,a,o,l,c,u){zt(i)&&(i=i(s||0,e,a));var h=e[t],f=n!=="get"?n:zt(h)?c?e[t.indexOf("set")||!zt(e["get"+t.substr(3)])?t:"get"+t.substr(3)](c):e[t]():h,d=zt(h)?c?qg:mp:tf,g;if(un(i)&&(~i.indexOf("random(")&&(i=Xa(i)),i.charAt(1)==="="&&(g=zs(f,i)+(Sn(f)||0),(g||g===0)&&(i=g))),!u||f!==i||Fc)return!isNaN(f*i)&&i!==""?(g=new zn(this._pt,e,t,+f||0,i-(f||0),typeof h=="boolean"?Zg:gp,0,d),c&&(g.fp=c),o&&g.modifier(o,this,e),this._pt=g):(!h&&!(t in e)&&$u(t,i),Vg.call(this,e,t,f,i,d,l||ni.stringFilter,c))},Hg=function(e,t,n,i,s){if(zt(e)&&(e=Pa(e,s,t,n,i)),!zi(e)||e.style&&e.nodeType||En(e)||Oh(e))return un(e)?Pa(e,s,t,n,i):e;var a={},o;for(o in e)a[o]=Pa(e[o],s,t,n,i);return a},dp=function(e,t,n,i,s,a){var o,l,c,u;if(Kn[e]&&(o=new Kn[e]).init(s,o.rawVars?t[e]:Hg(t[e],i,s,a,n),n,i,a)!==!1&&(n._pt=l=new zn(n._pt,s,e,0,1,o.render,o,0,o.priority),n!==Bs))for(c=n._ptLookup[n._targets.indexOf(s)],u=o._props.length;u--;)c[o._props[u]]=l;return o},vr,Fc,ef=function r(e,t,n){var i=e.vars,s=i.ease,a=i.startAt,o=i.immediateRender,l=i.lazy,c=i.onUpdate,u=i.runBackwards,h=i.yoyoEase,f=i.keyframes,d=i.autoRevert,g=e._dur,_=e._startAt,p=e._targets,m=e.parent,b=m&&m.data==="nested"?m.vars.targets:p,y=e._overwrite==="auto"&&!Wu,M=e.timeline,E=i.easeReverse||h,T,A,v,w,C,L,N,Y,H,O,z,I,q;if(M&&(!f||!s)&&(s="none"),e._ease=Qr(s,Va.ease),e._rEase=E&&(Qr(E)||e._ease),e._from=!M&&!!i.runBackwards,e._from&&(e.ratio=1),!M||f&&!i.stagger){if(Y=p[0]?jr(p[0]).harness:0,I=Y&&i[Y.prop],T=cl(i,Zu),_&&(_._zTime<0&&_.progress(1),t<0&&u&&o&&!d?_.render(-1,!0):_.revert(u&&g?Yo:gg),_._lazy=0),a){if(Rr(e._startAt=jt.set(p,ri({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!_&&Bn(l),startAt:null,delay:0,onUpdate:c&&function(){return ei(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(hn||!o&&!d)&&e._startAt.revert(Yo),o&&g&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(u&&g&&!_){if(t&&(o=!1),v=ri({overwrite:!1,data:"isFromStart",lazy:o&&!_&&Bn(l),immediateRender:o,stagger:0,parent:m},T),I&&(v[Y.prop]=I),Rr(e._startAt=jt.set(p,v)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(hn?e._startAt.revert(Yo):e._startAt.render(-1,!0)),e._zTime=t,!o)r(e._startAt,Tt,Tt);else if(!t)return}for(e._pt=e._ptCache=0,l=g&&Bn(l)||l&&!g,A=0;A<p.length;A++){if(C=p[A],N=C._gsap||ju(p)[A]._gsap,e._ptLookup[A]=O={},Pc[N.id]&&Tr.length&&ll(),z=b===p?A:b.indexOf(C),Y&&(H=new Y).init(C,I||T,e,z,b)!==!1&&(e._pt=w=new zn(e._pt,C,H.name,0,1,H.render,H,0,H.priority),H._props.forEach(function(j){O[j]=w}),H.priority&&(L=1)),!Y||I)for(v in T)Kn[v]&&(H=dp(v,T,e,z,C,b))?H.priority&&(L=1):O[v]=w=Qu.call(e,C,v,"get",T[v],z,b,0,i.stringFilter);e._op&&e._op[A]&&e.kill(C,e._op[A]),y&&e._pt&&(vr=e,Ut.killTweensOf(C,O,e.globalTime(t)),q=!e.parent,vr=0),e._pt&&l&&(Pc[N.id]=1)}L&&xp(e),e._onInit&&e._onInit(e)}e._onUpdate=c,e._initted=(!e._op||e._pt)&&!q,f&&t<=0&&M.render(pi,!0,!0)},Wg=function(e,t,n,i,s,a,o,l){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,h,f,d;if(!c)for(c=e._ptCache[t]=[],f=e._ptLookup,d=e._targets.length;d--;){if(u=f[d][t],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==t&&u.fp!==t;)u=u._next;if(!u)return Fc=1,e.vars[t]="+=0",ef(e,o),Fc=0,l?Ha(t+" not eligible for reset. Try splitting into individual properties"):1;c.push(u)}for(d=c.length;d--;)h=c[d],u=h._pt||h,u.s=(i||i===0)&&!s?i:u.s+(i||0)+a*u.c,u.c=n-u.s,h.e&&(h.e=Wt(n)+Sn(h.e)),h.b&&(h.b=u.s+Sn(h.b))},Xg=function(e,t){var n=e[0]?jr(e[0]).harness:0,i=n&&n.aliases,s,a,o,l;if(!i)return t;s=Ks({},t);for(a in i)if(a in s)for(l=i[a].split(","),o=l.length;o--;)s[l[o]]=s[a];return s},Yg=function(e,t,n,i){var s=t.ease||i||"power1.inOut",a,o;if(En(t))o=n[e]||(n[e]=[]),t.forEach(function(l,c){return o.push({t:c/(t.length-1)*100,v:l,e:s})});else for(a in t)o=n[a]||(n[a]=[]),a==="ease"||o.push({t:parseFloat(e),v:t[a],e:s})},Pa=function(e,t,n,i,s){return zt(e)?e.call(t,n,i,s):un(e)&&~e.indexOf("random(")?Xa(e):e},hp=Ku+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",pp={};kn(hp+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return pp[r]=1});var jt=(function(r){Uh(e,r);function e(n,i,s,a){var o;typeof i=="number"&&(s.duration=i,i=s,s=null),o=r.call(this,a?i:Ra(i))||this;var l=o.vars,c=l.duration,u=l.delay,h=l.immediateRender,f=l.stagger,d=l.overwrite,g=l.keyframes,_=l.defaults,p=l.scrollTrigger,m=i.parent||Ut,b=(En(n)||Oh(n)?ir(n[0]):"length"in i)?[n]:mi(n),y,M,E,T,A,v,w,C;if(o._targets=b.length?ju(b):Ha("GSAP target "+n+" not found. https://gsap.com",!ni.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=d,g||f||so(c)||so(u)){i=o.vars;var L=i.easeReverse||i.yoyoEase;if(y=o.timeline=new On({data:"nested",defaults:_||{},targets:m&&m.data==="nested"?m.vars.targets:b}),y.kill(),y.parent=y._dp=qi(o),y._start=0,f||so(c)||so(u)){if(T=b.length,w=f&&ep(f),zi(f))for(A in f)~hp.indexOf(A)&&(C||(C={}),C[A]=f[A]);for(M=0;M<T;M++)E=cl(i,pp),E.stagger=0,L&&(E.easeReverse=L),C&&Ks(E,C),v=b[M],E.duration=+Pa(c,qi(o),M,v,b),E.delay=(+Pa(u,qi(o),M,v,b)||0)-o._delay,!f&&T===1&&E.delay&&(o._delay=u=E.delay,o._start+=u,E.delay=0),y.to(v,E,w?w(M,v,b):0),y._ease=dt.none;y.duration()?c=u=0:o.timeline=0}else if(g){Ra(ri(y.vars.defaults,{ease:"none"})),y._ease=Qr(g.ease||i.ease||"none");var N=0,Y,H,O;if(En(g))g.forEach(function(z){return y.to(b,z,">")}),y.duration();else{E={};for(A in g)A==="ease"||A==="easeEach"||Yg(A,g[A],E,g.easeEach);for(A in E)for(Y=E[A].sort(function(z,I){return z.t-I.t}),N=0,M=0;M<Y.length;M++)H=Y[M],O={ease:H.e,duration:(H.t-(M?Y[M-1].t:0))/100*c},O[A]=H.v,y.to(b,O,N),N+=O.duration;y.duration()<c&&y.to({},{duration:c-y.duration()})}}c||o.duration(c=y.duration())}else o.timeline=0;return d===!0&&!Wu&&(vr=qi(o),Ut.killTweensOf(b),vr=0),Li(m,qi(o),s),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(h||!c&&!g&&o._start===It(m._time)&&Bn(h)&&bg(qi(o))&&m.data!=="nested")&&(o._tTime=-Tt,o.render(Math.max(0,-u)||0)),p&&Kh(qi(o),p),o}var t=e.prototype;return t.render=function(i,s,a){var o=this._time,l=this._tDur,c=this._dur,u=i<0,h=i>l-Tt&&!u?l:i<Tt?0:i,f,d,g,_,p,m,b,y;if(!c)Eg(this,i,s,a);else if(h!==this._tTime||!i||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u||this._lazy){if(f=h,y=this.timeline,this._repeat){if(_=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(_*100+i,s,a);if(f=It(h%_),h===l?(g=this._repeat,f=c):(p=It(h/_),g=~~p,g&&g===p?(f=c,g--):f>c&&(f=c)),m=this._yoyo&&g&1,m&&(f=c-f),p=js(this._tTime,_),f===o&&!a&&this._initted&&g===p)return this._tTime=h,this;g!==p&&this.vars.repeatRefresh&&!m&&!this._lock&&f!==_&&this._initted&&(this._lock=a=1,this.render(It(_*g),!0).invalidate()._lock=0)}if(!this._initted){if(jh(this,u?i:f,a,s,h))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&g!==p))return this;if(c!==this._dur)return this.render(i,s,a)}if(this._rEase){var M=f<o;if(M!==this._inv){var E=M?o:c-o;this._inv=M,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=o,this._invRecip=E?(M?-1:1)/E:0,this._invScale=M?-this.ratio:1-this.ratio,this._invEase=M?this._rEase:this._ease}this.ratio=b=this._invRatio+this._invScale*this._invEase((f-this._invTime)*this._invRecip)}else this.ratio=b=this._ease(f/c);if(this._from&&(this.ratio=b=1-b),this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),!o&&h&&!s&&!p&&(ei(this,"onStart"),this._tTime!==h))return this;for(d=this._pt;d;)d.r(b,d.d),d=d._next;y&&y.render(i<0?i:y._dur*y._ease(f/this._dur),s,a)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(u&&Dc(this,i,s,a),ei(this,"onUpdate")),this._repeat&&g!==p&&this.vars.onRepeat&&!s&&this.parent&&ei(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Dc(this,i,!0,!0),(i||!c)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Rr(this,1),!s&&!(u&&!o)&&(h||o||m)&&(ei(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},t.resetTo=function(i,s,a,o,l){Ya||Jn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||ef(this,c),u=this._ease(c/this._dur),Wg(this,i,s,a,o,u,c,l)?this.resetTo(i,s,a,o,1):(Al(this,0),this.parent||$h(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?xa(this):this.scrollTrigger&&this.scrollTrigger.kill(!!hn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,vr&&vr.vars.overwrite!==!0)._first||xa(this),this.parent&&a!==this.timeline.totalDuration()&&Js(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=i?mi(i):o,c=this._ptLookup,u=this._pt,h,f,d,g,_,p,m;if((!s||s==="all")&&Mg(o,l))return s==="all"&&(this._pt=0),xa(this);for(h=this._op=this._op||[],s!=="all"&&(un(s)&&(_={},kn(s,function(b){return _[b]=1}),s=_),s=Xg(o,s)),m=o.length;m--;)if(~l.indexOf(o[m])){f=c[m],s==="all"?(h[m]=s,g=f,d={}):(d=h[m]=h[m]||{},g=s);for(_ in g)p=f&&f[_],p&&((!("kill"in p.d)||p.d.kill(_)===!0)&&Tl(this,p,"_pt"),delete f[_]),d!=="all"&&(d[_]=1)}return this._initted&&!this._pt&&u&&xa(this),this},e.to=function(i,s){return new e(i,s,arguments[2])},e.from=function(i,s){return Ca(1,arguments)},e.delayedCall=function(i,s,a,o){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},e.fromTo=function(i,s,a){return Ca(2,arguments)},e.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(i,s)},e.killTweensOf=function(i,s,a){return Ut.killTweensOf(i,s,a)},e})(qa);ri(jt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});kn("staggerTo,staggerFrom,staggerFromTo",function(r){jt[r]=function(){var e=new On,t=Nc.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var tf=function(e,t,n){return e[t]=n},mp=function(e,t,n){return e[t](n)},qg=function(e,t,n,i){return e[t](i.fp,n)},$g=function(e,t,n){return e.setAttribute(t,n)},nf=function(e,t){return zt(e[t])?mp:Xu(e[t])&&e.setAttribute?$g:tf},gp=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Zg=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},_p=function(e,t){var n=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+i,n=n._next;i+=t.c}t.set(t.t,t.p,i,t)},rf=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},Kg=function(e,t,n,i){for(var s=this._pt,a;s;)a=s._next,s.p===i&&s.modifier(e,t,n),s=a},jg=function(e){for(var t=this._pt,n,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?Tl(this,t,"_pt"):t.dep||(n=1),t=i;return!n},Jg=function(e,t,n,i){i.mSet(e,t,i.m.call(i.tween,n,i.mt),i)},xp=function(e){for(var t=e._pt,n,i,s,a;t;){for(n=t._next,i=s;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:a)?t._prev._next=t:s=t,(t._next=i)?i._prev=t:a=t,t=n}e._pt=s},zn=(function(){function r(t,n,i,s,a,o,l,c,u){this.t=n,this.s=s,this.c=a,this.p=i,this.r=o||gp,this.d=l||this,this.set=c||tf,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Jg,this.m=n,this.mt=s,this.tween=i},r})();kn(Ku+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(r){return Zu[r]=1});ii.TweenMax=ii.TweenLite=jt;ii.TimelineLite=ii.TimelineMax=On;Ut=new On({sortChildren:!1,defaults:Va,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ni.stringFilter=cp;var es=[],$o={},Qg=[],$f=0,e0=0,zl=function(e){return($o[e]||Qg).map(function(t){return t()})},Oc=function(){var e=Date.now(),t=[];e-$f>2&&(zl("matchMediaInit"),es.forEach(function(n){var i=n.queries,s=n.conditions,a,o,l,c;for(o in i)a=Ci.matchMedia(i[o]).matches,a&&(l=1),a!==s[o]&&(s[o]=a,c=1);c&&(n.revert(),l&&t.push(n))}),zl("matchMediaRevert"),t.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),$f=e,zl("matchMedia"))},vp=(function(){function r(t,n){this.selector=n&&Ic(n),this.data=[],this._r=[],this.isReverted=!1,this.id=e0++,t&&this.add(t)}var e=r.prototype;return e.add=function(n,i,s){zt(n)&&(s=i,i=n,n=zt);var a=this,o=function(){var c=Nt,u=a.selector,h;return c&&c!==a&&c.data.push(a),s&&(a.selector=Ic(s)),Nt=a,h=i.apply(a,arguments),zt(h)&&a._r.push(h),Nt=c,a.selector=u,a.isReverted=!1,h};return a.last=o,n===zt?o(a,function(l){return a.add(null,l)}):n?a[n]=o:o},e.ignore=function(n){var i=Nt;Nt=null,n(this),Nt=i},e.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof jt&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(n,i){var s=this;if(n?(function(){for(var o=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof On?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof jt)&&c.revert&&c.revert(n);s._r.forEach(function(u){return u(n,s)}),s.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var a=es.length;a--;)es[a].id===this.id&&es.splice(a,1)},e.revert=function(n){this.kill(n||{})},r})(),t0=(function(){function r(t){this.contexts=[],this.scope=t,Nt&&Nt.data.push(this)}var e=r.prototype;return e.add=function(n,i,s){zi(n)||(n={matches:n});var a=new vp(0,s||this.scope),o=a.conditions={},l,c,u;Nt&&!a.selector&&(a.selector=Nt.selector),this.contexts.push(a),i=a.add("onMatch",i),a.queries=n;for(c in n)c==="all"?u=1:(l=Ci.matchMedia(n[c]),l&&(es.indexOf(a)<0&&es.push(a),(o[c]=l.matches)&&(u=1),l.addListener?l.addListener(Oc):l.addEventListener("change",Oc)));return u&&i(a,function(h){return a.add(null,h)}),this},e.revert=function(n){this.kill(n||{})},e.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r})(),fl={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(function(i){return ap(i)})},timeline:function(e){return new On(e)},getTweensOf:function(e,t){return Ut.getTweensOf(e,t)},getProperty:function(e,t,n,i){un(e)&&(e=mi(e)[0]);var s=jr(e||{}).get,a=n?qh:Yh;return n==="native"&&(n=""),e&&(t?a((Kn[t]&&Kn[t].get||s)(e,t,n,i)):function(o,l,c){return a((Kn[o]&&Kn[o].get||s)(e,o,l,c))})},quickSetter:function(e,t,n){if(e=mi(e),e.length>1){var i=e.map(function(u){return Wn.quickSetter(u,t,n)}),s=i.length;return function(u){for(var h=s;h--;)i[h](u)}}e=e[0]||{};var a=Kn[t],o=jr(e),l=o.harness&&(o.harness.aliases||{})[t]||t,c=a?function(u){var h=new a;Bs._pt=0,h.init(e,n?u+n:u,Bs,0,[e]),h.render(1,h),Bs._pt&&rf(1,Bs)}:o.set(e,l);return a?c:function(u){return c(e,l,n?u+n:u,o,1)}},quickTo:function(e,t,n){var i,s=Wn.to(e,ri((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),n||{})),a=function(l,c,u){return s.resetTo(t,l,c,u)};return a.tween=s,a},isTweening:function(e){return Ut.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Qr(e.ease,Va.ease)),Hf(Va,e||{})},config:function(e){return Hf(ni,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,i=e.plugins,s=e.defaults,a=e.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Kn[o]&&!ii[o]&&Ha(t+" effect requires "+o+" plugin.")}),Fl[t]=function(o,l,c){return n(mi(o),ri(l||{},s),c)},a&&(On.prototype[t]=function(o,l,c){return this.add(Fl[t](o,zi(l)?l:(c=l)&&{},this),c)})},registerEase:function(e,t){dt[e]=Qr(t)},parseEase:function(e,t){return arguments.length?Qr(e,t):dt},getById:function(e){return Ut.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new On(e),i,s;for(n.smoothChildTiming=Bn(e.smoothChildTiming),Ut.remove(n),n._dp=0,n._time=n._tTime=Ut._time,i=Ut._first;i;)s=i._next,(t||!(!i._dur&&i instanceof jt&&i.vars.onComplete===i._targets[0]))&&Li(n,i,i._start-i._delay),i=s;return Li(Ut,n,0),n},context:function(e,t){return e?new vp(e,t):Nt},matchMedia:function(e){return new t0(e)},matchMediaRefresh:function(){return es.forEach(function(e){var t=e.conditions,n,i;for(i in t)t[i]&&(t[i]=!1,n=1);n&&e.revert()})||Oc()},addEventListener:function(e,t){var n=$o[e]||($o[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=$o[e],i=n&&n.indexOf(t);i>=0&&n.splice(i,1)},utils:{wrap:Lg,wrapYoyo:Ng,distribute:ep,random:np,snap:tp,normalize:Dg,getUnit:Sn,clamp:Ag,splitColor:op,toArray:mi,selector:Ic,mapRange:rp,pipe:Cg,unitize:Pg,interpolate:Ig,shuffle:Qh},install:Gh,effects:Fl,ticker:Jn,updateRoot:On.updateRoot,plugins:Kn,globalTimeline:Ut,core:{PropTween:zn,globals:Vh,Tween:jt,Timeline:On,Animation:qa,getCache:jr,_removeLinkedListItem:Tl,reverting:function(){return hn},context:function(e){return e&&Nt&&(Nt.data.push(e),e._ctx=Nt),Nt},suppressOverwrites:function(e){return Wu=e}}};kn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return fl[r]=jt[r]});Jn.add(On.updateRoot);Bs=fl.to({},{duration:0});var n0=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},i0=function(e,t){var n=e._targets,i,s,a;for(i in t)for(s=n.length;s--;)a=e._ptLookup[s][i],a&&(a=a.d)&&(a._pt&&(a=n0(a,i)),a&&a.modifier&&a.modifier(t[i],e,n[s],i))},Gl=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,s,a){a._onInit=function(o){var l,c;if(un(s)&&(l={},kn(s,function(u){return l[u]=1}),s=l),t){l={};for(c in s)l[c]=t(s[c]);s=l}i0(o,s)}}}},Wn=fl.registerPlugin({name:"attr",init:function(e,t,n,i,s){var a,o,l;this.tween=n;for(a in t)l=e.getAttribute(a)||"",o=this.add(e,"setAttribute",(l||0)+"",t[a],i,s,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(e,t){for(var n=t._pt;n;)hn?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},Gl("roundProps",Uc),Gl("modifiers"),Gl("snap",tp))||fl;jt.version=On.version=Wn.version="3.15.0";zh=1;Yu()&&Qs();dt.Power0;dt.Power1;dt.Power2;dt.Power3;dt.Power4;dt.Linear;dt.Quad;dt.Cubic;dt.Quart;dt.Quint;dt.Strong;dt.Elastic;dt.Back;dt.SteppedEase;dt.Bounce;dt.Sine;dt.Expo;dt.Circ;var Zf,Mr,Gs,sf,qr,Kf,af,r0=function(){return typeof window<"u"},rr={},Gr=180/Math.PI,Vs=Math.PI/180,ms=Math.atan2,jf=1e8,of=/([A-Z])/g,s0=/(left|right|width|margin|padding|x)/i,a0=/[\s,\(]\S/,Ni={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Bc=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},o0=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},l0=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},c0=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},u0=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},Mp=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Sp=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},f0=function(e,t,n){return e.style[t]=n},d0=function(e,t,n){return e.style.setProperty(t,n)},h0=function(e,t,n){return e._gsap[t]=n},p0=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},m0=function(e,t,n,i,s){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(s,a)},g0=function(e,t,n,i,s){var a=e._gsap;a[t]=n,a.renderTransform(s,a)},Ft="transform",Gn=Ft+"Origin",_0=function r(e,t){var n=this,i=this.target,s=i.style,a=i._gsap;if(e in rr&&s){if(this.tfm=this.tfm||{},e!=="transform")e=Ni[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return n.tfm[o]=$i(i,o)}):this.tfm[e]=a.x?a[e]:$i(i,e),e===Gn&&(this.tfm.zOrigin=a.zOrigin);else return Ni.transform.split(",").forEach(function(o){return r.call(n,o,t)});if(this.props.indexOf(Ft)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Gn,t,"")),e=Ft}(s||t)&&this.props.push(e,t,s[e])},bp=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},x0=function(){var e=this.props,t=this.target,n=t.style,i=t._gsap,s,a;for(s=0;s<e.length;s+=3)e[s+1]?e[s+1]===2?t[e[s]](e[s+2]):t[e[s]]=e[s+2]:e[s+2]?n[e[s]]=e[s+2]:n.removeProperty(e[s].substr(0,2)==="--"?e[s]:e[s].replace(of,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)i[a]=this.tfm[a];i.svg&&(i.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=af(),(!s||!s.isStart)&&!n[Ft]&&(bp(n),i.zOrigin&&n[Gn]&&(n[Gn]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},yp=function(e,t){var n={target:e,props:[],revert:x0,save:_0};return e._gsap||Wn.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(i){return n.save(i)}),n},Ep,kc=function(e,t){var n=Mr.createElementNS?Mr.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Mr.createElement(e);return n&&n.style?n:Mr.createElement(e)},ti=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(of,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,ea(t)||t,1)||""},Jf="O,Moz,ms,Ms,Webkit".split(","),ea=function(e,t,n){var i=t||qr,s=i.style,a=5;if(e in s&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(Jf[a]+e in s););return a<0?null:(a===3?"ms":a>=0?Jf[a]:"")+e},zc=function(){r0()&&window.document&&(Zf=window,Mr=Zf.document,Gs=Mr.documentElement,qr=kc("div")||{style:{}},kc("div"),Ft=ea(Ft),Gn=Ft+"Origin",qr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ep=!!ea("perspective"),af=Wn.core.reverting,sf=1)},Qf=function(e){var t=e.ownerSVGElement,n=kc("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),s;i.style.display="block",n.appendChild(i),Gs.appendChild(n);try{s=i.getBBox()}catch{}return n.removeChild(i),Gs.removeChild(n),s},ed=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},Tp=function(e){var t,n;try{t=e.getBBox()}catch{t=Qf(e),n=1}return t&&(t.width||t.height)||n||(t=Qf(e)),t&&!t.width&&!t.x&&!t.y?{x:+ed(e,["x","cx","x1"])||0,y:+ed(e,["y","cy","y1"])||0,width:0,height:0}:t},wp=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Tp(e))},Cr=function(e,t){if(t){var n=e.style,i;t in rr&&t!==Gn&&(t=Ft),n.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),n.removeProperty(i==="--"?t:t.replace(of,"-$1").toLowerCase())):n.removeAttribute(t)}},Sr=function(e,t,n,i,s,a){var o=new zn(e._pt,t,n,0,1,a?Sp:Mp);return e._pt=o,o.b=i,o.e=s,e._props.push(n),o},td={deg:1,rad:1,turn:1},v0={grid:1,flex:1},Pr=function r(e,t,n,i){var s=parseFloat(n)||0,a=(n+"").trim().substr((s+"").length)||"px",o=qr.style,l=s0.test(t),c=e.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",d=i==="%",g,_,p,m;if(i===a||!s||td[i]||td[a])return s;if(a!=="px"&&!f&&(s=r(e,t,n,"px")),m=e.getCTM&&wp(e),(d||a==="%")&&(rr[t]||~t.indexOf("adius")))return g=m?e.getBBox()[l?"width":"height"]:e[u],Wt(d?s/g*h:s/100*g);if(o[l?"width":"height"]=h+(f?a:i),_=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!c?e:e.parentNode,m&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Mr||!_.appendChild)&&(_=Mr.body),p=_._gsap,p&&d&&p.width&&l&&p.time===Jn.time&&!p.uncache)return Wt(s/p.width*h);if(d&&(t==="height"||t==="width")){var b=e.style[t];e.style[t]=h+i,g=e[u],b?e.style[t]=b:Cr(e,t)}else(d||a==="%")&&!v0[ti(_,"display")]&&(o.position=ti(e,"position")),_===e&&(o.position="static"),_.appendChild(qr),g=qr[u],_.removeChild(qr),o.position="absolute";return l&&d&&(p=jr(_),p.time=Jn.time,p.width=_[u]),Wt(f?g*s/h:g&&s?h/g*s:0)},$i=function(e,t,n,i){var s;return sf||zc(),t in Ni&&t!=="transform"&&(t=Ni[t],~t.indexOf(",")&&(t=t.split(",")[0])),rr[t]&&t!=="transform"?(s=Za(e,i),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:hl(ti(e,Gn))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=dl[t]&&dl[t](e,t,n)||ti(e,t)||Wh(e,t)||(t==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?Pr(e,t,s,n)+n:s},M0=function(e,t,n,i){if(!n||n==="none"){var s=ea(t,e,1),a=s&&ti(e,s,1);a&&a!==n?(t=s,n=a):t==="borderColor"&&(n=ti(e,"borderTopColor"))}var o=new zn(this._pt,e.style,t,0,1,_p),l=0,c=0,u,h,f,d,g,_,p,m,b,y,M,E;if(o.b=n,o.e=i,n+="",i+="",i.substring(0,6)==="var(--"&&(i=ti(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(_=e.style[t],e.style[t]=i,i=ti(e,t)||i,_?e.style[t]=_:Cr(e,t)),u=[n,i],cp(u),n=u[0],i=u[1],f=n.match(Os)||[],E=i.match(Os)||[],E.length){for(;h=Os.exec(i);)p=h[0],b=i.substring(l,h.index),g?g=(g+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(g=1),p!==(_=f[c++]||"")&&(d=parseFloat(_)||0,M=_.substr((d+"").length),p.charAt(1)==="="&&(p=zs(d,p)+M),m=parseFloat(p),y=p.substr((m+"").length),l=Os.lastIndex-y.length,y||(y=y||ni.units[t]||M,l===i.length&&(i+=y,o.e+=y)),M!==y&&(d=Pr(e,t,_,y)||0),o._pt={_next:o._pt,p:b||c===1?b:",",s:d,c:m-d,m:g&&g<4||t==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=t==="display"&&i==="none"?Sp:Mp;return kh.test(i)&&(o.e=0),this._pt=o,o},nd={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},S0=function(e){var t=e.split(" "),n=t[0],i=t[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(e=n,n=i,i=e),t[0]=nd[n]||n,t[1]=nd[i]||i,t.join(" ")},b0=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n=t.t,i=n.style,s=t.u,a=n._gsap,o,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)o=s[c],rr[o]&&(l=1,o=o==="transformOrigin"?Gn:Ft),Cr(n,o);l&&(Cr(n,Ft),a&&(a.svg&&n.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Za(n,1),a.uncache=1,bp(i)))}},dl={clearProps:function(e,t,n,i,s){if(s.data!=="isFromStart"){var a=e._pt=new zn(e._pt,t,n,0,0,b0);return a.u=i,a.pr=-10,a.tween=s,e._props.push(n),1}}},$a=[1,0,0,1,0,0],Ap={},Rp=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},id=function(e){var t=ti(e,Ft);return Rp(t)?$a:t.substr(7).match(Bh).map(Wt)},lf=function(e,t){var n=e._gsap||jr(e),i=e.style,s=id(e),a,o,l,c;return n.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?$a:s):(s===$a&&!e.offsetParent&&e!==Gs&&!n.svg&&(l=i.display,i.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,o=e.nextElementSibling,Gs.appendChild(e)),s=id(e),l?i.display=l:Cr(e,"display"),c&&(o?a.insertBefore(e,o):a?a.appendChild(e):Gs.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Gc=function(e,t,n,i,s,a){var o=e._gsap,l=s||lf(e,!0),c=o.xOrigin||0,u=o.yOrigin||0,h=o.xOffset||0,f=o.yOffset||0,d=l[0],g=l[1],_=l[2],p=l[3],m=l[4],b=l[5],y=t.split(" "),M=parseFloat(y[0])||0,E=parseFloat(y[1])||0,T,A,v,w;n?l!==$a&&(A=d*p-g*_)&&(v=M*(p/A)+E*(-_/A)+(_*b-p*m)/A,w=M*(-g/A)+E*(d/A)-(d*b-g*m)/A,M=v,E=w):(T=Tp(e),M=T.x+(~y[0].indexOf("%")?M/100*T.width:M),E=T.y+(~(y[1]||y[0]).indexOf("%")?E/100*T.height:E)),i||i!==!1&&o.smooth?(m=M-c,b=E-u,o.xOffset=h+(m*d+b*_)-m,o.yOffset=f+(m*g+b*p)-b):o.xOffset=o.yOffset=0,o.xOrigin=M,o.yOrigin=E,o.smooth=!!i,o.origin=t,o.originIsAbsolute=!!n,e.style[Gn]="0px 0px",a&&(Sr(a,o,"xOrigin",c,M),Sr(a,o,"yOrigin",u,E),Sr(a,o,"xOffset",h,o.xOffset),Sr(a,o,"yOffset",f,o.yOffset)),e.setAttribute("data-svg-origin",M+" "+E)},Za=function(e,t){var n=e._gsap||new fp(e);if("x"in n&&!t&&!n.uncache)return n;var i=e.style,s=n.scaleX<0,a="px",o="deg",l=getComputedStyle(e),c=ti(e,Gn)||"0",u,h,f,d,g,_,p,m,b,y,M,E,T,A,v,w,C,L,N,Y,H,O,z,I,q,j,D,se,pe,Ve,He,Le;return u=h=f=_=p=m=b=y=M=0,d=g=1,n.svg=!!(e.getCTM&&wp(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ft]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ft]!=="none"?l[Ft]:"")),i.scale=i.rotate=i.translate="none"),A=lf(e,n.svg),n.svg&&(n.uncache?(q=e.getBBox(),c=n.xOrigin-q.x+"px "+(n.yOrigin-q.y)+"px",I=""):I=!t&&e.getAttribute("data-svg-origin"),Gc(e,I||c,!!I||n.originIsAbsolute,n.smooth!==!1,A)),E=n.xOrigin||0,T=n.yOrigin||0,A!==$a&&(L=A[0],N=A[1],Y=A[2],H=A[3],u=O=A[4],h=z=A[5],A.length===6?(d=Math.sqrt(L*L+N*N),g=Math.sqrt(H*H+Y*Y),_=L||N?ms(N,L)*Gr:0,b=Y||H?ms(Y,H)*Gr+_:0,b&&(g*=Math.abs(Math.cos(b*Vs))),n.svg&&(u-=E-(E*L+T*Y),h-=T-(E*N+T*H))):(Le=A[6],Ve=A[7],D=A[8],se=A[9],pe=A[10],He=A[11],u=A[12],h=A[13],f=A[14],v=ms(Le,pe),p=v*Gr,v&&(w=Math.cos(-v),C=Math.sin(-v),I=O*w+D*C,q=z*w+se*C,j=Le*w+pe*C,D=O*-C+D*w,se=z*-C+se*w,pe=Le*-C+pe*w,He=Ve*-C+He*w,O=I,z=q,Le=j),v=ms(-Y,pe),m=v*Gr,v&&(w=Math.cos(-v),C=Math.sin(-v),I=L*w-D*C,q=N*w-se*C,j=Y*w-pe*C,He=H*C+He*w,L=I,N=q,Y=j),v=ms(N,L),_=v*Gr,v&&(w=Math.cos(v),C=Math.sin(v),I=L*w+N*C,q=O*w+z*C,N=N*w-L*C,z=z*w-O*C,L=I,O=q),p&&Math.abs(p)+Math.abs(_)>359.9&&(p=_=0,m=180-m),d=Wt(Math.sqrt(L*L+N*N+Y*Y)),g=Wt(Math.sqrt(z*z+Le*Le)),v=ms(O,z),b=Math.abs(v)>2e-4?v*Gr:0,M=He?1/(He<0?-He:He):0),n.svg&&(I=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!Rp(ti(e,Ft)),I&&e.setAttribute("transform",I))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(d*=-1,b+=_<=0?180:-180,_+=_<=0?180:-180):(g*=-1,b+=b<=0?180:-180)),t=t||n.uncache,n.x=u-((n.xPercent=u&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+a,n.y=h-((n.yPercent=h&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+a,n.z=f+a,n.scaleX=Wt(d),n.scaleY=Wt(g),n.rotation=Wt(_)+o,n.rotationX=Wt(p)+o,n.rotationY=Wt(m)+o,n.skewX=b+o,n.skewY=y+o,n.transformPerspective=M+a,(n.zOrigin=parseFloat(c.split(" ")[2])||!t&&n.zOrigin||0)&&(i[Gn]=hl(c)),n.xOffset=n.yOffset=0,n.force3D=ni.force3D,n.renderTransform=n.svg?E0:Ep?Cp:y0,n.uncache=0,n},hl=function(e){return(e=e.split(" "))[0]+" "+e[1]},Vl=function(e,t,n){var i=Sn(t);return Wt(parseFloat(t)+parseFloat(Pr(e,"x",n+"px",i)))+i},y0=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Cp(e,t)},Ir="0deg",ca="0px",Ur=") ",Cp=function(e,t){var n=t||this,i=n.xPercent,s=n.yPercent,a=n.x,o=n.y,l=n.z,c=n.rotation,u=n.rotationY,h=n.rotationX,f=n.skewX,d=n.skewY,g=n.scaleX,_=n.scaleY,p=n.transformPerspective,m=n.force3D,b=n.target,y=n.zOrigin,M="",E=m==="auto"&&e&&e!==1||m===!0;if(y&&(h!==Ir||u!==Ir)){var T=parseFloat(u)*Vs,A=Math.sin(T),v=Math.cos(T),w;T=parseFloat(h)*Vs,w=Math.cos(T),a=Vl(b,a,A*w*-y),o=Vl(b,o,-Math.sin(T)*-y),l=Vl(b,l,v*w*-y+y)}p!==ca&&(M+="perspective("+p+Ur),(i||s)&&(M+="translate("+i+"%, "+s+"%) "),(E||a!==ca||o!==ca||l!==ca)&&(M+=l!==ca||E?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+Ur),c!==Ir&&(M+="rotate("+c+Ur),u!==Ir&&(M+="rotateY("+u+Ur),h!==Ir&&(M+="rotateX("+h+Ur),(f!==Ir||d!==Ir)&&(M+="skew("+f+", "+d+Ur),(g!==1||_!==1)&&(M+="scale("+g+", "+_+Ur),b.style[Ft]=M||"translate(0, 0)"},E0=function(e,t){var n=t||this,i=n.xPercent,s=n.yPercent,a=n.x,o=n.y,l=n.rotation,c=n.skewX,u=n.skewY,h=n.scaleX,f=n.scaleY,d=n.target,g=n.xOrigin,_=n.yOrigin,p=n.xOffset,m=n.yOffset,b=n.forceCSS,y=parseFloat(a),M=parseFloat(o),E,T,A,v,w;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=Vs,c*=Vs,E=Math.cos(l)*h,T=Math.sin(l)*h,A=Math.sin(l-c)*-f,v=Math.cos(l-c)*f,c&&(u*=Vs,w=Math.tan(c-u),w=Math.sqrt(1+w*w),A*=w,v*=w,u&&(w=Math.tan(u),w=Math.sqrt(1+w*w),E*=w,T*=w)),E=Wt(E),T=Wt(T),A=Wt(A),v=Wt(v)):(E=h,v=f,T=A=0),(y&&!~(a+"").indexOf("px")||M&&!~(o+"").indexOf("px"))&&(y=Pr(d,"x",a,"px"),M=Pr(d,"y",o,"px")),(g||_||p||m)&&(y=Wt(y+g-(g*E+_*A)+p),M=Wt(M+_-(g*T+_*v)+m)),(i||s)&&(w=d.getBBox(),y=Wt(y+i/100*w.width),M=Wt(M+s/100*w.height)),w="matrix("+E+","+T+","+A+","+v+","+y+","+M+")",d.setAttribute("transform",w),b&&(d.style[Ft]=w)},T0=function(e,t,n,i,s){var a=360,o=un(s),l=parseFloat(s)*(o&&~s.indexOf("rad")?Gr:1),c=l-i,u=i+c+"deg",h,f;return o&&(h=s.split("_")[1],h==="short"&&(c%=a,c!==c%(a/2)&&(c+=c<0?a:-a)),h==="cw"&&c<0?c=(c+a*jf)%a-~~(c/a)*a:h==="ccw"&&c>0&&(c=(c-a*jf)%a-~~(c/a)*a)),e._pt=f=new zn(e._pt,t,n,i,c,o0),f.e=u,f.u="deg",e._props.push(n),f},rd=function(e,t){for(var n in t)e[n]=t[n];return e},w0=function(e,t,n){var i=rd({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=n.style,o,l,c,u,h,f,d,g;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),a[Ft]=t,o=Za(n,1),Cr(n,Ft),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Ft],a[Ft]=t,o=Za(n,1),a[Ft]=c);for(l in rr)c=i[l],u=o[l],c!==u&&s.indexOf(l)<0&&(d=Sn(c),g=Sn(u),h=d!==g?Pr(n,l,c,g):parseFloat(c),f=parseFloat(u),e._pt=new zn(e._pt,o,l,h,f-h,Bc),e._pt.u=g||0,e._props.push(l));rd(o,i)};kn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",a=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(o){return e<2?r+o:"border"+o+r});dl[e>1?"border"+r:r]=function(o,l,c,u,h){var f,d;if(arguments.length<4)return f=a.map(function(g){return $i(o,g,c)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(u+"").split(" "),d={},a.forEach(function(g,_){return d[g]=f[_]=f[_]||f[(_-1)/2|0]}),o.init(l,d,h)}});var Pp={name:"css",register:zc,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,s){var a=this._props,o=e.style,l=n.vars.startAt,c,u,h,f,d,g,_,p,m,b,y,M,E,T,A,v,w;sf||zc(),this.styles=this.styles||yp(e),v=this.styles.props,this.tween=n;for(_ in t)if(_!=="autoRound"&&(u=t[_],!(Kn[_]&&dp(_,t,n,i,e,s)))){if(d=typeof u,g=dl[_],d==="function"&&(u=u.call(n,i,e,s),d=typeof u),d==="string"&&~u.indexOf("random(")&&(u=Xa(u)),g)g(this,e,_,u,n)&&(A=1);else if(_.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(_)+"").trim(),u+="",wr.lastIndex=0,wr.test(c)||(p=Sn(c),m=Sn(u),m?p!==m&&(c=Pr(e,_,c,m)+m):p&&(u+=p)),this.add(o,"setProperty",c,u,i,s,0,0,_),a.push(_),v.push(_,0,o[_]);else if(d!=="undefined"){if(l&&_ in l?(c=typeof l[_]=="function"?l[_].call(n,i,e,s):l[_],un(c)&&~c.indexOf("random(")&&(c=Xa(c)),Sn(c+"")||c==="auto"||(c+=ni.units[_]||Sn($i(e,_))||""),(c+"").charAt(1)==="="&&(c=$i(e,_))):c=$i(e,_),f=parseFloat(c),b=d==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),h=parseFloat(u),_ in Ni&&(_==="autoAlpha"&&(f===1&&$i(e,"visibility")==="hidden"&&h&&(f=0),v.push("visibility",0,o.visibility),Sr(this,o,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=Ni[_],~_.indexOf(",")&&(_=_.split(",")[0]))),y=_ in rr,y){if(this.styles.save(_),w=u,d==="string"&&u.substring(0,6)==="var(--"){if(u=ti(e,u.substring(4,u.indexOf(")"))),u.substring(0,5)==="calc("){var C=e.style.perspective;e.style.perspective=u,u=ti(e,"perspective"),C?e.style.perspective=C:Cr(e,"perspective")}h=parseFloat(u)}if(M||(E=e._gsap,E.renderTransform&&!t.parseTransform||Za(e,t.parseTransform),T=t.smoothOrigin!==!1&&E.smooth,M=this._pt=new zn(this._pt,o,Ft,0,1,E.renderTransform,E,0,-1),M.dep=1),_==="scale")this._pt=new zn(this._pt,E,"scaleY",E.scaleY,(b?zs(E.scaleY,b+h):h)-E.scaleY||0,Bc),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){v.push(Gn,0,o[Gn]),u=S0(u),E.svg?Gc(e,u,0,T,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==E.zOrigin&&Sr(this,E,"zOrigin",E.zOrigin,m),Sr(this,o,_,hl(c),hl(u)));continue}else if(_==="svgOrigin"){Gc(e,u,1,T,0,this);continue}else if(_ in Ap){T0(this,E,_,f,b?zs(f,b+u):u);continue}else if(_==="smoothOrigin"){Sr(this,E,"smooth",E.smooth,u);continue}else if(_==="force3D"){E[_]=u;continue}else if(_==="transform"){w0(this,u,e);continue}}else _ in o||(_=ea(_)||_);if(y||(h||h===0)&&(f||f===0)&&!a0.test(u)&&_ in o)p=(c+"").substr((f+"").length),h||(h=0),m=Sn(u)||(_ in ni.units?ni.units[_]:p),p!==m&&(f=Pr(e,_,c,m)),this._pt=new zn(this._pt,y?E:o,_,f,(b?zs(f,b+h):h)-f,!y&&(m==="px"||_==="zIndex")&&t.autoRound!==!1?u0:Bc),this._pt.u=m||0,y&&w!==u?(this._pt.b=c,this._pt.e=w,this._pt.r=c0):p!==m&&m!=="%"&&(this._pt.b=c,this._pt.r=l0);else if(_ in o)M0.call(this,e,_,c,b?b+u:u);else if(_ in e)this.add(e,_,c||e[_],b?b+u:u,i,s);else if(_!=="parseTransform"){$u(_,u);continue}y||(_ in o?v.push(_,0,o[_]):typeof e[_]=="function"?v.push(_,2,e[_]()):v.push(_,1,c||e[_])),a.push(_)}}A&&xp(this)},render:function(e,t){if(t.tween._time||!af())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:$i,aliases:Ni,getSetter:function(e,t,n){var i=Ni[t];return i&&i.indexOf(",")<0&&(t=i),t in rr&&t!==Gn&&(e._gsap.x||$i(e,"x"))?n&&Kf===n?t==="scale"?p0:h0:(Kf=n||{})&&(t==="scale"?m0:g0):e.style&&!Xu(e.style[t])?f0:~t.indexOf("-")?d0:nf(e,t)},core:{_removeProperty:Cr,_getMatrix:lf}};Wn.utils.checkPrefix=ea;Wn.core.getStyleSaver=yp;(function(r,e,t,n){var i=kn(r+","+e+","+t,function(s){rr[s]=1});kn(e,function(s){ni.units[s]="deg",Ap[s]=1}),Ni[i[13]]=r+","+e,kn(n,function(s){var a=s.split(":");Ni[a[1]]=i[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");kn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ni.units[r]="px"});Wn.registerPlugin(Pp);var Lt=Wn.registerPlugin(Pp)||Wn;Lt.core.Tween;function A0(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function R0(r,e,t){return e&&A0(r.prototype,e),r}var fn,Zo,Qn,br,yr,Hs,Dp,Vr,Ws,Lp,ji,Mi,Np,Ip=function(){return fn||typeof window<"u"&&(fn=window.gsap)&&fn.registerPlugin&&fn},Up=1,ks=[],at=[],Oi=[],Da=Date.now,Vc=function(e,t){return t},C0=function(){var e=Ws.core,t=e.bridge||{},n=e._scrollers,i=e._proxies;n.push.apply(n,at),i.push.apply(i,Oi),at=n,Oi=i,Vc=function(a,o){return t[a](o)}},Ar=function(e,t){return~Oi.indexOf(e)&&Oi[Oi.indexOf(e)+1][t]},La=function(e){return!!~Lp.indexOf(e)},Rn=function(e,t,n,i,s){return e.addEventListener(t,n,{passive:i!==!1,capture:!!s})},An=function(e,t,n,i){return e.removeEventListener(t,n,!!i)},ao="scrollLeft",oo="scrollTop",Hc=function(){return ji&&ji.isPressed||at.cache++},pl=function(e,t){var n=function i(s){if(s||s===0){Up&&(Qn.history.scrollRestoration="manual");var a=ji&&ji.isPressed;s=i.v=Math.round(s)||(ji&&ji.iOS?1:0),e(s),i.cacheID=at.cache,a&&Vc("ss",s)}else(t||at.cache!==i.cacheID||Vc("ref"))&&(i.cacheID=at.cache,i.v=e());return i.v+i.offset};return n.offset=0,e&&n},In={s:ao,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:pl(function(r){return arguments.length?Qn.scrollTo(r,en.sc()):Qn.pageXOffset||br[ao]||yr[ao]||Hs[ao]||0})},en={s:oo,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:In,sc:pl(function(r){return arguments.length?Qn.scrollTo(In.sc(),r):Qn.pageYOffset||br[oo]||yr[oo]||Hs[oo]||0})},Fn=function(e,t){return(t&&t._ctx&&t._ctx.selector||fn.utils.toArray)(e)[0]||(typeof e=="string"&&fn.config().nullTargetWarn!==!1?console.warn("Element not found:",e):null)},P0=function(e,t){for(var n=t.length;n--;)if(t[n]===e||t[n].contains(e))return!0;return!1},Dr=function(e,t){var n=t.s,i=t.sc;La(e)&&(e=br.scrollingElement||yr);var s=at.indexOf(e),a=i===en.sc?1:2;!~s&&(s=at.push(e)-1),at[s+a]||Rn(e,"scroll",Hc);var o=at[s+a],l=o||(at[s+a]=pl(Ar(e,n),!0)||(La(e)?i:pl(function(c){return arguments.length?e[n]=c:e[n]})));return l.target=e,o||(l.smooth=fn.getProperty(e,"scrollBehavior")==="smooth"),l},Wc=function(e,t,n){var i=e,s=e,a=Da(),o=a,l=t||50,c=Math.max(500,l*3),u=function(g,_){var p=Da();_||p-a>l?(s=i,i=g,o=a,a=p):n?i+=g:i=s+(g-s)/(p-o)*(a-o)},h=function(){s=i=n?0:i,o=a=0},f=function(g){var _=o,p=s,m=Da();return(g||g===0)&&g!==i&&u(g),a===o||m-o>c?0:(i+(n?p:-p))/((n?m:a)-_)*1e3};return{update:u,reset:h,getVelocity:f}},ua=function(e,t){return t&&!e._gsapAllow&&e.cancelable!==!1&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},sd=function(e){var t=Math.max.apply(Math,e),n=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(n)?t:n},Fp=function(){Ws=fn.core.globals().ScrollTrigger,Ws&&Ws.core&&C0()},Op=function(e){return fn=e||Ip(),!Zo&&fn&&typeof document<"u"&&document.body&&(Qn=window,br=document,yr=br.documentElement,Hs=br.body,Lp=[Qn,br,yr,Hs],fn.utils.clamp,Np=fn.core.context||function(){},Vr="onpointerenter"in Hs?"pointer":"mouse",Dp=Xt.isTouch=Qn.matchMedia&&Qn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Qn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,Mi=Xt.eventTypes=("ontouchstart"in yr?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in yr?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return Up=0},500),Zo=1),Ws||Fp(),Zo};In.op=en;at.cache=0;var Xt=(function(){function r(t){this.init(t)}var e=r.prototype;return e.init=function(n){Zo||Op(fn)||console.warn("Please gsap.registerPlugin(Observer)"),Ws||Fp();var i=n.tolerance,s=n.dragMinimum,a=n.type,o=n.target,l=n.lineHeight,c=n.debounce,u=n.preventDefault,h=n.onStop,f=n.onStopDelay,d=n.ignore,g=n.wheelSpeed,_=n.event,p=n.onDragStart,m=n.onDragEnd,b=n.onDrag,y=n.onPress,M=n.onRelease,E=n.onRight,T=n.onLeft,A=n.onUp,v=n.onDown,w=n.onChangeX,C=n.onChangeY,L=n.onChange,N=n.onToggleX,Y=n.onToggleY,H=n.onHover,O=n.onHoverEnd,z=n.onMove,I=n.ignoreCheck,q=n.isNormalizer,j=n.onGestureStart,D=n.onGestureEnd,se=n.onWheel,pe=n.onEnable,Ve=n.onDisable,He=n.onClick,Le=n.scrollSpeed,Q=n.capture,oe=n.allowClicks,ne=n.lockAxis,Ee=n.onLockAxis;this.target=o=Fn(o)||yr,this.vars=n,d&&(d=fn.utils.toArray(d)),i=i||1e-9,s=s||0,g=g||1,Le=Le||1,a=a||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(Qn.getComputedStyle(Hs).lineHeight)||22);var Oe,Te,tt,Me,ze,qe,Ye,$=this,lt=0,We=0,Qe=n.passive||!u&&n.passive!==!1,Ge=Dr(o,In),Ze=Dr(o,en),F=Ge(),Ct=Ze(),Xe=~a.indexOf("touch")&&!~a.indexOf("pointer")&&Mi[0]==="pointerdown",R=La(o),x=o.ownerDocument||br,k=[0,0,0],V=[0,0,0],K=0,ce=function(){return K=Da()},ae=function(re,Be){return($.event=re)&&d&&P0(re.target,d)||Be&&Xe&&re.pointerType!=="touch"||I&&I(re,Be)},J=function(){$._vx.reset(),$._vy.reset(),Te.pause(),h&&h($)},ee=function(){var re=$.deltaX=sd(k),Be=$.deltaY=sd(V),ue=Math.abs(re)>=i,ke=Math.abs(Be)>=i;L&&(ue||ke)&&L($,re,Be,k,V),ue&&(E&&$.deltaX>0&&E($),T&&$.deltaX<0&&T($),w&&w($),N&&$.deltaX<0!=lt<0&&N($),lt=$.deltaX,k[0]=k[1]=k[2]=0),ke&&(v&&$.deltaY>0&&v($),A&&$.deltaY<0&&A($),C&&C($),Y&&$.deltaY<0!=We<0&&Y($),We=$.deltaY,V[0]=V[1]=V[2]=0),(Me||tt)&&(z&&z($),tt&&(p&&tt===1&&p($),b&&b($),tt=0),Me=!1),qe&&!(qe=!1)&&Ee&&Ee($),ze&&(se($),ze=!1),Oe=0},he=function(re,Be,ue){k[ue]+=re,V[ue]+=Be,$._vx.update(re),$._vy.update(Be),c?Oe||(Oe=requestAnimationFrame(ee)):ee()},Ae=function(re,Be){ne&&!Ye&&($.axis=Ye=Math.abs(re)>Math.abs(Be)?"x":"y",qe=!0),Ye!=="y"&&(k[2]+=re,$._vx.update(re,!0)),Ye!=="x"&&(V[2]+=Be,$._vy.update(Be,!0)),c?Oe||(Oe=requestAnimationFrame(ee)):ee()},ge=function(re){if(!ae(re,1)){re=ua(re,u);var Be=re.clientX,ue=re.clientY,ke=Be-$.x,Ce=ue-$.y,Ke=$.isDragging;$.x=Be,$.y=ue,(Ke||(ke||Ce)&&(Math.abs($.startX-Be)>=s||Math.abs($.startY-ue)>=s))&&(tt||(tt=Ke?2:1),Ke||($.isDragging=!0),Ae(ke,Ce))}},me=$.onPress=function(le){ae(le,1)||le&&le.button||($.axis=Ye=null,Te.pause(),$.isPressed=!0,le=ua(le),lt=We=0,$.startX=$.x=le.clientX,$.startY=$.y=le.clientY,$._vx.reset(),$._vy.reset(),Rn(q?o:x,Mi[1],ge,Qe,!0),$.deltaX=$.deltaY=0,y&&y($))},fe=$.onRelease=function(le){if(!ae(le,1)){An(q?o:x,Mi[1],ge,!0);var re=!isNaN($.y-$.startY),Be=$.isDragging,ue=Be&&(Math.abs($.x-$.startX)>3||Math.abs($.y-$.startY)>3),ke=ua(le);!ue&&re&&($._vx.reset(),$._vy.reset(),u&&oe&&fn.delayedCall(.08,function(){if(Da()-K>300&&!le.defaultPrevented){if(le.target.click)le.target.click();else if(x.createEvent){var Ce=x.createEvent("MouseEvents");Ce.initMouseEvent("click",!0,!0,Qn,1,ke.screenX,ke.screenY,ke.clientX,ke.clientY,!1,!1,!1,!1,0,null),le.target.dispatchEvent(Ce)}}})),$.isDragging=$.isGesturing=$.isPressed=!1,h&&Be&&!q&&Te.restart(!0),tt&&ee(),m&&Be&&m($),M&&M($,ue)}},Pe=function(re){return re.touches&&re.touches.length>1&&($.isGesturing=!0)&&j(re,$.isDragging)},Ie=function(){return($.isGesturing=!1)||D($)},U=function(re){if(!ae(re)){var Be=Ge(),ue=Ze();he((Be-F)*Le,(ue-Ct)*Le,1),F=Be,Ct=ue,h&&Te.restart(!0)}},de=function(re){if(!ae(re)){re=ua(re,u),se&&(ze=!0);var Be=(re.deltaMode===1?l:re.deltaMode===2?Qn.innerHeight:1)*g;he(re.deltaX*Be,re.deltaY*Be,0),h&&!q&&Te.restart(!0)}},te=function(re){if(!ae(re)){var Be=re.clientX,ue=re.clientY,ke=Be-$.x,Ce=ue-$.y;$.x=Be,$.y=ue,Me=!0,h&&Te.restart(!0),(ke||Ce)&&Ae(ke,Ce)}},_e=function(re){$.event=re,H($)},xe=function(re){$.event=re,O($)},ie=function(re){return ae(re)||ua(re,u)&&He($)};Te=$._dc=fn.delayedCall(f||.25,J).pause(),$.deltaX=$.deltaY=0,$._vx=Wc(0,50,!0),$._vy=Wc(0,50,!0),$.scrollX=Ge,$.scrollY=Ze,$.isDragging=$.isGesturing=$.isPressed=!1,Np(this),$.enable=function(le){return $.isEnabled||(Rn(R?x:o,"scroll",Hc),a.indexOf("scroll")>=0&&Rn(R?x:o,"scroll",U,Qe,Q),a.indexOf("wheel")>=0&&Rn(o,"wheel",de,Qe,Q),(a.indexOf("touch")>=0&&Dp||a.indexOf("pointer")>=0)&&(Rn(o,Mi[0],me,Qe,Q),Rn(x,Mi[2],fe),Rn(x,Mi[3],fe),oe&&Rn(o,"click",ce,!0,!0),He&&Rn(o,"click",ie),j&&Rn(x,"gesturestart",Pe),D&&Rn(x,"gestureend",Ie),H&&Rn(o,Vr+"enter",_e),O&&Rn(o,Vr+"leave",xe),z&&Rn(o,Vr+"move",te)),$.isEnabled=!0,$.isDragging=$.isGesturing=$.isPressed=Me=tt=!1,$._vx.reset(),$._vy.reset(),F=Ge(),Ct=Ze(),le&&le.type&&me(le),pe&&pe($)),$},$.disable=function(){$.isEnabled&&(ks.filter(function(le){return le!==$&&La(le.target)}).length||An(R?x:o,"scroll",Hc),$.isPressed&&($._vx.reset(),$._vy.reset(),An(q?o:x,Mi[1],ge,!0)),An(R?x:o,"scroll",U,Q),An(o,"wheel",de,Q),An(o,Mi[0],me,Q),An(x,Mi[2],fe),An(x,Mi[3],fe),An(o,"click",ce,!0),An(o,"click",ie),An(x,"gesturestart",Pe),An(x,"gestureend",Ie),An(o,Vr+"enter",_e),An(o,Vr+"leave",xe),An(o,Vr+"move",te),$.isEnabled=$.isPressed=$.isDragging=!1,Ve&&Ve($))},$.kill=$.revert=function(){$.disable();var le=ks.indexOf($);le>=0&&ks.splice(le,1),ji===$&&(ji=0)},ks.push($),q&&La(o)&&(ji=$),$.enable(_)},R0(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r})();Xt.version="3.15.0";Xt.create=function(r){return new Xt(r)};Xt.register=Op;Xt.getAll=function(){return ks.slice()};Xt.getById=function(r){return ks.filter(function(e){return e.vars.id===r})[0]};Ip()&&fn.registerPlugin(Xt);var Re,Is,st,xt,jn,_t,cf,ml,Ka,Na,Ma,lo,xn,Rl,Xc,Ln,ad,od,Us,Bp,Hl,kp,Dn,Yc,zp,Gp,_r,qc,uf,Xs,ff,Ia,$c,Wl,co=1,vn=Date.now,Xl=vn(),gi=0,Sa=0,ld=function(e,t,n){var i=Zn(e)&&(e.substr(0,6)==="clamp("||e.indexOf("max")>-1);return n["_"+t+"Clamp"]=i,i?e.substr(6,e.length-7):e},cd=function(e,t){return t&&(!Zn(e)||e.substr(0,6)!=="clamp(")?"clamp("+e+")":e},D0=function r(){return Sa&&requestAnimationFrame(r)},ud=function(){return Rl=1},fd=function(){return Rl=0},Pi=function(e){return e},ba=function(e){return Math.round(e*1e5)/1e5||0},Vp=function(){return typeof window<"u"},Hp=function(){return Re||Vp()&&(Re=window.gsap)&&Re.registerPlugin&&Re},rs=function(e){return!!~cf.indexOf(e)},Wp=function(e){return(e==="Height"?ff:st["inner"+e])||jn["client"+e]||_t["client"+e]},Xp=function(e){return Ar(e,"getBoundingClientRect")||(rs(e)?function(){return el.width=st.innerWidth,el.height=ff,el}:function(){return Zi(e)})},L0=function(e,t,n){var i=n.d,s=n.d2,a=n.a;return(a=Ar(e,"getBoundingClientRect"))?function(){return a()[i]}:function(){return(t?Wp(s):e["client"+s])||0}},N0=function(e,t){return!t||~Oi.indexOf(e)?Xp(e):function(){return el}},Ii=function(e,t){var n=t.s,i=t.d2,s=t.d,a=t.a;return Math.max(0,(n="scroll"+i)&&(a=Ar(e,n))?a()-Xp(e)()[s]:rs(e)?(jn[n]||_t[n])-Wp(i):e[n]-e["offset"+i])},uo=function(e,t){for(var n=0;n<Us.length;n+=3)(!t||~t.indexOf(Us[n+1]))&&e(Us[n],Us[n+1],Us[n+2])},Zn=function(e){return typeof e=="string"},bn=function(e){return typeof e=="function"},ya=function(e){return typeof e=="number"},Hr=function(e){return typeof e=="object"},fa=function(e,t,n){return e&&e.progress(t?0:1)&&n&&e.pause()},gs=function(e,t,n){if(e.enabled){var i=e._ctx?e._ctx.add(function(){return t(e,n)}):t(e,n);i&&i.totalTime&&(e.callbackAnimation=i)}},_s=Math.abs,Yp="left",qp="top",df="right",hf="bottom",ts="width",ns="height",Ua="Right",Fa="Left",Oa="Top",Ba="Bottom",Kt="padding",ui="margin",ta="Width",pf="Height",Qt="px",fi=function(e){return st.getComputedStyle(e.nodeType===Node.DOCUMENT_NODE?e.scrollingElement:e)},I0=function(e){var t=fi(e).position;e.style.position=t==="absolute"||t==="fixed"?t:"relative"},dd=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},Zi=function(e,t){var n=t&&fi(e)[Xc]!=="matrix(1, 0, 0, 1, 0, 0)"&&Re.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=e.getBoundingClientRect?e.getBoundingClientRect():e.scrollingElement.getBoundingClientRect();return n&&n.progress(0).kill(),i},gl=function(e,t){var n=t.d2;return e["offset"+n]||e["client"+n]||0},$p=function(e){var t=[],n=e.labels,i=e.duration(),s;for(s in n)t.push(n[s]/i);return t},U0=function(e){return function(t){return Re.utils.snap($p(e),t)}},mf=function(e){var t=Re.utils.snap(e),n=Array.isArray(e)&&e.slice(0).sort(function(i,s){return i-s});return n?function(i,s,a){a===void 0&&(a=.001);var o;if(!s)return t(i);if(s>0){for(i-=a,o=0;o<n.length;o++)if(n[o]>=i)return n[o];return n[o-1]}else for(o=n.length,i+=a;o--;)if(n[o]<=i)return n[o];return n[0]}:function(i,s,a){a===void 0&&(a=.001);var o=t(i);return!s||Math.abs(o-i)<a||o-i<0==s<0?o:t(s<0?i-e:i+e)}},F0=function(e){return function(t,n){return mf($p(e))(t,n.direction)}},fo=function(e,t,n,i){return n.split(",").forEach(function(s){return e(t,s,i)})},cn=function(e,t,n,i,s){return e.addEventListener(t,n,{passive:!i,capture:!!s})},on=function(e,t,n,i){return e.removeEventListener(t,n,!!i)},ho=function(e,t,n){n=n&&n.wheelHandler,n&&(e(t,"wheel",n),e(t,"touchmove",n))},hd={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},po={toggleActions:"play",anticipatePin:0},_l={top:0,left:0,center:.5,bottom:1,right:1},Ko=function(e,t){if(Zn(e)){var n=e.indexOf("="),i=~n?+(e.charAt(n-1)+1)*parseFloat(e.substr(n+1)):0;~n&&(e.indexOf("%")>n&&(i*=t/100),e=e.substr(0,n-1)),e=i+(e in _l?_l[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},mo=function(e,t,n,i,s,a,o,l){var c=s.startColor,u=s.endColor,h=s.fontSize,f=s.indent,d=s.fontWeight,g=xt.createElement("div"),_=rs(n)||Ar(n,"pinType")==="fixed",p=e.indexOf("scroller")!==-1,m=_?_t:n.tagName==="IFRAME"?n.contentDocument.body:n,b=e.indexOf("start")!==-1,y=b?c:u,M="border-color:"+y+";font-size:"+h+";color:"+y+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return M+="position:"+((p||l)&&_?"fixed;":"absolute;"),(p||l||!_)&&(M+=(i===en?df:hf)+":"+(a+parseFloat(f))+"px;"),o&&(M+="box-sizing:border-box;text-align:left;width:"+o.offsetWidth+"px;"),g._isStart=b,g.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),g.style.cssText=M,g.innerText=t||t===0?e+"-"+t:e,m.children[0]?m.insertBefore(g,m.children[0]):m.appendChild(g),g._offset=g["offset"+i.op.d2],jo(g,0,i,b),g},jo=function(e,t,n,i){var s={display:"block"},a=n[i?"os2":"p2"],o=n[i?"p2":"os2"];e._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+a+ta]=1,s["border"+o+ta]=0,s[n.p]=t+"px",Re.set(e,s)},it=[],Zc={},ja,pd=function(){return vn()-gi>34&&(ja||(ja=requestAnimationFrame(Qi)))},xs=function(){(!Dn||!Dn.isPressed||Dn.startX>_t.clientWidth)&&(at.cache++,Dn?ja||(ja=requestAnimationFrame(Qi)):Qi(),gi||as("scrollStart"),gi=vn())},Yl=function(){Gp=st.innerWidth,zp=st.innerHeight},Ea=function(e){at.cache++,(e===!0||!xn&&!kp&&!xt.fullscreenElement&&!xt.webkitFullscreenElement&&(!Yc||Gp!==st.innerWidth||Math.abs(st.innerHeight-zp)>st.innerHeight*.25))&&ml.restart(!0)},ss={},O0=[],Zp=function r(){return on(ot,"scrollEnd",r)||$r(!0)},as=function(e){return ss[e]&&ss[e].map(function(t){return t()})||O0},$n=[],Kp=function(e){for(var t=0;t<$n.length;t+=5)(!e||$n[t+4]&&$n[t+4].query===e)&&($n[t].style.cssText=$n[t+1],$n[t].getBBox&&$n[t].setAttribute("transform",$n[t+2]||""),$n[t+3].uncache=1)},jp=function(){return at.forEach(function(e){return bn(e)&&++e.cacheID&&(e.rec=e())})},gf=function(e,t){var n;for(Ln=0;Ln<it.length;Ln++)n=it[Ln],n&&(!t||n._ctx===t)&&(e?n.kill(1):n.revert(!0,!0));Ia=!0,t&&Kp(t),t||as("revert")},Jp=function(e,t){at.cache++,(t||!Nn)&&at.forEach(function(n){return bn(n)&&n.cacheID++&&(n.rec=0)}),Zn(e)&&(st.history.scrollRestoration=uf=e)},Nn,is=0,md,B0=function(){if(md!==is){var e=md=is;requestAnimationFrame(function(){return e===is&&$r(!0)})}},Qp=function(){_t.appendChild(Xs),ff=!Dn&&Xs.offsetHeight||st.innerHeight,_t.removeChild(Xs)},gd=function(e){return Ka(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(t){return t.style.display=e?"none":"block"})},$r=function(e,t){if(jn=xt.documentElement,_t=xt.body,cf=[st,xt,jn,_t],gi&&!e&&!Ia){cn(ot,"scrollEnd",Zp);return}Qp(),Nn=ot.isRefreshing=!0,Ia||jp();var n=as("refreshInit");Bp&&ot.sort(),t||gf(),at.forEach(function(i){bn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),it.slice(0).forEach(function(i){return i.refresh()}),Ia=!1,it.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",a=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-a),i.refresh()}}),$c=1,gd(!0),it.forEach(function(i){var s=Ii(i.scroller,i._dir),a=i.vars.end==="max"||i._endClamp&&i.end>s,o=i._startClamp&&i.start>=s;(a||o)&&i.setPositions(o?s-1:i.start,a?Math.max(o?s:i.start+1,s):i.end,!0)}),gd(!1),$c=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),at.forEach(function(i){bn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Jp(uf,1),ml.pause(),is++,Nn=2,Qi(2),it.forEach(function(i){return bn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),Nn=ot.isRefreshing=!1,as("refresh")},Kc=0,Jo=1,ka,Qi=function(e){if(e===2||!Nn&&!Ia){ot.isUpdating=!0,ka&&ka.update(0);var t=it.length,n=vn(),i=n-Xl>=50,s=t&&it[0].scroll();if(Jo=Kc>s?-1:1,Nn||(Kc=s),i&&(gi&&!Rl&&n-gi>200&&(gi=0,as("scrollEnd")),Ma=Xl,Xl=n),Jo<0){for(Ln=t;Ln-- >0;)it[Ln]&&it[Ln].update(0,i);Jo=1}else for(Ln=0;Ln<t;Ln++)it[Ln]&&it[Ln].update(0,i);ot.isUpdating=!1}ja=0},jc=[Yp,qp,hf,df,ui+Ba,ui+Ua,ui+Oa,ui+Fa,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Qo=jc.concat([ts,ns,"boxSizing","max"+ta,"max"+pf,"position",ui,Kt,Kt+Oa,Kt+Ua,Kt+Ba,Kt+Fa]),k0=function(e,t,n){Ys(n);var i=e._gsap;if(i.spacerIsNative)Ys(i.spacerState);else if(e._gsap.swappedIn){var s=t.parentNode;s&&(s.insertBefore(e,t),s.removeChild(t))}e._gsap.swappedIn=!1},ql=function(e,t,n,i){if(!e._gsap.swappedIn){for(var s=jc.length,a=t.style,o=e.style,l;s--;)l=jc[s],a[l]=n[l];a.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(a.display="inline-block"),o[hf]=o[df]="auto",a.flexBasis=n.flexBasis||"auto",a.overflow="visible",a.boxSizing="border-box",a[ts]=gl(e,In)+Qt,a[ns]=gl(e,en)+Qt,a[Kt]=o[ui]=o[qp]=o[Yp]="0",Ys(i),o[ts]=o["max"+ta]=n[ts],o[ns]=o["max"+pf]=n[ns],o[Kt]=n[Kt],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},z0=/([A-Z])/g,Ys=function(e){if(e){var t=e.t.style,n=e.length,i=0,s,a;for((e.t._gsap||Re.core.getCache(e.t)).uncache=1;i<n;i+=2)a=e[i+1],s=e[i],a?t[s]=a:t[s]&&t.removeProperty(s.replace(z0,"-$1").toLowerCase())}},go=function(e){for(var t=Qo.length,n=e.style,i=[],s=0;s<t;s++)i.push(Qo[s],n[Qo[s]]);return i.t=e,i},G0=function(e,t,n){for(var i=[],s=e.length,a=n?8:0,o;a<s;a+=2)o=e[a],i.push(o,o in t?t[o]:e[a+1]);return i.t=e.t,i},el={left:0,top:0},_d=function(e,t,n,i,s,a,o,l,c,u,h,f,d,g){bn(e)&&(e=e(l)),Zn(e)&&e.substr(0,3)==="max"&&(e=f+(e.charAt(4)==="="?Ko("0"+e.substr(3),n):0));var _=d?d.time():0,p,m,b;if(d&&d.seek(0),isNaN(e)||(e=+e),ya(e))d&&(e=Re.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,f,e)),o&&jo(o,n,i,!0);else{bn(t)&&(t=t(l));var y=(e||"0").split(" "),M,E,T,A;b=Fn(t,l)||_t,M=Zi(b)||{},(!M||!M.left&&!M.top)&&fi(b).display==="none"&&(A=b.style.display,b.style.display="block",M=Zi(b),A?b.style.display=A:b.style.removeProperty("display")),E=Ko(y[0],M[i.d]),T=Ko(y[1]||"0",n),e=M[i.p]-c[i.p]-u+E+s-T,o&&jo(o,T,i,n-T<20||o._isStart&&T>20),n-=n-T}if(g&&(l[g]=e||-.001,e<0&&(e=0)),a){var v=e+n,w=a._isStart;p="scroll"+i.d2,jo(a,v,i,w&&v>20||!w&&(h?Math.max(_t[p],jn[p]):a.parentNode[p])<=v+1),h&&(c=Zi(o),h&&(a.style[i.op.p]=c[i.op.p]-i.op.m-a._offset+Qt))}return d&&b&&(p=Zi(b),d.seek(f),m=Zi(b),d._caScrollDist=p[i.p]-m[i.p],e=e/d._caScrollDist*f),d&&d.seek(_),d?e:Math.round(e)},V0=/(webkit|moz|length|cssText|inset)/i,xd=function(e,t,n,i){if(e.parentNode!==t){var s=e.style,a,o;if(t===_t){e._stOrig=s.cssText,o=fi(e);for(a in o)!+a&&!V0.test(a)&&o[a]&&typeof s[a]=="string"&&a!=="0"&&(s[a]=o[a]);s.top=n,s.left=i}else s.cssText=e._stOrig;Re.core.getCache(e).uncache=1,t.appendChild(e)}},em=function(e,t,n){var i=t,s=i;return function(a){var o=Math.round(e());return o!==i&&o!==s&&Math.abs(o-i)>3&&Math.abs(o-s)>3&&(a=o,n&&n()),s=i,i=Math.round(a),i}},_o=function(e,t,n){var i={};i[t.p]="+="+n,Re.set(e,i)},vd=function(e,t){var n=Dr(e,t),i="_scroll"+t.p2,s=function a(o,l,c,u,h){var f=a.tween,d=l.onComplete,g={};c=c||n();var _=em(n,c,function(){f.kill(),a.tween=0});return h=u&&h||0,u=u||o-c,f&&f.kill(),l[i]=o,l.inherit=!1,l.modifiers=g,g[i]=function(){return _(c+u*f.ratio+h*f.ratio*f.ratio)},l.onUpdate=function(){at.cache++,a.tween&&Qi()},l.onComplete=function(){a.tween=0,d&&d.call(f)},f=a.tween=Re.to(e,l),f};return e[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},cn(e,"wheel",n.wheelHandler),ot.isTouch&&cn(e,"touchmove",n.wheelHandler),s},ot=(function(){function r(t,n){Is||r.register(Re)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),qc(this),this.init(t,n)}var e=r.prototype;return e.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!Sa){this.update=this.refresh=this.kill=Pi;return}n=dd(Zn(n)||ya(n)||n.nodeType?{trigger:n}:n,po);var s=n,a=s.onUpdate,o=s.toggleClass,l=s.id,c=s.onToggle,u=s.onRefresh,h=s.scrub,f=s.trigger,d=s.pin,g=s.pinSpacing,_=s.invalidateOnRefresh,p=s.anticipatePin,m=s.onScrubComplete,b=s.onSnapComplete,y=s.once,M=s.snap,E=s.pinReparent,T=s.pinSpacer,A=s.containerAnimation,v=s.fastScrollEnd,w=s.preventOverlaps,C=n.horizontal||n.containerAnimation&&n.horizontal!==!1?In:en,L=!h&&h!==0,N=Fn(n.scroller||st),Y=Re.core.getCache(N),H=rs(N),O=("pinType"in n?n.pinType:Ar(N,"pinType")||H&&"fixed")==="fixed",z=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],I=L&&n.toggleActions.split(" "),q="markers"in n?n.markers:po.markers,j=H?0:parseFloat(fi(N)["border"+C.p2+ta])||0,D=this,se=n.onRefreshInit&&function(){return n.onRefreshInit(D)},pe=L0(N,H,C),Ve=N0(N,H),He=0,Le=0,Q=0,oe=Dr(N,C),ne,Ee,Oe,Te,tt,Me,ze,qe,Ye,$,lt,We,Qe,Ge,Ze,F,Ct,Xe,R,x,k,V,K,ce,ae,J,ee,he,Ae,ge,me,fe,Pe,Ie,U,de,te,_e,xe;if(D._startClamp=D._endClamp=!1,D._dir=C,p*=45,D.scroller=N,D.scroll=A?A.time.bind(A):oe,Te=oe(),D.vars=n,i=i||n.animation,"refreshPriority"in n&&(Bp=1,n.refreshPriority===-9999&&(ka=D)),Y.tweenScroll=Y.tweenScroll||{top:vd(N,en),left:vd(N,In)},D.tweenTo=ne=Y.tweenScroll[C.p],D.scrubDuration=function(ue){Pe=ya(ue)&&ue,Pe?fe?fe.duration(ue):fe=Re.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:Pe,paused:!0,onComplete:function(){return m&&m(D)}}):(fe&&fe.progress(1).kill(),fe=0)},i&&(i.vars.lazy=!1,i._initted&&!D.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),D.animation=i.pause(),i.scrollTrigger=D,D.scrubDuration(h),ge=0,l||(l=i.vars.id)),M&&((!Hr(M)||M.push)&&(M={snapTo:M}),"scrollBehavior"in _t.style&&Re.set(H?[_t,jn]:N,{scrollBehavior:"auto"}),at.forEach(function(ue){return bn(ue)&&ue.target===(H?xt.scrollingElement||jn:N)&&(ue.smooth=!1)}),Oe=bn(M.snapTo)?M.snapTo:M.snapTo==="labels"?U0(i):M.snapTo==="labelsDirectional"?F0(i):M.directional!==!1?function(ue,ke){return mf(M.snapTo)(ue,vn()-Le<500?0:ke.direction)}:Re.utils.snap(M.snapTo),Ie=M.duration||{min:.1,max:2},Ie=Hr(Ie)?Na(Ie.min,Ie.max):Na(Ie,Ie),U=Re.delayedCall(M.delay||Pe/2||.1,function(){var ue=oe(),ke=vn()-Le<500,Ce=ne.tween;if((ke||Math.abs(D.getVelocity())<10)&&!Ce&&!Rl&&He!==ue){var Ke=(ue-Me)/Ge,qt=i&&!L?i.totalProgress():Ke,rt=ke?0:(qt-me)/(vn()-Ma)*1e3||0,Pt=Re.utils.clamp(-Ke,1-Ke,_s(rt/2)*rt/.185),rn=Ke+(M.inertia===!1?0:Pt),Dt,St,ut=M,Tn=ut.onStart,wt=ut.onInterrupt,pn=ut.onComplete;if(Dt=Oe(rn,D),ya(Dt)||(Dt=rn),St=Math.max(0,Math.round(Me+Dt*Ge)),ue<=ze&&ue>=Me&&St!==ue){if(Ce&&!Ce._initted&&Ce.data<=_s(St-ue))return;M.inertia===!1&&(Pt=Dt-Ke),ne(St,{duration:Ie(_s(Math.max(_s(rn-qt),_s(Dt-qt))*.185/rt/.05||0)),ease:M.ease||"power3",data:_s(St-ue),onInterrupt:function(){return U.restart(!0)&&wt&&gs(D,wt)},onComplete:function(){D.update(),He=oe(),i&&!L&&(fe?fe.resetTo("totalProgress",Dt,i._tTime/i._tDur):i.progress(Dt)),ge=me=i&&!L?i.totalProgress():D.progress,b&&b(D),pn&&gs(D,pn)}},ue,Pt*Ge,St-ue-Pt*Ge),Tn&&gs(D,Tn,ne.tween)}}else D.isActive&&He!==ue&&U.restart(!0)}).pause()),l&&(Zc[l]=D),f=D.trigger=Fn(f||d!==!0&&d),xe=f&&f._gsap&&f._gsap.stRevert,xe&&(xe=xe(D)),d=d===!0?f:Fn(d),Zn(o)&&(o={targets:f,className:o}),d&&(g===!1||g===ui||(g=!g&&d.parentNode&&d.parentNode.style&&fi(d.parentNode).display==="flex"?!1:Kt),D.pin=d,Ee=Re.core.getCache(d),Ee.spacer?Ze=Ee.pinState:(T&&(T=Fn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),Ee.spacerIsNative=!!T,T&&(Ee.spacerState=go(T))),Ee.spacer=Xe=T||xt.createElement("div"),Xe.classList.add("pin-spacer"),l&&Xe.classList.add("pin-spacer-"+l),Ee.pinState=Ze=go(d)),n.force3D!==!1&&Re.set(d,{force3D:!0}),D.spacer=Xe=Ee.spacer,Ae=fi(d),ce=Ae[g+C.os2],x=Re.getProperty(d),k=Re.quickSetter(d,C.a,Qt),ql(d,Xe,Ae),Ct=go(d)),q){We=Hr(q)?dd(q,hd):hd,$=mo("scroller-start",l,N,C,We,0),lt=mo("scroller-end",l,N,C,We,0,$),R=$["offset"+C.op.d2];var ie=Fn(Ar(N,"content")||N);qe=this.markerStart=mo("start",l,ie,C,We,R,0,A),Ye=this.markerEnd=mo("end",l,ie,C,We,R,0,A),A&&(_e=Re.quickSetter([qe,Ye],C.a,Qt)),!O&&!(Oi.length&&Ar(N,"fixedMarkers")===!0)&&(I0(H?_t:N),Re.set([$,lt],{force3D:!0}),J=Re.quickSetter($,C.a,Qt),he=Re.quickSetter(lt,C.a,Qt))}if(A){var le=A.vars.onUpdate,re=A.vars.onUpdateParams;A.eventCallback("onUpdate",function(){D.update(0,0,1),le&&le.apply(A,re||[])})}if(D.previous=function(){return it[it.indexOf(D)-1]},D.next=function(){return it[it.indexOf(D)+1]},D.revert=function(ue,ke){if(!ke)return D.kill(!0);var Ce=ue!==!1||!D.enabled,Ke=xn;Ce!==D.isReverted&&(Ce&&(de=Math.max(oe(),D.scroll.rec||0),Q=D.progress,te=i&&i.progress()),qe&&[qe,Ye,$,lt].forEach(function(qt){return qt.style.display=Ce?"none":"block"}),Ce&&(xn=D,D.update(Ce)),d&&(!E||!D.isActive)&&(Ce?k0(d,Xe,Ze):ql(d,Xe,fi(d),ae)),Ce||D.update(Ce),xn=Ke,D.isReverted=Ce)},D.refresh=function(ue,ke,Ce,Ke){if(!((xn||!D.enabled)&&!ke)){if(d&&ue&&gi){cn(r,"scrollEnd",Zp);return}!Nn&&se&&se(D),xn=D,ne.tween&&!Ce&&(ne.tween.kill(),ne.tween=0),fe&&fe.pause(),_&&i&&(i.revert({kill:!1}).invalidate(),i.getChildren?i.getChildren(!0,!0,!1).forEach(function(Se){return Se.vars.immediateRender&&Se.render(0,!0,!0)}):i.vars.immediateRender&&i.render(0,!0,!0)),D.isReverted||D.revert(!0,!0),D._subPinOffset=!1;var qt=pe(),rt=Ve(),Pt=A?A.duration():Ii(N,C),rn=Ge<=.01||!Ge,Dt=0,St=Ke||0,ut=Hr(Ce)?Ce.end:n.end,Tn=n.endTrigger||f,wt=Hr(Ce)?Ce.start:n.start||(n.start===0||!f?0:d?"0 0":"0 100%"),pn=D.pinnedContainer=n.pinnedContainer&&Fn(n.pinnedContainer,D),wn=f&&Math.max(0,it.indexOf(D))||0,$t=wn,Ot,Jt,Ti,ds,sn,Gt,si,S,B,Z,G,W,ve;for(q&&Hr(Ce)&&(W=Re.getProperty($,C.p),ve=Re.getProperty(lt,C.p));$t-- >0;)Gt=it[$t],Gt.end||Gt.refresh(0,1)||(xn=D),si=Gt.pin,si&&(si===f||si===d||si===pn)&&!Gt.isReverted&&(Z||(Z=[]),Z.unshift(Gt),Gt.revert(!0,!0)),Gt!==it[$t]&&(wn--,$t--);for(bn(wt)&&(wt=wt(D)),wt=ld(wt,"start",D),Me=_d(wt,f,qt,C,oe(),qe,$,D,rt,j,O,Pt,A,D._startClamp&&"_startClamp")||(d?-.001:0),bn(ut)&&(ut=ut(D)),Zn(ut)&&!ut.indexOf("+=")&&(~ut.indexOf(" ")?ut=(Zn(wt)?wt.split(" ")[0]:"")+ut:(Dt=Ko(ut.substr(2),qt),ut=Zn(wt)?wt:(A?Re.utils.mapRange(0,A.duration(),A.scrollTrigger.start,A.scrollTrigger.end,Me):Me)+Dt,Tn=f)),ut=ld(ut,"end",D),ze=Math.max(Me,_d(ut||(Tn?"100% 0":Pt),Tn,qt,C,oe()+Dt,Ye,lt,D,rt,j,O,Pt,A,D._endClamp&&"_endClamp"))||-.001,Dt=0,$t=wn;$t--;)Gt=it[$t]||{},si=Gt.pin,si&&Gt.start-Gt._pinPush<=Me&&!A&&Gt.end>0&&(Ot=Gt.end-(D._startClamp?Math.max(0,Gt.start):Gt.start),(si===f&&Gt.start-Gt._pinPush<Me||si===pn)&&isNaN(wt)&&(Dt+=Ot*(1-Gt.progress)),si===d&&(St+=Ot));if(Me+=Dt,ze+=Dt,D._startClamp&&(D._startClamp+=Dt),D._endClamp&&!Nn&&(D._endClamp=ze||-.001,ze=Math.min(ze,Ii(N,C))),Ge=ze-Me||(Me-=.01)&&.001,rn&&(Q=Re.utils.clamp(0,1,Re.utils.normalize(Me,ze,de))),D._pinPush=St,qe&&Dt&&(Ot={},Ot[C.a]="+="+Dt,pn&&(Ot[C.p]="-="+oe()),Re.set([qe,Ye],Ot)),d&&!($c&&D.end>=Ii(N,C)))Ot=fi(d),ds=C===en,Ti=oe(),V=parseFloat(x(C.a))+St,!Pt&&ze>1&&(G=(H?xt.scrollingElement||jn:N).style,G={style:G,value:G["overflow"+C.a.toUpperCase()]},H&&fi(_t)["overflow"+C.a.toUpperCase()]!=="scroll"&&(G.style["overflow"+C.a.toUpperCase()]="scroll")),ql(d,Xe,Ot),Ct=go(d),Jt=Zi(d,!0),S=O&&Dr(N,ds?In:en)(),g?(ae=[g+C.os2,Ge+St+Qt],ae.t=Xe,$t=g===Kt?gl(d,C)+Ge+St:0,$t&&(ae.push(C.d,$t+Qt),Xe.style.flexBasis!=="auto"&&(Xe.style.flexBasis=$t+Qt)),Ys(ae),pn&&it.forEach(function(Se){Se.pin===pn&&Se.vars.pinSpacing!==!1&&(Se._subPinOffset=!0)}),O&&oe(de)):($t=gl(d,C),$t&&Xe.style.flexBasis!=="auto"&&(Xe.style.flexBasis=$t+Qt)),O&&(sn={top:Jt.top+(ds?Ti-Me:S)+Qt,left:Jt.left+(ds?S:Ti-Me)+Qt,boxSizing:"border-box",position:"fixed"},sn[ts]=sn["max"+ta]=Math.ceil(Jt.width)+Qt,sn[ns]=sn["max"+pf]=Math.ceil(Jt.height)+Qt,sn[ui]=sn[ui+Oa]=sn[ui+Ua]=sn[ui+Ba]=sn[ui+Fa]="0",sn[Kt]=Ot[Kt],sn[Kt+Oa]=Ot[Kt+Oa],sn[Kt+Ua]=Ot[Kt+Ua],sn[Kt+Ba]=Ot[Kt+Ba],sn[Kt+Fa]=Ot[Kt+Fa],F=G0(Ze,sn,E),Nn&&oe(0)),i?(B=i._initted,Hl(1),i.render(i.duration(),!0,!0),K=x(C.a)-V+Ge+St,ee=Math.abs(Ge-K)>1,O&&ee&&F.splice(F.length-2,2),i.render(0,!0,!0),B||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),Hl(0)):K=Ge,G&&(G.value?G.style["overflow"+C.a.toUpperCase()]=G.value:G.style.removeProperty("overflow-"+C.a));else if(f&&oe()&&!A)for(Jt=f.parentNode;Jt&&Jt!==_t;)Jt._pinOffset&&(Me-=Jt._pinOffset,ze-=Jt._pinOffset),Jt=Jt.parentNode;Z&&Z.forEach(function(Se){return Se.revert(!1,!0)}),D.start=Me,D.end=ze,Te=tt=Nn?de:oe(),!A&&!Nn&&(Te<de&&oe(de),D.scroll.rec=0),D.revert(!1,!0),Le=vn(),U&&(He=-1,U.restart(!0)),xn=0,i&&L&&(i._initted||te)&&i.progress()!==te&&i.progress(te||0,!0).render(i.time(),!0,!0),(rn||Q!==D.progress||A||_||i&&!i._initted)&&(i&&!L&&(i._initted||Q||i.vars.immediateRender!==!1)&&i.totalProgress(A&&Me<-.001&&!Q?Re.utils.normalize(Me,ze,0):Q,!0),D.progress=rn||(Te-Me)/Ge===Q?0:Q),d&&g&&(Xe._pinOffset=Math.round(D.progress*K)),fe&&fe.invalidate(),isNaN(W)||(W-=Re.getProperty($,C.p),ve-=Re.getProperty(lt,C.p),_o($,C,W),_o(qe,C,W-(Ke||0)),_o(lt,C,ve),_o(Ye,C,ve-(Ke||0))),rn&&!Nn&&D.update(),u&&!Nn&&!Qe&&(Qe=!0,u(D),Qe=!1)}},D.getVelocity=function(){return(oe()-tt)/(vn()-Ma)*1e3||0},D.endAnimation=function(){fa(D.callbackAnimation),i&&(fe?fe.progress(1):i.paused()?L||fa(i,D.direction<0,1):fa(i,i.reversed()))},D.labelToScroll=function(ue){return i&&i.labels&&(Me||D.refresh()||Me)+i.labels[ue]/i.duration()*Ge||0},D.getTrailing=function(ue){var ke=it.indexOf(D),Ce=D.direction>0?it.slice(0,ke).reverse():it.slice(ke+1);return(Zn(ue)?Ce.filter(function(Ke){return Ke.vars.preventOverlaps===ue}):Ce).filter(function(Ke){return D.direction>0?Ke.end<=Me:Ke.start>=ze})},D.update=function(ue,ke,Ce){if(!(A&&!Ce&&!ue)){var Ke=Nn===!0?de:D.scroll(),qt=ue?0:(Ke-Me)/Ge,rt=qt<0?0:qt>1?1:qt||0,Pt=D.progress,rn,Dt,St,ut,Tn,wt,pn,wn;if(ke&&(tt=Te,Te=A?oe():Ke,M&&(me=ge,ge=i&&!L?i.totalProgress():rt)),p&&d&&!xn&&!co&&gi&&(!rt&&Me<Ke+(Ke-tt)/(vn()-Ma)*p?rt=1e-4:rt===1&&ze>Ke+(Ke-tt)/(vn()-Ma)*p&&(rt=.9999)),rt!==Pt&&D.enabled){if(rn=D.isActive=!!rt&&rt<1,Dt=!!Pt&&Pt<1,wt=rn!==Dt,Tn=wt||!!rt!=!!Pt,D.direction=rt>Pt?1:-1,D.progress=rt,Tn&&!xn&&(St=rt&&!Pt?0:rt===1?1:Pt===1?2:3,L&&(ut=!wt&&I[St+1]!=="none"&&I[St+1]||I[St],wn=i&&(ut==="complete"||ut==="reset"||ut in i))),w&&(wt||wn)&&(wn||h||!i)&&(bn(w)?w(D):D.getTrailing(w).forEach(function(Ti){return Ti.endAnimation()})),L||(fe&&!xn&&!co?(fe._dp._time-fe._start!==fe._time&&fe.render(fe._dp._time-fe._start),fe.resetTo?fe.resetTo("totalProgress",rt,i._tTime/i._tDur):(fe.vars.totalProgress=rt,fe.invalidate().restart())):i&&i.totalProgress(rt,!!(xn&&(Le||ue)))),d){if(ue&&g&&(Xe.style[g+C.os2]=ce),!O)k(ba(V+K*rt));else if(Tn){if(pn=!ue&&rt>Pt&&ze+1>Ke&&Ke+1>=Ii(N,C),E)if(!ue&&(rn||pn)){var $t=Zi(d,!0),Ot=Ke-Me;xd(d,_t,$t.top+(C===en?Ot:0)+Qt,$t.left+(C===en?0:Ot)+Qt)}else xd(d,Xe);Ys(rn||pn?F:Ct),ee&&rt<1&&rn||k(V+(rt===1&&!pn?K:0))}}M&&!ne.tween&&!xn&&!co&&U.restart(!0),o&&(wt||y&&rt&&(rt<1||!Wl))&&Ka(o.targets).forEach(function(Ti){return Ti.classList[rn||y?"add":"remove"](o.className)}),a&&!L&&!ue&&a(D),Tn&&!xn?(L&&(wn&&(ut==="complete"?i.pause().totalProgress(1):ut==="reset"?i.restart(!0).pause():ut==="restart"?i.restart(!0):i[ut]()),a&&a(D)),(wt||!Wl)&&(c&&wt&&gs(D,c),z[St]&&gs(D,z[St]),y&&(rt===1?D.kill(!1,1):z[St]=0),wt||(St=rt===1?1:3,z[St]&&gs(D,z[St]))),v&&!rn&&Math.abs(D.getVelocity())>(ya(v)?v:2500)&&(fa(D.callbackAnimation),fe?fe.progress(1):fa(i,ut==="reverse"?1:!rt,1))):L&&a&&!xn&&a(D)}if(he){var Jt=A?Ke/A.duration()*(A._caScrollDist||0):Ke;J(Jt+($._isFlipped?1:0)),he(Jt)}_e&&_e(-Ke/A.duration()*(A._caScrollDist||0))}},D.enable=function(ue,ke){D.enabled||(D.enabled=!0,cn(N,"resize",Ea),H||cn(N,"scroll",xs),se&&cn(r,"refreshInit",se),ue!==!1&&(D.progress=Q=0,Te=tt=He=oe()),ke!==!1&&D.refresh())},D.getTween=function(ue){return ue&&ne?ne.tween:fe},D.setPositions=function(ue,ke,Ce,Ke){if(A){var qt=A.scrollTrigger,rt=A.duration(),Pt=qt.end-qt.start;ue=qt.start+Pt*ue/rt,ke=qt.start+Pt*ke/rt}D.refresh(!1,!1,{start:cd(ue,Ce&&!!D._startClamp),end:cd(ke,Ce&&!!D._endClamp)},Ke),D.update()},D.adjustPinSpacing=function(ue){if(ae&&ue){var ke=ae.indexOf(C.d)+1;ae[ke]=parseFloat(ae[ke])+ue+Qt,ae[1]=parseFloat(ae[1])+ue+Qt,Ys(ae)}},D.disable=function(ue,ke){if(ue!==!1&&D.revert(!0,!0),D.enabled&&(D.enabled=D.isActive=!1,ke||fe&&fe.pause(),de=0,Ee&&(Ee.uncache=1),se&&on(r,"refreshInit",se),U&&(U.pause(),ne.tween&&ne.tween.kill()&&(ne.tween=0)),!H)){for(var Ce=it.length;Ce--;)if(it[Ce].scroller===N&&it[Ce]!==D)return;on(N,"resize",Ea),H||on(N,"scroll",xs)}},D.kill=function(ue,ke){D.disable(ue,ke),fe&&!ke&&fe.kill(),l&&delete Zc[l];var Ce=it.indexOf(D);Ce>=0&&it.splice(Ce,1),Ce===Ln&&Jo>0&&Ln--,Ce=0,it.forEach(function(Ke){return Ke.scroller===D.scroller&&(Ce=1)}),Ce||Nn||(D.scroll.rec=0),i&&(i.scrollTrigger=null,ue&&i.revert({kill:!1}),ke||i.kill()),qe&&[qe,Ye,$,lt].forEach(function(Ke){return Ke.parentNode&&Ke.parentNode.removeChild(Ke)}),ka===D&&(ka=0),d&&(Ee&&(Ee.uncache=1),Ce=0,it.forEach(function(Ke){return Ke.pin===d&&Ce++}),Ce||(Ee.spacer=0)),n.onKill&&n.onKill(D)},it.push(D),D.enable(!1,!1),xe&&xe(D),i&&i.add&&!Ge){var Be=D.update;D.update=function(){D.update=Be,at.cache++,Me||ze||D.refresh()},Re.delayedCall(.01,D.update),Ge=.01,Me=ze=0}else D.refresh();d&&B0()},r.register=function(n){return Is||(Re=n||Hp(),Vp()&&window.document&&r.enable(),Is=Sa),Is},r.defaults=function(n){if(n)for(var i in n)po[i]=n[i];return po},r.disable=function(n,i){Sa=0,it.forEach(function(a){return a[i?"kill":"disable"](n)}),on(st,"wheel",xs),on(xt,"scroll",xs),clearInterval(lo),on(xt,"touchcancel",Pi),on(_t,"touchstart",Pi),fo(on,xt,"pointerdown,touchstart,mousedown",ud),fo(on,xt,"pointerup,touchend,mouseup",fd),ml.kill(),uo(on);for(var s=0;s<at.length;s+=3)ho(on,at[s],at[s+1]),ho(on,at[s],at[s+2])},r.enable=function(){if(st=window,xt=document,jn=xt.documentElement,_t=xt.body,Re){if(Ka=Re.utils.toArray,Na=Re.utils.clamp,qc=Re.core.context||Pi,Hl=Re.core.suppressOverwrites||Pi,uf=st.history.scrollRestoration||"auto",Kc=st.pageYOffset||0,Re.core.globals("ScrollTrigger",r),_t){Sa=1,Xs=document.createElement("div"),Xs.style.height="100vh",Xs.style.position="absolute",Qp(),D0(),Xt.register(Re),r.isTouch=Xt.isTouch,_r=Xt.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Yc=Xt.isTouch===1,cn(st,"wheel",xs),cf=[st,xt,jn,_t],Re.matchMedia?(r.matchMedia=function(u){var h=Re.matchMedia(),f;for(f in u)h.add(f,u[f]);return h},Re.addEventListener("matchMediaInit",function(){jp(),gf()}),Re.addEventListener("matchMediaRevert",function(){return Kp()}),Re.addEventListener("matchMedia",function(){$r(0,1),as("matchMedia")}),Re.matchMedia().add("(orientation: portrait)",function(){return Yl(),Yl})):console.warn("Requires GSAP 3.11.0 or later"),Yl(),cn(xt,"scroll",xs);var n=_t.hasAttribute("style"),i=_t.style,s=i.borderTopStyle,a=Re.core.Animation.prototype,o,l;for(a.revert||Object.defineProperty(a,"revert",{value:function(){return this.time(-.01,!0)}}),i.borderTopStyle="solid",o=Zi(_t),en.m=Math.round(o.top+en.sc())||0,In.m=Math.round(o.left+In.sc())||0,s?i.borderTopStyle=s:i.removeProperty("border-top-style"),n||(_t.setAttribute("style",""),_t.removeAttribute("style")),lo=setInterval(pd,250),Re.delayedCall(.5,function(){return co=0}),cn(xt,"touchcancel",Pi),cn(_t,"touchstart",Pi),fo(cn,xt,"pointerdown,touchstart,mousedown",ud),fo(cn,xt,"pointerup,touchend,mouseup",fd),Xc=Re.utils.checkPrefix("transform"),Qo.push(Xc),Is=vn(),ml=Re.delayedCall(.2,$r).pause(),Us=[xt,"visibilitychange",function(){var u=st.innerWidth,h=st.innerHeight;xt.hidden?(ad=u,od=h):(ad!==u||od!==h)&&Ea()},xt,"DOMContentLoaded",$r,st,"load",$r,st,"resize",Ea],uo(cn),it.forEach(function(u){return u.enable(0,1)}),l=0;l<at.length;l+=3)ho(on,at[l],at[l+1]),ho(on,at[l],at[l+2])}else if(xt){var c=function u(){r.enable(),xt.removeEventListener("DOMContentLoaded",u)};xt.addEventListener("DOMContentLoaded",c)}}},r.config=function(n){"limitCallbacks"in n&&(Wl=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(lo)||(lo=i)&&setInterval(pd,i),"ignoreMobileResize"in n&&(Yc=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(uo(on)||uo(cn,n.autoRefreshEvents||"none"),kp=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=Fn(n),a=at.indexOf(s),o=rs(s);~a&&at.splice(a,o?6:2),i&&(o?Oi.unshift(st,i,_t,i,jn,i):Oi.unshift(s,i))},r.clearMatchMedia=function(n){it.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var a=(Zn(n)?Fn(n):n).getBoundingClientRect(),o=a[s?ts:ns]*i||0;return s?a.right-o>0&&a.left+o<st.innerWidth:a.bottom-o>0&&a.top+o<st.innerHeight},r.positionInViewport=function(n,i,s){Zn(n)&&(n=Fn(n));var a=n.getBoundingClientRect(),o=a[s?ts:ns],l=i==null?o/2:i in _l?_l[i]*o:~i.indexOf("%")?parseFloat(i)*o/100:parseFloat(i)||0;return s?(a.left+l)/st.innerWidth:(a.top+l)/st.innerHeight},r.killAll=function(n){if(it.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=ss.killAll||[];ss={},i.forEach(function(s){return s()})}},r})();ot.version="3.15.0";ot.saveStyles=function(r){return r?Ka(r).forEach(function(e){if(e&&e.style){var t=$n.indexOf(e);t>=0&&$n.splice(t,5),$n.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),Re.core.getCache(e),qc())}}):$n};ot.revert=function(r,e){return gf(!r,e)};ot.create=function(r,e){return new ot(r,e)};ot.refresh=function(r){return r?Ea(!0):(Is||ot.register())&&$r(!0)};ot.update=function(r){return++at.cache&&Qi(r===!0?2:0)};ot.clearScrollMemory=Jp;ot.maxScroll=function(r,e){return Ii(r,e?In:en)};ot.getScrollFunc=function(r,e){return Dr(Fn(r),e?In:en)};ot.getById=function(r){return Zc[r]};ot.getAll=function(){return it.filter(function(r){return r.vars.id!=="ScrollSmoother"})};ot.isScrolling=function(){return!!gi};ot.snapDirectional=mf;ot.addEventListener=function(r,e){var t=ss[r]||(ss[r]=[]);~t.indexOf(e)||t.push(e)};ot.removeEventListener=function(r,e){var t=ss[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)};ot.batch=function(r,e){var t=[],n={},i=e.interval||.016,s=e.batchMax||1e9,a=function(c,u){var h=[],f=[],d=Re.delayedCall(i,function(){u(h,f),h=[],f=[]}).pause();return function(g){h.length||d.restart(!0),h.push(g.trigger),f.push(g),s<=h.length&&d.progress(1)}},o;for(o in e)n[o]=o.substr(0,2)==="on"&&bn(e[o])&&o!=="onRefreshInit"?a(o,e[o]):e[o];return bn(s)&&(s=s(),cn(ot,"refresh",function(){return s=e.batchMax()})),Ka(r).forEach(function(l){var c={};for(o in n)c[o]=n[o];c.trigger=l,t.push(ot.create(c))}),t};var Md=function(e,t,n,i){return t>i?e(i):t<0&&e(0),n>i?(i-t)/(n-t):n<0?t/(t-n):1},$l=function r(e,t){t===!0?e.style.removeProperty("touch-action"):e.style.touchAction=t===!0?"auto":t?"pan-"+t+(Xt.isTouch?" pinch-zoom":""):"none",e===jn&&r(_t,t)},xo={auto:1,scroll:1},H0=function(e){var t=e.event,n=e.target,i=e.axis,s=(t.changedTouches?t.changedTouches[0]:t).target,a=s._gsap||Re.core.getCache(s),o=vn(),l;if(!a._isScrollT||o-a._isScrollT>2e3){for(;s&&s!==_t&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(xo[(l=fi(s)).overflowY]||xo[l.overflowX]));)s=s.parentNode;a._isScroll=s&&s!==n&&!rs(s)&&(xo[(l=fi(s)).overflowY]||xo[l.overflowX]),a._isScrollT=o}(a._isScroll||i==="x")&&(t.stopPropagation(),t._gsapAllow=!0)},tm=function(e,t,n,i){return Xt.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:i=i&&H0,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&cn(xt,Xt.eventTypes[0],bd,!1,!0)},onDisable:function(){return on(xt,Xt.eventTypes[0],bd,!0)}})},W0=/(input|label|select|textarea)/i,Sd,bd=function(e){var t=W0.test(e.target.tagName);(t||Sd)&&(e._gsapAllow=!0,Sd=t)},X0=function(e){Hr(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t=e,n=t.normalizeScrollX,i=t.momentum,s=t.allowNestedScroll,a=t.onRelease,o,l,c=Fn(e.target)||jn,u=Re.core.globals().ScrollSmoother,h=u&&u.get(),f=_r&&(e.content&&Fn(e.content)||h&&e.content!==!1&&!h.smooth()&&h.content()),d=Dr(c,en),g=Dr(c,In),_=1,p=(Xt.isTouch&&st.visualViewport?st.visualViewport.scale*st.visualViewport.width:st.outerWidth)/st.innerWidth,m=0,b=bn(i)?function(){return i(o)}:function(){return i||2.8},y,M,E=tm(c,e.type,!0,s),T=function(){return M=!1},A=Pi,v=Pi,w=function(){l=Ii(c,en),v=Na(_r?1:0,l),n&&(A=Na(0,Ii(c,In))),y=is},C=function(){f._gsap.y=ba(parseFloat(f._gsap.y)+d.offset)+"px",f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(f._gsap.y)+", 0, 1)",d.offset=d.cacheID=0},L=function(){if(M){requestAnimationFrame(T);var q=ba(o.deltaY/2),j=v(d.v-q);if(f&&j!==d.v+d.offset){d.offset=j-d.v;var D=ba((parseFloat(f&&f._gsap.y)||0)-d.offset);f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+D+", 0, 1)",f._gsap.y=D+"px",d.cacheID=at.cache,Qi()}return!0}d.offset&&C(),M=!0},N,Y,H,O,z=function(){w(),N.isActive()&&N.vars.scrollY>l&&(d()>l?N.progress(1)&&d(l):N.resetTo("scrollY",l))};return f&&Re.set(f,{y:"+=0"}),e.ignoreCheck=function(I){return _r&&I.type==="touchmove"&&L()||_>1.05&&I.type!=="touchstart"||o.isGesturing||I.touches&&I.touches.length>1},e.onPress=function(){M=!1;var I=_;_=ba((st.visualViewport&&st.visualViewport.scale||1)/p),N.pause(),I!==_&&$l(c,_>1.01?!0:n?!1:"x"),Y=g(),H=d(),w(),y=is},e.onRelease=e.onGestureStart=function(I,q){if(d.offset&&C(),!q)O.restart(!0);else{at.cache++;var j=b(),D,se;n&&(D=g(),se=D+j*.05*-I.velocityX/.227,j*=Md(g,D,se,Ii(c,In)),N.vars.scrollX=A(se)),D=d(),se=D+j*.05*-I.velocityY/.227,j*=Md(d,D,se,Ii(c,en)),N.vars.scrollY=v(se),N.invalidate().duration(j).play(.01),(_r&&N.vars.scrollY>=l||D>=l-1)&&Re.to({},{onUpdate:z,duration:j})}a&&a(I)},e.onWheel=function(){N._ts&&N.pause(),vn()-m>1e3&&(y=0,m=vn())},e.onChange=function(I,q,j,D,se){if(is!==y&&w(),q&&n&&g(A(D[2]===q?Y+(I.startX-I.x):g()+q-D[1])),j){d.offset&&C();var pe=se[2]===j,Ve=pe?H+I.startY-I.y:d()+j-se[1],He=v(Ve);pe&&Ve!==He&&(H+=He-Ve),d(He)}(j||q)&&Qi()},e.onEnable=function(){$l(c,n?!1:"x"),ot.addEventListener("refresh",z),cn(st,"resize",z),d.smooth&&(d.target.style.scrollBehavior="auto",d.smooth=g.smooth=!1),E.enable()},e.onDisable=function(){$l(c,!0),on(st,"resize",z),ot.removeEventListener("refresh",z),E.kill()},e.lockAxis=e.lockAxis!==!1,o=new Xt(e),o.iOS=_r,_r&&!d()&&d(1),_r&&Re.ticker.add(Pi),O=o._dc,N=Re.to(o,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:em(d,d(),function(){return N.pause()})},onUpdate:Qi,onComplete:O.vars.onComplete}),o};ot.sort=function(r){if(bn(r))return it.sort(r);var e=st.pageYOffset||0;return ot.getAll().forEach(function(t){return t._sortY=t.trigger?e+t.trigger.getBoundingClientRect().top:t.start+st.innerHeight}),it.sort(r||function(t,n){return(t.vars.refreshPriority||0)*-1e6+(t.vars.containerAnimation?1e6:t._sortY)-((n.vars.containerAnimation?1e6:n._sortY)+(n.vars.refreshPriority||0)*-1e6)})};ot.observe=function(r){return new Xt(r)};ot.normalizeScroll=function(r){if(typeof r>"u")return Dn;if(r===!0&&Dn)return Dn.enable();if(r===!1){Dn&&Dn.kill(),Dn=r;return}var e=r instanceof Xt?r:X0(r);return Dn&&Dn.target===e.target&&Dn.kill(),rs(e.target)&&(Dn=e),e};ot.core={_getVelocityProp:Wc,_inputObserver:tm,_scrollers:at,_proxies:Oi,bridge:{ss:function(){gi||as("scrollStart"),gi=vn()},ref:function(){return xn}}};Hp()&&Re.registerPlugin(ot);Lt.registerPlugin(ot);const _f="185",Y0=0,yd=1,q0=2,tl=1,$0=2,Ta=3,Lr=0,Vn=1,Ki=2,er=0,qs=1,Jc=2,Ed=3,Td=4,Z0=5,Xr=100,K0=101,j0=102,J0=103,Q0=104,e_=200,t_=201,n_=202,i_=203,Qc=204,eu=205,r_=206,s_=207,a_=208,o_=209,l_=210,c_=211,u_=212,f_=213,d_=214,tu=0,nu=1,iu=2,na=3,ru=4,su=5,au=6,ou=7,nm=0,h_=1,p_=2,Bi=0,im=1,rm=2,sm=3,am=4,om=5,lm=6,cm=7,um=300,os=301,ia=302,Zl=303,Kl=304,Cl=306,lu=1e3,Ji=1001,cu=1002,dn=1003,m_=1004,vo=1005,yn=1006,jl=1007,Zr=1008,hi=1009,fm=1010,dm=1011,Ja=1012,xf=1013,Gi=1014,Ui=1015,sr=1016,vf=1017,Mf=1018,Qa=1020,hm=35902,pm=35899,mm=1021,gm=1022,bi=1023,ar=1026,Kr=1027,_m=1028,Sf=1029,ls=1030,bf=1031,yf=1033,nl=33776,il=33777,rl=33778,sl=33779,uu=35840,fu=35841,du=35842,hu=35843,pu=36196,mu=37492,gu=37496,_u=37488,xu=37489,xl=37490,vu=37491,Mu=37808,Su=37809,bu=37810,yu=37811,Eu=37812,Tu=37813,wu=37814,Au=37815,Ru=37816,Cu=37817,Pu=37818,Du=37819,Lu=37820,Nu=37821,Iu=36492,Uu=36494,Fu=36495,Ou=36283,Bu=36284,vl=36285,ku=36286,g_=3200,wd=0,__=1,xr="",ci="srgb",Ml="srgb-linear",Sl="linear",vt="srgb",vs=7680,Ad=519,x_=512,v_=513,M_=514,Ef=515,S_=516,b_=517,Tf=518,y_=519,Rd=35044,Cd="300 es",Fi=2e3,bl=2001;function E_(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function yl(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function T_(){const r=yl("canvas");return r.style.display="block",r}const Pd={};function Dd(...r){const e="THREE."+r.shift();console.log(e,...r)}function xm(r){const e=r[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=r[1];t&&t.isStackTrace?r[0]+=" "+t.getLocation():r[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return r}function $e(...r){r=xm(r);const e="THREE."+r.shift();{const t=r[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...r)}}function mt(...r){r=xm(r);const e="THREE."+r.shift();{const t=r[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...r)}}function $s(...r){const e=r.join(" ");e in Pd||(Pd[e]=!0,$e(...r))}function w_(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const A_={[tu]:nu,[iu]:au,[ru]:ou,[na]:su,[nu]:tu,[au]:iu,[ou]:ru,[su]:na};class fs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const gn=["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"];let Ld=1234567;const za=Math.PI/180,eo=180/Math.PI;function aa(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(gn[r&255]+gn[r>>8&255]+gn[r>>16&255]+gn[r>>24&255]+"-"+gn[e&255]+gn[e>>8&255]+"-"+gn[e>>16&15|64]+gn[e>>24&255]+"-"+gn[t&63|128]+gn[t>>8&255]+"-"+gn[t>>16&255]+gn[t>>24&255]+gn[n&255]+gn[n>>8&255]+gn[n>>16&255]+gn[n>>24&255]).toLowerCase()}function ct(r,e,t){return Math.max(e,Math.min(t,r))}function wf(r,e){return(r%e+e)%e}function R_(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function C_(r,e,t){return r!==e?(t-r)/(e-r):0}function Ga(r,e,t){return(1-t)*r+t*e}function P_(r,e,t,n){return Ga(r,e,1-Math.exp(-t*n))}function D_(r,e=1){return e-Math.abs(wf(r,e*2)-e)}function L_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function N_(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function I_(r,e){return r+Math.floor(Math.random()*(e-r+1))}function U_(r,e){return r+Math.random()*(e-r)}function F_(r){return r*(.5-Math.random())}function O_(r){r!==void 0&&(Ld=r);let e=Ld+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function B_(r){return r*za}function k_(r){return r*eo}function z_(r){return(r&r-1)===0&&r!==0}function G_(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function V_(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function H_(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),u=a((e+n)/2),h=s((e-n)/2),f=a((e-n)/2),d=s((n-e)/2),g=a((n-e)/2);switch(i){case"XYX":r.set(o*u,l*h,l*f,o*c);break;case"YZY":r.set(l*f,o*u,l*h,o*c);break;case"ZXZ":r.set(l*h,l*f,o*u,o*c);break;case"XZX":r.set(o*u,l*g,l*d,o*c);break;case"YXY":r.set(l*d,o*u,l*g,o*c);break;case"ZYZ":r.set(l*g,l*d,o*u,o*c);break;default:$e("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Fs(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Cn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const Fr={DEG2RAD:za,RAD2DEG:eo,generateUUID:aa,clamp:ct,euclideanModulo:wf,mapLinear:R_,inverseLerp:C_,lerp:Ga,damp:P_,pingpong:D_,smoothstep:L_,smootherstep:N_,randInt:I_,randFloat:U_,randFloatSpread:F_,seededRandom:O_,degToRad:B_,radToDeg:k_,isPowerOfTwo:z_,ceilPowerOfTwo:G_,floorPowerOfTwo:V_,setQuaternionFromProperEuler:H_,normalize:Cn,denormalize:Fs},Pf=class Pf{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=ct(this.x,e.x,t.x),this.y=ct(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ct(this.x,e,t),this.y=ct(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ct(n,e,t))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ct(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Pf.prototype.isVector2=!0;let gt=Pf;class oa{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,a,o){let l=n[i+0],c=n[i+1],u=n[i+2],h=n[i+3],f=s[a+0],d=s[a+1],g=s[a+2],_=s[a+3];if(h!==_||l!==f||c!==d||u!==g){let p=l*f+c*d+u*g+h*_;p<0&&(f=-f,d=-d,g=-g,_=-_,p=-p);let m=1-o;if(p<.9995){const b=Math.acos(p),y=Math.sin(b);m=Math.sin(m*b)/y,o=Math.sin(o*b)/y,l=l*m+f*o,c=c*m+d*o,u=u*m+g*o,h=h*m+_*o}else{l=l*m+f*o,c=c*m+d*o,u=u*m+g*o,h=h*m+_*o;const b=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=b,c*=b,u*=b,h*=b}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[a],f=s[a+1],d=s[a+2],g=s[a+3];return e[t]=o*g+u*h+l*d-c*f,e[t+1]=l*g+u*f+c*h-o*d,e[t+2]=c*g+u*d+o*f-l*h,e[t+3]=u*g-o*h-l*f-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(i/2),h=o(s/2),f=l(n/2),d=l(i/2),g=l(s/2);switch(a){case"XYZ":this._x=f*u*h+c*d*g,this._y=c*d*h-f*u*g,this._z=c*u*g+f*d*h,this._w=c*u*h-f*d*g;break;case"YXZ":this._x=f*u*h+c*d*g,this._y=c*d*h-f*u*g,this._z=c*u*g-f*d*h,this._w=c*u*h+f*d*g;break;case"ZXY":this._x=f*u*h-c*d*g,this._y=c*d*h+f*u*g,this._z=c*u*g+f*d*h,this._w=c*u*h-f*d*g;break;case"ZYX":this._x=f*u*h-c*d*g,this._y=c*d*h+f*u*g,this._z=c*u*g-f*d*h,this._w=c*u*h+f*d*g;break;case"YZX":this._x=f*u*h+c*d*g,this._y=c*d*h+f*u*g,this._z=c*u*g-f*d*h,this._w=c*u*h-f*d*g;break;case"XZY":this._x=f*u*h-c*d*g,this._y=c*d*h-f*u*g,this._z=c*u*g+f*d*h,this._w=c*u*h+f*d*g;break;default:$e("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=n+o+h;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(a-i)*d}else if(n>o&&n>h){const d=2*Math.sqrt(1+n-o-h);this._w=(u-l)/d,this._x=.25*d,this._y=(i+a)/d,this._z=(s+c)/d}else if(o>h){const d=2*Math.sqrt(1+o-n-h);this._w=(s-c)/d,this._x=(i+a)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+h-n-o);this._w=(a-i)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ct(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+a*o+i*c-s*l,this._y=i*u+a*l+s*o-n*c,this._z=s*u+a*c+n*l-i*o,this._w=a*u-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,i=-i,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+n*t,this._y=this._y*l+i*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+n*t,this._y=this._y*l+i*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Df=class Df{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Nd.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Nd.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),u=2*(o*t-s*i),h=2*(s*n-a*t);return this.x=t+l*c+a*h-o*u,this.y=n+l*u+o*c-s*h,this.z=i+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=ct(this.x,e.x,t.x),this.y=ct(this.y,e.y,t.y),this.z=ct(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ct(this.x,e,t),this.y=ct(this.y,e,t),this.z=ct(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ct(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Jl.copy(this).projectOnVector(e),this.sub(Jl)}reflect(e){return this.sub(Jl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ct(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Df.prototype.isVector3=!0;let X=Df;const Jl=new X,Nd=new oa,Lf=class Lf{constructor(e,t,n,i,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],h=n[7],f=n[2],d=n[5],g=n[8],_=i[0],p=i[3],m=i[6],b=i[1],y=i[4],M=i[7],E=i[2],T=i[5],A=i[8];return s[0]=a*_+o*b+l*E,s[3]=a*p+o*y+l*T,s[6]=a*m+o*M+l*A,s[1]=c*_+u*b+h*E,s[4]=c*p+u*y+h*T,s[7]=c*m+u*M+h*A,s[2]=f*_+d*b+g*E,s[5]=f*p+d*y+g*T,s[8]=f*m+d*M+g*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-n*s*u+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,f=o*l-u*s,d=c*s-a*l,g=t*h+n*f+i*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return e[0]=h*_,e[1]=(i*c-u*n)*_,e[2]=(o*n-i*a)*_,e[3]=f*_,e[4]=(u*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=d*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return $s("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Ql.makeScale(e,t)),this}rotate(e){return $s("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Ql.makeRotation(-e)),this}translate(e,t){return $s("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Ql.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Lf.prototype.isMatrix3=!0;let je=Lf;const Ql=new je,Id=new je().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ud=new je().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function W_(){const r={enabled:!0,workingColorSpace:Ml,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===vt&&(i.r=tr(i.r),i.g=tr(i.g),i.b=tr(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===vt&&(i.r=Zs(i.r),i.g=Zs(i.g),i.b=Zs(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===xr?Sl:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return $s("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return $s("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Ml]:{primaries:e,whitePoint:n,transfer:Sl,toXYZ:Id,fromXYZ:Ud,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:ci},outputColorSpaceConfig:{drawingBufferColorSpace:ci}},[ci]:{primaries:e,whitePoint:n,transfer:vt,toXYZ:Id,fromXYZ:Ud,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:ci}}}),r}const ft=W_();function tr(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Zs(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Ms;class X_{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Ms===void 0&&(Ms=yl("canvas")),Ms.width=e.width,Ms.height=e.height;const i=Ms.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Ms}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=yl("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=tr(s[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(tr(t[n]/255)*255):t[n]=tr(t[n]);return{data:t,width:e.width,height:e.height}}else return $e("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Y_=0;class Af{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Y_++}),this.uuid=aa(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(ec(i[a].image)):s.push(ec(i[a]))}else s=ec(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function ec(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?X_.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:($e("Texture: Unable to serialize Texture."),{})}let q_=0;const tc=new X;class Un extends fs{constructor(e=Un.DEFAULT_IMAGE,t=Un.DEFAULT_MAPPING,n=Ji,i=Ji,s=yn,a=Zr,o=bi,l=hi,c=Un.DEFAULT_ANISOTROPY,u=xr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:q_++}),this.uuid=aa(),this.name="",this.source=new Af(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new gt(0,0),this.repeat=new gt(1,1),this.center=new gt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(tc).x}get height(){return this.source.getSize(tc).y}get depth(){return this.source.getSize(tc).z}get image(){return this.source.data}set image(e){this.source.data=e}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(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){$e(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){$e(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==um)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case lu:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case cu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case lu:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case cu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Un.DEFAULT_IMAGE=null;Un.DEFAULT_MAPPING=um;Un.DEFAULT_ANISOTROPY=1;const Nf=class Nf{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],d=l[5],g=l[9],_=l[2],p=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-_)<.01&&Math.abs(g-p)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+_)<.1&&Math.abs(g+p)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(c+1)/2,M=(d+1)/2,E=(m+1)/2,T=(u+f)/4,A=(h+_)/4,v=(g+p)/4;return y>M&&y>E?y<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(y),i=T/n,s=A/n):M>E?M<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),n=T/i,s=v/i):E<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(E),n=A/s,i=v/s),this.set(n,i,s,t),this}let b=Math.sqrt((p-g)*(p-g)+(h-_)*(h-_)+(f-u)*(f-u));return Math.abs(b)<.001&&(b=1),this.x=(p-g)/b,this.y=(h-_)/b,this.z=(f-u)/b,this.w=Math.acos((c+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=ct(this.x,e.x,t.x),this.y=ct(this.y,e.y,t.y),this.z=ct(this.z,e.z,t.z),this.w=ct(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ct(this.x,e,t),this.y=ct(this.y,e,t),this.z=ct(this.z,e,t),this.w=ct(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ct(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}};Nf.prototype.isVector4=!0;let kt=Nf;class $_ extends fs{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:yn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new kt(0,0,e,t),this.scissorTest=!1,this.viewport=new kt(0,0,e,t),this.textures=[];const i={width:e,height:t,depth:n.depth},s=new Un(i),a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:yn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Af(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ki extends $_{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class vm extends Un{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dn,this.minFilter=dn,this.wrapR=Ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Z_ extends Un{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dn,this.minFilter=dn,this.wrapR=Ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const El=class El{constructor(e,t,n,i,s,a,o,l,c,u,h,f,d,g,_,p){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c,u,h,f,d,g,_,p)}set(e,t,n,i,s,a,o,l,c,u,h,f,d,g,_,p){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=i,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=d,m[7]=g,m[11]=_,m[15]=p,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 El().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();const t=this.elements,n=e.elements,i=1/Ss.setFromMatrixColumn(e,0).length(),s=1/Ss.setFromMatrixColumn(e,1).length(),a=1/Ss.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*u,d=a*h,g=o*u,_=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=d+g*c,t[5]=f-_*c,t[9]=-o*l,t[2]=_-f*c,t[6]=g+d*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,d=l*h,g=c*u,_=c*h;t[0]=f+_*o,t[4]=g*o-d,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=d*o-g,t[6]=_+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,d=l*h,g=c*u,_=c*h;t[0]=f-_*o,t[4]=-a*h,t[8]=g+d*o,t[1]=d+g*o,t[5]=a*u,t[9]=_-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,d=a*h,g=o*u,_=o*h;t[0]=l*u,t[4]=g*c-d,t[8]=f*c+_,t[1]=l*h,t[5]=_*c+f,t[9]=d*c-g,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,d=a*c,g=o*l,_=o*c;t[0]=l*u,t[4]=_-f*h,t[8]=g*h+d,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=d*h+g,t[10]=f-_*h}else if(e.order==="XZY"){const f=a*l,d=a*c,g=o*l,_=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+_,t[5]=a*u,t[9]=d*h-g,t[2]=g*h-d,t[6]=o*u,t[10]=_*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(K_,e,j_)}lookAt(e,t,n){const i=this.elements;return Yn.subVectors(e,t),Yn.lengthSq()===0&&(Yn.z=1),Yn.normalize(),fr.crossVectors(n,Yn),fr.lengthSq()===0&&(Math.abs(n.z)===1?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),fr.crossVectors(n,Yn)),fr.normalize(),Mo.crossVectors(Yn,fr),i[0]=fr.x,i[4]=Mo.x,i[8]=Yn.x,i[1]=fr.y,i[5]=Mo.y,i[9]=Yn.y,i[2]=fr.z,i[6]=Mo.z,i[10]=Yn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],h=n[5],f=n[9],d=n[13],g=n[2],_=n[6],p=n[10],m=n[14],b=n[3],y=n[7],M=n[11],E=n[15],T=i[0],A=i[4],v=i[8],w=i[12],C=i[1],L=i[5],N=i[9],Y=i[13],H=i[2],O=i[6],z=i[10],I=i[14],q=i[3],j=i[7],D=i[11],se=i[15];return s[0]=a*T+o*C+l*H+c*q,s[4]=a*A+o*L+l*O+c*j,s[8]=a*v+o*N+l*z+c*D,s[12]=a*w+o*Y+l*I+c*se,s[1]=u*T+h*C+f*H+d*q,s[5]=u*A+h*L+f*O+d*j,s[9]=u*v+h*N+f*z+d*D,s[13]=u*w+h*Y+f*I+d*se,s[2]=g*T+_*C+p*H+m*q,s[6]=g*A+_*L+p*O+m*j,s[10]=g*v+_*N+p*z+m*D,s[14]=g*w+_*Y+p*I+m*se,s[3]=b*T+y*C+M*H+E*q,s[7]=b*A+y*L+M*O+E*j,s[11]=b*v+y*N+M*z+E*D,s[15]=b*w+y*Y+M*I+E*se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],d=e[14],g=e[3],_=e[7],p=e[11],m=e[15],b=l*d-c*f,y=o*d-c*h,M=o*f-l*h,E=a*d-c*u,T=a*f-l*u,A=a*h-o*u;return t*(_*b-p*y+m*M)-n*(g*b-p*E+m*T)+i*(g*y-_*E+m*A)-s*(g*M-_*T+p*A)}determinantAffine(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],u=e[10];return t*(a*u-o*c)-n*(s*u-o*l)+i*(s*c-a*l)}transpose(){const e=this.elements;let t;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(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],g=e[12],_=e[13],p=e[14],m=e[15],b=t*o-n*a,y=t*l-i*a,M=t*c-s*a,E=n*l-i*o,T=n*c-s*o,A=i*c-s*l,v=u*_-h*g,w=u*p-f*g,C=u*m-d*g,L=h*p-f*_,N=h*m-d*_,Y=f*m-d*p,H=b*Y-y*N+M*L+E*C-T*w+A*v;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/H;return e[0]=(o*Y-l*N+c*L)*O,e[1]=(i*N-n*Y-s*L)*O,e[2]=(_*A-p*T+m*E)*O,e[3]=(f*T-h*A-d*E)*O,e[4]=(l*C-a*Y-c*w)*O,e[5]=(t*Y-i*C+s*w)*O,e[6]=(p*M-g*A-m*y)*O,e[7]=(u*A-f*M+d*y)*O,e[8]=(a*N-o*C+c*v)*O,e[9]=(n*C-t*N-s*v)*O,e[10]=(g*T-_*M+m*b)*O,e[11]=(h*M-u*T-d*b)*O,e[12]=(o*w-a*L-l*v)*O,e[13]=(t*L-n*w+i*v)*O,e[14]=(_*y-g*E-p*b)*O,e[15]=(u*E-h*y+f*b)*O,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,u*o+n,u*l-i*a,0,c*l-i*o,u*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,f=s*c,d=s*u,g=s*h,_=a*u,p=a*h,m=o*h,b=l*c,y=l*u,M=l*h,E=n.x,T=n.y,A=n.z;return i[0]=(1-(_+m))*E,i[1]=(d+M)*E,i[2]=(g-y)*E,i[3]=0,i[4]=(d-M)*T,i[5]=(1-(f+m))*T,i[6]=(p+b)*T,i[7]=0,i[8]=(g+y)*A,i[9]=(p-b)*A,i[10]=(1-(f+_))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];const s=this.determinantAffine();if(s===0)return n.set(1,1,1),t.identity(),this;let a=Ss.set(i[0],i[1],i[2]).length();const o=Ss.set(i[4],i[5],i[6]).length(),l=Ss.set(i[8],i[9],i[10]).length();s<0&&(a=-a),_i.copy(this);const c=1/a,u=1/o,h=1/l;return _i.elements[0]*=c,_i.elements[1]*=c,_i.elements[2]*=c,_i.elements[4]*=u,_i.elements[5]*=u,_i.elements[6]*=u,_i.elements[8]*=h,_i.elements[9]*=h,_i.elements[10]*=h,t.setFromRotationMatrix(_i),n.x=a,n.y=o,n.z=l,this}makePerspective(e,t,n,i,s,a,o=Fi,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(n-i),f=(t+e)/(t-e),d=(n+i)/(n-i);let g,_;if(l)g=s/(a-s),_=a*s/(a-s);else if(o===Fi)g=-(a+s)/(a-s),_=-2*a*s/(a-s);else if(o===bl)g=-a/(a-s),_=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=_,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,s,a,o=Fi,l=!1){const c=this.elements,u=2/(t-e),h=2/(n-i),f=-(t+e)/(t-e),d=-(n+i)/(n-i);let g,_;if(l)g=1/(a-s),_=a/(a-s);else if(o===Fi)g=-2/(a-s),_=-(a+s)/(a-s);else if(o===bl)g=-1/(a-s),_=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=d,c[2]=0,c[6]=0,c[10]=g,c[14]=_,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};El.prototype.isMatrix4=!0;let Yt=El;const Ss=new X,_i=new Yt,K_=new X(0,0,0),j_=new X(1,1,1),fr=new X,Mo=new X,Yn=new X,Fd=new Yt,Od=new oa;class cs{constructor(e=0,t=0,n=0,i=cs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],u=i[9],h=i[2],f=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(ct(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-ct(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(ct(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ct(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(ct(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-ct(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:$e("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Fd.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Fd,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Od.setFromEuler(this),this.setFromQuaternion(Od,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}cs.DEFAULT_ORDER="XYZ";class Mm{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let J_=0;const Bd=new X,bs=new oa,Vi=new Yt,So=new X,da=new X,Q_=new X,ex=new oa,kd=new X(1,0,0),zd=new X(0,1,0),Gd=new X(0,0,1),Vd={type:"added"},tx={type:"removed"},ys={type:"childadded",child:null},nc={type:"childremoved",child:null};class Hn extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:J_++}),this.uuid=aa(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Hn.DEFAULT_UP.clone();const e=new X,t=new cs,n=new oa,i=new X(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Yt},normalMatrix:{value:new je}}),this.matrix=new Yt,this.matrixWorld=new Yt,this.matrixAutoUpdate=Hn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Mm,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(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return bs.setFromAxisAngle(e,t),this.quaternion.multiply(bs),this}rotateOnWorldAxis(e,t){return bs.setFromAxisAngle(e,t),this.quaternion.premultiply(bs),this}rotateX(e){return this.rotateOnAxis(kd,e)}rotateY(e){return this.rotateOnAxis(zd,e)}rotateZ(e){return this.rotateOnAxis(Gd,e)}translateOnAxis(e,t){return Bd.copy(e).applyQuaternion(this.quaternion),this.position.add(Bd.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(kd,e)}translateY(e){return this.translateOnAxis(zd,e)}translateZ(e){return this.translateOnAxis(Gd,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Vi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?So.copy(e):So.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),da.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Vi.lookAt(da,So,this.up):Vi.lookAt(So,da,this.up),this.quaternion.setFromRotationMatrix(Vi),i&&(Vi.extractRotation(i.matrixWorld),bs.setFromRotationMatrix(Vi),this.quaternion.premultiply(bs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(mt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Vd),ys.child=e,this.dispatchEvent(ys),ys.child=null):mt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(tx),nc.child=e,this.dispatchEvent(nc),nc.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Vi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Vi.multiply(e.parent.matrixWorld)),e.applyMatrix4(Vi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Vd),ys.child=e,this.dispatchEvent(ys),ys.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(da,e,Q_),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(da,ex,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,i=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*n-s[8]*i,s[13]+=n-s[1]*t-s[5]*n-s[9]*i,s[14]+=i-s[2]*t-s[6]*n-s[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){const s=this.children;for(let a=0,o=s.length;a<o;a++)s[a].updateWorldMatrix(!1,!0,n)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),this.static!==!1&&(i.static=this.static),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(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(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(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),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(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),f=a(e.skeletons),d=a(e.animations),g=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=i,n;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Hn.DEFAULT_UP=new X(0,1,0);Hn.DEFAULT_MATRIX_AUTO_UPDATE=!0;Hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class bo extends Hn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const nx={type:"move"};class ic{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new bo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const p=t.getJointPose(_,n),m=this._getHandJoint(c,_);p!==null&&(m.matrix.fromArray(p.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=p.radius),m.visible=p!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),d=.02,g=.005;c.inputState.pinching&&f>d+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=d-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(nx)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new bo;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const Sm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},dr={h:0,s:0,l:0},yo={h:0,s:0,l:0};function rc(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class ht{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ci){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ft.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=ft.workingColorSpace){return this.r=e,this.g=t,this.b=n,ft.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=ft.workingColorSpace){if(e=wf(e,1),t=ct(t,0,1),n=ct(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=rc(a,s,e+1/3),this.g=rc(a,s,e),this.b=rc(a,s,e-1/3)}return ft.colorSpaceToWorking(this,i),this}setStyle(e,t=ci){function n(s){s!==void 0&&parseFloat(s)<1&&$e("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(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,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(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,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:$e("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);$e("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ci){const n=Sm[e.toLowerCase()];return n!==void 0?this.setHex(n,t):$e("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=tr(e.r),this.g=tr(e.g),this.b=tr(e.b),this}copyLinearToSRGB(e){return this.r=Zs(e.r),this.g=Zs(e.g),this.b=Zs(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ci){return ft.workingToColorSpace(_n.copy(this),e),Math.round(ct(_n.r*255,0,255))*65536+Math.round(ct(_n.g*255,0,255))*256+Math.round(ct(_n.b*255,0,255))}getHexString(e=ci){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ft.workingColorSpace){ft.workingToColorSpace(_n.copy(this),t);const n=_n.r,i=_n.g,s=_n.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case n:l=(i-s)/h+(i<s?6:0);break;case i:l=(s-n)/h+2;break;case s:l=(n-i)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=ft.workingColorSpace){return ft.workingToColorSpace(_n.copy(this),t),e.r=_n.r,e.g=_n.g,e.b=_n.b,e}getStyle(e=ci){ft.workingToColorSpace(_n.copy(this),e);const t=_n.r,n=_n.g,i=_n.b;return e!==ci?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(dr),this.setHSL(dr.h+e,dr.s+t,dr.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(dr),e.getHSL(yo);const n=Ga(dr.h,yo.h,t),i=Ga(dr.s,yo.s,t),s=Ga(dr.l,yo.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const _n=new ht;ht.NAMES=Sm;class ix extends Hn{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 cs,this.environmentIntensity=1,this.environmentRotation=new cs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const xi=new X,Hi=new X,sc=new X,Wi=new X,Es=new X,Ts=new X,Hd=new X,ac=new X,oc=new X,lc=new X,cc=new kt,uc=new kt,fc=new kt;class Si{constructor(e=new X,t=new X,n=new X){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),xi.subVectors(e,t),i.cross(xi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){xi.subVectors(i,t),Hi.subVectors(n,t),sc.subVectors(e,t);const a=xi.dot(xi),o=xi.dot(Hi),l=xi.dot(sc),c=Hi.dot(Hi),u=Hi.dot(sc),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,d=(c*l-o*u)*f,g=(a*u-o*l)*f;return s.set(1-d-g,g,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Wi)===null?!1:Wi.x>=0&&Wi.y>=0&&Wi.x+Wi.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,Wi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Wi.x),l.addScaledVector(a,Wi.y),l.addScaledVector(o,Wi.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return cc.setScalar(0),uc.setScalar(0),fc.setScalar(0),cc.fromBufferAttribute(e,t),uc.fromBufferAttribute(e,n),fc.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(cc,s.x),a.addScaledVector(uc,s.y),a.addScaledVector(fc,s.z),a}static isFrontFacing(e,t,n,i){return xi.subVectors(n,t),Hi.subVectors(e,t),xi.cross(Hi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return xi.subVectors(this.c,this.b),Hi.subVectors(this.a,this.b),xi.cross(Hi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Si.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Si.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return Si.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Si.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Si.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;Es.subVectors(i,n),Ts.subVectors(s,n),ac.subVectors(e,n);const l=Es.dot(ac),c=Ts.dot(ac);if(l<=0&&c<=0)return t.copy(n);oc.subVectors(e,i);const u=Es.dot(oc),h=Ts.dot(oc);if(u>=0&&h<=u)return t.copy(i);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(n).addScaledVector(Es,a);lc.subVectors(e,s);const d=Es.dot(lc),g=Ts.dot(lc);if(g>=0&&d<=g)return t.copy(s);const _=d*c-l*g;if(_<=0&&c>=0&&g<=0)return o=c/(c-g),t.copy(n).addScaledVector(Ts,o);const p=u*g-d*h;if(p<=0&&h-u>=0&&d-g>=0)return Hd.subVectors(s,i),o=(h-u)/(h-u+(d-g)),t.copy(i).addScaledVector(Hd,o);const m=1/(p+_+f);return a=_*m,o=f*m,t.copy(n).addScaledVector(Es,a).addScaledVector(Ts,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class no{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(vi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(vi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=vi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,vi):vi.fromBufferAttribute(s,a),vi.applyMatrix4(e.matrixWorld),this.expandByPoint(vi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Eo.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Eo.copy(n.boundingBox)),Eo.applyMatrix4(e.matrixWorld),this.union(Eo)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,vi),vi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ha),To.subVectors(this.max,ha),ws.subVectors(e.a,ha),As.subVectors(e.b,ha),Rs.subVectors(e.c,ha),hr.subVectors(As,ws),pr.subVectors(Rs,As),Or.subVectors(ws,Rs);let t=[0,-hr.z,hr.y,0,-pr.z,pr.y,0,-Or.z,Or.y,hr.z,0,-hr.x,pr.z,0,-pr.x,Or.z,0,-Or.x,-hr.y,hr.x,0,-pr.y,pr.x,0,-Or.y,Or.x,0];return!dc(t,ws,As,Rs,To)||(t=[1,0,0,0,1,0,0,0,1],!dc(t,ws,As,Rs,To))?!1:(wo.crossVectors(hr,pr),t=[wo.x,wo.y,wo.z],dc(t,ws,As,Rs,To))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Xi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Xi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Xi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Xi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Xi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Xi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Xi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Xi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Xi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Xi=[new X,new X,new X,new X,new X,new X,new X,new X],vi=new X,Eo=new no,ws=new X,As=new X,Rs=new X,hr=new X,pr=new X,Or=new X,ha=new X,To=new X,wo=new X,Br=new X;function dc(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Br.fromArray(r,s);const o=i.x*Math.abs(Br.x)+i.y*Math.abs(Br.y)+i.z*Math.abs(Br.z),l=e.dot(Br),c=t.dot(Br),u=n.dot(Br);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const Zt=new X,Ao=new gt;let rx=0;class Mn extends fs{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:rx++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Rd,this.updateRanges=[],this.gpuType=Ui,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ao.fromBufferAttribute(this,t),Ao.applyMatrix3(e),this.setXY(t,Ao.x,Ao.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.applyMatrix3(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.applyMatrix4(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.applyNormalMatrix(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Zt.fromBufferAttribute(this,t),Zt.transformDirection(e),this.setXYZ(t,Zt.x,Zt.y,Zt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Fs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Cn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Fs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Fs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Fs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Fs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Cn(t,this.array),n=Cn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Cn(t,this.array),n=Cn(n,this.array),i=Cn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Cn(t,this.array),n=Cn(n,this.array),i=Cn(i,this.array),s=Cn(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Rd&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class bm extends Mn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class ym extends Mn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class nr extends Mn{constructor(e,t,n){super(new Float32Array(e),t,n)}}const sx=new no,pa=new X,hc=new X;class Pl{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):sx.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;pa.subVectors(e,this.center);const t=pa.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(pa,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(hc.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pa.copy(e.center).add(hc)),this.expandByPoint(pa.copy(e.center).sub(hc))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let ax=0;const oi=new Yt,pc=new Hn,Cs=new X,qn=new no,ma=new no,an=new X;class Ei extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ax++}),this.uuid=aa(),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(e){return Array.isArray(e)?this.index=new(E_(e)?ym:bm)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new je().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return oi.makeRotationFromQuaternion(e),this.applyMatrix4(oi),this}rotateX(e){return oi.makeRotationX(e),this.applyMatrix4(oi),this}rotateY(e){return oi.makeRotationY(e),this.applyMatrix4(oi),this}rotateZ(e){return oi.makeRotationZ(e),this.applyMatrix4(oi),this}translate(e,t,n){return oi.makeTranslation(e,t,n),this.applyMatrix4(oi),this}scale(e,t,n){return oi.makeScale(e,t,n),this.applyMatrix4(oi),this}lookAt(e){return pc.lookAt(e),pc.updateMatrix(),this.applyMatrix4(pc.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Cs).negate(),this.translate(Cs.x,Cs.y,Cs.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,s=e.length;i<s;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new nr(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&$e("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new no);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){mt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];qn.setFromBufferAttribute(s),this.morphTargetsRelative?(an.addVectors(this.boundingBox.min,qn.min),this.boundingBox.expandByPoint(an),an.addVectors(this.boundingBox.max,qn.max),this.boundingBox.expandByPoint(an)):(this.boundingBox.expandByPoint(qn.min),this.boundingBox.expandByPoint(qn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&mt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Pl);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){mt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new X,1/0);return}if(e){const n=this.boundingSphere.center;if(qn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];ma.setFromBufferAttribute(o),this.morphTargetsRelative?(an.addVectors(qn.min,ma.min),qn.expandByPoint(an),an.addVectors(qn.max,ma.max),qn.expandByPoint(an)):(qn.expandByPoint(ma.min),qn.expandByPoint(ma.max))}qn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)an.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(an));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)an.fromBufferAttribute(o,c),l&&(Cs.fromBufferAttribute(e,c),an.add(Cs)),i=Math.max(i,n.distanceToSquared(an))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&mt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){mt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;let a=this.getAttribute("tangent");(a===void 0||a.count!==n.count)&&(a=new Mn(new Float32Array(4*n.count),4),this.setAttribute("tangent",a));const o=[],l=[];for(let v=0;v<n.count;v++)o[v]=new X,l[v]=new X;const c=new X,u=new X,h=new X,f=new gt,d=new gt,g=new gt,_=new X,p=new X;function m(v,w,C){c.fromBufferAttribute(n,v),u.fromBufferAttribute(n,w),h.fromBufferAttribute(n,C),f.fromBufferAttribute(s,v),d.fromBufferAttribute(s,w),g.fromBufferAttribute(s,C),u.sub(c),h.sub(c),d.sub(f),g.sub(f);const L=1/(d.x*g.y-g.x*d.y);isFinite(L)&&(_.copy(u).multiplyScalar(g.y).addScaledVector(h,-d.y).multiplyScalar(L),p.copy(h).multiplyScalar(d.x).addScaledVector(u,-g.x).multiplyScalar(L),o[v].add(_),o[w].add(_),o[C].add(_),l[v].add(p),l[w].add(p),l[C].add(p))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let v=0,w=b.length;v<w;++v){const C=b[v],L=C.start,N=C.count;for(let Y=L,H=L+N;Y<H;Y+=3)m(e.getX(Y+0),e.getX(Y+1),e.getX(Y+2))}const y=new X,M=new X,E=new X,T=new X;function A(v){E.fromBufferAttribute(i,v),T.copy(E);const w=o[v];y.copy(w),y.sub(E.multiplyScalar(E.dot(w))).normalize(),M.crossVectors(T,w);const L=M.dot(l[v])<0?-1:1;a.setXYZW(v,y.x,y.y,y.z,L)}for(let v=0,w=b.length;v<w;++v){const C=b[v],L=C.start,N=C.count;for(let Y=L,H=L+N;Y<H;Y+=3)A(e.getX(Y+0)),A(e.getX(Y+1)),A(e.getX(Y+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0||n.count!==t.count)n=new Mn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let f=0,d=n.count;f<d;f++)n.setXYZ(f,0,0,0);const i=new X,s=new X,a=new X,o=new X,l=new X,c=new X,u=new X,h=new X;if(e)for(let f=0,d=e.count;f<d;f+=3){const g=e.getX(f+0),_=e.getX(f+1),p=e.getX(f+2);i.fromBufferAttribute(t,g),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,p),u.subVectors(a,s),h.subVectors(i,s),u.cross(h),o.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,p),o.add(u),l.add(u),c.add(u),n.setXYZ(g,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let f=0,d=t.count;f<d;f+=3)i.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),h.subVectors(i,s),u.cross(h),n.setXYZ(f+0,u.x,u.y,u.z),n.setXYZ(f+1,u.x,u.y,u.z),n.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)an.fromBufferAttribute(e,t),an.normalize(),e.setXYZ(t,an.x,an.y,an.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,f=new c.constructor(l.length*u);let d=0,g=0;for(let _=0,p=l.length;_<p;_++){o.isInterleavedBufferAttribute?d=l[_]*o.data.stride+o.offset:d=l[_]*u;for(let m=0;m<u;m++)f[g++]=c[d++]}return new Mn(f,u,h)}if(this.index===null)return $e("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Ei,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const f=c[u],d=e(f,n);l.push(d)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?"BufferGeometry":this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){const d=c[h];u.push(d.toJSON(e.data))}u.length>0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,d=h.length;f<d;f++)u.push(h[f].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let ox=0;class io extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ox++}),this.uuid=aa(),this.name="",this.type="Material",this.blending=qs,this.side=Lr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Qc,this.blendDst=eu,this.blendEquation=Xr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ht(0,0,0),this.blendAlpha=0,this.depthFunc=na,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ad,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=vs,this.stencilZFail=vs,this.stencilZPass=vs,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(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){$e(`Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){$e(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector2&&n&&n.isVector2||i&&i.isEuler&&n&&n.isEuler||i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==qs&&(n.blending=this.blending),this.side!==Lr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Qc&&(n.blendSrc=this.blendSrc),this.blendDst!==eu&&(n.blendDst=this.blendDst),this.blendEquation!==Xr&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==na&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Ad&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==vs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==vs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==vs&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new ht().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let n=e.normalScale;Array.isArray(n)===!1&&(n=[n,n]),this.normalScale=new gt().fromArray(n)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new gt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const Yi=new X,mc=new X,Ro=new X,mr=new X,gc=new X,Co=new X,_c=new X;class Em{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Yi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Yi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Yi.copy(this.origin).addScaledVector(this.direction,t),Yi.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){mc.copy(e).add(t).multiplyScalar(.5),Ro.copy(t).sub(e).normalize(),mr.copy(this.origin).sub(mc);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Ro),o=mr.dot(this.direction),l=-mr.dot(Ro),c=mr.lengthSq(),u=Math.abs(1-a*a);let h,f,d,g;if(u>0)if(h=a*l-o,f=a*o-l,g=s*u,h>=0)if(f>=-g)if(f<=g){const _=1/u;h*=_,f*=_,d=h*(h+a*f+2*o)+f*(a*h+f+2*l)+c}else f=s,h=Math.max(0,-(a*f+o)),d=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(a*f+o)),d=-h*h+f*(f+2*l)+c;else f<=-g?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c):f<=g?(h=0,f=Math.min(Math.max(-s,-l),s),d=f*(f+2*l)+c):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),d=-h*h+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(mc).addScaledVector(Ro,f),d}intersectSphere(e,t){Yi.subVectors(e.center,this.origin);const n=Yi.dot(this.direction),i=Yi.dot(Yi)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Yi)!==null}intersectTriangle(e,t,n,i,s){gc.subVectors(t,e),Co.subVectors(n,e),_c.crossVectors(gc,Co);let a=this.direction.dot(_c),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;mr.subVectors(this.origin,e);const l=o*this.direction.dot(Co.crossVectors(mr,Co));if(l<0)return null;const c=o*this.direction.dot(gc.cross(mr));if(c<0||l+c>a)return null;const u=-o*mr.dot(_c);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Tm extends io{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cs,this.combine=nm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Wd=new Yt,kr=new Em,Po=new Pl,Xd=new X,Do=new X,Lo=new X,No=new X,xc=new X,Io=new X,Yd=new X,Uo=new X;class or extends Hn{constructor(e=new Ei,t=new Tm){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Io.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(xc.fromBufferAttribute(h,e),a?Io.addScaledVector(xc,u):Io.addScaledVector(xc.sub(t),u))}t.add(Io)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Po.copy(n.boundingSphere),Po.applyMatrix4(s),kr.copy(e.ray).recast(e.near),!(Po.containsPoint(kr.origin)===!1&&(kr.intersectSphere(Po,Xd)===null||kr.origin.distanceToSquared(Xd)>(e.far-e.near)**2))&&(Wd.copy(s).invert(),kr.copy(e.ray).applyMatrix4(Wd),!(n.boundingBox!==null&&kr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,kr)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,_=f.length;g<_;g++){const p=f[g],m=a[p.materialIndex],b=Math.max(p.start,d.start),y=Math.min(o.count,Math.min(p.start+p.count,d.start+d.count));for(let M=b,E=y;M<E;M+=3){const T=o.getX(M),A=o.getX(M+1),v=o.getX(M+2);i=Fo(this,m,e,n,c,u,h,T,A,v),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),_=Math.min(o.count,d.start+d.count);for(let p=g,m=_;p<m;p+=3){const b=o.getX(p),y=o.getX(p+1),M=o.getX(p+2);i=Fo(this,a,e,n,c,u,h,b,y,M),i&&(i.faceIndex=Math.floor(p/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let g=0,_=f.length;g<_;g++){const p=f[g],m=a[p.materialIndex],b=Math.max(p.start,d.start),y=Math.min(l.count,Math.min(p.start+p.count,d.start+d.count));for(let M=b,E=y;M<E;M+=3){const T=M,A=M+1,v=M+2;i=Fo(this,m,e,n,c,u,h,T,A,v),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),_=Math.min(l.count,d.start+d.count);for(let p=g,m=_;p<m;p+=3){const b=p,y=p+1,M=p+2;i=Fo(this,a,e,n,c,u,h,b,y,M),i&&(i.faceIndex=Math.floor(p/3),t.push(i))}}}}function lx(r,e,t,n,i,s,a,o){let l;if(e.side===Vn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,e.side===Lr,o),l===null)return null;Uo.copy(o),Uo.applyMatrix4(r.matrixWorld);const c=t.ray.origin.distanceTo(Uo);return c<t.near||c>t.far?null:{distance:c,point:Uo.clone(),object:r}}function Fo(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,Do),r.getVertexPosition(l,Lo),r.getVertexPosition(c,No);const u=lx(r,e,t,n,Do,Lo,No,Yd);if(u){const h=new X;Si.getBarycoord(Yd,Do,Lo,No,h),i&&(u.uv=Si.getInterpolatedAttribute(i,o,l,c,h,new gt)),s&&(u.uv1=Si.getInterpolatedAttribute(s,o,l,c,h,new gt)),a&&(u.normal=Si.getInterpolatedAttribute(a,o,l,c,h,new X),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new X,materialIndex:0};Si.getNormal(Do,Lo,No,f.normal),u.face=f,u.barycoord=h}return u}class cx extends Un{constructor(e=null,t=1,n=1,i,s,a,o,l,c=dn,u=dn,h,f){super(null,a,o,l,c,u,i,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const vc=new X,ux=new X,fx=new je;class Wr{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=vc.subVectors(n,t).cross(ux.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){const i=e.delta(vc),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||fx.getNormalMatrix(e),i=this.coplanarPoint(vc).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const zr=new Pl,dx=new gt(.5,.5),Oo=new X;class wm{constructor(e=new Wr,t=new Wr,n=new Wr,i=new Wr,s=new Wr,a=new Wr){this.planes=[e,t,n,i,s,a]}set(e,t,n,i,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Fi,n=!1){const i=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],d=s[7],g=s[8],_=s[9],p=s[10],m=s[11],b=s[12],y=s[13],M=s[14],E=s[15];if(i[0].setComponents(c-a,d-u,m-g,E-b).normalize(),i[1].setComponents(c+a,d+u,m+g,E+b).normalize(),i[2].setComponents(c+o,d+h,m+_,E+y).normalize(),i[3].setComponents(c-o,d-h,m-_,E-y).normalize(),n)i[4].setComponents(l,f,p,M).normalize(),i[5].setComponents(c-l,d-f,m-p,E-M).normalize();else if(i[4].setComponents(c-l,d-f,m-p,E-M).normalize(),t===Fi)i[5].setComponents(c+l,d+f,m+p,E+M).normalize();else if(t===bl)i[5].setComponents(l,f,p,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),zr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zr)}intersectsSprite(e){zr.center.set(0,0,0);const t=dx.distanceTo(e.center);return zr.radius=.7071067811865476+t,zr.applyMatrix4(e.matrixWorld),this.intersectsSphere(zr)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Oo.x=i.normal.x>0?e.max.x:e.min.x,Oo.y=i.normal.y>0?e.max.y:e.min.y,Oo.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Oo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class hx extends io{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ht(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const qd=new Yt,zu=new Em,Bo=new Pl,ko=new X;class px extends Hn{constructor(e=new Ei,t=new hx){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Bo.copy(n.boundingSphere),Bo.applyMatrix4(i),Bo.radius+=s,e.ray.intersectsSphere(Bo)===!1)return;qd.copy(i).invert(),zu.copy(e.ray).applyMatrix4(qd);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,h=n.attributes.position;if(c!==null){const f=Math.max(0,a.start),d=Math.min(c.count,a.start+a.count);for(let g=f,_=d;g<_;g++){const p=c.getX(g);ko.fromBufferAttribute(h,p),$d(ko,p,l,i,e,t,this)}}else{const f=Math.max(0,a.start),d=Math.min(h.count,a.start+a.count);for(let g=f,_=d;g<_;g++)ko.fromBufferAttribute(h,g),$d(ko,g,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function $d(r,e,t,n,i,s,a){const o=zu.distanceSqToPoint(r);if(o<t){const l=new X;zu.closestPointToPoint(r,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Am extends Un{constructor(e=[],t=os,n,i,s,a,o,l,c,u){super(e,t,n,i,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ra extends Un{constructor(e,t,n=Gi,i,s,a,o=dn,l=dn,c,u=ar,h=1){if(u!==ar&&u!==Kr)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,i,s,a,o,l,u,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Af(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class mx extends ra{constructor(e,t=Gi,n=os,i,s,a=dn,o=dn,l,c=ar){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,n,i,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Rm extends Un{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ro extends Ei{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let f=0,d=0;g("z","y","x",-1,-1,n,t,e,a,s,0),g("z","y","x",1,-1,n,t,-e,a,s,1),g("x","z","y",1,1,e,n,t,i,a,2),g("x","z","y",1,-1,e,n,-t,i,a,3),g("x","y","z",1,-1,e,t,n,i,s,4),g("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new nr(c,3)),this.setAttribute("normal",new nr(u,3)),this.setAttribute("uv",new nr(h,2));function g(_,p,m,b,y,M,E,T,A,v,w){const C=M/A,L=E/v,N=M/2,Y=E/2,H=T/2,O=A+1,z=v+1;let I=0,q=0;const j=new X;for(let D=0;D<z;D++){const se=D*L-Y;for(let pe=0;pe<O;pe++){const Ve=pe*C-N;j[_]=Ve*b,j[p]=se*y,j[m]=H,c.push(j.x,j.y,j.z),j[_]=0,j[p]=0,j[m]=T>0?1:-1,u.push(j.x,j.y,j.z),h.push(pe/A),h.push(1-D/v),I+=1}}for(let D=0;D<v;D++)for(let se=0;se<A;se++){const pe=f+se+O*D,Ve=f+se+O*(D+1),He=f+(se+1)+O*(D+1),Le=f+(se+1)+O*D;l.push(pe,Ve,Le),l.push(Ve,He,Le),q+=6}o.addGroup(d,q,w),d+=q,f+=I}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ro(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Dl extends Ei{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,u=l+1,h=e/o,f=t/l,d=[],g=[],_=[],p=[];for(let m=0;m<u;m++){const b=m*f-a;for(let y=0;y<c;y++){const M=y*h-s;g.push(M,-b,0),_.push(0,0,1),p.push(y/o),p.push(1-m/l)}}for(let m=0;m<l;m++)for(let b=0;b<o;b++){const y=b+c*m,M=b+c*(m+1),E=b+1+c*(m+1),T=b+1+c*m;d.push(y,M,T),d.push(M,E,T)}this.setIndex(d),this.setAttribute("position",new nr(g,3)),this.setAttribute("normal",new nr(_,3)),this.setAttribute("uv",new nr(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Dl(e.width,e.height,e.widthSegments,e.heightSegments)}}function sa(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];if(Zd(i))i.isRenderTargetTexture?($e("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone();else if(Array.isArray(i))if(Zd(i[0])){const s=[];for(let a=0,o=i.length;a<o;a++)s[a]=i[a].clone();e[t][n]=s}else e[t][n]=i.slice();else e[t][n]=i}}return e}function Pn(r){const e={};for(let t=0;t<r.length;t++){const n=sa(r[t]);for(const i in n)e[i]=n[i]}return e}function Zd(r){return r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)}function gx(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Cm(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:ft.workingColorSpace}const _x={clone:sa,merge:Pn};var xx=`void main() {
1
+ import{r as Fe,j as P,P as Xm,x as Nh,cG as Ac,cH as Ff,cI as Of,cJ as Ym,R as qm,b as Hu,L as Ns,e as $m,U as Km,W as Zm,bs as jm,cK as Jm,c as Bf,ag as Qm}from"./__vite-browser-external-Eoyj4eG-.js";import{H as eg}from"./HeaderGithubStar-DE1USQbb.js";import{u as tg}from"./use-community-stats-CExk3D6G.js";import{C as ng}from"./check-B87_qvAg.js";import{C as ig}from"./copy-Dtr68epm.js";import{G as rg,A as kf,W as zf}from"./icons-BaaYJxUN.js";import{D as sg}from"./download-DaWsA_Gj.js";import{A as Gf,L as ag}from"./agent-logos-D3K_ZRUj.js";import{f as Ih}from"./format-tokens-C6Pidz3s.js";function og(){if(typeof window>"u")return!1;const r=window.location.hostname;return r==="localhost"||r==="127.0.0.1"||r==="::1"}function Vf(){return og()?"/":"/dashboard"}const ln={accent:"#8a7aff",accentSoft:"#b8b3ff",accentFaint:"rgba(138, 122, 255, 0.16)",accentGhost:"rgba(138, 122, 255, 0.06)",glint:"#fbdfff",bg:"#050507",panel:"#0a0a0d",line:"rgba(138, 122, 255, 0.22)",scrim:"rgba(5, 5, 7, 0.62)",orbSurface:"radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0) 55%), radial-gradient(circle at 68% 84%, rgba(138, 122, 255, 0.30), rgba(138, 122, 255, 0) 55%), radial-gradient(circle at 50% 50%, rgba(20, 18, 34, 0.55), rgba(8, 8, 16, 0.82) 78%)",orbShadow:"inset 0 1px 1px rgba(255, 255, 255, 0.30), inset 0 -3px 9px rgba(138, 122, 255, 0.38), inset -5px -7px 14px rgba(0, 0, 0, 0.38), 0 0 30px rgba(138, 122, 255, 0.20), 0 10px 26px rgba(0, 0, 0, 0.5)",orbHighlight:"linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0))",orbGlint:"radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%)"},Il={accent:9075455,accentSoft:12104703,glint:16506879},lg={"--lv3-accent":ln.accent,"--lv3-accent-soft":ln.accentSoft,"--lv3-accent-faint":ln.accentFaint,"--lv3-accent-ghost":ln.accentGhost,"--lv3-glint":ln.glint,"--lv3-bg":ln.bg,"--lv3-panel":ln.panel,"--lv3-line":ln.line,"--lv3-scrim":ln.scrim,"--lv3-orb-surface":ln.orbSurface,"--lv3-orb-shadow":ln.orbShadow,"--lv3-orb-highlight":ln.orbHighlight,"--lv3-orb-glint":ln.orbGlint};function qi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Uh(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var ni={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Va={duration:.5,overwrite:!1,delay:0},Wu,hn,Nt,pi=1e8,Tt=1/pi,Rc=Math.PI*2,cg=Rc/4,ug=0,Fh=Math.sqrt,fg=Math.cos,dg=Math.sin,un=function(e){return typeof e=="string"},zt=function(e){return typeof e=="function"},ir=function(e){return typeof e=="number"},Xu=function(e){return typeof e>"u"},zi=function(e){return typeof e=="object"},Bn=function(e){return e!==!1},Yu=function(){return typeof window<"u"},so=function(e){return zt(e)||un(e)},Oh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},En=Array.isArray,hg=/random\([^)]+\)/g,pg=/,\s*/g,Hf=/(?:-?\.?\d|\.)+/gi,Bh=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Os=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ul=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,kh=/[+-]=-?[.\d]+/,mg=/[^,'"\[\]\s]+/gi,gg=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ut,Ci,Cc,qu,ii={},ol={},zh,Gh=function(e){return(ol=Zs(e,ii))&&Wn},$u=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Ha=function(e,t){return!t&&console.warn(e)},Vh=function(e,t){return e&&(ii[e]=t)&&ol&&(ol[e]=t)||ii},Wa=function(){return 0},_g={suppressEvents:!0,isStart:!0,kill:!1},Yo={suppressEvents:!0,kill:!1},xg={suppressEvents:!0},Ku={},Tr=[],Pc={},Hh,Zn={},Fl={},Wf=30,qo=[],Zu="",ju=function(e){var t=e[0],n,i;if(zi(t)||zt(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(i=qo.length;i--&&!qo[i].targetTest(t););n=qo[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new fp(e[i],n)))||e.splice(i,1);return e},jr=function(e){return e._gsap||ju(mi(e))[0]._gsap},Wh=function(e,t,n){return(n=e[t])&&zt(n)?e[t]():Xu(n)&&e.getAttribute&&e.getAttribute(t)||n},kn=function(e,t){return(e=e.split(",")).forEach(t)||e},Wt=function(e){return Math.round(e*1e5)/1e5||0},It=function(e){return Math.round(e*1e7)/1e7||0},zs=function(e,t){var n=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),n==="+"?e+i:n==="-"?e-i:n==="*"?e*i:e/i},vg=function(e,t){for(var n=t.length,i=0;e.indexOf(t[i])<0&&++i<n;);return i<n},ll=function(){var e=Tr.length,t=Tr.slice(0),n,i;for(Pc={},Tr.length=0,n=0;n<e;n++)i=t[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Ju=function(e){return!!(e._initted||e._startAt||e.add)},Xh=function(e,t,n,i){Tr.length&&!hn&&ll(),e.render(t,n,!!(hn&&t<0&&Ju(e))),Tr.length&&!hn&&ll()},Yh=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(mg).length<2?t:un(e)?e.trim():e},qh=function(e){return e},ri=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},Mg=function(e){return function(t,n){for(var i in n)i in t||i==="duration"&&e||i==="ease"||(t[i]=n[i])}},Zs=function(e,t){for(var n in t)e[n]=t[n];return e},Xf=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=zi(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},cl=function(e,t){var n={},i;for(i in e)i in t||(n[i]=e[i]);return n},Ra=function(e){var t=e.parent||Ut,n=e.keyframes?Mg(En(e.keyframes)):ri;if(Bn(e.inherit))for(;t;)n(e,t.vars.defaults),t=t.parent||t._dp;return e},Sg=function(e,t){for(var n=e.length,i=n===t.length;i&&n--&&e[n]===t[n];);return n<0},$h=function(e,t,n,i,s){var a=e[i],o;if(s)for(o=t[s];a&&a[s]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=a,t.parent=t._dp=e,t},Tl=function(e,t,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=t._prev,a=t._next;s?s._next=a:e[n]===t&&(e[n]=a),a?a._prev=s:e[i]===t&&(e[i]=s),t._next=t._prev=t.parent=null},Rr=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Jr=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},bg=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Dc=function(e,t,n,i){return e._startAt&&(hn?e._startAt.revert(Yo):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},yg=function r(e){return!e||e._ts&&r(e.parent)},Yf=function(e){return e._repeat?js(e._tTime,e=e.duration()+e._rDelay)*e:0},js=function(e,t){var n=Math.floor(e=It(e/t));return e&&n===e?n-1:n},ul=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},wl=function(e){return e._end=It(e._start+(e._tDur/Math.abs(e._ts||e._rts||Tt)||0))},Al=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=It(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),wl(e),n._dirty||Jr(n,e)),e},Kh=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=ul(e.rawTime(),t),(!t._dur||to(0,t.totalDuration(),n)-t._tTime>Tt)&&t.render(n,!0)),Jr(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-Tt}},Li=function(e,t,n,i){return t.parent&&Rr(t),t._start=It((ir(n)?n:n||e!==Ut?li(e,n,t):e._time)+t._delay),t._end=It(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),$h(e,t,"_first","_last",e._sort?"_start":0),Lc(t)||(e._recent=t),i||Kh(e,t),e._ts<0&&Al(e,e._tTime),e},Zh=function(e,t){return(ii.ScrollTrigger||$u("scrollTrigger",t))&&ii.ScrollTrigger.create(t,e)},jh=function(e,t,n,i,s){if(ef(e,t,s),!e._initted)return 1;if(!n&&e._pt&&!hn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Hh!==Jn.frame)return Tr.push(e),e._lazy=[s,i],1},Eg=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},Lc=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},Tg=function(e,t,n,i){var s=e.ratio,a=t<0||!t&&(!e._start&&Eg(e)&&!(!e._initted&&Lc(e))||(e._ts<0||e._dp._ts<0)&&!Lc(e))?0:1,o=e._rDelay,l=0,c,u,h;if(o&&e._repeat&&(l=to(0,e._tDur,t),u=js(l,o),e._yoyo&&u&1&&(a=1-a),u!==js(e._tTime,o)&&(s=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==s||hn||i||e._zTime===Tt||!t&&e._zTime){if(!e._initted&&jh(e,t,i,n,l))return;for(h=e._zTime,e._zTime=t||(n?Tt:0),n||(n=t&&!h),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=l,c=e._pt;c;)c.r(a,c.d),c=c._next;t<0&&Dc(e,t,n,!0),e._onUpdate&&!n&&ei(e,"onUpdate"),l&&e._repeat&&!n&&e.parent&&ei(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&Rr(e,1),!n&&!hn&&(ei(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},wg=function(e,t,n){var i;if(n>t)for(i=e._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<t)return i;i=i._prev}},Js=function(e,t,n,i){var s=e._repeat,a=It(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=a/e._dur),e._dur=a,e._tDur=s?s<0?1e10:It(a*(s+1)+e._rDelay*s):a,o>0&&!i&&Al(e,e._tTime=e._tDur*o),e.parent&&wl(e),n||Jr(e.parent,e),e},qf=function(e){return e instanceof On?Jr(e):Js(e,e._dur)},Ag={_start:0,endTime:Wa,totalDuration:Wa},li=function r(e,t,n){var i=e.labels,s=e._recent||Ag,a=e.duration()>=pi?s.endTime(!1):e._dur,o,l,c;return un(t)&&(isNaN(t)||t in i)?(l=t.charAt(0),c=t.substr(-1)==="%",o=t.indexOf("="),l==="<"||l===">"?(o>=0&&(t=t.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(c?(o<0?s:n).totalDuration()/100:1)):o<0?(t in i||(i[t]=a),i[t]):(l=parseFloat(t.charAt(o-1)+t.substr(o+1)),c&&n&&(l=l/100*(En(n)?n[0]:n).totalDuration()),o>1?r(e,t.substr(0,o-1),n)+l:a+l)):t==null?a:+t},Ca=function(e,t,n){var i=ir(t[1]),s=(i?2:1)+(e<2?0:1),a=t[s],o,l;if(i&&(a.duration=t[1]),a.parent=n,e){for(o=a,l=n;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=Bn(l.vars.inherit)&&l.parent;a.immediateRender=Bn(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[s-1]}return new jt(t[0],a,t[s+1])},Nr=function(e,t){return e||e===0?t(e):t},to=function(e,t,n){return n<e?e:n>t?t:n},Sn=function(e,t){return!un(e)||!(t=gg.exec(e))?"":t[1]},Rg=function(e,t,n){return Nr(n,function(i){return to(e,t,i)})},Nc=[].slice,Jh=function(e,t){return e&&zi(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&zi(e[0]))&&!e.nodeType&&e!==Ci},Cg=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(i){var s;return un(i)&&!t||Jh(i,1)?(s=n).push.apply(s,mi(i)):n.push(i)})||n},mi=function(e,t,n){return Nt&&!t&&Nt.selector?Nt.selector(e):un(e)&&!n&&(Cc||!Qs())?Nc.call((t||qu).querySelectorAll(e),0):En(e)?Cg(e,n):Jh(e)?Nc.call(e,0):e?[e]:[]},Ic=function(e){return e=mi(e)[0]||Ha("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return mi(t,n.querySelectorAll?n:n===e?Ha("Invalid scope")||qu.createElement("div"):e)}},Qh=function(e){return e.sort(function(){return .5-Math.random()})},ep=function(e){if(zt(e))return e;var t=zi(e)?e:{each:e},n=Qr(t.ease),i=t.from||0,s=parseFloat(t.base)||0,a={},o=i>0&&i<1,l=isNaN(i)||o,c=t.axis,u=i,h=i;return un(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!o&&l&&(u=i[0],h=i[1]),function(f,d,g){var _=(g||t).length,p=a[_],m,b,y,M,E,T,A,v,w;if(!p){if(w=t.grid==="auto"?0:(t.grid||[1,pi])[1],!w){for(A=-pi;A<(A=g[w++].getBoundingClientRect().left)&&w<_;);w<_&&w--}for(p=a[_]=[],m=l?Math.min(w,_)*u-.5:i%w,b=w===pi?0:l?_*h/w-.5:i/w|0,A=0,v=pi,T=0;T<_;T++)y=T%w-m,M=b-(T/w|0),p[T]=E=c?Math.abs(c==="y"?M:y):Fh(y*y+M*M),E>A&&(A=E),E<v&&(v=E);i==="random"&&Qh(p),p.max=A-v,p.min=v,p.v=_=(parseFloat(t.amount)||parseFloat(t.each)*(w>_?_-1:c?c==="y"?_/w:w:Math.max(w,_/w))||0)*(i==="edges"?-1:1),p.b=_<0?s-_:s,p.u=Sn(t.amount||t.each)||0,n=n&&_<0?Vg(n):n}return _=(p[f]-p.min)/p.max||0,It(p.b+(n?n(_):_)*p.v)+p.u}},Uc=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var i=It(Math.round(parseFloat(n)/e)*e*t);return(i-i%1)/t+(ir(n)?0:Sn(n))}},tp=function(e,t){var n=En(e),i,s;return!n&&zi(e)&&(i=n=e.radius||pi,e.values?(e=mi(e.values),(s=!ir(e[0]))&&(i*=i)):e=Uc(e.increment)),Nr(t,n?zt(e)?function(a){return s=e(a),Math.abs(s-a)<=i?s:a}:function(a){for(var o=parseFloat(s?a.x:a),l=parseFloat(s?a.y:0),c=pi,u=0,h=e.length,f,d;h--;)s?(f=e[h].x-o,d=e[h].y-l,f=f*f+d*d):f=Math.abs(e[h]-o),f<c&&(c=f,u=h);return u=!i||c<=i?e[u]:a,s||u===a||ir(a)?u:u+Sn(a)}:Uc(e))},np=function(e,t,n,i){return Nr(En(e)?!t:n===!0?!!(n=0):!i,function(){return En(e)?e[~~(Math.random()*e.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+n*.99))/n)*n*i)/i})},Pg=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(i){return t.reduce(function(s,a){return a(s)},i)}},Dg=function(e,t){return function(n){return e(parseFloat(n))+(t||Sn(n))}},Lg=function(e,t,n){return rp(e,t,0,1,n)},ip=function(e,t,n){return Nr(n,function(i){return e[~~t(i)]})},Ng=function r(e,t,n){var i=t-e;return En(e)?ip(e,r(0,e.length),t):Nr(n,function(s){return(i+(s-e)%i)%i+e})},Ig=function r(e,t,n){var i=t-e,s=i*2;return En(e)?ip(e,r(0,e.length-1),t):Nr(n,function(a){return a=(s+(a-e)%s)%s||0,e+(a>i?s-a:a)})},Xa=function(e){return e.replace(hg,function(t){var n=t.indexOf("[")+1,i=t.substring(n||7,n?t.indexOf("]"):t.length-1).split(pg);return np(n?i:+i[0],n?0:+i[1],+i[2]||1e-5)})},rp=function(e,t,n,i,s){var a=t-e,o=i-n;return Nr(s,function(l){return n+((l-e)/a*o||0)})},Ug=function r(e,t,n,i){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var a=un(e),o={},l,c,u,h,f;if(n===!0&&(i=1)&&(n=null),a)e={p:e},t={p:t};else if(En(e)&&!En(t)){for(u=[],h=e.length,f=h-2,c=1;c<h;c++)u.push(r(e[c-1],e[c]));h--,s=function(g){g*=h;var _=Math.min(f,~~g);return u[_](g-_)},n=t}else i||(e=Zs(En(e)?[]:{},e));if(!u){for(l in t)Qu.call(o,e,l,"get",t[l]);s=function(g){return rf(g,o)||(a?e.p:e)}}}return Nr(n,s)},$f=function(e,t,n){var i=e.labels,s=pi,a,o,l;for(a in i)o=i[a]-t,o<0==!!n&&o&&s>(o=Math.abs(o))&&(l=a,s=o);return l},ei=function(e,t,n){var i=e.vars,s=i[t],a=Nt,o=e._ctx,l,c,u;if(s)return l=i[t+"Params"],c=i.callbackScope||e,n&&Tr.length&&ll(),o&&(Nt=o),u=l?s.apply(c,l):s.call(c),Nt=a,u},xa=function(e){return Rr(e),e.scrollTrigger&&e.scrollTrigger.kill(!!hn),e.progress()<1&&ei(e,"onInterrupt"),e},Bs,sp=[],ap=function(e){if(e)if(e=!e.name&&e.default||e,Yu()||e.headless){var t=e.name,n=zt(e),i=t&&!n&&e.init?function(){this._props=[]}:e,s={init:Wa,render:rf,add:Qu,kill:Jg,modifier:jg,rawVars:0},a={targetTest:0,get:0,getSetter:nf,aliases:{},register:0};if(Qs(),e!==i){if(Zn[t])return;ri(i,ri(cl(e,s),a)),Zs(i.prototype,Zs(s,cl(e,a))),Zn[i.prop=t]=i,e.targetTest&&(qo.push(i),Ku[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Vh(t,i),e.register&&e.register(Wn,i,zn)}else sp.push(e)},Et=255,va={aqua:[0,Et,Et],lime:[0,Et,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Et],navy:[0,0,128],white:[Et,Et,Et],olive:[128,128,0],yellow:[Et,Et,0],orange:[Et,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Et,0,0],pink:[Et,192,203],cyan:[0,Et,Et],transparent:[Et,Et,Et,0]},Ol=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*Et+.5|0},op=function(e,t,n){var i=e?ir(e)?[e>>16,e>>8&Et,e&Et]:0:va.black,s,a,o,l,c,u,h,f,d,g;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),va[e])i=va[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e="#"+s+s+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&Et,i&Et,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&Et,e&Et]}else if(e.substr(0,3)==="hsl"){if(i=g=e.match(Hf),!t)l=+i[0]%360/360,c=+i[1]/100,u=+i[2]/100,a=u<=.5?u*(c+1):u+c-u*c,s=u*2-a,i.length>3&&(i[3]*=1),i[0]=Ol(l+1/3,s,a),i[1]=Ol(l,s,a),i[2]=Ol(l-1/3,s,a);else if(~e.indexOf("="))return i=e.match(Bh),n&&i.length<4&&(i[3]=1),i}else i=e.match(Hf)||va.transparent;i=i.map(Number)}return t&&!g&&(s=i[0]/Et,a=i[1]/Et,o=i[2]/Et,h=Math.max(s,a,o),f=Math.min(s,a,o),u=(h+f)/2,h===f?l=c=0:(d=h-f,c=u>.5?d/(2-h-f):d/(h+f),l=h===s?(a-o)/d+(a<o?6:0):h===a?(o-s)/d+2:(s-a)/d+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(u*100+.5)),n&&i.length<4&&(i[3]=1),i},lp=function(e){var t=[],n=[],i=-1;return e.split(wr).forEach(function(s){var a=s.match(Os)||[];t.push.apply(t,a),n.push(i+=a.length+1)}),t.c=n,t},Kf=function(e,t,n){var i="",s=(e+i).match(wr),a=t?"hsla(":"rgba(",o=0,l,c,u,h;if(!s)return e;if(s=s.map(function(f){return(f=op(f,t,1))&&a+(t?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(u=lp(e),l=n.c,l.join(i)!==u.c.join(i)))for(c=e.replace(wr,"1").split(Os),h=c.length-1;o<h;o++)i+=c[o]+(~l.indexOf(o)?s.shift()||a+"0,0,0,0)":(u.length?u:s.length?s:n).shift());if(!c)for(c=e.split(wr),h=c.length-1;o<h;o++)i+=c[o]+s[o];return i+c[h]},wr=(function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in va)r+="|"+e+"\\b";return new RegExp(r+")","gi")})(),Fg=/hsl[a]?\(/,cp=function(e){var t=e.join(" "),n;if(wr.lastIndex=0,wr.test(t))return n=Fg.test(t),e[1]=Kf(e[1],n),e[0]=Kf(e[0],n,lp(e[1])),!0},Ya,Jn=(function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,a=s,o=[],l,c,u,h,f,d,g=function _(p){var m=r()-i,b=p===!0,y,M,E,T;if((m>e||m<0)&&(n+=m-t),i+=m,E=i-n,y=E-a,(y>0||b)&&(T=++h.frame,f=E-h.time*1e3,h.time=E=E/1e3,a+=y+(y>=s?4:s-y),M=1),b||(l=c(_)),M)for(d=0;d<o.length;d++)o[d](E,f,T,p)};return h={time:0,frame:0,tick:function(){g(!0)},deltaRatio:function(p){return f/(1e3/(p||60))},wake:function(){zh&&(!Cc&&Yu()&&(Ci=Cc=window,qu=Ci.document||{},ii.gsap=Wn,(Ci.gsapVersions||(Ci.gsapVersions=[])).push(Wn.version),Gh(ol||Ci.GreenSockGlobals||!Ci.gsap&&Ci||{}),sp.forEach(ap)),u=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&h.sleep(),c=u||function(p){return setTimeout(p,a-h.time*1e3+1|0)},Ya=1,g(2))},sleep:function(){(u?cancelAnimationFrame:clearTimeout)(l),Ya=0,c=Wa},lagSmoothing:function(p,m){e=p||1/0,t=Math.min(m||33,e)},fps:function(p){s=1e3/(p||240),a=h.time*1e3+s},add:function(p,m,b){var y=m?function(M,E,T,A){p(M,E,T,A),h.remove(y)}:p;return h.remove(p),o[b?"unshift":"push"](y),Qs(),y},remove:function(p,m){~(m=o.indexOf(p))&&o.splice(m,1)&&d>=m&&d--},_listeners:o},h})(),Qs=function(){return!Ya&&Jn.wake()},dt={},Og=/^[\d.\-M][\d.\-,\s]/,Bg=/["']/g,kg=function(e){for(var t={},n=e.substr(1,e.length-3).split(":"),i=n[0],s=1,a=n.length,o,l,c;s<a;s++)l=n[s],o=s!==a-1?l.lastIndexOf(","):l.length,c=l.substr(0,o),t[i]=isNaN(c)?c.replace(Bg,"").trim():+c,i=l.substr(o+1).trim();return t},zg=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")"),i=e.indexOf("(",t);return e.substring(t,~i&&i<n?e.indexOf(")",n+1):n)},Gg=function(e){var t=(e+"").split("("),n=dt[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[kg(t[1])]:zg(e).split(",").map(Yh)):dt._CE&&Og.test(e)?dt._CE("",e):n},Vg=function(e){return function(t){return 1-e(1-t)}},Qr=function(e,t){return e&&(zt(e)?e:dt[e]||Gg(e))||t},us=function(e,t,n,i){n===void 0&&(n=function(l){return 1-t(1-l)}),i===void 0&&(i=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var s={easeIn:t,easeOut:n,easeInOut:i},a;return kn(e,function(o){dt[o]=ii[o]=s,dt[a=o.toLowerCase()]=n;for(var l in s)dt[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=dt[o+"."+l]=s[l]}),s},up=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},Bl=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),a=s/Rc*(Math.asin(1/i)||0),o=function(u){return u===1?1:i*Math.pow(2,-10*u)*dg((u-a)*s)+1},l=e==="out"?o:e==="in"?function(c){return 1-o(1-c)}:up(o);return s=Rc/s,l.config=function(c,u){return r(e,c,u)},l},kl=function r(e,t){t===void 0&&(t=1.70158);var n=function(a){return a?--a*a*((t+1)*a+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:up(n);return i.config=function(s){return r(e,s)},i};kn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;us(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})});dt.Linear.easeNone=dt.none=dt.Linear.easeIn;us("Elastic",Bl("in"),Bl("out"),Bl());(function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};us("Bounce",function(a){return 1-s(1-a)},s)})(7.5625,2.75);us("Expo",function(r){return Math.pow(2,10*(r-1))*r+r*r*r*r*r*r*(1-r)});us("Circ",function(r){return-(Fh(1-r*r)-1)});us("Sine",function(r){return r===1?1:-fg(r*cg)+1});us("Back",kl("in"),kl("out"),kl());dt.SteppedEase=dt.steps=ii.SteppedEase={config:function(e,t){e===void 0&&(e=1);var n=1/e,i=e+(t?0:1),s=t?1:0,a=1-Tt;return function(o){return((i*to(0,a,o)|0)+s)*n}}};Va.ease=dt["quad.out"];kn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Zu+=r+","+r+"Params,"});var fp=function(e,t){this.id=ug++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:Wh,this.set=t?t.getSetter:nf},qa=(function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Js(this,+t.duration,1,1),this.data=t.data,Nt&&(this._ctx=Nt,Nt.data.push(this)),Ya||Jn.wake()}var e=r.prototype;return e.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},e.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},e.totalDuration=function(n){return arguments.length?(this._dirty=0,Js(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(n,i){if(Qs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(Al(this,n),!s._dp||s.parent||Kh(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&Li(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Tt||!this._initted&&this._dur&&n||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Xh(this,n,i)),this},e.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Yf(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},e.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Yf(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?js(this._tTime,s)+1:1},e.timeScale=function(n,i){if(!arguments.length)return this._rts===-Tt?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?ul(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-Tt?0:this._rts,this.totalTime(to(-Math.abs(this._delay),this.totalDuration(),s),i!==!1),wl(this),bg(this)},e.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Qs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Tt&&(this._tTime-=Tt)))),this):this._ps},e.startTime=function(n){if(arguments.length){this._start=It(n);var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Li(i,this,this._start-this._delay),this}return this._start},e.endTime=function(n){return this._start+(Bn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ul(i.rawTime(n),this):this._tTime:this._tTime},e.revert=function(n){n===void 0&&(n=xg);var i=hn;return hn=n,Ju(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),hn=i,this},e.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},e.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,qf(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,qf(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},e.seek=function(n,i){return this.totalTime(li(this,n),Bn(i))},e.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Bn(i)),this._dur||(this._zTime=-Tt),this},e.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},e.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-Tt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Tt,this},e.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-Tt)},e.eventCallback=function(n,i,s){var a=this.vars;return arguments.length>1?(i?(a[n]=i,s&&(a[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete a[n],this):a[n]},e.then=function(n){var i=this,s=i._prom;return new Promise(function(a){var o=zt(n)?n:qh,l=function(){var u=i.then;i.then=null,s&&s(),zt(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=u),a(o),i.then=u};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?l():i._prom=l})},e.kill=function(){xa(this)},r})();ri(qa.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Tt,_prom:0,_ps:!1,_rts:1});var On=(function(r){Uh(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=Bn(n.sortChildren),Ut&&Li(n.parent||Ut,qi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Zh(qi(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(i,s,a){return Ca(0,arguments,this),this},t.from=function(i,s,a){return Ca(1,arguments,this),this},t.fromTo=function(i,s,a,o){return Ca(2,arguments,this),this},t.set=function(i,s,a){return s.duration=0,s.parent=this,Ra(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new jt(i,s,li(this,a),1),this},t.call=function(i,s,a){return Li(this,jt.delayedCall(0,i,s),a)},t.staggerTo=function(i,s,a,o,l,c,u){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=c,a.onCompleteParams=u,a.parent=this,new jt(i,a,li(this,l)),this},t.staggerFrom=function(i,s,a,o,l,c,u){return a.runBackwards=1,Ra(a).immediateRender=Bn(a.immediateRender),this.staggerTo(i,s,a,o,l,c,u)},t.staggerFromTo=function(i,s,a,o,l,c,u,h){return o.startAt=a,Ra(o).immediateRender=Bn(o.immediateRender),this.staggerTo(i,s,o,l,c,u,h)},t.render=function(i,s,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,u=i<=0?0:It(i),h=this._zTime<0!=i<0&&(this._initted||!c),f,d,g,_,p,m,b,y,M,E,T,A;if(this!==Ut&&u>l&&i>=0&&(u=l),u!==this._tTime||a||h){if(o!==this._time&&c&&(u+=this._time-o,i+=this._time-o),f=u,M=this._start,y=this._ts,m=!y,h&&(c||(o=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,p=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(p*100+i,s,a);if(f=It(u%p),u===l?(_=this._repeat,f=c):(E=It(u/p),_=~~E,_&&_===E&&(f=c,_--),f>c&&(f=c)),E=js(this._tTime,p),!o&&this._tTime&&E!==_&&this._tTime-E*p-this._dur<=0&&(E=_),T&&_&1&&(f=c-f,A=1),_!==E&&!this._lock){var v=T&&E&1,w=v===(T&&_&1);if(_<E&&(v=!v),o=v?0:u%c?c:u,this._lock=1,this.render(o||(A?0:It(_*p)),s,!c)._lock=0,this._tTime=u,!s&&this.parent&&ei(this,"onRepeat"),this.vars.repeatRefresh&&!A&&(this.invalidate()._lock=1,E=_),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,w&&(this._lock=2,o=v?c:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!A&&this.invalidate()),this._lock=0,!this._ts&&!m)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=wg(this,It(o),It(f)),b&&(u-=f-(f=b._start))),this._tTime=u,this._time=f,this._act=!!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,o=0),!o&&u&&c&&!s&&!E&&(ei(this,"onStart"),this._tTime!==u))return this;if(f>=o&&i>=0)for(d=this._first;d;){if(g=d._next,(d._act||f>=d._start)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,a);if(d.render(d._ts>0?(f-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(f-d._start)*d._ts,s,a),f!==this._time||!this._ts&&!m){b=0,g&&(u+=this._zTime=-Tt);break}}d=g}else{d=this._last;for(var C=i<0?i:f;d;){if(g=d._prev,(d._act||C<=d._end)&&d._ts&&b!==d){if(d.parent!==this)return this.render(i,s,a);if(d.render(d._ts>0?(C-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(C-d._start)*d._ts,s,a||hn&&Ju(d)),f!==this._time||!this._ts&&!m){b=0,g&&(u+=this._zTime=C?-Tt:Tt);break}}d=g}}if(b&&!s&&(this.pause(),b.render(f>=o?0:-Tt)._zTime=f>=o?1:-1,this._ts))return this._start=M,wl(this),this.render(i,s,a);this._onUpdate&&!s&&ei(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&o)&&(M===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(u===l&&this._ts>0||!u&&this._ts<0)&&Rr(this,1),!s&&!(i<0&&!o)&&(u||o||!l)&&(ei(this,u===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(i,s){var a=this;if(ir(s)||(s=li(this,s,i)),!(i instanceof qa)){if(En(i))return i.forEach(function(o){return a.add(o,s)}),this;if(un(i))return this.addLabel(i,s);if(zt(i))i=jt.delayedCall(0,i);else return this}return this!==i?Li(this,i,s):this},t.getChildren=function(i,s,a,o){i===void 0&&(i=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-pi);for(var l=[],c=this._first;c;)c._start>=o&&(c instanceof jt?s&&l.push(c):(a&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,a)))),c=c._next;return l},t.getById=function(i){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===i)return s[a]},t.remove=function(i){return un(i)?this.removeLabel(i):zt(i)?this.killTweensOf(i):(i.parent===this&&Tl(this,i),i===this._recent&&(this._recent=this._last),Jr(this))},t.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=It(Jn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},t.addLabel=function(i,s){return this.labels[i]=li(this,s),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,s,a){var o=jt.delayedCall(0,s||Wa,a);return o.data="isPause",this._hasPause=1,Li(this,o,li(this,i))},t.removePause=function(i){var s=this._first;for(i=li(this,i);s;)s._start===i&&s.data==="isPause"&&Rr(s),s=s._next},t.killTweensOf=function(i,s,a){for(var o=this.getTweensOf(i,a),l=o.length;l--;)vr!==o[l]&&o[l].kill(i,s);return this},t.getTweensOf=function(i,s){for(var a=[],o=mi(i),l=this._first,c=ir(s),u;l;)l instanceof jt?vg(l._targets,o)&&(c?(!vr||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&a.push(l):(u=l.getTweensOf(o,s)).length&&a.push.apply(a,u),l=l._next;return a},t.tweenTo=function(i,s){s=s||{};var a=this,o=li(a,i),l=s,c=l.startAt,u=l.onStart,h=l.onStartParams,f=l.immediateRender,d,g=jt.to(a,ri({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(c&&"time"in c?c.time:a._time))/a.timeScale())||Tt,onStart:function(){if(a.pause(),!d){var p=s.duration||Math.abs((o-(c&&"time"in c?c.time:a._time))/a.timeScale());g._dur!==p&&Js(g,p,0,1).render(g._time,!0,!0),d=1}u&&u.apply(g,h||[])}},s));return f?g.render(0):g},t.tweenFromTo=function(i,s,a){return this.tweenTo(s,ri({startAt:{time:li(this,i)}},a))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),$f(this,li(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),$f(this,li(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Tt)},t.shiftChildren=function(i,s,a){a===void 0&&(a=0);var o=this._first,l=this.labels,c;for(i=It(i);o;)o._start>=a&&(o._start+=i,o._end+=i),o=o._next;if(s)for(c in l)l[c]>=a&&(l[c]+=i);return Jr(this)},t.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Jr(this)},t.totalDuration=function(i){var s=0,a=this,o=a._last,l=pi,c,u,h;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-i:i));if(a._dirty){for(h=a.parent;o;)c=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,Li(a,o,u-o._delay,1)._lock=0):l=u,u<0&&o._ts&&(s-=u,(!h&&!a._dp||h&&h.smoothChildTiming)&&(a._start+=It(u/a._ts),a._time-=u,a._tTime-=u),a.shiftChildren(-u,!1,-1/0),l=0),o._end>s&&o._ts&&(s=o._end),o=c;Js(a,a===Ut&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(i){if(Ut._ts&&(Xh(Ut,ul(i,Ut)),Hh=Jn.frame),Jn.frame>=Wf){Wf+=ni.autoSleep||120;var s=Ut._first;if((!s||!s._ts)&&ni.autoSleep&&Jn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Jn.sleep()}}},e})(qa);ri(On.prototype,{_lock:0,_hasPause:0,_forcing:0});var Hg=function(e,t,n,i,s,a,o){var l=new zn(this._pt,e,t,0,1,_p,null,s),c=0,u=0,h,f,d,g,_,p,m,b;for(l.b=n,l.e=i,n+="",i+="",(m=~i.indexOf("random("))&&(i=Xa(i)),a&&(b=[n,i],a(b,e,t),n=b[0],i=b[1]),f=n.match(Ul)||[];h=Ul.exec(i);)g=h[0],_=i.substring(c,h.index),d?d=(d+1)%5:_.substr(-5)==="rgba("&&(d=1),g!==f[u++]&&(p=parseFloat(f[u-1])||0,l._pt={_next:l._pt,p:_||u===1?_:",",s:p,c:g.charAt(1)==="="?zs(p,g)-p:parseFloat(g)-p,m:d&&d<4?Math.round:0},c=Ul.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=o,(kh.test(i)||m)&&(l.e=0),this._pt=l,l},Qu=function(e,t,n,i,s,a,o,l,c,u){zt(i)&&(i=i(s||0,e,a));var h=e[t],f=n!=="get"?n:zt(h)?c?e[t.indexOf("set")||!zt(e["get"+t.substr(3)])?t:"get"+t.substr(3)](c):e[t]():h,d=zt(h)?c?$g:mp:tf,g;if(un(i)&&(~i.indexOf("random(")&&(i=Xa(i)),i.charAt(1)==="="&&(g=zs(f,i)+(Sn(f)||0),(g||g===0)&&(i=g))),!u||f!==i||Fc)return!isNaN(f*i)&&i!==""?(g=new zn(this._pt,e,t,+f||0,i-(f||0),typeof h=="boolean"?Zg:gp,0,d),c&&(g.fp=c),o&&g.modifier(o,this,e),this._pt=g):(!h&&!(t in e)&&$u(t,i),Hg.call(this,e,t,f,i,d,l||ni.stringFilter,c))},Wg=function(e,t,n,i,s){if(zt(e)&&(e=Pa(e,s,t,n,i)),!zi(e)||e.style&&e.nodeType||En(e)||Oh(e))return un(e)?Pa(e,s,t,n,i):e;var a={},o;for(o in e)a[o]=Pa(e[o],s,t,n,i);return a},dp=function(e,t,n,i,s,a){var o,l,c,u;if(Zn[e]&&(o=new Zn[e]).init(s,o.rawVars?t[e]:Wg(t[e],i,s,a,n),n,i,a)!==!1&&(n._pt=l=new zn(n._pt,s,e,0,1,o.render,o,0,o.priority),n!==Bs))for(c=n._ptLookup[n._targets.indexOf(s)],u=o._props.length;u--;)c[o._props[u]]=l;return o},vr,Fc,ef=function r(e,t,n){var i=e.vars,s=i.ease,a=i.startAt,o=i.immediateRender,l=i.lazy,c=i.onUpdate,u=i.runBackwards,h=i.yoyoEase,f=i.keyframes,d=i.autoRevert,g=e._dur,_=e._startAt,p=e._targets,m=e.parent,b=m&&m.data==="nested"?m.vars.targets:p,y=e._overwrite==="auto"&&!Wu,M=e.timeline,E=i.easeReverse||h,T,A,v,w,C,L,N,Y,H,O,z,I,q;if(M&&(!f||!s)&&(s="none"),e._ease=Qr(s,Va.ease),e._rEase=E&&(Qr(E)||e._ease),e._from=!M&&!!i.runBackwards,e._from&&(e.ratio=1),!M||f&&!i.stagger){if(Y=p[0]?jr(p[0]).harness:0,I=Y&&i[Y.prop],T=cl(i,Ku),_&&(_._zTime<0&&_.progress(1),t<0&&u&&o&&!d?_.render(-1,!0):_.revert(u&&g?Yo:_g),_._lazy=0),a){if(Rr(e._startAt=jt.set(p,ri({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!_&&Bn(l),startAt:null,delay:0,onUpdate:c&&function(){return ei(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(hn||!o&&!d)&&e._startAt.revert(Yo),o&&g&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(u&&g&&!_){if(t&&(o=!1),v=ri({overwrite:!1,data:"isFromStart",lazy:o&&!_&&Bn(l),immediateRender:o,stagger:0,parent:m},T),I&&(v[Y.prop]=I),Rr(e._startAt=jt.set(p,v)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(hn?e._startAt.revert(Yo):e._startAt.render(-1,!0)),e._zTime=t,!o)r(e._startAt,Tt,Tt);else if(!t)return}for(e._pt=e._ptCache=0,l=g&&Bn(l)||l&&!g,A=0;A<p.length;A++){if(C=p[A],N=C._gsap||ju(p)[A]._gsap,e._ptLookup[A]=O={},Pc[N.id]&&Tr.length&&ll(),z=b===p?A:b.indexOf(C),Y&&(H=new Y).init(C,I||T,e,z,b)!==!1&&(e._pt=w=new zn(e._pt,C,H.name,0,1,H.render,H,0,H.priority),H._props.forEach(function(j){O[j]=w}),H.priority&&(L=1)),!Y||I)for(v in T)Zn[v]&&(H=dp(v,T,e,z,C,b))?H.priority&&(L=1):O[v]=w=Qu.call(e,C,v,"get",T[v],z,b,0,i.stringFilter);e._op&&e._op[A]&&e.kill(C,e._op[A]),y&&e._pt&&(vr=e,Ut.killTweensOf(C,O,e.globalTime(t)),q=!e.parent,vr=0),e._pt&&l&&(Pc[N.id]=1)}L&&xp(e),e._onInit&&e._onInit(e)}e._onUpdate=c,e._initted=(!e._op||e._pt)&&!q,f&&t<=0&&M.render(pi,!0,!0)},Xg=function(e,t,n,i,s,a,o,l){var c=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,h,f,d;if(!c)for(c=e._ptCache[t]=[],f=e._ptLookup,d=e._targets.length;d--;){if(u=f[d][t],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==t&&u.fp!==t;)u=u._next;if(!u)return Fc=1,e.vars[t]="+=0",ef(e,o),Fc=0,l?Ha(t+" not eligible for reset. Try splitting into individual properties"):1;c.push(u)}for(d=c.length;d--;)h=c[d],u=h._pt||h,u.s=(i||i===0)&&!s?i:u.s+(i||0)+a*u.c,u.c=n-u.s,h.e&&(h.e=Wt(n)+Sn(h.e)),h.b&&(h.b=u.s+Sn(h.b))},Yg=function(e,t){var n=e[0]?jr(e[0]).harness:0,i=n&&n.aliases,s,a,o,l;if(!i)return t;s=Zs({},t);for(a in i)if(a in s)for(l=i[a].split(","),o=l.length;o--;)s[l[o]]=s[a];return s},qg=function(e,t,n,i){var s=t.ease||i||"power1.inOut",a,o;if(En(t))o=n[e]||(n[e]=[]),t.forEach(function(l,c){return o.push({t:c/(t.length-1)*100,v:l,e:s})});else for(a in t)o=n[a]||(n[a]=[]),a==="ease"||o.push({t:parseFloat(e),v:t[a],e:s})},Pa=function(e,t,n,i,s){return zt(e)?e.call(t,n,i,s):un(e)&&~e.indexOf("random(")?Xa(e):e},hp=Zu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",pp={};kn(hp+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return pp[r]=1});var jt=(function(r){Uh(e,r);function e(n,i,s,a){var o;typeof i=="number"&&(s.duration=i,i=s,s=null),o=r.call(this,a?i:Ra(i))||this;var l=o.vars,c=l.duration,u=l.delay,h=l.immediateRender,f=l.stagger,d=l.overwrite,g=l.keyframes,_=l.defaults,p=l.scrollTrigger,m=i.parent||Ut,b=(En(n)||Oh(n)?ir(n[0]):"length"in i)?[n]:mi(n),y,M,E,T,A,v,w,C;if(o._targets=b.length?ju(b):Ha("GSAP target "+n+" not found. https://gsap.com",!ni.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=d,g||f||so(c)||so(u)){i=o.vars;var L=i.easeReverse||i.yoyoEase;if(y=o.timeline=new On({data:"nested",defaults:_||{},targets:m&&m.data==="nested"?m.vars.targets:b}),y.kill(),y.parent=y._dp=qi(o),y._start=0,f||so(c)||so(u)){if(T=b.length,w=f&&ep(f),zi(f))for(A in f)~hp.indexOf(A)&&(C||(C={}),C[A]=f[A]);for(M=0;M<T;M++)E=cl(i,pp),E.stagger=0,L&&(E.easeReverse=L),C&&Zs(E,C),v=b[M],E.duration=+Pa(c,qi(o),M,v,b),E.delay=(+Pa(u,qi(o),M,v,b)||0)-o._delay,!f&&T===1&&E.delay&&(o._delay=u=E.delay,o._start+=u,E.delay=0),y.to(v,E,w?w(M,v,b):0),y._ease=dt.none;y.duration()?c=u=0:o.timeline=0}else if(g){Ra(ri(y.vars.defaults,{ease:"none"})),y._ease=Qr(g.ease||i.ease||"none");var N=0,Y,H,O;if(En(g))g.forEach(function(z){return y.to(b,z,">")}),y.duration();else{E={};for(A in g)A==="ease"||A==="easeEach"||qg(A,g[A],E,g.easeEach);for(A in E)for(Y=E[A].sort(function(z,I){return z.t-I.t}),N=0,M=0;M<Y.length;M++)H=Y[M],O={ease:H.e,duration:(H.t-(M?Y[M-1].t:0))/100*c},O[A]=H.v,y.to(b,O,N),N+=O.duration;y.duration()<c&&y.to({},{duration:c-y.duration()})}}c||o.duration(c=y.duration())}else o.timeline=0;return d===!0&&!Wu&&(vr=qi(o),Ut.killTweensOf(b),vr=0),Li(m,qi(o),s),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(h||!c&&!g&&o._start===It(m._time)&&Bn(h)&&yg(qi(o))&&m.data!=="nested")&&(o._tTime=-Tt,o.render(Math.max(0,-u)||0)),p&&Zh(qi(o),p),o}var t=e.prototype;return t.render=function(i,s,a){var o=this._time,l=this._tDur,c=this._dur,u=i<0,h=i>l-Tt&&!u?l:i<Tt?0:i,f,d,g,_,p,m,b,y;if(!c)Tg(this,i,s,a);else if(h!==this._tTime||!i||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u||this._lazy){if(f=h,y=this.timeline,this._repeat){if(_=c+this._rDelay,this._repeat<-1&&u)return this.totalTime(_*100+i,s,a);if(f=It(h%_),h===l?(g=this._repeat,f=c):(p=It(h/_),g=~~p,g&&g===p?(f=c,g--):f>c&&(f=c)),m=this._yoyo&&g&1,m&&(f=c-f),p=js(this._tTime,_),f===o&&!a&&this._initted&&g===p)return this._tTime=h,this;g!==p&&this.vars.repeatRefresh&&!m&&!this._lock&&f!==_&&this._initted&&(this._lock=a=1,this.render(It(_*g),!0).invalidate()._lock=0)}if(!this._initted){if(jh(this,u?i:f,a,s,h))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&g!==p))return this;if(c!==this._dur)return this.render(i,s,a)}if(this._rEase){var M=f<o;if(M!==this._inv){var E=M?o:c-o;this._inv=M,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=o,this._invRecip=E?(M?-1:1)/E:0,this._invScale=M?-this.ratio:1-this.ratio,this._invEase=M?this._rEase:this._ease}this.ratio=b=this._invRatio+this._invScale*this._invEase((f-this._invTime)*this._invRecip)}else this.ratio=b=this._ease(f/c);if(this._from&&(this.ratio=b=1-b),this._tTime=h,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),!o&&h&&!s&&!p&&(ei(this,"onStart"),this._tTime!==h))return this;for(d=this._pt;d;)d.r(b,d.d),d=d._next;y&&y.render(i<0?i:y._dur*y._ease(f/this._dur),s,a)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(u&&Dc(this,i,s,a),ei(this,"onUpdate")),this._repeat&&g!==p&&this.vars.onRepeat&&!s&&this.parent&&ei(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Dc(this,i,!0,!0),(i||!c)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Rr(this,1),!s&&!(u&&!o)&&(h||o||m)&&(ei(this,h===l?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},t.resetTo=function(i,s,a,o,l){Ya||Jn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||ef(this,c),u=this._ease(c/this._dur),Xg(this,i,s,a,o,u,c,l)?this.resetTo(i,s,a,o,1):(Al(this,0),this.parent||$h(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?xa(this):this.scrollTrigger&&this.scrollTrigger.kill(!!hn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,vr&&vr.vars.overwrite!==!0)._first||xa(this),this.parent&&a!==this.timeline.totalDuration()&&Js(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=i?mi(i):o,c=this._ptLookup,u=this._pt,h,f,d,g,_,p,m;if((!s||s==="all")&&Sg(o,l))return s==="all"&&(this._pt=0),xa(this);for(h=this._op=this._op||[],s!=="all"&&(un(s)&&(_={},kn(s,function(b){return _[b]=1}),s=_),s=Yg(o,s)),m=o.length;m--;)if(~l.indexOf(o[m])){f=c[m],s==="all"?(h[m]=s,g=f,d={}):(d=h[m]=h[m]||{},g=s);for(_ in g)p=f&&f[_],p&&((!("kill"in p.d)||p.d.kill(_)===!0)&&Tl(this,p,"_pt"),delete f[_]),d!=="all"&&(d[_]=1)}return this._initted&&!this._pt&&u&&xa(this),this},e.to=function(i,s){return new e(i,s,arguments[2])},e.from=function(i,s){return Ca(1,arguments)},e.delayedCall=function(i,s,a,o){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},e.fromTo=function(i,s,a){return Ca(2,arguments)},e.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(i,s)},e.killTweensOf=function(i,s,a){return Ut.killTweensOf(i,s,a)},e})(qa);ri(jt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});kn("staggerTo,staggerFrom,staggerFromTo",function(r){jt[r]=function(){var e=new On,t=Nc.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var tf=function(e,t,n){return e[t]=n},mp=function(e,t,n){return e[t](n)},$g=function(e,t,n,i){return e[t](i.fp,n)},Kg=function(e,t,n){return e.setAttribute(t,n)},nf=function(e,t){return zt(e[t])?mp:Xu(e[t])&&e.setAttribute?Kg:tf},gp=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Zg=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},_p=function(e,t){var n=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+i,n=n._next;i+=t.c}t.set(t.t,t.p,i,t)},rf=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},jg=function(e,t,n,i){for(var s=this._pt,a;s;)a=s._next,s.p===i&&s.modifier(e,t,n),s=a},Jg=function(e){for(var t=this._pt,n,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?Tl(this,t,"_pt"):t.dep||(n=1),t=i;return!n},Qg=function(e,t,n,i){i.mSet(e,t,i.m.call(i.tween,n,i.mt),i)},xp=function(e){for(var t=e._pt,n,i,s,a;t;){for(n=t._next,i=s;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:a)?t._prev._next=t:s=t,(t._next=i)?i._prev=t:a=t,t=n}e._pt=s},zn=(function(){function r(t,n,i,s,a,o,l,c,u){this.t=n,this.s=s,this.c=a,this.p=i,this.r=o||gp,this.d=l||this,this.set=c||tf,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Qg,this.m=n,this.mt=s,this.tween=i},r})();kn(Zu+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(r){return Ku[r]=1});ii.TweenMax=ii.TweenLite=jt;ii.TimelineLite=ii.TimelineMax=On;Ut=new On({sortChildren:!1,defaults:Va,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ni.stringFilter=cp;var es=[],$o={},e_=[],Zf=0,t_=0,zl=function(e){return($o[e]||e_).map(function(t){return t()})},Oc=function(){var e=Date.now(),t=[];e-Zf>2&&(zl("matchMediaInit"),es.forEach(function(n){var i=n.queries,s=n.conditions,a,o,l,c;for(o in i)a=Ci.matchMedia(i[o]).matches,a&&(l=1),a!==s[o]&&(s[o]=a,c=1);c&&(n.revert(),l&&t.push(n))}),zl("matchMediaRevert"),t.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Zf=e,zl("matchMedia"))},vp=(function(){function r(t,n){this.selector=n&&Ic(n),this.data=[],this._r=[],this.isReverted=!1,this.id=t_++,t&&this.add(t)}var e=r.prototype;return e.add=function(n,i,s){zt(n)&&(s=i,i=n,n=zt);var a=this,o=function(){var c=Nt,u=a.selector,h;return c&&c!==a&&c.data.push(a),s&&(a.selector=Ic(s)),Nt=a,h=i.apply(a,arguments),zt(h)&&a._r.push(h),Nt=c,a.selector=u,a.isReverted=!1,h};return a.last=o,n===zt?o(a,function(l){return a.add(null,l)}):n?a[n]=o:o},e.ignore=function(n){var i=Nt;Nt=null,n(this),Nt=i},e.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof jt&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(n,i){var s=this;if(n?(function(){for(var o=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof On?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof jt)&&c.revert&&c.revert(n);s._r.forEach(function(u){return u(n,s)}),s.isReverted=!0})():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),i)for(var a=es.length;a--;)es[a].id===this.id&&es.splice(a,1)},e.revert=function(n){this.kill(n||{})},r})(),n_=(function(){function r(t){this.contexts=[],this.scope=t,Nt&&Nt.data.push(this)}var e=r.prototype;return e.add=function(n,i,s){zi(n)||(n={matches:n});var a=new vp(0,s||this.scope),o=a.conditions={},l,c,u;Nt&&!a.selector&&(a.selector=Nt.selector),this.contexts.push(a),i=a.add("onMatch",i),a.queries=n;for(c in n)c==="all"?u=1:(l=Ci.matchMedia(n[c]),l&&(es.indexOf(a)<0&&es.push(a),(o[c]=l.matches)&&(u=1),l.addListener?l.addListener(Oc):l.addEventListener("change",Oc)));return u&&i(a,function(h){return a.add(null,h)}),this},e.revert=function(n){this.kill(n||{})},e.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r})(),fl={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(function(i){return ap(i)})},timeline:function(e){return new On(e)},getTweensOf:function(e,t){return Ut.getTweensOf(e,t)},getProperty:function(e,t,n,i){un(e)&&(e=mi(e)[0]);var s=jr(e||{}).get,a=n?qh:Yh;return n==="native"&&(n=""),e&&(t?a((Zn[t]&&Zn[t].get||s)(e,t,n,i)):function(o,l,c){return a((Zn[o]&&Zn[o].get||s)(e,o,l,c))})},quickSetter:function(e,t,n){if(e=mi(e),e.length>1){var i=e.map(function(u){return Wn.quickSetter(u,t,n)}),s=i.length;return function(u){for(var h=s;h--;)i[h](u)}}e=e[0]||{};var a=Zn[t],o=jr(e),l=o.harness&&(o.harness.aliases||{})[t]||t,c=a?function(u){var h=new a;Bs._pt=0,h.init(e,n?u+n:u,Bs,0,[e]),h.render(1,h),Bs._pt&&rf(1,Bs)}:o.set(e,l);return a?c:function(u){return c(e,l,n?u+n:u,o,1)}},quickTo:function(e,t,n){var i,s=Wn.to(e,ri((i={},i[t]="+=0.1",i.paused=!0,i.stagger=0,i),n||{})),a=function(l,c,u){return s.resetTo(t,l,c,u)};return a.tween=s,a},isTweening:function(e){return Ut.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Qr(e.ease,Va.ease)),Xf(Va,e||{})},config:function(e){return Xf(ni,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,i=e.plugins,s=e.defaults,a=e.extendTimeline;(i||"").split(",").forEach(function(o){return o&&!Zn[o]&&!ii[o]&&Ha(t+" effect requires "+o+" plugin.")}),Fl[t]=function(o,l,c){return n(mi(o),ri(l||{},s),c)},a&&(On.prototype[t]=function(o,l,c){return this.add(Fl[t](o,zi(l)?l:(c=l)&&{},this),c)})},registerEase:function(e,t){dt[e]=Qr(t)},parseEase:function(e,t){return arguments.length?Qr(e,t):dt},getById:function(e){return Ut.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new On(e),i,s;for(n.smoothChildTiming=Bn(e.smoothChildTiming),Ut.remove(n),n._dp=0,n._time=n._tTime=Ut._time,i=Ut._first;i;)s=i._next,(t||!(!i._dur&&i instanceof jt&&i.vars.onComplete===i._targets[0]))&&Li(n,i,i._start-i._delay),i=s;return Li(Ut,n,0),n},context:function(e,t){return e?new vp(e,t):Nt},matchMedia:function(e){return new n_(e)},matchMediaRefresh:function(){return es.forEach(function(e){var t=e.conditions,n,i;for(i in t)t[i]&&(t[i]=!1,n=1);n&&e.revert()})||Oc()},addEventListener:function(e,t){var n=$o[e]||($o[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=$o[e],i=n&&n.indexOf(t);i>=0&&n.splice(i,1)},utils:{wrap:Ng,wrapYoyo:Ig,distribute:ep,random:np,snap:tp,normalize:Lg,getUnit:Sn,clamp:Rg,splitColor:op,toArray:mi,selector:Ic,mapRange:rp,pipe:Pg,unitize:Dg,interpolate:Ug,shuffle:Qh},install:Gh,effects:Fl,ticker:Jn,updateRoot:On.updateRoot,plugins:Zn,globalTimeline:Ut,core:{PropTween:zn,globals:Vh,Tween:jt,Timeline:On,Animation:qa,getCache:jr,_removeLinkedListItem:Tl,reverting:function(){return hn},context:function(e){return e&&Nt&&(Nt.data.push(e),e._ctx=Nt),Nt},suppressOverwrites:function(e){return Wu=e}}};kn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return fl[r]=jt[r]});Jn.add(On.updateRoot);Bs=fl.to({},{duration:0});var i_=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},r_=function(e,t){var n=e._targets,i,s,a;for(i in t)for(s=n.length;s--;)a=e._ptLookup[s][i],a&&(a=a.d)&&(a._pt&&(a=i_(a,i)),a&&a.modifier&&a.modifier(t[i],e,n[s],i))},Gl=function(e,t){return{name:e,headless:1,rawVars:1,init:function(i,s,a){a._onInit=function(o){var l,c;if(un(s)&&(l={},kn(s,function(u){return l[u]=1}),s=l),t){l={};for(c in s)l[c]=t(s[c]);s=l}r_(o,s)}}}},Wn=fl.registerPlugin({name:"attr",init:function(e,t,n,i,s){var a,o,l;this.tween=n;for(a in t)l=e.getAttribute(a)||"",o=this.add(e,"setAttribute",(l||0)+"",t[a],i,s,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(e,t){for(var n=t._pt;n;)hn?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},Gl("roundProps",Uc),Gl("modifiers"),Gl("snap",tp))||fl;jt.version=On.version=Wn.version="3.15.0";zh=1;Yu()&&Qs();dt.Power0;dt.Power1;dt.Power2;dt.Power3;dt.Power4;dt.Linear;dt.Quad;dt.Cubic;dt.Quart;dt.Quint;dt.Strong;dt.Elastic;dt.Back;dt.SteppedEase;dt.Bounce;dt.Sine;dt.Expo;dt.Circ;var jf,Mr,Gs,sf,qr,Jf,af,s_=function(){return typeof window<"u"},rr={},Gr=180/Math.PI,Vs=Math.PI/180,ms=Math.atan2,Qf=1e8,of=/([A-Z])/g,a_=/(left|right|width|margin|padding|x)/i,o_=/[\s,\(]\S/,Ni={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Bc=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},l_=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},c_=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},u_=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},f_=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},Mp=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Sp=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},d_=function(e,t,n){return e.style[t]=n},h_=function(e,t,n){return e.style.setProperty(t,n)},p_=function(e,t,n){return e._gsap[t]=n},m_=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},g_=function(e,t,n,i,s){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(s,a)},__=function(e,t,n,i,s){var a=e._gsap;a[t]=n,a.renderTransform(s,a)},Ft="transform",Gn=Ft+"Origin",x_=function r(e,t){var n=this,i=this.target,s=i.style,a=i._gsap;if(e in rr&&s){if(this.tfm=this.tfm||{},e!=="transform")e=Ni[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return n.tfm[o]=$i(i,o)}):this.tfm[e]=a.x?a[e]:$i(i,e),e===Gn&&(this.tfm.zOrigin=a.zOrigin);else return Ni.transform.split(",").forEach(function(o){return r.call(n,o,t)});if(this.props.indexOf(Ft)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Gn,t,"")),e=Ft}(s||t)&&this.props.push(e,t,s[e])},bp=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},v_=function(){var e=this.props,t=this.target,n=t.style,i=t._gsap,s,a;for(s=0;s<e.length;s+=3)e[s+1]?e[s+1]===2?t[e[s]](e[s+2]):t[e[s]]=e[s+2]:e[s+2]?n[e[s]]=e[s+2]:n.removeProperty(e[s].substr(0,2)==="--"?e[s]:e[s].replace(of,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)i[a]=this.tfm[a];i.svg&&(i.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=af(),(!s||!s.isStart)&&!n[Ft]&&(bp(n),i.zOrigin&&n[Gn]&&(n[Gn]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},yp=function(e,t){var n={target:e,props:[],revert:v_,save:x_};return e._gsap||Wn.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(i){return n.save(i)}),n},Ep,kc=function(e,t){var n=Mr.createElementNS?Mr.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Mr.createElement(e);return n&&n.style?n:Mr.createElement(e)},ti=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(of,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,ea(t)||t,1)||""},ed="O,Moz,ms,Ms,Webkit".split(","),ea=function(e,t,n){var i=t||qr,s=i.style,a=5;if(e in s&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(ed[a]+e in s););return a<0?null:(a===3?"ms":a>=0?ed[a]:"")+e},zc=function(){s_()&&window.document&&(jf=window,Mr=jf.document,Gs=Mr.documentElement,qr=kc("div")||{style:{}},kc("div"),Ft=ea(Ft),Gn=Ft+"Origin",qr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ep=!!ea("perspective"),af=Wn.core.reverting,sf=1)},td=function(e){var t=e.ownerSVGElement,n=kc("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0),s;i.style.display="block",n.appendChild(i),Gs.appendChild(n);try{s=i.getBBox()}catch{}return n.removeChild(i),Gs.removeChild(n),s},nd=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},Tp=function(e){var t,n;try{t=e.getBBox()}catch{t=td(e),n=1}return t&&(t.width||t.height)||n||(t=td(e)),t&&!t.width&&!t.x&&!t.y?{x:+nd(e,["x","cx","x1"])||0,y:+nd(e,["y","cy","y1"])||0,width:0,height:0}:t},wp=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Tp(e))},Cr=function(e,t){if(t){var n=e.style,i;t in rr&&t!==Gn&&(t=Ft),n.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),n.removeProperty(i==="--"?t:t.replace(of,"-$1").toLowerCase())):n.removeAttribute(t)}},Sr=function(e,t,n,i,s,a){var o=new zn(e._pt,t,n,0,1,a?Sp:Mp);return e._pt=o,o.b=i,o.e=s,e._props.push(n),o},id={deg:1,rad:1,turn:1},M_={grid:1,flex:1},Pr=function r(e,t,n,i){var s=parseFloat(n)||0,a=(n+"").trim().substr((s+"").length)||"px",o=qr.style,l=a_.test(t),c=e.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),h=100,f=i==="px",d=i==="%",g,_,p,m;if(i===a||!s||id[i]||id[a])return s;if(a!=="px"&&!f&&(s=r(e,t,n,"px")),m=e.getCTM&&wp(e),(d||a==="%")&&(rr[t]||~t.indexOf("adius")))return g=m?e.getBBox()[l?"width":"height"]:e[u],Wt(d?s/g*h:s/100*g);if(o[l?"width":"height"]=h+(f?a:i),_=i!=="rem"&&~t.indexOf("adius")||i==="em"&&e.appendChild&&!c?e:e.parentNode,m&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Mr||!_.appendChild)&&(_=Mr.body),p=_._gsap,p&&d&&p.width&&l&&p.time===Jn.time&&!p.uncache)return Wt(s/p.width*h);if(d&&(t==="height"||t==="width")){var b=e.style[t];e.style[t]=h+i,g=e[u],b?e.style[t]=b:Cr(e,t)}else(d||a==="%")&&!M_[ti(_,"display")]&&(o.position=ti(e,"position")),_===e&&(o.position="static"),_.appendChild(qr),g=qr[u],_.removeChild(qr),o.position="absolute";return l&&d&&(p=jr(_),p.time=Jn.time,p.width=_[u]),Wt(f?g*s/h:g&&s?h/g*s:0)},$i=function(e,t,n,i){var s;return sf||zc(),t in Ni&&t!=="transform"&&(t=Ni[t],~t.indexOf(",")&&(t=t.split(",")[0])),rr[t]&&t!=="transform"?(s=Ka(e,i),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:hl(ti(e,Gn))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=dl[t]&&dl[t](e,t,n)||ti(e,t)||Wh(e,t)||(t==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?Pr(e,t,s,n)+n:s},S_=function(e,t,n,i){if(!n||n==="none"){var s=ea(t,e,1),a=s&&ti(e,s,1);a&&a!==n?(t=s,n=a):t==="borderColor"&&(n=ti(e,"borderTopColor"))}var o=new zn(this._pt,e.style,t,0,1,_p),l=0,c=0,u,h,f,d,g,_,p,m,b,y,M,E;if(o.b=n,o.e=i,n+="",i+="",i.substring(0,6)==="var(--"&&(i=ti(e,i.substring(4,i.indexOf(")")))),i==="auto"&&(_=e.style[t],e.style[t]=i,i=ti(e,t)||i,_?e.style[t]=_:Cr(e,t)),u=[n,i],cp(u),n=u[0],i=u[1],f=n.match(Os)||[],E=i.match(Os)||[],E.length){for(;h=Os.exec(i);)p=h[0],b=i.substring(l,h.index),g?g=(g+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(g=1),p!==(_=f[c++]||"")&&(d=parseFloat(_)||0,M=_.substr((d+"").length),p.charAt(1)==="="&&(p=zs(d,p)+M),m=parseFloat(p),y=p.substr((m+"").length),l=Os.lastIndex-y.length,y||(y=y||ni.units[t]||M,l===i.length&&(i+=y,o.e+=y)),M!==y&&(d=Pr(e,t,_,y)||0),o._pt={_next:o._pt,p:b||c===1?b:",",s:d,c:m-d,m:g&&g<4||t==="zIndex"?Math.round:0});o.c=l<i.length?i.substring(l,i.length):""}else o.r=t==="display"&&i==="none"?Sp:Mp;return kh.test(i)&&(o.e=0),this._pt=o,o},rd={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},b_=function(e){var t=e.split(" "),n=t[0],i=t[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(e=n,n=i,i=e),t[0]=rd[n]||n,t[1]=rd[i]||i,t.join(" ")},y_=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n=t.t,i=n.style,s=t.u,a=n._gsap,o,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)o=s[c],rr[o]&&(l=1,o=o==="transformOrigin"?Gn:Ft),Cr(n,o);l&&(Cr(n,Ft),a&&(a.svg&&n.removeAttribute("transform"),i.scale=i.rotate=i.translate="none",Ka(n,1),a.uncache=1,bp(i)))}},dl={clearProps:function(e,t,n,i,s){if(s.data!=="isFromStart"){var a=e._pt=new zn(e._pt,t,n,0,0,y_);return a.u=i,a.pr=-10,a.tween=s,e._props.push(n),1}}},$a=[1,0,0,1,0,0],Ap={},Rp=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},sd=function(e){var t=ti(e,Ft);return Rp(t)?$a:t.substr(7).match(Bh).map(Wt)},lf=function(e,t){var n=e._gsap||jr(e),i=e.style,s=sd(e),a,o,l,c;return n.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?$a:s):(s===$a&&!e.offsetParent&&e!==Gs&&!n.svg&&(l=i.display,i.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,o=e.nextElementSibling,Gs.appendChild(e)),s=sd(e),l?i.display=l:Cr(e,"display"),c&&(o?a.insertBefore(e,o):a?a.appendChild(e):Gs.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Gc=function(e,t,n,i,s,a){var o=e._gsap,l=s||lf(e,!0),c=o.xOrigin||0,u=o.yOrigin||0,h=o.xOffset||0,f=o.yOffset||0,d=l[0],g=l[1],_=l[2],p=l[3],m=l[4],b=l[5],y=t.split(" "),M=parseFloat(y[0])||0,E=parseFloat(y[1])||0,T,A,v,w;n?l!==$a&&(A=d*p-g*_)&&(v=M*(p/A)+E*(-_/A)+(_*b-p*m)/A,w=M*(-g/A)+E*(d/A)-(d*b-g*m)/A,M=v,E=w):(T=Tp(e),M=T.x+(~y[0].indexOf("%")?M/100*T.width:M),E=T.y+(~(y[1]||y[0]).indexOf("%")?E/100*T.height:E)),i||i!==!1&&o.smooth?(m=M-c,b=E-u,o.xOffset=h+(m*d+b*_)-m,o.yOffset=f+(m*g+b*p)-b):o.xOffset=o.yOffset=0,o.xOrigin=M,o.yOrigin=E,o.smooth=!!i,o.origin=t,o.originIsAbsolute=!!n,e.style[Gn]="0px 0px",a&&(Sr(a,o,"xOrigin",c,M),Sr(a,o,"yOrigin",u,E),Sr(a,o,"xOffset",h,o.xOffset),Sr(a,o,"yOffset",f,o.yOffset)),e.setAttribute("data-svg-origin",M+" "+E)},Ka=function(e,t){var n=e._gsap||new fp(e);if("x"in n&&!t&&!n.uncache)return n;var i=e.style,s=n.scaleX<0,a="px",o="deg",l=getComputedStyle(e),c=ti(e,Gn)||"0",u,h,f,d,g,_,p,m,b,y,M,E,T,A,v,w,C,L,N,Y,H,O,z,I,q,j,D,se,pe,Ve,He,Le;return u=h=f=_=p=m=b=y=M=0,d=g=1,n.svg=!!(e.getCTM&&wp(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Ft]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Ft]!=="none"?l[Ft]:"")),i.scale=i.rotate=i.translate="none"),A=lf(e,n.svg),n.svg&&(n.uncache?(q=e.getBBox(),c=n.xOrigin-q.x+"px "+(n.yOrigin-q.y)+"px",I=""):I=!t&&e.getAttribute("data-svg-origin"),Gc(e,I||c,!!I||n.originIsAbsolute,n.smooth!==!1,A)),E=n.xOrigin||0,T=n.yOrigin||0,A!==$a&&(L=A[0],N=A[1],Y=A[2],H=A[3],u=O=A[4],h=z=A[5],A.length===6?(d=Math.sqrt(L*L+N*N),g=Math.sqrt(H*H+Y*Y),_=L||N?ms(N,L)*Gr:0,b=Y||H?ms(Y,H)*Gr+_:0,b&&(g*=Math.abs(Math.cos(b*Vs))),n.svg&&(u-=E-(E*L+T*Y),h-=T-(E*N+T*H))):(Le=A[6],Ve=A[7],D=A[8],se=A[9],pe=A[10],He=A[11],u=A[12],h=A[13],f=A[14],v=ms(Le,pe),p=v*Gr,v&&(w=Math.cos(-v),C=Math.sin(-v),I=O*w+D*C,q=z*w+se*C,j=Le*w+pe*C,D=O*-C+D*w,se=z*-C+se*w,pe=Le*-C+pe*w,He=Ve*-C+He*w,O=I,z=q,Le=j),v=ms(-Y,pe),m=v*Gr,v&&(w=Math.cos(-v),C=Math.sin(-v),I=L*w-D*C,q=N*w-se*C,j=Y*w-pe*C,He=H*C+He*w,L=I,N=q,Y=j),v=ms(N,L),_=v*Gr,v&&(w=Math.cos(v),C=Math.sin(v),I=L*w+N*C,q=O*w+z*C,N=N*w-L*C,z=z*w-O*C,L=I,O=q),p&&Math.abs(p)+Math.abs(_)>359.9&&(p=_=0,m=180-m),d=Wt(Math.sqrt(L*L+N*N+Y*Y)),g=Wt(Math.sqrt(z*z+Le*Le)),v=ms(O,z),b=Math.abs(v)>2e-4?v*Gr:0,M=He?1/(He<0?-He:He):0),n.svg&&(I=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!Rp(ti(e,Ft)),I&&e.setAttribute("transform",I))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(d*=-1,b+=_<=0?180:-180,_+=_<=0?180:-180):(g*=-1,b+=b<=0?180:-180)),t=t||n.uncache,n.x=u-((n.xPercent=u&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+a,n.y=h-((n.yPercent=h&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+a,n.z=f+a,n.scaleX=Wt(d),n.scaleY=Wt(g),n.rotation=Wt(_)+o,n.rotationX=Wt(p)+o,n.rotationY=Wt(m)+o,n.skewX=b+o,n.skewY=y+o,n.transformPerspective=M+a,(n.zOrigin=parseFloat(c.split(" ")[2])||!t&&n.zOrigin||0)&&(i[Gn]=hl(c)),n.xOffset=n.yOffset=0,n.force3D=ni.force3D,n.renderTransform=n.svg?T_:Ep?Cp:E_,n.uncache=0,n},hl=function(e){return(e=e.split(" "))[0]+" "+e[1]},Vl=function(e,t,n){var i=Sn(t);return Wt(parseFloat(t)+parseFloat(Pr(e,"x",n+"px",i)))+i},E_=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Cp(e,t)},Ir="0deg",ca="0px",Ur=") ",Cp=function(e,t){var n=t||this,i=n.xPercent,s=n.yPercent,a=n.x,o=n.y,l=n.z,c=n.rotation,u=n.rotationY,h=n.rotationX,f=n.skewX,d=n.skewY,g=n.scaleX,_=n.scaleY,p=n.transformPerspective,m=n.force3D,b=n.target,y=n.zOrigin,M="",E=m==="auto"&&e&&e!==1||m===!0;if(y&&(h!==Ir||u!==Ir)){var T=parseFloat(u)*Vs,A=Math.sin(T),v=Math.cos(T),w;T=parseFloat(h)*Vs,w=Math.cos(T),a=Vl(b,a,A*w*-y),o=Vl(b,o,-Math.sin(T)*-y),l=Vl(b,l,v*w*-y+y)}p!==ca&&(M+="perspective("+p+Ur),(i||s)&&(M+="translate("+i+"%, "+s+"%) "),(E||a!==ca||o!==ca||l!==ca)&&(M+=l!==ca||E?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+Ur),c!==Ir&&(M+="rotate("+c+Ur),u!==Ir&&(M+="rotateY("+u+Ur),h!==Ir&&(M+="rotateX("+h+Ur),(f!==Ir||d!==Ir)&&(M+="skew("+f+", "+d+Ur),(g!==1||_!==1)&&(M+="scale("+g+", "+_+Ur),b.style[Ft]=M||"translate(0, 0)"},T_=function(e,t){var n=t||this,i=n.xPercent,s=n.yPercent,a=n.x,o=n.y,l=n.rotation,c=n.skewX,u=n.skewY,h=n.scaleX,f=n.scaleY,d=n.target,g=n.xOrigin,_=n.yOrigin,p=n.xOffset,m=n.yOffset,b=n.forceCSS,y=parseFloat(a),M=parseFloat(o),E,T,A,v,w;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=Vs,c*=Vs,E=Math.cos(l)*h,T=Math.sin(l)*h,A=Math.sin(l-c)*-f,v=Math.cos(l-c)*f,c&&(u*=Vs,w=Math.tan(c-u),w=Math.sqrt(1+w*w),A*=w,v*=w,u&&(w=Math.tan(u),w=Math.sqrt(1+w*w),E*=w,T*=w)),E=Wt(E),T=Wt(T),A=Wt(A),v=Wt(v)):(E=h,v=f,T=A=0),(y&&!~(a+"").indexOf("px")||M&&!~(o+"").indexOf("px"))&&(y=Pr(d,"x",a,"px"),M=Pr(d,"y",o,"px")),(g||_||p||m)&&(y=Wt(y+g-(g*E+_*A)+p),M=Wt(M+_-(g*T+_*v)+m)),(i||s)&&(w=d.getBBox(),y=Wt(y+i/100*w.width),M=Wt(M+s/100*w.height)),w="matrix("+E+","+T+","+A+","+v+","+y+","+M+")",d.setAttribute("transform",w),b&&(d.style[Ft]=w)},w_=function(e,t,n,i,s){var a=360,o=un(s),l=parseFloat(s)*(o&&~s.indexOf("rad")?Gr:1),c=l-i,u=i+c+"deg",h,f;return o&&(h=s.split("_")[1],h==="short"&&(c%=a,c!==c%(a/2)&&(c+=c<0?a:-a)),h==="cw"&&c<0?c=(c+a*Qf)%a-~~(c/a)*a:h==="ccw"&&c>0&&(c=(c-a*Qf)%a-~~(c/a)*a)),e._pt=f=new zn(e._pt,t,n,i,c,l_),f.e=u,f.u="deg",e._props.push(n),f},ad=function(e,t){for(var n in t)e[n]=t[n];return e},A_=function(e,t,n){var i=ad({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=n.style,o,l,c,u,h,f,d,g;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),a[Ft]=t,o=Ka(n,1),Cr(n,Ft),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Ft],a[Ft]=t,o=Ka(n,1),a[Ft]=c);for(l in rr)c=i[l],u=o[l],c!==u&&s.indexOf(l)<0&&(d=Sn(c),g=Sn(u),h=d!==g?Pr(n,l,c,g):parseFloat(c),f=parseFloat(u),e._pt=new zn(e._pt,o,l,h,f-h,Bc),e._pt.u=g||0,e._props.push(l));ad(o,i)};kn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",a=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(o){return e<2?r+o:"border"+o+r});dl[e>1?"border"+r:r]=function(o,l,c,u,h){var f,d;if(arguments.length<4)return f=a.map(function(g){return $i(o,g,c)}),d=f.join(" "),d.split(f[0]).length===5?f[0]:d;f=(u+"").split(" "),d={},a.forEach(function(g,_){return d[g]=f[_]=f[_]||f[(_-1)/2|0]}),o.init(l,d,h)}});var Pp={name:"css",register:zc,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,s){var a=this._props,o=e.style,l=n.vars.startAt,c,u,h,f,d,g,_,p,m,b,y,M,E,T,A,v,w;sf||zc(),this.styles=this.styles||yp(e),v=this.styles.props,this.tween=n;for(_ in t)if(_!=="autoRound"&&(u=t[_],!(Zn[_]&&dp(_,t,n,i,e,s)))){if(d=typeof u,g=dl[_],d==="function"&&(u=u.call(n,i,e,s),d=typeof u),d==="string"&&~u.indexOf("random(")&&(u=Xa(u)),g)g(this,e,_,u,n)&&(A=1);else if(_.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(_)+"").trim(),u+="",wr.lastIndex=0,wr.test(c)||(p=Sn(c),m=Sn(u),m?p!==m&&(c=Pr(e,_,c,m)+m):p&&(u+=p)),this.add(o,"setProperty",c,u,i,s,0,0,_),a.push(_),v.push(_,0,o[_]);else if(d!=="undefined"){if(l&&_ in l?(c=typeof l[_]=="function"?l[_].call(n,i,e,s):l[_],un(c)&&~c.indexOf("random(")&&(c=Xa(c)),Sn(c+"")||c==="auto"||(c+=ni.units[_]||Sn($i(e,_))||""),(c+"").charAt(1)==="="&&(c=$i(e,_))):c=$i(e,_),f=parseFloat(c),b=d==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),h=parseFloat(u),_ in Ni&&(_==="autoAlpha"&&(f===1&&$i(e,"visibility")==="hidden"&&h&&(f=0),v.push("visibility",0,o.visibility),Sr(this,o,"visibility",f?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=Ni[_],~_.indexOf(",")&&(_=_.split(",")[0]))),y=_ in rr,y){if(this.styles.save(_),w=u,d==="string"&&u.substring(0,6)==="var(--"){if(u=ti(e,u.substring(4,u.indexOf(")"))),u.substring(0,5)==="calc("){var C=e.style.perspective;e.style.perspective=u,u=ti(e,"perspective"),C?e.style.perspective=C:Cr(e,"perspective")}h=parseFloat(u)}if(M||(E=e._gsap,E.renderTransform&&!t.parseTransform||Ka(e,t.parseTransform),T=t.smoothOrigin!==!1&&E.smooth,M=this._pt=new zn(this._pt,o,Ft,0,1,E.renderTransform,E,0,-1),M.dep=1),_==="scale")this._pt=new zn(this._pt,E,"scaleY",E.scaleY,(b?zs(E.scaleY,b+h):h)-E.scaleY||0,Bc),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){v.push(Gn,0,o[Gn]),u=b_(u),E.svg?Gc(e,u,0,T,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==E.zOrigin&&Sr(this,E,"zOrigin",E.zOrigin,m),Sr(this,o,_,hl(c),hl(u)));continue}else if(_==="svgOrigin"){Gc(e,u,1,T,0,this);continue}else if(_ in Ap){w_(this,E,_,f,b?zs(f,b+u):u);continue}else if(_==="smoothOrigin"){Sr(this,E,"smooth",E.smooth,u);continue}else if(_==="force3D"){E[_]=u;continue}else if(_==="transform"){A_(this,u,e);continue}}else _ in o||(_=ea(_)||_);if(y||(h||h===0)&&(f||f===0)&&!o_.test(u)&&_ in o)p=(c+"").substr((f+"").length),h||(h=0),m=Sn(u)||(_ in ni.units?ni.units[_]:p),p!==m&&(f=Pr(e,_,c,m)),this._pt=new zn(this._pt,y?E:o,_,f,(b?zs(f,b+h):h)-f,!y&&(m==="px"||_==="zIndex")&&t.autoRound!==!1?f_:Bc),this._pt.u=m||0,y&&w!==u?(this._pt.b=c,this._pt.e=w,this._pt.r=u_):p!==m&&m!=="%"&&(this._pt.b=c,this._pt.r=c_);else if(_ in o)S_.call(this,e,_,c,b?b+u:u);else if(_ in e)this.add(e,_,c||e[_],b?b+u:u,i,s);else if(_!=="parseTransform"){$u(_,u);continue}y||(_ in o?v.push(_,0,o[_]):typeof e[_]=="function"?v.push(_,2,e[_]()):v.push(_,1,c||e[_])),a.push(_)}}A&&xp(this)},render:function(e,t){if(t.tween._time||!af())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:$i,aliases:Ni,getSetter:function(e,t,n){var i=Ni[t];return i&&i.indexOf(",")<0&&(t=i),t in rr&&t!==Gn&&(e._gsap.x||$i(e,"x"))?n&&Jf===n?t==="scale"?m_:p_:(Jf=n||{})&&(t==="scale"?g_:__):e.style&&!Xu(e.style[t])?d_:~t.indexOf("-")?h_:nf(e,t)},core:{_removeProperty:Cr,_getMatrix:lf}};Wn.utils.checkPrefix=ea;Wn.core.getStyleSaver=yp;(function(r,e,t,n){var i=kn(r+","+e+","+t,function(s){rr[s]=1});kn(e,function(s){ni.units[s]="deg",Ap[s]=1}),Ni[i[13]]=r+","+e,kn(n,function(s){var a=s.split(":");Ni[a[1]]=i[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");kn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ni.units[r]="px"});Wn.registerPlugin(Pp);var Lt=Wn.registerPlugin(Pp)||Wn;Lt.core.Tween;function R_(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function C_(r,e,t){return e&&R_(r.prototype,e),r}var fn,Ko,Qn,br,yr,Hs,Dp,Vr,Ws,Lp,ji,Mi,Np,Ip=function(){return fn||typeof window<"u"&&(fn=window.gsap)&&fn.registerPlugin&&fn},Up=1,ks=[],at=[],Oi=[],Da=Date.now,Vc=function(e,t){return t},P_=function(){var e=Ws.core,t=e.bridge||{},n=e._scrollers,i=e._proxies;n.push.apply(n,at),i.push.apply(i,Oi),at=n,Oi=i,Vc=function(a,o){return t[a](o)}},Ar=function(e,t){return~Oi.indexOf(e)&&Oi[Oi.indexOf(e)+1][t]},La=function(e){return!!~Lp.indexOf(e)},Rn=function(e,t,n,i,s){return e.addEventListener(t,n,{passive:i!==!1,capture:!!s})},An=function(e,t,n,i){return e.removeEventListener(t,n,!!i)},ao="scrollLeft",oo="scrollTop",Hc=function(){return ji&&ji.isPressed||at.cache++},pl=function(e,t){var n=function i(s){if(s||s===0){Up&&(Qn.history.scrollRestoration="manual");var a=ji&&ji.isPressed;s=i.v=Math.round(s)||(ji&&ji.iOS?1:0),e(s),i.cacheID=at.cache,a&&Vc("ss",s)}else(t||at.cache!==i.cacheID||Vc("ref"))&&(i.cacheID=at.cache,i.v=e());return i.v+i.offset};return n.offset=0,e&&n},In={s:ao,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:pl(function(r){return arguments.length?Qn.scrollTo(r,en.sc()):Qn.pageXOffset||br[ao]||yr[ao]||Hs[ao]||0})},en={s:oo,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:In,sc:pl(function(r){return arguments.length?Qn.scrollTo(In.sc(),r):Qn.pageYOffset||br[oo]||yr[oo]||Hs[oo]||0})},Fn=function(e,t){return(t&&t._ctx&&t._ctx.selector||fn.utils.toArray)(e)[0]||(typeof e=="string"&&fn.config().nullTargetWarn!==!1?console.warn("Element not found:",e):null)},D_=function(e,t){for(var n=t.length;n--;)if(t[n]===e||t[n].contains(e))return!0;return!1},Dr=function(e,t){var n=t.s,i=t.sc;La(e)&&(e=br.scrollingElement||yr);var s=at.indexOf(e),a=i===en.sc?1:2;!~s&&(s=at.push(e)-1),at[s+a]||Rn(e,"scroll",Hc);var o=at[s+a],l=o||(at[s+a]=pl(Ar(e,n),!0)||(La(e)?i:pl(function(c){return arguments.length?e[n]=c:e[n]})));return l.target=e,o||(l.smooth=fn.getProperty(e,"scrollBehavior")==="smooth"),l},Wc=function(e,t,n){var i=e,s=e,a=Da(),o=a,l=t||50,c=Math.max(500,l*3),u=function(g,_){var p=Da();_||p-a>l?(s=i,i=g,o=a,a=p):n?i+=g:i=s+(g-s)/(p-o)*(a-o)},h=function(){s=i=n?0:i,o=a=0},f=function(g){var _=o,p=s,m=Da();return(g||g===0)&&g!==i&&u(g),a===o||m-o>c?0:(i+(n?p:-p))/((n?m:a)-_)*1e3};return{update:u,reset:h,getVelocity:f}},ua=function(e,t){return t&&!e._gsapAllow&&e.cancelable!==!1&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},od=function(e){var t=Math.max.apply(Math,e),n=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(n)?t:n},Fp=function(){Ws=fn.core.globals().ScrollTrigger,Ws&&Ws.core&&P_()},Op=function(e){return fn=e||Ip(),!Ko&&fn&&typeof document<"u"&&document.body&&(Qn=window,br=document,yr=br.documentElement,Hs=br.body,Lp=[Qn,br,yr,Hs],fn.utils.clamp,Np=fn.core.context||function(){},Vr="onpointerenter"in Hs?"pointer":"mouse",Dp=Xt.isTouch=Qn.matchMedia&&Qn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Qn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,Mi=Xt.eventTypes=("ontouchstart"in yr?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in yr?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return Up=0},500),Ko=1),Ws||Fp(),Ko};In.op=en;at.cache=0;var Xt=(function(){function r(t){this.init(t)}var e=r.prototype;return e.init=function(n){Ko||Op(fn)||console.warn("Please gsap.registerPlugin(Observer)"),Ws||Fp();var i=n.tolerance,s=n.dragMinimum,a=n.type,o=n.target,l=n.lineHeight,c=n.debounce,u=n.preventDefault,h=n.onStop,f=n.onStopDelay,d=n.ignore,g=n.wheelSpeed,_=n.event,p=n.onDragStart,m=n.onDragEnd,b=n.onDrag,y=n.onPress,M=n.onRelease,E=n.onRight,T=n.onLeft,A=n.onUp,v=n.onDown,w=n.onChangeX,C=n.onChangeY,L=n.onChange,N=n.onToggleX,Y=n.onToggleY,H=n.onHover,O=n.onHoverEnd,z=n.onMove,I=n.ignoreCheck,q=n.isNormalizer,j=n.onGestureStart,D=n.onGestureEnd,se=n.onWheel,pe=n.onEnable,Ve=n.onDisable,He=n.onClick,Le=n.scrollSpeed,Q=n.capture,oe=n.allowClicks,ne=n.lockAxis,Ee=n.onLockAxis;this.target=o=Fn(o)||yr,this.vars=n,d&&(d=fn.utils.toArray(d)),i=i||1e-9,s=s||0,g=g||1,Le=Le||1,a=a||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(Qn.getComputedStyle(Hs).lineHeight)||22);var Oe,Te,tt,Me,ze,qe,Ye,$=this,lt=0,We=0,Qe=n.passive||!u&&n.passive!==!1,Ge=Dr(o,In),Ke=Dr(o,en),F=Ge(),Ct=Ke(),Xe=~a.indexOf("touch")&&!~a.indexOf("pointer")&&Mi[0]==="pointerdown",R=La(o),x=o.ownerDocument||br,k=[0,0,0],V=[0,0,0],Z=0,ce=function(){return Z=Da()},ae=function(re,Be){return($.event=re)&&d&&D_(re.target,d)||Be&&Xe&&re.pointerType!=="touch"||I&&I(re,Be)},J=function(){$._vx.reset(),$._vy.reset(),Te.pause(),h&&h($)},ee=function(){var re=$.deltaX=od(k),Be=$.deltaY=od(V),ue=Math.abs(re)>=i,ke=Math.abs(Be)>=i;L&&(ue||ke)&&L($,re,Be,k,V),ue&&(E&&$.deltaX>0&&E($),T&&$.deltaX<0&&T($),w&&w($),N&&$.deltaX<0!=lt<0&&N($),lt=$.deltaX,k[0]=k[1]=k[2]=0),ke&&(v&&$.deltaY>0&&v($),A&&$.deltaY<0&&A($),C&&C($),Y&&$.deltaY<0!=We<0&&Y($),We=$.deltaY,V[0]=V[1]=V[2]=0),(Me||tt)&&(z&&z($),tt&&(p&&tt===1&&p($),b&&b($),tt=0),Me=!1),qe&&!(qe=!1)&&Ee&&Ee($),ze&&(se($),ze=!1),Oe=0},he=function(re,Be,ue){k[ue]+=re,V[ue]+=Be,$._vx.update(re),$._vy.update(Be),c?Oe||(Oe=requestAnimationFrame(ee)):ee()},Ae=function(re,Be){ne&&!Ye&&($.axis=Ye=Math.abs(re)>Math.abs(Be)?"x":"y",qe=!0),Ye!=="y"&&(k[2]+=re,$._vx.update(re,!0)),Ye!=="x"&&(V[2]+=Be,$._vy.update(Be,!0)),c?Oe||(Oe=requestAnimationFrame(ee)):ee()},ge=function(re){if(!ae(re,1)){re=ua(re,u);var Be=re.clientX,ue=re.clientY,ke=Be-$.x,Ce=ue-$.y,Ze=$.isDragging;$.x=Be,$.y=ue,(Ze||(ke||Ce)&&(Math.abs($.startX-Be)>=s||Math.abs($.startY-ue)>=s))&&(tt||(tt=Ze?2:1),Ze||($.isDragging=!0),Ae(ke,Ce))}},me=$.onPress=function(le){ae(le,1)||le&&le.button||($.axis=Ye=null,Te.pause(),$.isPressed=!0,le=ua(le),lt=We=0,$.startX=$.x=le.clientX,$.startY=$.y=le.clientY,$._vx.reset(),$._vy.reset(),Rn(q?o:x,Mi[1],ge,Qe,!0),$.deltaX=$.deltaY=0,y&&y($))},fe=$.onRelease=function(le){if(!ae(le,1)){An(q?o:x,Mi[1],ge,!0);var re=!isNaN($.y-$.startY),Be=$.isDragging,ue=Be&&(Math.abs($.x-$.startX)>3||Math.abs($.y-$.startY)>3),ke=ua(le);!ue&&re&&($._vx.reset(),$._vy.reset(),u&&oe&&fn.delayedCall(.08,function(){if(Da()-Z>300&&!le.defaultPrevented){if(le.target.click)le.target.click();else if(x.createEvent){var Ce=x.createEvent("MouseEvents");Ce.initMouseEvent("click",!0,!0,Qn,1,ke.screenX,ke.screenY,ke.clientX,ke.clientY,!1,!1,!1,!1,0,null),le.target.dispatchEvent(Ce)}}})),$.isDragging=$.isGesturing=$.isPressed=!1,h&&Be&&!q&&Te.restart(!0),tt&&ee(),m&&Be&&m($),M&&M($,ue)}},Pe=function(re){return re.touches&&re.touches.length>1&&($.isGesturing=!0)&&j(re,$.isDragging)},Ie=function(){return($.isGesturing=!1)||D($)},U=function(re){if(!ae(re)){var Be=Ge(),ue=Ke();he((Be-F)*Le,(ue-Ct)*Le,1),F=Be,Ct=ue,h&&Te.restart(!0)}},de=function(re){if(!ae(re)){re=ua(re,u),se&&(ze=!0);var Be=(re.deltaMode===1?l:re.deltaMode===2?Qn.innerHeight:1)*g;he(re.deltaX*Be,re.deltaY*Be,0),h&&!q&&Te.restart(!0)}},te=function(re){if(!ae(re)){var Be=re.clientX,ue=re.clientY,ke=Be-$.x,Ce=ue-$.y;$.x=Be,$.y=ue,Me=!0,h&&Te.restart(!0),(ke||Ce)&&Ae(ke,Ce)}},_e=function(re){$.event=re,H($)},xe=function(re){$.event=re,O($)},ie=function(re){return ae(re)||ua(re,u)&&He($)};Te=$._dc=fn.delayedCall(f||.25,J).pause(),$.deltaX=$.deltaY=0,$._vx=Wc(0,50,!0),$._vy=Wc(0,50,!0),$.scrollX=Ge,$.scrollY=Ke,$.isDragging=$.isGesturing=$.isPressed=!1,Np(this),$.enable=function(le){return $.isEnabled||(Rn(R?x:o,"scroll",Hc),a.indexOf("scroll")>=0&&Rn(R?x:o,"scroll",U,Qe,Q),a.indexOf("wheel")>=0&&Rn(o,"wheel",de,Qe,Q),(a.indexOf("touch")>=0&&Dp||a.indexOf("pointer")>=0)&&(Rn(o,Mi[0],me,Qe,Q),Rn(x,Mi[2],fe),Rn(x,Mi[3],fe),oe&&Rn(o,"click",ce,!0,!0),He&&Rn(o,"click",ie),j&&Rn(x,"gesturestart",Pe),D&&Rn(x,"gestureend",Ie),H&&Rn(o,Vr+"enter",_e),O&&Rn(o,Vr+"leave",xe),z&&Rn(o,Vr+"move",te)),$.isEnabled=!0,$.isDragging=$.isGesturing=$.isPressed=Me=tt=!1,$._vx.reset(),$._vy.reset(),F=Ge(),Ct=Ke(),le&&le.type&&me(le),pe&&pe($)),$},$.disable=function(){$.isEnabled&&(ks.filter(function(le){return le!==$&&La(le.target)}).length||An(R?x:o,"scroll",Hc),$.isPressed&&($._vx.reset(),$._vy.reset(),An(q?o:x,Mi[1],ge,!0)),An(R?x:o,"scroll",U,Q),An(o,"wheel",de,Q),An(o,Mi[0],me,Q),An(x,Mi[2],fe),An(x,Mi[3],fe),An(o,"click",ce,!0),An(o,"click",ie),An(x,"gesturestart",Pe),An(x,"gestureend",Ie),An(o,Vr+"enter",_e),An(o,Vr+"leave",xe),An(o,Vr+"move",te),$.isEnabled=$.isPressed=$.isDragging=!1,Ve&&Ve($))},$.kill=$.revert=function(){$.disable();var le=ks.indexOf($);le>=0&&ks.splice(le,1),ji===$&&(ji=0)},ks.push($),q&&La(o)&&(ji=$),$.enable(_)},C_(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r})();Xt.version="3.15.0";Xt.create=function(r){return new Xt(r)};Xt.register=Op;Xt.getAll=function(){return ks.slice()};Xt.getById=function(r){return ks.filter(function(e){return e.vars.id===r})[0]};Ip()&&fn.registerPlugin(Xt);var Re,Is,st,xt,jn,_t,cf,ml,Za,Na,Ma,lo,xn,Rl,Xc,Ln,ld,cd,Us,Bp,Hl,kp,Dn,Yc,zp,Gp,_r,qc,uf,Xs,ff,Ia,$c,Wl,co=1,vn=Date.now,Xl=vn(),gi=0,Sa=0,ud=function(e,t,n){var i=Kn(e)&&(e.substr(0,6)==="clamp("||e.indexOf("max")>-1);return n["_"+t+"Clamp"]=i,i?e.substr(6,e.length-7):e},fd=function(e,t){return t&&(!Kn(e)||e.substr(0,6)!=="clamp(")?"clamp("+e+")":e},L_=function r(){return Sa&&requestAnimationFrame(r)},dd=function(){return Rl=1},hd=function(){return Rl=0},Pi=function(e){return e},ba=function(e){return Math.round(e*1e5)/1e5||0},Vp=function(){return typeof window<"u"},Hp=function(){return Re||Vp()&&(Re=window.gsap)&&Re.registerPlugin&&Re},rs=function(e){return!!~cf.indexOf(e)},Wp=function(e){return(e==="Height"?ff:st["inner"+e])||jn["client"+e]||_t["client"+e]},Xp=function(e){return Ar(e,"getBoundingClientRect")||(rs(e)?function(){return el.width=st.innerWidth,el.height=ff,el}:function(){return Ki(e)})},N_=function(e,t,n){var i=n.d,s=n.d2,a=n.a;return(a=Ar(e,"getBoundingClientRect"))?function(){return a()[i]}:function(){return(t?Wp(s):e["client"+s])||0}},I_=function(e,t){return!t||~Oi.indexOf(e)?Xp(e):function(){return el}},Ii=function(e,t){var n=t.s,i=t.d2,s=t.d,a=t.a;return Math.max(0,(n="scroll"+i)&&(a=Ar(e,n))?a()-Xp(e)()[s]:rs(e)?(jn[n]||_t[n])-Wp(i):e[n]-e["offset"+i])},uo=function(e,t){for(var n=0;n<Us.length;n+=3)(!t||~t.indexOf(Us[n+1]))&&e(Us[n],Us[n+1],Us[n+2])},Kn=function(e){return typeof e=="string"},bn=function(e){return typeof e=="function"},ya=function(e){return typeof e=="number"},Hr=function(e){return typeof e=="object"},fa=function(e,t,n){return e&&e.progress(t?0:1)&&n&&e.pause()},gs=function(e,t,n){if(e.enabled){var i=e._ctx?e._ctx.add(function(){return t(e,n)}):t(e,n);i&&i.totalTime&&(e.callbackAnimation=i)}},_s=Math.abs,Yp="left",qp="top",df="right",hf="bottom",ts="width",ns="height",Ua="Right",Fa="Left",Oa="Top",Ba="Bottom",Zt="padding",ui="margin",ta="Width",pf="Height",Qt="px",fi=function(e){return st.getComputedStyle(e.nodeType===Node.DOCUMENT_NODE?e.scrollingElement:e)},U_=function(e){var t=fi(e).position;e.style.position=t==="absolute"||t==="fixed"?t:"relative"},pd=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},Ki=function(e,t){var n=t&&fi(e)[Xc]!=="matrix(1, 0, 0, 1, 0, 0)"&&Re.to(e,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=e.getBoundingClientRect?e.getBoundingClientRect():e.scrollingElement.getBoundingClientRect();return n&&n.progress(0).kill(),i},gl=function(e,t){var n=t.d2;return e["offset"+n]||e["client"+n]||0},$p=function(e){var t=[],n=e.labels,i=e.duration(),s;for(s in n)t.push(n[s]/i);return t},F_=function(e){return function(t){return Re.utils.snap($p(e),t)}},mf=function(e){var t=Re.utils.snap(e),n=Array.isArray(e)&&e.slice(0).sort(function(i,s){return i-s});return n?function(i,s,a){a===void 0&&(a=.001);var o;if(!s)return t(i);if(s>0){for(i-=a,o=0;o<n.length;o++)if(n[o]>=i)return n[o];return n[o-1]}else for(o=n.length,i+=a;o--;)if(n[o]<=i)return n[o];return n[0]}:function(i,s,a){a===void 0&&(a=.001);var o=t(i);return!s||Math.abs(o-i)<a||o-i<0==s<0?o:t(s<0?i-e:i+e)}},O_=function(e){return function(t,n){return mf($p(e))(t,n.direction)}},fo=function(e,t,n,i){return n.split(",").forEach(function(s){return e(t,s,i)})},cn=function(e,t,n,i,s){return e.addEventListener(t,n,{passive:!i,capture:!!s})},on=function(e,t,n,i){return e.removeEventListener(t,n,!!i)},ho=function(e,t,n){n=n&&n.wheelHandler,n&&(e(t,"wheel",n),e(t,"touchmove",n))},md={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},po={toggleActions:"play",anticipatePin:0},_l={top:0,left:0,center:.5,bottom:1,right:1},Zo=function(e,t){if(Kn(e)){var n=e.indexOf("="),i=~n?+(e.charAt(n-1)+1)*parseFloat(e.substr(n+1)):0;~n&&(e.indexOf("%")>n&&(i*=t/100),e=e.substr(0,n-1)),e=i+(e in _l?_l[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},mo=function(e,t,n,i,s,a,o,l){var c=s.startColor,u=s.endColor,h=s.fontSize,f=s.indent,d=s.fontWeight,g=xt.createElement("div"),_=rs(n)||Ar(n,"pinType")==="fixed",p=e.indexOf("scroller")!==-1,m=_?_t:n.tagName==="IFRAME"?n.contentDocument.body:n,b=e.indexOf("start")!==-1,y=b?c:u,M="border-color:"+y+";font-size:"+h+";color:"+y+";font-weight:"+d+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return M+="position:"+((p||l)&&_?"fixed;":"absolute;"),(p||l||!_)&&(M+=(i===en?df:hf)+":"+(a+parseFloat(f))+"px;"),o&&(M+="box-sizing:border-box;text-align:left;width:"+o.offsetWidth+"px;"),g._isStart=b,g.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),g.style.cssText=M,g.innerText=t||t===0?e+"-"+t:e,m.children[0]?m.insertBefore(g,m.children[0]):m.appendChild(g),g._offset=g["offset"+i.op.d2],jo(g,0,i,b),g},jo=function(e,t,n,i){var s={display:"block"},a=n[i?"os2":"p2"],o=n[i?"p2":"os2"];e._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+a+ta]=1,s["border"+o+ta]=0,s[n.p]=t+"px",Re.set(e,s)},it=[],Kc={},ja,gd=function(){return vn()-gi>34&&(ja||(ja=requestAnimationFrame(Qi)))},xs=function(){(!Dn||!Dn.isPressed||Dn.startX>_t.clientWidth)&&(at.cache++,Dn?ja||(ja=requestAnimationFrame(Qi)):Qi(),gi||as("scrollStart"),gi=vn())},Yl=function(){Gp=st.innerWidth,zp=st.innerHeight},Ea=function(e){at.cache++,(e===!0||!xn&&!kp&&!xt.fullscreenElement&&!xt.webkitFullscreenElement&&(!Yc||Gp!==st.innerWidth||Math.abs(st.innerHeight-zp)>st.innerHeight*.25))&&ml.restart(!0)},ss={},B_=[],Kp=function r(){return on(ot,"scrollEnd",r)||$r(!0)},as=function(e){return ss[e]&&ss[e].map(function(t){return t()})||B_},$n=[],Zp=function(e){for(var t=0;t<$n.length;t+=5)(!e||$n[t+4]&&$n[t+4].query===e)&&($n[t].style.cssText=$n[t+1],$n[t].getBBox&&$n[t].setAttribute("transform",$n[t+2]||""),$n[t+3].uncache=1)},jp=function(){return at.forEach(function(e){return bn(e)&&++e.cacheID&&(e.rec=e())})},gf=function(e,t){var n;for(Ln=0;Ln<it.length;Ln++)n=it[Ln],n&&(!t||n._ctx===t)&&(e?n.kill(1):n.revert(!0,!0));Ia=!0,t&&Zp(t),t||as("revert")},Jp=function(e,t){at.cache++,(t||!Nn)&&at.forEach(function(n){return bn(n)&&n.cacheID++&&(n.rec=0)}),Kn(e)&&(st.history.scrollRestoration=uf=e)},Nn,is=0,_d,k_=function(){if(_d!==is){var e=_d=is;requestAnimationFrame(function(){return e===is&&$r(!0)})}},Qp=function(){_t.appendChild(Xs),ff=!Dn&&Xs.offsetHeight||st.innerHeight,_t.removeChild(Xs)},xd=function(e){return Za(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(t){return t.style.display=e?"none":"block"})},$r=function(e,t){if(jn=xt.documentElement,_t=xt.body,cf=[st,xt,jn,_t],gi&&!e&&!Ia){cn(ot,"scrollEnd",Kp);return}Qp(),Nn=ot.isRefreshing=!0,Ia||jp();var n=as("refreshInit");Bp&&ot.sort(),t||gf(),at.forEach(function(i){bn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),it.slice(0).forEach(function(i){return i.refresh()}),Ia=!1,it.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",a=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-a),i.refresh()}}),$c=1,xd(!0),it.forEach(function(i){var s=Ii(i.scroller,i._dir),a=i.vars.end==="max"||i._endClamp&&i.end>s,o=i._startClamp&&i.start>=s;(a||o)&&i.setPositions(o?s-1:i.start,a?Math.max(o?s:i.start+1,s):i.end,!0)}),xd(!1),$c=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),at.forEach(function(i){bn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),Jp(uf,1),ml.pause(),is++,Nn=2,Qi(2),it.forEach(function(i){return bn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),Nn=ot.isRefreshing=!1,as("refresh")},Zc=0,Jo=1,ka,Qi=function(e){if(e===2||!Nn&&!Ia){ot.isUpdating=!0,ka&&ka.update(0);var t=it.length,n=vn(),i=n-Xl>=50,s=t&&it[0].scroll();if(Jo=Zc>s?-1:1,Nn||(Zc=s),i&&(gi&&!Rl&&n-gi>200&&(gi=0,as("scrollEnd")),Ma=Xl,Xl=n),Jo<0){for(Ln=t;Ln-- >0;)it[Ln]&&it[Ln].update(0,i);Jo=1}else for(Ln=0;Ln<t;Ln++)it[Ln]&&it[Ln].update(0,i);ot.isUpdating=!1}ja=0},jc=[Yp,qp,hf,df,ui+Ba,ui+Ua,ui+Oa,ui+Fa,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Qo=jc.concat([ts,ns,"boxSizing","max"+ta,"max"+pf,"position",ui,Zt,Zt+Oa,Zt+Ua,Zt+Ba,Zt+Fa]),z_=function(e,t,n){Ys(n);var i=e._gsap;if(i.spacerIsNative)Ys(i.spacerState);else if(e._gsap.swappedIn){var s=t.parentNode;s&&(s.insertBefore(e,t),s.removeChild(t))}e._gsap.swappedIn=!1},ql=function(e,t,n,i){if(!e._gsap.swappedIn){for(var s=jc.length,a=t.style,o=e.style,l;s--;)l=jc[s],a[l]=n[l];a.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(a.display="inline-block"),o[hf]=o[df]="auto",a.flexBasis=n.flexBasis||"auto",a.overflow="visible",a.boxSizing="border-box",a[ts]=gl(e,In)+Qt,a[ns]=gl(e,en)+Qt,a[Zt]=o[ui]=o[qp]=o[Yp]="0",Ys(i),o[ts]=o["max"+ta]=n[ts],o[ns]=o["max"+pf]=n[ns],o[Zt]=n[Zt],e.parentNode!==t&&(e.parentNode.insertBefore(t,e),t.appendChild(e)),e._gsap.swappedIn=!0}},G_=/([A-Z])/g,Ys=function(e){if(e){var t=e.t.style,n=e.length,i=0,s,a;for((e.t._gsap||Re.core.getCache(e.t)).uncache=1;i<n;i+=2)a=e[i+1],s=e[i],a?t[s]=a:t[s]&&t.removeProperty(s.replace(G_,"-$1").toLowerCase())}},go=function(e){for(var t=Qo.length,n=e.style,i=[],s=0;s<t;s++)i.push(Qo[s],n[Qo[s]]);return i.t=e,i},V_=function(e,t,n){for(var i=[],s=e.length,a=n?8:0,o;a<s;a+=2)o=e[a],i.push(o,o in t?t[o]:e[a+1]);return i.t=e.t,i},el={left:0,top:0},vd=function(e,t,n,i,s,a,o,l,c,u,h,f,d,g){bn(e)&&(e=e(l)),Kn(e)&&e.substr(0,3)==="max"&&(e=f+(e.charAt(4)==="="?Zo("0"+e.substr(3),n):0));var _=d?d.time():0,p,m,b;if(d&&d.seek(0),isNaN(e)||(e=+e),ya(e))d&&(e=Re.utils.mapRange(d.scrollTrigger.start,d.scrollTrigger.end,0,f,e)),o&&jo(o,n,i,!0);else{bn(t)&&(t=t(l));var y=(e||"0").split(" "),M,E,T,A;b=Fn(t,l)||_t,M=Ki(b)||{},(!M||!M.left&&!M.top)&&fi(b).display==="none"&&(A=b.style.display,b.style.display="block",M=Ki(b),A?b.style.display=A:b.style.removeProperty("display")),E=Zo(y[0],M[i.d]),T=Zo(y[1]||"0",n),e=M[i.p]-c[i.p]-u+E+s-T,o&&jo(o,T,i,n-T<20||o._isStart&&T>20),n-=n-T}if(g&&(l[g]=e||-.001,e<0&&(e=0)),a){var v=e+n,w=a._isStart;p="scroll"+i.d2,jo(a,v,i,w&&v>20||!w&&(h?Math.max(_t[p],jn[p]):a.parentNode[p])<=v+1),h&&(c=Ki(o),h&&(a.style[i.op.p]=c[i.op.p]-i.op.m-a._offset+Qt))}return d&&b&&(p=Ki(b),d.seek(f),m=Ki(b),d._caScrollDist=p[i.p]-m[i.p],e=e/d._caScrollDist*f),d&&d.seek(_),d?e:Math.round(e)},H_=/(webkit|moz|length|cssText|inset)/i,Md=function(e,t,n,i){if(e.parentNode!==t){var s=e.style,a,o;if(t===_t){e._stOrig=s.cssText,o=fi(e);for(a in o)!+a&&!H_.test(a)&&o[a]&&typeof s[a]=="string"&&a!=="0"&&(s[a]=o[a]);s.top=n,s.left=i}else s.cssText=e._stOrig;Re.core.getCache(e).uncache=1,t.appendChild(e)}},em=function(e,t,n){var i=t,s=i;return function(a){var o=Math.round(e());return o!==i&&o!==s&&Math.abs(o-i)>3&&Math.abs(o-s)>3&&(a=o,n&&n()),s=i,i=Math.round(a),i}},_o=function(e,t,n){var i={};i[t.p]="+="+n,Re.set(e,i)},Sd=function(e,t){var n=Dr(e,t),i="_scroll"+t.p2,s=function a(o,l,c,u,h){var f=a.tween,d=l.onComplete,g={};c=c||n();var _=em(n,c,function(){f.kill(),a.tween=0});return h=u&&h||0,u=u||o-c,f&&f.kill(),l[i]=o,l.inherit=!1,l.modifiers=g,g[i]=function(){return _(c+u*f.ratio+h*f.ratio*f.ratio)},l.onUpdate=function(){at.cache++,a.tween&&Qi()},l.onComplete=function(){a.tween=0,d&&d.call(f)},f=a.tween=Re.to(e,l),f};return e[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},cn(e,"wheel",n.wheelHandler),ot.isTouch&&cn(e,"touchmove",n.wheelHandler),s},ot=(function(){function r(t,n){Is||r.register(Re)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),qc(this),this.init(t,n)}var e=r.prototype;return e.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!Sa){this.update=this.refresh=this.kill=Pi;return}n=pd(Kn(n)||ya(n)||n.nodeType?{trigger:n}:n,po);var s=n,a=s.onUpdate,o=s.toggleClass,l=s.id,c=s.onToggle,u=s.onRefresh,h=s.scrub,f=s.trigger,d=s.pin,g=s.pinSpacing,_=s.invalidateOnRefresh,p=s.anticipatePin,m=s.onScrubComplete,b=s.onSnapComplete,y=s.once,M=s.snap,E=s.pinReparent,T=s.pinSpacer,A=s.containerAnimation,v=s.fastScrollEnd,w=s.preventOverlaps,C=n.horizontal||n.containerAnimation&&n.horizontal!==!1?In:en,L=!h&&h!==0,N=Fn(n.scroller||st),Y=Re.core.getCache(N),H=rs(N),O=("pinType"in n?n.pinType:Ar(N,"pinType")||H&&"fixed")==="fixed",z=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],I=L&&n.toggleActions.split(" "),q="markers"in n?n.markers:po.markers,j=H?0:parseFloat(fi(N)["border"+C.p2+ta])||0,D=this,se=n.onRefreshInit&&function(){return n.onRefreshInit(D)},pe=N_(N,H,C),Ve=I_(N,H),He=0,Le=0,Q=0,oe=Dr(N,C),ne,Ee,Oe,Te,tt,Me,ze,qe,Ye,$,lt,We,Qe,Ge,Ke,F,Ct,Xe,R,x,k,V,Z,ce,ae,J,ee,he,Ae,ge,me,fe,Pe,Ie,U,de,te,_e,xe;if(D._startClamp=D._endClamp=!1,D._dir=C,p*=45,D.scroller=N,D.scroll=A?A.time.bind(A):oe,Te=oe(),D.vars=n,i=i||n.animation,"refreshPriority"in n&&(Bp=1,n.refreshPriority===-9999&&(ka=D)),Y.tweenScroll=Y.tweenScroll||{top:Sd(N,en),left:Sd(N,In)},D.tweenTo=ne=Y.tweenScroll[C.p],D.scrubDuration=function(ue){Pe=ya(ue)&&ue,Pe?fe?fe.duration(ue):fe=Re.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:Pe,paused:!0,onComplete:function(){return m&&m(D)}}):(fe&&fe.progress(1).kill(),fe=0)},i&&(i.vars.lazy=!1,i._initted&&!D.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),D.animation=i.pause(),i.scrollTrigger=D,D.scrubDuration(h),ge=0,l||(l=i.vars.id)),M&&((!Hr(M)||M.push)&&(M={snapTo:M}),"scrollBehavior"in _t.style&&Re.set(H?[_t,jn]:N,{scrollBehavior:"auto"}),at.forEach(function(ue){return bn(ue)&&ue.target===(H?xt.scrollingElement||jn:N)&&(ue.smooth=!1)}),Oe=bn(M.snapTo)?M.snapTo:M.snapTo==="labels"?F_(i):M.snapTo==="labelsDirectional"?O_(i):M.directional!==!1?function(ue,ke){return mf(M.snapTo)(ue,vn()-Le<500?0:ke.direction)}:Re.utils.snap(M.snapTo),Ie=M.duration||{min:.1,max:2},Ie=Hr(Ie)?Na(Ie.min,Ie.max):Na(Ie,Ie),U=Re.delayedCall(M.delay||Pe/2||.1,function(){var ue=oe(),ke=vn()-Le<500,Ce=ne.tween;if((ke||Math.abs(D.getVelocity())<10)&&!Ce&&!Rl&&He!==ue){var Ze=(ue-Me)/Ge,qt=i&&!L?i.totalProgress():Ze,rt=ke?0:(qt-me)/(vn()-Ma)*1e3||0,Pt=Re.utils.clamp(-Ze,1-Ze,_s(rt/2)*rt/.185),rn=Ze+(M.inertia===!1?0:Pt),Dt,St,ut=M,Tn=ut.onStart,wt=ut.onInterrupt,pn=ut.onComplete;if(Dt=Oe(rn,D),ya(Dt)||(Dt=rn),St=Math.max(0,Math.round(Me+Dt*Ge)),ue<=ze&&ue>=Me&&St!==ue){if(Ce&&!Ce._initted&&Ce.data<=_s(St-ue))return;M.inertia===!1&&(Pt=Dt-Ze),ne(St,{duration:Ie(_s(Math.max(_s(rn-qt),_s(Dt-qt))*.185/rt/.05||0)),ease:M.ease||"power3",data:_s(St-ue),onInterrupt:function(){return U.restart(!0)&&wt&&gs(D,wt)},onComplete:function(){D.update(),He=oe(),i&&!L&&(fe?fe.resetTo("totalProgress",Dt,i._tTime/i._tDur):i.progress(Dt)),ge=me=i&&!L?i.totalProgress():D.progress,b&&b(D),pn&&gs(D,pn)}},ue,Pt*Ge,St-ue-Pt*Ge),Tn&&gs(D,Tn,ne.tween)}}else D.isActive&&He!==ue&&U.restart(!0)}).pause()),l&&(Kc[l]=D),f=D.trigger=Fn(f||d!==!0&&d),xe=f&&f._gsap&&f._gsap.stRevert,xe&&(xe=xe(D)),d=d===!0?f:Fn(d),Kn(o)&&(o={targets:f,className:o}),d&&(g===!1||g===ui||(g=!g&&d.parentNode&&d.parentNode.style&&fi(d.parentNode).display==="flex"?!1:Zt),D.pin=d,Ee=Re.core.getCache(d),Ee.spacer?Ke=Ee.pinState:(T&&(T=Fn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),Ee.spacerIsNative=!!T,T&&(Ee.spacerState=go(T))),Ee.spacer=Xe=T||xt.createElement("div"),Xe.classList.add("pin-spacer"),l&&Xe.classList.add("pin-spacer-"+l),Ee.pinState=Ke=go(d)),n.force3D!==!1&&Re.set(d,{force3D:!0}),D.spacer=Xe=Ee.spacer,Ae=fi(d),ce=Ae[g+C.os2],x=Re.getProperty(d),k=Re.quickSetter(d,C.a,Qt),ql(d,Xe,Ae),Ct=go(d)),q){We=Hr(q)?pd(q,md):md,$=mo("scroller-start",l,N,C,We,0),lt=mo("scroller-end",l,N,C,We,0,$),R=$["offset"+C.op.d2];var ie=Fn(Ar(N,"content")||N);qe=this.markerStart=mo("start",l,ie,C,We,R,0,A),Ye=this.markerEnd=mo("end",l,ie,C,We,R,0,A),A&&(_e=Re.quickSetter([qe,Ye],C.a,Qt)),!O&&!(Oi.length&&Ar(N,"fixedMarkers")===!0)&&(U_(H?_t:N),Re.set([$,lt],{force3D:!0}),J=Re.quickSetter($,C.a,Qt),he=Re.quickSetter(lt,C.a,Qt))}if(A){var le=A.vars.onUpdate,re=A.vars.onUpdateParams;A.eventCallback("onUpdate",function(){D.update(0,0,1),le&&le.apply(A,re||[])})}if(D.previous=function(){return it[it.indexOf(D)-1]},D.next=function(){return it[it.indexOf(D)+1]},D.revert=function(ue,ke){if(!ke)return D.kill(!0);var Ce=ue!==!1||!D.enabled,Ze=xn;Ce!==D.isReverted&&(Ce&&(de=Math.max(oe(),D.scroll.rec||0),Q=D.progress,te=i&&i.progress()),qe&&[qe,Ye,$,lt].forEach(function(qt){return qt.style.display=Ce?"none":"block"}),Ce&&(xn=D,D.update(Ce)),d&&(!E||!D.isActive)&&(Ce?z_(d,Xe,Ke):ql(d,Xe,fi(d),ae)),Ce||D.update(Ce),xn=Ze,D.isReverted=Ce)},D.refresh=function(ue,ke,Ce,Ze){if(!((xn||!D.enabled)&&!ke)){if(d&&ue&&gi){cn(r,"scrollEnd",Kp);return}!Nn&&se&&se(D),xn=D,ne.tween&&!Ce&&(ne.tween.kill(),ne.tween=0),fe&&fe.pause(),_&&i&&(i.revert({kill:!1}).invalidate(),i.getChildren?i.getChildren(!0,!0,!1).forEach(function(Se){return Se.vars.immediateRender&&Se.render(0,!0,!0)}):i.vars.immediateRender&&i.render(0,!0,!0)),D.isReverted||D.revert(!0,!0),D._subPinOffset=!1;var qt=pe(),rt=Ve(),Pt=A?A.duration():Ii(N,C),rn=Ge<=.01||!Ge,Dt=0,St=Ze||0,ut=Hr(Ce)?Ce.end:n.end,Tn=n.endTrigger||f,wt=Hr(Ce)?Ce.start:n.start||(n.start===0||!f?0:d?"0 0":"0 100%"),pn=D.pinnedContainer=n.pinnedContainer&&Fn(n.pinnedContainer,D),wn=f&&Math.max(0,it.indexOf(D))||0,$t=wn,Ot,Jt,Ti,ds,sn,Gt,si,S,B,K,G,W,ve;for(q&&Hr(Ce)&&(W=Re.getProperty($,C.p),ve=Re.getProperty(lt,C.p));$t-- >0;)Gt=it[$t],Gt.end||Gt.refresh(0,1)||(xn=D),si=Gt.pin,si&&(si===f||si===d||si===pn)&&!Gt.isReverted&&(K||(K=[]),K.unshift(Gt),Gt.revert(!0,!0)),Gt!==it[$t]&&(wn--,$t--);for(bn(wt)&&(wt=wt(D)),wt=ud(wt,"start",D),Me=vd(wt,f,qt,C,oe(),qe,$,D,rt,j,O,Pt,A,D._startClamp&&"_startClamp")||(d?-.001:0),bn(ut)&&(ut=ut(D)),Kn(ut)&&!ut.indexOf("+=")&&(~ut.indexOf(" ")?ut=(Kn(wt)?wt.split(" ")[0]:"")+ut:(Dt=Zo(ut.substr(2),qt),ut=Kn(wt)?wt:(A?Re.utils.mapRange(0,A.duration(),A.scrollTrigger.start,A.scrollTrigger.end,Me):Me)+Dt,Tn=f)),ut=ud(ut,"end",D),ze=Math.max(Me,vd(ut||(Tn?"100% 0":Pt),Tn,qt,C,oe()+Dt,Ye,lt,D,rt,j,O,Pt,A,D._endClamp&&"_endClamp"))||-.001,Dt=0,$t=wn;$t--;)Gt=it[$t]||{},si=Gt.pin,si&&Gt.start-Gt._pinPush<=Me&&!A&&Gt.end>0&&(Ot=Gt.end-(D._startClamp?Math.max(0,Gt.start):Gt.start),(si===f&&Gt.start-Gt._pinPush<Me||si===pn)&&isNaN(wt)&&(Dt+=Ot*(1-Gt.progress)),si===d&&(St+=Ot));if(Me+=Dt,ze+=Dt,D._startClamp&&(D._startClamp+=Dt),D._endClamp&&!Nn&&(D._endClamp=ze||-.001,ze=Math.min(ze,Ii(N,C))),Ge=ze-Me||(Me-=.01)&&.001,rn&&(Q=Re.utils.clamp(0,1,Re.utils.normalize(Me,ze,de))),D._pinPush=St,qe&&Dt&&(Ot={},Ot[C.a]="+="+Dt,pn&&(Ot[C.p]="-="+oe()),Re.set([qe,Ye],Ot)),d&&!($c&&D.end>=Ii(N,C)))Ot=fi(d),ds=C===en,Ti=oe(),V=parseFloat(x(C.a))+St,!Pt&&ze>1&&(G=(H?xt.scrollingElement||jn:N).style,G={style:G,value:G["overflow"+C.a.toUpperCase()]},H&&fi(_t)["overflow"+C.a.toUpperCase()]!=="scroll"&&(G.style["overflow"+C.a.toUpperCase()]="scroll")),ql(d,Xe,Ot),Ct=go(d),Jt=Ki(d,!0),S=O&&Dr(N,ds?In:en)(),g?(ae=[g+C.os2,Ge+St+Qt],ae.t=Xe,$t=g===Zt?gl(d,C)+Ge+St:0,$t&&(ae.push(C.d,$t+Qt),Xe.style.flexBasis!=="auto"&&(Xe.style.flexBasis=$t+Qt)),Ys(ae),pn&&it.forEach(function(Se){Se.pin===pn&&Se.vars.pinSpacing!==!1&&(Se._subPinOffset=!0)}),O&&oe(de)):($t=gl(d,C),$t&&Xe.style.flexBasis!=="auto"&&(Xe.style.flexBasis=$t+Qt)),O&&(sn={top:Jt.top+(ds?Ti-Me:S)+Qt,left:Jt.left+(ds?S:Ti-Me)+Qt,boxSizing:"border-box",position:"fixed"},sn[ts]=sn["max"+ta]=Math.ceil(Jt.width)+Qt,sn[ns]=sn["max"+pf]=Math.ceil(Jt.height)+Qt,sn[ui]=sn[ui+Oa]=sn[ui+Ua]=sn[ui+Ba]=sn[ui+Fa]="0",sn[Zt]=Ot[Zt],sn[Zt+Oa]=Ot[Zt+Oa],sn[Zt+Ua]=Ot[Zt+Ua],sn[Zt+Ba]=Ot[Zt+Ba],sn[Zt+Fa]=Ot[Zt+Fa],F=V_(Ke,sn,E),Nn&&oe(0)),i?(B=i._initted,Hl(1),i.render(i.duration(),!0,!0),Z=x(C.a)-V+Ge+St,ee=Math.abs(Ge-Z)>1,O&&ee&&F.splice(F.length-2,2),i.render(0,!0,!0),B||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),Hl(0)):Z=Ge,G&&(G.value?G.style["overflow"+C.a.toUpperCase()]=G.value:G.style.removeProperty("overflow-"+C.a));else if(f&&oe()&&!A)for(Jt=f.parentNode;Jt&&Jt!==_t;)Jt._pinOffset&&(Me-=Jt._pinOffset,ze-=Jt._pinOffset),Jt=Jt.parentNode;K&&K.forEach(function(Se){return Se.revert(!1,!0)}),D.start=Me,D.end=ze,Te=tt=Nn?de:oe(),!A&&!Nn&&(Te<de&&oe(de),D.scroll.rec=0),D.revert(!1,!0),Le=vn(),U&&(He=-1,U.restart(!0)),xn=0,i&&L&&(i._initted||te)&&i.progress()!==te&&i.progress(te||0,!0).render(i.time(),!0,!0),(rn||Q!==D.progress||A||_||i&&!i._initted)&&(i&&!L&&(i._initted||Q||i.vars.immediateRender!==!1)&&i.totalProgress(A&&Me<-.001&&!Q?Re.utils.normalize(Me,ze,0):Q,!0),D.progress=rn||(Te-Me)/Ge===Q?0:Q),d&&g&&(Xe._pinOffset=Math.round(D.progress*Z)),fe&&fe.invalidate(),isNaN(W)||(W-=Re.getProperty($,C.p),ve-=Re.getProperty(lt,C.p),_o($,C,W),_o(qe,C,W-(Ze||0)),_o(lt,C,ve),_o(Ye,C,ve-(Ze||0))),rn&&!Nn&&D.update(),u&&!Nn&&!Qe&&(Qe=!0,u(D),Qe=!1)}},D.getVelocity=function(){return(oe()-tt)/(vn()-Ma)*1e3||0},D.endAnimation=function(){fa(D.callbackAnimation),i&&(fe?fe.progress(1):i.paused()?L||fa(i,D.direction<0,1):fa(i,i.reversed()))},D.labelToScroll=function(ue){return i&&i.labels&&(Me||D.refresh()||Me)+i.labels[ue]/i.duration()*Ge||0},D.getTrailing=function(ue){var ke=it.indexOf(D),Ce=D.direction>0?it.slice(0,ke).reverse():it.slice(ke+1);return(Kn(ue)?Ce.filter(function(Ze){return Ze.vars.preventOverlaps===ue}):Ce).filter(function(Ze){return D.direction>0?Ze.end<=Me:Ze.start>=ze})},D.update=function(ue,ke,Ce){if(!(A&&!Ce&&!ue)){var Ze=Nn===!0?de:D.scroll(),qt=ue?0:(Ze-Me)/Ge,rt=qt<0?0:qt>1?1:qt||0,Pt=D.progress,rn,Dt,St,ut,Tn,wt,pn,wn;if(ke&&(tt=Te,Te=A?oe():Ze,M&&(me=ge,ge=i&&!L?i.totalProgress():rt)),p&&d&&!xn&&!co&&gi&&(!rt&&Me<Ze+(Ze-tt)/(vn()-Ma)*p?rt=1e-4:rt===1&&ze>Ze+(Ze-tt)/(vn()-Ma)*p&&(rt=.9999)),rt!==Pt&&D.enabled){if(rn=D.isActive=!!rt&&rt<1,Dt=!!Pt&&Pt<1,wt=rn!==Dt,Tn=wt||!!rt!=!!Pt,D.direction=rt>Pt?1:-1,D.progress=rt,Tn&&!xn&&(St=rt&&!Pt?0:rt===1?1:Pt===1?2:3,L&&(ut=!wt&&I[St+1]!=="none"&&I[St+1]||I[St],wn=i&&(ut==="complete"||ut==="reset"||ut in i))),w&&(wt||wn)&&(wn||h||!i)&&(bn(w)?w(D):D.getTrailing(w).forEach(function(Ti){return Ti.endAnimation()})),L||(fe&&!xn&&!co?(fe._dp._time-fe._start!==fe._time&&fe.render(fe._dp._time-fe._start),fe.resetTo?fe.resetTo("totalProgress",rt,i._tTime/i._tDur):(fe.vars.totalProgress=rt,fe.invalidate().restart())):i&&i.totalProgress(rt,!!(xn&&(Le||ue)))),d){if(ue&&g&&(Xe.style[g+C.os2]=ce),!O)k(ba(V+Z*rt));else if(Tn){if(pn=!ue&&rt>Pt&&ze+1>Ze&&Ze+1>=Ii(N,C),E)if(!ue&&(rn||pn)){var $t=Ki(d,!0),Ot=Ze-Me;Md(d,_t,$t.top+(C===en?Ot:0)+Qt,$t.left+(C===en?0:Ot)+Qt)}else Md(d,Xe);Ys(rn||pn?F:Ct),ee&&rt<1&&rn||k(V+(rt===1&&!pn?Z:0))}}M&&!ne.tween&&!xn&&!co&&U.restart(!0),o&&(wt||y&&rt&&(rt<1||!Wl))&&Za(o.targets).forEach(function(Ti){return Ti.classList[rn||y?"add":"remove"](o.className)}),a&&!L&&!ue&&a(D),Tn&&!xn?(L&&(wn&&(ut==="complete"?i.pause().totalProgress(1):ut==="reset"?i.restart(!0).pause():ut==="restart"?i.restart(!0):i[ut]()),a&&a(D)),(wt||!Wl)&&(c&&wt&&gs(D,c),z[St]&&gs(D,z[St]),y&&(rt===1?D.kill(!1,1):z[St]=0),wt||(St=rt===1?1:3,z[St]&&gs(D,z[St]))),v&&!rn&&Math.abs(D.getVelocity())>(ya(v)?v:2500)&&(fa(D.callbackAnimation),fe?fe.progress(1):fa(i,ut==="reverse"?1:!rt,1))):L&&a&&!xn&&a(D)}if(he){var Jt=A?Ze/A.duration()*(A._caScrollDist||0):Ze;J(Jt+($._isFlipped?1:0)),he(Jt)}_e&&_e(-Ze/A.duration()*(A._caScrollDist||0))}},D.enable=function(ue,ke){D.enabled||(D.enabled=!0,cn(N,"resize",Ea),H||cn(N,"scroll",xs),se&&cn(r,"refreshInit",se),ue!==!1&&(D.progress=Q=0,Te=tt=He=oe()),ke!==!1&&D.refresh())},D.getTween=function(ue){return ue&&ne?ne.tween:fe},D.setPositions=function(ue,ke,Ce,Ze){if(A){var qt=A.scrollTrigger,rt=A.duration(),Pt=qt.end-qt.start;ue=qt.start+Pt*ue/rt,ke=qt.start+Pt*ke/rt}D.refresh(!1,!1,{start:fd(ue,Ce&&!!D._startClamp),end:fd(ke,Ce&&!!D._endClamp)},Ze),D.update()},D.adjustPinSpacing=function(ue){if(ae&&ue){var ke=ae.indexOf(C.d)+1;ae[ke]=parseFloat(ae[ke])+ue+Qt,ae[1]=parseFloat(ae[1])+ue+Qt,Ys(ae)}},D.disable=function(ue,ke){if(ue!==!1&&D.revert(!0,!0),D.enabled&&(D.enabled=D.isActive=!1,ke||fe&&fe.pause(),de=0,Ee&&(Ee.uncache=1),se&&on(r,"refreshInit",se),U&&(U.pause(),ne.tween&&ne.tween.kill()&&(ne.tween=0)),!H)){for(var Ce=it.length;Ce--;)if(it[Ce].scroller===N&&it[Ce]!==D)return;on(N,"resize",Ea),H||on(N,"scroll",xs)}},D.kill=function(ue,ke){D.disable(ue,ke),fe&&!ke&&fe.kill(),l&&delete Kc[l];var Ce=it.indexOf(D);Ce>=0&&it.splice(Ce,1),Ce===Ln&&Jo>0&&Ln--,Ce=0,it.forEach(function(Ze){return Ze.scroller===D.scroller&&(Ce=1)}),Ce||Nn||(D.scroll.rec=0),i&&(i.scrollTrigger=null,ue&&i.revert({kill:!1}),ke||i.kill()),qe&&[qe,Ye,$,lt].forEach(function(Ze){return Ze.parentNode&&Ze.parentNode.removeChild(Ze)}),ka===D&&(ka=0),d&&(Ee&&(Ee.uncache=1),Ce=0,it.forEach(function(Ze){return Ze.pin===d&&Ce++}),Ce||(Ee.spacer=0)),n.onKill&&n.onKill(D)},it.push(D),D.enable(!1,!1),xe&&xe(D),i&&i.add&&!Ge){var Be=D.update;D.update=function(){D.update=Be,at.cache++,Me||ze||D.refresh()},Re.delayedCall(.01,D.update),Ge=.01,Me=ze=0}else D.refresh();d&&k_()},r.register=function(n){return Is||(Re=n||Hp(),Vp()&&window.document&&r.enable(),Is=Sa),Is},r.defaults=function(n){if(n)for(var i in n)po[i]=n[i];return po},r.disable=function(n,i){Sa=0,it.forEach(function(a){return a[i?"kill":"disable"](n)}),on(st,"wheel",xs),on(xt,"scroll",xs),clearInterval(lo),on(xt,"touchcancel",Pi),on(_t,"touchstart",Pi),fo(on,xt,"pointerdown,touchstart,mousedown",dd),fo(on,xt,"pointerup,touchend,mouseup",hd),ml.kill(),uo(on);for(var s=0;s<at.length;s+=3)ho(on,at[s],at[s+1]),ho(on,at[s],at[s+2])},r.enable=function(){if(st=window,xt=document,jn=xt.documentElement,_t=xt.body,Re){if(Za=Re.utils.toArray,Na=Re.utils.clamp,qc=Re.core.context||Pi,Hl=Re.core.suppressOverwrites||Pi,uf=st.history.scrollRestoration||"auto",Zc=st.pageYOffset||0,Re.core.globals("ScrollTrigger",r),_t){Sa=1,Xs=document.createElement("div"),Xs.style.height="100vh",Xs.style.position="absolute",Qp(),L_(),Xt.register(Re),r.isTouch=Xt.isTouch,_r=Xt.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),Yc=Xt.isTouch===1,cn(st,"wheel",xs),cf=[st,xt,jn,_t],Re.matchMedia?(r.matchMedia=function(u){var h=Re.matchMedia(),f;for(f in u)h.add(f,u[f]);return h},Re.addEventListener("matchMediaInit",function(){jp(),gf()}),Re.addEventListener("matchMediaRevert",function(){return Zp()}),Re.addEventListener("matchMedia",function(){$r(0,1),as("matchMedia")}),Re.matchMedia().add("(orientation: portrait)",function(){return Yl(),Yl})):console.warn("Requires GSAP 3.11.0 or later"),Yl(),cn(xt,"scroll",xs);var n=_t.hasAttribute("style"),i=_t.style,s=i.borderTopStyle,a=Re.core.Animation.prototype,o,l;for(a.revert||Object.defineProperty(a,"revert",{value:function(){return this.time(-.01,!0)}}),i.borderTopStyle="solid",o=Ki(_t),en.m=Math.round(o.top+en.sc())||0,In.m=Math.round(o.left+In.sc())||0,s?i.borderTopStyle=s:i.removeProperty("border-top-style"),n||(_t.setAttribute("style",""),_t.removeAttribute("style")),lo=setInterval(gd,250),Re.delayedCall(.5,function(){return co=0}),cn(xt,"touchcancel",Pi),cn(_t,"touchstart",Pi),fo(cn,xt,"pointerdown,touchstart,mousedown",dd),fo(cn,xt,"pointerup,touchend,mouseup",hd),Xc=Re.utils.checkPrefix("transform"),Qo.push(Xc),Is=vn(),ml=Re.delayedCall(.2,$r).pause(),Us=[xt,"visibilitychange",function(){var u=st.innerWidth,h=st.innerHeight;xt.hidden?(ld=u,cd=h):(ld!==u||cd!==h)&&Ea()},xt,"DOMContentLoaded",$r,st,"load",$r,st,"resize",Ea],uo(cn),it.forEach(function(u){return u.enable(0,1)}),l=0;l<at.length;l+=3)ho(on,at[l],at[l+1]),ho(on,at[l],at[l+2])}else if(xt){var c=function u(){r.enable(),xt.removeEventListener("DOMContentLoaded",u)};xt.addEventListener("DOMContentLoaded",c)}}},r.config=function(n){"limitCallbacks"in n&&(Wl=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(lo)||(lo=i)&&setInterval(gd,i),"ignoreMobileResize"in n&&(Yc=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(uo(on)||uo(cn,n.autoRefreshEvents||"none"),kp=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=Fn(n),a=at.indexOf(s),o=rs(s);~a&&at.splice(a,o?6:2),i&&(o?Oi.unshift(st,i,_t,i,jn,i):Oi.unshift(s,i))},r.clearMatchMedia=function(n){it.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var a=(Kn(n)?Fn(n):n).getBoundingClientRect(),o=a[s?ts:ns]*i||0;return s?a.right-o>0&&a.left+o<st.innerWidth:a.bottom-o>0&&a.top+o<st.innerHeight},r.positionInViewport=function(n,i,s){Kn(n)&&(n=Fn(n));var a=n.getBoundingClientRect(),o=a[s?ts:ns],l=i==null?o/2:i in _l?_l[i]*o:~i.indexOf("%")?parseFloat(i)*o/100:parseFloat(i)||0;return s?(a.left+l)/st.innerWidth:(a.top+l)/st.innerHeight},r.killAll=function(n){if(it.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=ss.killAll||[];ss={},i.forEach(function(s){return s()})}},r})();ot.version="3.15.0";ot.saveStyles=function(r){return r?Za(r).forEach(function(e){if(e&&e.style){var t=$n.indexOf(e);t>=0&&$n.splice(t,5),$n.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),Re.core.getCache(e),qc())}}):$n};ot.revert=function(r,e){return gf(!r,e)};ot.create=function(r,e){return new ot(r,e)};ot.refresh=function(r){return r?Ea(!0):(Is||ot.register())&&$r(!0)};ot.update=function(r){return++at.cache&&Qi(r===!0?2:0)};ot.clearScrollMemory=Jp;ot.maxScroll=function(r,e){return Ii(r,e?In:en)};ot.getScrollFunc=function(r,e){return Dr(Fn(r),e?In:en)};ot.getById=function(r){return Kc[r]};ot.getAll=function(){return it.filter(function(r){return r.vars.id!=="ScrollSmoother"})};ot.isScrolling=function(){return!!gi};ot.snapDirectional=mf;ot.addEventListener=function(r,e){var t=ss[r]||(ss[r]=[]);~t.indexOf(e)||t.push(e)};ot.removeEventListener=function(r,e){var t=ss[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)};ot.batch=function(r,e){var t=[],n={},i=e.interval||.016,s=e.batchMax||1e9,a=function(c,u){var h=[],f=[],d=Re.delayedCall(i,function(){u(h,f),h=[],f=[]}).pause();return function(g){h.length||d.restart(!0),h.push(g.trigger),f.push(g),s<=h.length&&d.progress(1)}},o;for(o in e)n[o]=o.substr(0,2)==="on"&&bn(e[o])&&o!=="onRefreshInit"?a(o,e[o]):e[o];return bn(s)&&(s=s(),cn(ot,"refresh",function(){return s=e.batchMax()})),Za(r).forEach(function(l){var c={};for(o in n)c[o]=n[o];c.trigger=l,t.push(ot.create(c))}),t};var bd=function(e,t,n,i){return t>i?e(i):t<0&&e(0),n>i?(i-t)/(n-t):n<0?t/(t-n):1},$l=function r(e,t){t===!0?e.style.removeProperty("touch-action"):e.style.touchAction=t===!0?"auto":t?"pan-"+t+(Xt.isTouch?" pinch-zoom":""):"none",e===jn&&r(_t,t)},xo={auto:1,scroll:1},W_=function(e){var t=e.event,n=e.target,i=e.axis,s=(t.changedTouches?t.changedTouches[0]:t).target,a=s._gsap||Re.core.getCache(s),o=vn(),l;if(!a._isScrollT||o-a._isScrollT>2e3){for(;s&&s!==_t&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(xo[(l=fi(s)).overflowY]||xo[l.overflowX]));)s=s.parentNode;a._isScroll=s&&s!==n&&!rs(s)&&(xo[(l=fi(s)).overflowY]||xo[l.overflowX]),a._isScrollT=o}(a._isScroll||i==="x")&&(t.stopPropagation(),t._gsapAllow=!0)},tm=function(e,t,n,i){return Xt.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:i=i&&W_,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&cn(xt,Xt.eventTypes[0],Ed,!1,!0)},onDisable:function(){return on(xt,Xt.eventTypes[0],Ed,!0)}})},X_=/(input|label|select|textarea)/i,yd,Ed=function(e){var t=X_.test(e.target.tagName);(t||yd)&&(e._gsapAllow=!0,yd=t)},Y_=function(e){Hr(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t=e,n=t.normalizeScrollX,i=t.momentum,s=t.allowNestedScroll,a=t.onRelease,o,l,c=Fn(e.target)||jn,u=Re.core.globals().ScrollSmoother,h=u&&u.get(),f=_r&&(e.content&&Fn(e.content)||h&&e.content!==!1&&!h.smooth()&&h.content()),d=Dr(c,en),g=Dr(c,In),_=1,p=(Xt.isTouch&&st.visualViewport?st.visualViewport.scale*st.visualViewport.width:st.outerWidth)/st.innerWidth,m=0,b=bn(i)?function(){return i(o)}:function(){return i||2.8},y,M,E=tm(c,e.type,!0,s),T=function(){return M=!1},A=Pi,v=Pi,w=function(){l=Ii(c,en),v=Na(_r?1:0,l),n&&(A=Na(0,Ii(c,In))),y=is},C=function(){f._gsap.y=ba(parseFloat(f._gsap.y)+d.offset)+"px",f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(f._gsap.y)+", 0, 1)",d.offset=d.cacheID=0},L=function(){if(M){requestAnimationFrame(T);var q=ba(o.deltaY/2),j=v(d.v-q);if(f&&j!==d.v+d.offset){d.offset=j-d.v;var D=ba((parseFloat(f&&f._gsap.y)||0)-d.offset);f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+D+", 0, 1)",f._gsap.y=D+"px",d.cacheID=at.cache,Qi()}return!0}d.offset&&C(),M=!0},N,Y,H,O,z=function(){w(),N.isActive()&&N.vars.scrollY>l&&(d()>l?N.progress(1)&&d(l):N.resetTo("scrollY",l))};return f&&Re.set(f,{y:"+=0"}),e.ignoreCheck=function(I){return _r&&I.type==="touchmove"&&L()||_>1.05&&I.type!=="touchstart"||o.isGesturing||I.touches&&I.touches.length>1},e.onPress=function(){M=!1;var I=_;_=ba((st.visualViewport&&st.visualViewport.scale||1)/p),N.pause(),I!==_&&$l(c,_>1.01?!0:n?!1:"x"),Y=g(),H=d(),w(),y=is},e.onRelease=e.onGestureStart=function(I,q){if(d.offset&&C(),!q)O.restart(!0);else{at.cache++;var j=b(),D,se;n&&(D=g(),se=D+j*.05*-I.velocityX/.227,j*=bd(g,D,se,Ii(c,In)),N.vars.scrollX=A(se)),D=d(),se=D+j*.05*-I.velocityY/.227,j*=bd(d,D,se,Ii(c,en)),N.vars.scrollY=v(se),N.invalidate().duration(j).play(.01),(_r&&N.vars.scrollY>=l||D>=l-1)&&Re.to({},{onUpdate:z,duration:j})}a&&a(I)},e.onWheel=function(){N._ts&&N.pause(),vn()-m>1e3&&(y=0,m=vn())},e.onChange=function(I,q,j,D,se){if(is!==y&&w(),q&&n&&g(A(D[2]===q?Y+(I.startX-I.x):g()+q-D[1])),j){d.offset&&C();var pe=se[2]===j,Ve=pe?H+I.startY-I.y:d()+j-se[1],He=v(Ve);pe&&Ve!==He&&(H+=He-Ve),d(He)}(j||q)&&Qi()},e.onEnable=function(){$l(c,n?!1:"x"),ot.addEventListener("refresh",z),cn(st,"resize",z),d.smooth&&(d.target.style.scrollBehavior="auto",d.smooth=g.smooth=!1),E.enable()},e.onDisable=function(){$l(c,!0),on(st,"resize",z),ot.removeEventListener("refresh",z),E.kill()},e.lockAxis=e.lockAxis!==!1,o=new Xt(e),o.iOS=_r,_r&&!d()&&d(1),_r&&Re.ticker.add(Pi),O=o._dc,N=Re.to(o,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:em(d,d(),function(){return N.pause()})},onUpdate:Qi,onComplete:O.vars.onComplete}),o};ot.sort=function(r){if(bn(r))return it.sort(r);var e=st.pageYOffset||0;return ot.getAll().forEach(function(t){return t._sortY=t.trigger?e+t.trigger.getBoundingClientRect().top:t.start+st.innerHeight}),it.sort(r||function(t,n){return(t.vars.refreshPriority||0)*-1e6+(t.vars.containerAnimation?1e6:t._sortY)-((n.vars.containerAnimation?1e6:n._sortY)+(n.vars.refreshPriority||0)*-1e6)})};ot.observe=function(r){return new Xt(r)};ot.normalizeScroll=function(r){if(typeof r>"u")return Dn;if(r===!0&&Dn)return Dn.enable();if(r===!1){Dn&&Dn.kill(),Dn=r;return}var e=r instanceof Xt?r:Y_(r);return Dn&&Dn.target===e.target&&Dn.kill(),rs(e.target)&&(Dn=e),e};ot.core={_getVelocityProp:Wc,_inputObserver:tm,_scrollers:at,_proxies:Oi,bridge:{ss:function(){gi||as("scrollStart"),gi=vn()},ref:function(){return xn}}};Hp()&&Re.registerPlugin(ot);Lt.registerPlugin(ot);const _f="185",q_=0,Td=1,$_=2,tl=1,K_=2,Ta=3,Lr=0,Vn=1,Zi=2,er=0,qs=1,Jc=2,wd=3,Ad=4,Z_=5,Xr=100,j_=101,J_=102,Q_=103,e0=104,t0=200,n0=201,i0=202,r0=203,Qc=204,eu=205,s0=206,a0=207,o0=208,l0=209,c0=210,u0=211,f0=212,d0=213,h0=214,tu=0,nu=1,iu=2,na=3,ru=4,su=5,au=6,ou=7,nm=0,p0=1,m0=2,Bi=0,im=1,rm=2,sm=3,am=4,om=5,lm=6,cm=7,um=300,os=301,ia=302,Kl=303,Zl=304,Cl=306,lu=1e3,Ji=1001,cu=1002,dn=1003,g0=1004,vo=1005,yn=1006,jl=1007,Kr=1008,hi=1009,fm=1010,dm=1011,Ja=1012,xf=1013,Gi=1014,Ui=1015,sr=1016,vf=1017,Mf=1018,Qa=1020,hm=35902,pm=35899,mm=1021,gm=1022,bi=1023,ar=1026,Zr=1027,_m=1028,Sf=1029,ls=1030,bf=1031,yf=1033,nl=33776,il=33777,rl=33778,sl=33779,uu=35840,fu=35841,du=35842,hu=35843,pu=36196,mu=37492,gu=37496,_u=37488,xu=37489,xl=37490,vu=37491,Mu=37808,Su=37809,bu=37810,yu=37811,Eu=37812,Tu=37813,wu=37814,Au=37815,Ru=37816,Cu=37817,Pu=37818,Du=37819,Lu=37820,Nu=37821,Iu=36492,Uu=36494,Fu=36495,Ou=36283,Bu=36284,vl=36285,ku=36286,_0=3200,Rd=0,x0=1,xr="",ci="srgb",Ml="srgb-linear",Sl="linear",vt="srgb",vs=7680,Cd=519,v0=512,M0=513,S0=514,Ef=515,b0=516,y0=517,Tf=518,E0=519,Pd=35044,Dd="300 es",Fi=2e3,bl=2001;function T0(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function yl(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function w0(){const r=yl("canvas");return r.style.display="block",r}const Ld={};function Nd(...r){const e="THREE."+r.shift();console.log(e,...r)}function xm(r){const e=r[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=r[1];t&&t.isStackTrace?r[0]+=" "+t.getLocation():r[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return r}function $e(...r){r=xm(r);const e="THREE."+r.shift();{const t=r[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...r)}}function mt(...r){r=xm(r);const e="THREE."+r.shift();{const t=r[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...r)}}function $s(...r){const e=r.join(" ");e in Ld||(Ld[e]=!0,$e(...r))}function A0(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const R0={[tu]:nu,[iu]:au,[ru]:ou,[na]:su,[nu]:tu,[au]:iu,[ou]:ru,[su]:na};class fs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const gn=["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"];let Id=1234567;const za=Math.PI/180,eo=180/Math.PI;function aa(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(gn[r&255]+gn[r>>8&255]+gn[r>>16&255]+gn[r>>24&255]+"-"+gn[e&255]+gn[e>>8&255]+"-"+gn[e>>16&15|64]+gn[e>>24&255]+"-"+gn[t&63|128]+gn[t>>8&255]+"-"+gn[t>>16&255]+gn[t>>24&255]+gn[n&255]+gn[n>>8&255]+gn[n>>16&255]+gn[n>>24&255]).toLowerCase()}function ct(r,e,t){return Math.max(e,Math.min(t,r))}function wf(r,e){return(r%e+e)%e}function C0(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function P0(r,e,t){return r!==e?(t-r)/(e-r):0}function Ga(r,e,t){return(1-t)*r+t*e}function D0(r,e,t,n){return Ga(r,e,1-Math.exp(-t*n))}function L0(r,e=1){return e-Math.abs(wf(r,e*2)-e)}function N0(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function I0(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function U0(r,e){return r+Math.floor(Math.random()*(e-r+1))}function F0(r,e){return r+Math.random()*(e-r)}function O0(r){return r*(.5-Math.random())}function B0(r){r!==void 0&&(Id=r);let e=Id+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function k0(r){return r*za}function z0(r){return r*eo}function G0(r){return(r&r-1)===0&&r!==0}function V0(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function H0(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function W0(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),u=a((e+n)/2),h=s((e-n)/2),f=a((e-n)/2),d=s((n-e)/2),g=a((n-e)/2);switch(i){case"XYX":r.set(o*u,l*h,l*f,o*c);break;case"YZY":r.set(l*f,o*u,l*h,o*c);break;case"ZXZ":r.set(l*h,l*f,o*u,o*c);break;case"XZX":r.set(o*u,l*g,l*d,o*c);break;case"YXY":r.set(l*d,o*u,l*g,o*c);break;case"ZYZ":r.set(l*g,l*d,o*u,o*c);break;default:$e("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Fs(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Cn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const Fr={DEG2RAD:za,RAD2DEG:eo,generateUUID:aa,clamp:ct,euclideanModulo:wf,mapLinear:C0,inverseLerp:P0,lerp:Ga,damp:D0,pingpong:L0,smoothstep:N0,smootherstep:I0,randInt:U0,randFloat:F0,randFloatSpread:O0,seededRandom:B0,degToRad:k0,radToDeg:z0,isPowerOfTwo:G0,ceilPowerOfTwo:V0,floorPowerOfTwo:H0,setQuaternionFromProperEuler:W0,normalize:Cn,denormalize:Fs},Pf=class Pf{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=ct(this.x,e.x,t.x),this.y=ct(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ct(this.x,e,t),this.y=ct(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ct(n,e,t))}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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ct(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Pf.prototype.isVector2=!0;let gt=Pf;class oa{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,a,o){let l=n[i+0],c=n[i+1],u=n[i+2],h=n[i+3],f=s[a+0],d=s[a+1],g=s[a+2],_=s[a+3];if(h!==_||l!==f||c!==d||u!==g){let p=l*f+c*d+u*g+h*_;p<0&&(f=-f,d=-d,g=-g,_=-_,p=-p);let m=1-o;if(p<.9995){const b=Math.acos(p),y=Math.sin(b);m=Math.sin(m*b)/y,o=Math.sin(o*b)/y,l=l*m+f*o,c=c*m+d*o,u=u*m+g*o,h=h*m+_*o}else{l=l*m+f*o,c=c*m+d*o,u=u*m+g*o,h=h*m+_*o;const b=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=b,c*=b,u*=b,h*=b}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[a],f=s[a+1],d=s[a+2],g=s[a+3];return e[t]=o*g+u*h+l*d-c*f,e[t+1]=l*g+u*f+c*h-o*d,e[t+2]=c*g+u*d+o*f-l*h,e[t+3]=u*g-o*h-l*f-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(i/2),h=o(s/2),f=l(n/2),d=l(i/2),g=l(s/2);switch(a){case"XYZ":this._x=f*u*h+c*d*g,this._y=c*d*h-f*u*g,this._z=c*u*g+f*d*h,this._w=c*u*h-f*d*g;break;case"YXZ":this._x=f*u*h+c*d*g,this._y=c*d*h-f*u*g,this._z=c*u*g-f*d*h,this._w=c*u*h+f*d*g;break;case"ZXY":this._x=f*u*h-c*d*g,this._y=c*d*h+f*u*g,this._z=c*u*g+f*d*h,this._w=c*u*h-f*d*g;break;case"ZYX":this._x=f*u*h-c*d*g,this._y=c*d*h+f*u*g,this._z=c*u*g-f*d*h,this._w=c*u*h+f*d*g;break;case"YZX":this._x=f*u*h+c*d*g,this._y=c*d*h+f*u*g,this._z=c*u*g-f*d*h,this._w=c*u*h-f*d*g;break;case"XZY":this._x=f*u*h-c*d*g,this._y=c*d*h-f*u*g,this._z=c*u*g+f*d*h,this._w=c*u*h+f*d*g;break;default:$e("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=n+o+h;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-c)*d,this._z=(a-i)*d}else if(n>o&&n>h){const d=2*Math.sqrt(1+n-o-h);this._w=(u-l)/d,this._x=.25*d,this._y=(i+a)/d,this._z=(s+c)/d}else if(o>h){const d=2*Math.sqrt(1+o-n-h);this._w=(s-c)/d,this._x=(i+a)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+h-n-o);this._w=(a-i)/d,this._x=(s+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ct(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+a*o+i*c-s*l,this._y=i*u+a*l+s*o-n*c,this._z=s*u+a*c+n*l-i*o,this._w=a*u-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,i=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,i=-i,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+n*t,this._y=this._y*l+i*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+n*t,this._y=this._y*l+i*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Df=class Df{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Ud.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ud.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),u=2*(o*t-s*i),h=2*(s*n-a*t);return this.x=t+l*c+a*h-o*u,this.y=n+l*u+o*c-s*h,this.z=i+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=ct(this.x,e.x,t.x),this.y=ct(this.y,e.y,t.y),this.z=ct(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ct(this.x,e,t),this.y=ct(this.y,e,t),this.z=ct(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ct(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Jl.copy(this).projectOnVector(e),this.sub(Jl)}reflect(e){return this.sub(Jl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ct(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Df.prototype.isVector3=!0;let X=Df;const Jl=new X,Ud=new oa,Lf=class Lf{constructor(e,t,n,i,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],h=n[7],f=n[2],d=n[5],g=n[8],_=i[0],p=i[3],m=i[6],b=i[1],y=i[4],M=i[7],E=i[2],T=i[5],A=i[8];return s[0]=a*_+o*b+l*E,s[3]=a*p+o*y+l*T,s[6]=a*m+o*M+l*A,s[1]=c*_+u*b+h*E,s[4]=c*p+u*y+h*T,s[7]=c*m+u*M+h*A,s[2]=f*_+d*b+g*E,s[5]=f*p+d*y+g*T,s[8]=f*m+d*M+g*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-n*s*u+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,f=o*l-u*s,d=c*s-a*l,g=t*h+n*f+i*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/g;return e[0]=h*_,e[1]=(i*c-u*n)*_,e[2]=(o*n-i*a)*_,e[3]=f*_,e[4]=(u*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=d*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return $s("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Ql.makeScale(e,t)),this}rotate(e){return $s("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Ql.makeRotation(-e)),this}translate(e,t){return $s("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Ql.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Lf.prototype.isMatrix3=!0;let je=Lf;const Ql=new je,Fd=new je().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Od=new je().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function X0(){const r={enabled:!0,workingColorSpace:Ml,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===vt&&(i.r=tr(i.r),i.g=tr(i.g),i.b=tr(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===vt&&(i.r=Ks(i.r),i.g=Ks(i.g),i.b=Ks(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===xr?Sl:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return $s("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return $s("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Ml]:{primaries:e,whitePoint:n,transfer:Sl,toXYZ:Fd,fromXYZ:Od,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:ci},outputColorSpaceConfig:{drawingBufferColorSpace:ci}},[ci]:{primaries:e,whitePoint:n,transfer:vt,toXYZ:Fd,fromXYZ:Od,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:ci}}}),r}const ft=X0();function tr(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Ks(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Ms;class Y0{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Ms===void 0&&(Ms=yl("canvas")),Ms.width=e.width,Ms.height=e.height;const i=Ms.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Ms}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=yl("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=tr(s[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(tr(t[n]/255)*255):t[n]=tr(t[n]);return{data:t,width:e.width,height:e.height}}else return $e("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let q0=0;class Af{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:q0++}),this.uuid=aa(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(ec(i[a].image)):s.push(ec(i[a]))}else s=ec(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function ec(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Y0.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:($e("Texture: Unable to serialize Texture."),{})}let $0=0;const tc=new X;class Un extends fs{constructor(e=Un.DEFAULT_IMAGE,t=Un.DEFAULT_MAPPING,n=Ji,i=Ji,s=yn,a=Kr,o=bi,l=hi,c=Un.DEFAULT_ANISOTROPY,u=xr){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:$0++}),this.uuid=aa(),this.name="",this.source=new Af(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new gt(0,0),this.repeat=new gt(1,1),this.center=new gt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(tc).x}get height(){return this.source.getSize(tc).y}get depth(){return this.source.getSize(tc).z}get image(){return this.source.data}set image(e){this.source.data=e}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(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){$e(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){$e(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==um)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case lu:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case cu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case lu:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case cu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Un.DEFAULT_IMAGE=null;Un.DEFAULT_MAPPING=um;Un.DEFAULT_ANISOTROPY=1;const Nf=class Nf{constructor(e=0,t=0,n=0,i=1){this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],d=l[5],g=l[9],_=l[2],p=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-_)<.01&&Math.abs(g-p)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+_)<.1&&Math.abs(g+p)<.1&&Math.abs(c+d+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(c+1)/2,M=(d+1)/2,E=(m+1)/2,T=(u+f)/4,A=(h+_)/4,v=(g+p)/4;return y>M&&y>E?y<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(y),i=T/n,s=A/n):M>E?M<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),n=T/i,s=v/i):E<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(E),n=A/s,i=v/s),this.set(n,i,s,t),this}let b=Math.sqrt((p-g)*(p-g)+(h-_)*(h-_)+(f-u)*(f-u));return Math.abs(b)<.001&&(b=1),this.x=(p-g)/b,this.y=(h-_)/b,this.z=(f-u)/b,this.w=Math.acos((c+d+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=ct(this.x,e.x,t.x),this.y=ct(this.y,e.y,t.y),this.z=ct(this.z,e.z,t.z),this.w=ct(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ct(this.x,e,t),this.y=ct(this.y,e,t),this.z=ct(this.z,e,t),this.w=ct(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ct(n,e,t))}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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}};Nf.prototype.isVector4=!0;let kt=Nf;class K0 extends fs{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:yn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new kt(0,0,e,t),this.scissorTest=!1,this.viewport=new kt(0,0,e,t),this.textures=[];const i={width:e,height:t,depth:n.depth},s=new Un(i),a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:yn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Af(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ki extends K0{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class vm extends Un{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dn,this.minFilter=dn,this.wrapR=Ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Z0 extends Un{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=dn,this.minFilter=dn,this.wrapR=Ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const El=class El{constructor(e,t,n,i,s,a,o,l,c,u,h,f,d,g,_,p){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c,u,h,f,d,g,_,p)}set(e,t,n,i,s,a,o,l,c,u,h,f,d,g,_,p){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=i,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=d,m[7]=g,m[11]=_,m[15]=p,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 El().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();const t=this.elements,n=e.elements,i=1/Ss.setFromMatrixColumn(e,0).length(),s=1/Ss.setFromMatrixColumn(e,1).length(),a=1/Ss.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*u,d=a*h,g=o*u,_=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=d+g*c,t[5]=f-_*c,t[9]=-o*l,t[2]=_-f*c,t[6]=g+d*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,d=l*h,g=c*u,_=c*h;t[0]=f+_*o,t[4]=g*o-d,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=d*o-g,t[6]=_+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,d=l*h,g=c*u,_=c*h;t[0]=f-_*o,t[4]=-a*h,t[8]=g+d*o,t[1]=d+g*o,t[5]=a*u,t[9]=_-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,d=a*h,g=o*u,_=o*h;t[0]=l*u,t[4]=g*c-d,t[8]=f*c+_,t[1]=l*h,t[5]=_*c+f,t[9]=d*c-g,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,d=a*c,g=o*l,_=o*c;t[0]=l*u,t[4]=_-f*h,t[8]=g*h+d,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=d*h+g,t[10]=f-_*h}else if(e.order==="XZY"){const f=a*l,d=a*c,g=o*l,_=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+_,t[5]=a*u,t[9]=d*h-g,t[2]=g*h-d,t[6]=o*u,t[10]=_*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(j0,e,J0)}lookAt(e,t,n){const i=this.elements;return Yn.subVectors(e,t),Yn.lengthSq()===0&&(Yn.z=1),Yn.normalize(),fr.crossVectors(n,Yn),fr.lengthSq()===0&&(Math.abs(n.z)===1?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),fr.crossVectors(n,Yn)),fr.normalize(),Mo.crossVectors(Yn,fr),i[0]=fr.x,i[4]=Mo.x,i[8]=Yn.x,i[1]=fr.y,i[5]=Mo.y,i[9]=Yn.y,i[2]=fr.z,i[6]=Mo.z,i[10]=Yn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],h=n[5],f=n[9],d=n[13],g=n[2],_=n[6],p=n[10],m=n[14],b=n[3],y=n[7],M=n[11],E=n[15],T=i[0],A=i[4],v=i[8],w=i[12],C=i[1],L=i[5],N=i[9],Y=i[13],H=i[2],O=i[6],z=i[10],I=i[14],q=i[3],j=i[7],D=i[11],se=i[15];return s[0]=a*T+o*C+l*H+c*q,s[4]=a*A+o*L+l*O+c*j,s[8]=a*v+o*N+l*z+c*D,s[12]=a*w+o*Y+l*I+c*se,s[1]=u*T+h*C+f*H+d*q,s[5]=u*A+h*L+f*O+d*j,s[9]=u*v+h*N+f*z+d*D,s[13]=u*w+h*Y+f*I+d*se,s[2]=g*T+_*C+p*H+m*q,s[6]=g*A+_*L+p*O+m*j,s[10]=g*v+_*N+p*z+m*D,s[14]=g*w+_*Y+p*I+m*se,s[3]=b*T+y*C+M*H+E*q,s[7]=b*A+y*L+M*O+E*j,s[11]=b*v+y*N+M*z+E*D,s[15]=b*w+y*Y+M*I+E*se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],d=e[14],g=e[3],_=e[7],p=e[11],m=e[15],b=l*d-c*f,y=o*d-c*h,M=o*f-l*h,E=a*d-c*u,T=a*f-l*u,A=a*h-o*u;return t*(_*b-p*y+m*M)-n*(g*b-p*E+m*T)+i*(g*y-_*E+m*A)-s*(g*M-_*T+p*A)}determinantAffine(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],u=e[10];return t*(a*u-o*c)-n*(s*u-o*l)+i*(s*c-a*l)}transpose(){const e=this.elements;let t;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(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],g=e[12],_=e[13],p=e[14],m=e[15],b=t*o-n*a,y=t*l-i*a,M=t*c-s*a,E=n*l-i*o,T=n*c-s*o,A=i*c-s*l,v=u*_-h*g,w=u*p-f*g,C=u*m-d*g,L=h*p-f*_,N=h*m-d*_,Y=f*m-d*p,H=b*Y-y*N+M*L+E*C-T*w+A*v;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/H;return e[0]=(o*Y-l*N+c*L)*O,e[1]=(i*N-n*Y-s*L)*O,e[2]=(_*A-p*T+m*E)*O,e[3]=(f*T-h*A-d*E)*O,e[4]=(l*C-a*Y-c*w)*O,e[5]=(t*Y-i*C+s*w)*O,e[6]=(p*M-g*A-m*y)*O,e[7]=(u*A-f*M+d*y)*O,e[8]=(a*N-o*C+c*v)*O,e[9]=(n*C-t*N-s*v)*O,e[10]=(g*T-_*M+m*b)*O,e[11]=(h*M-u*T-d*b)*O,e[12]=(o*w-a*L-l*v)*O,e[13]=(t*L-n*w+i*v)*O,e[14]=(_*y-g*E-p*b)*O,e[15]=(u*E-h*y+f*b)*O,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,u*o+n,u*l-i*a,0,c*l-i*o,u*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,f=s*c,d=s*u,g=s*h,_=a*u,p=a*h,m=o*h,b=l*c,y=l*u,M=l*h,E=n.x,T=n.y,A=n.z;return i[0]=(1-(_+m))*E,i[1]=(d+M)*E,i[2]=(g-y)*E,i[3]=0,i[4]=(d-M)*T,i[5]=(1-(f+m))*T,i[6]=(p+b)*T,i[7]=0,i[8]=(g+y)*A,i[9]=(p-b)*A,i[10]=(1-(f+_))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;e.x=i[12],e.y=i[13],e.z=i[14];const s=this.determinantAffine();if(s===0)return n.set(1,1,1),t.identity(),this;let a=Ss.set(i[0],i[1],i[2]).length();const o=Ss.set(i[4],i[5],i[6]).length(),l=Ss.set(i[8],i[9],i[10]).length();s<0&&(a=-a),_i.copy(this);const c=1/a,u=1/o,h=1/l;return _i.elements[0]*=c,_i.elements[1]*=c,_i.elements[2]*=c,_i.elements[4]*=u,_i.elements[5]*=u,_i.elements[6]*=u,_i.elements[8]*=h,_i.elements[9]*=h,_i.elements[10]*=h,t.setFromRotationMatrix(_i),n.x=a,n.y=o,n.z=l,this}makePerspective(e,t,n,i,s,a,o=Fi,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(n-i),f=(t+e)/(t-e),d=(n+i)/(n-i);let g,_;if(l)g=s/(a-s),_=a*s/(a-s);else if(o===Fi)g=-(a+s)/(a-s),_=-2*a*s/(a-s);else if(o===bl)g=-a/(a-s),_=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=_,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,s,a,o=Fi,l=!1){const c=this.elements,u=2/(t-e),h=2/(n-i),f=-(t+e)/(t-e),d=-(n+i)/(n-i);let g,_;if(l)g=1/(a-s),_=a/(a-s);else if(o===Fi)g=-2/(a-s),_=-(a+s)/(a-s);else if(o===bl)g=-1/(a-s),_=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=d,c[2]=0,c[6]=0,c[10]=g,c[14]=_,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};El.prototype.isMatrix4=!0;let Yt=El;const Ss=new X,_i=new Yt,j0=new X(0,0,0),J0=new X(1,1,1),fr=new X,Mo=new X,Yn=new X,Bd=new Yt,kd=new oa;class cs{constructor(e=0,t=0,n=0,i=cs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],u=i[9],h=i[2],f=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(ct(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-ct(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(ct(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ct(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(ct(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-ct(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:$e("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Bd.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Bd,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return kd.setFromEuler(this),this.setFromQuaternion(kd,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}cs.DEFAULT_ORDER="XYZ";class Mm{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Q0=0;const zd=new X,bs=new oa,Vi=new Yt,So=new X,da=new X,ex=new X,tx=new oa,Gd=new X(1,0,0),Vd=new X(0,1,0),Hd=new X(0,0,1),Wd={type:"added"},nx={type:"removed"},ys={type:"childadded",child:null},nc={type:"childremoved",child:null};class Hn extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Q0++}),this.uuid=aa(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Hn.DEFAULT_UP.clone();const e=new X,t=new cs,n=new oa,i=new X(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Yt},normalMatrix:{value:new je}}),this.matrix=new Yt,this.matrixWorld=new Yt,this.matrixAutoUpdate=Hn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Mm,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(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return bs.setFromAxisAngle(e,t),this.quaternion.multiply(bs),this}rotateOnWorldAxis(e,t){return bs.setFromAxisAngle(e,t),this.quaternion.premultiply(bs),this}rotateX(e){return this.rotateOnAxis(Gd,e)}rotateY(e){return this.rotateOnAxis(Vd,e)}rotateZ(e){return this.rotateOnAxis(Hd,e)}translateOnAxis(e,t){return zd.copy(e).applyQuaternion(this.quaternion),this.position.add(zd.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Gd,e)}translateY(e){return this.translateOnAxis(Vd,e)}translateZ(e){return this.translateOnAxis(Hd,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Vi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?So.copy(e):So.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),da.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Vi.lookAt(da,So,this.up):Vi.lookAt(So,da,this.up),this.quaternion.setFromRotationMatrix(Vi),i&&(Vi.extractRotation(i.matrixWorld),bs.setFromRotationMatrix(Vi),this.quaternion.premultiply(bs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(mt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Wd),ys.child=e,this.dispatchEvent(ys),ys.child=null):mt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(nx),nc.child=e,this.dispatchEvent(nc),nc.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Vi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Vi.multiply(e.parent.matrixWorld)),e.applyMatrix4(Vi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Wd),ys.child=e,this.dispatchEvent(ys),ys.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(da,e,ex),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(da,tx,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,i=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*n-s[8]*i,s[13]+=n-s[1]*t-s[5]*n-s[9]*i,s[14]+=i-s[2]*t-s[6]*n-s[10]*i}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){const s=this.children;for(let a=0,o=s.length;a<o;a++)s[a].updateWorldMatrix(!1,!0,n)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),this.static!==!1&&(i.static=this.static),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(),this.pivot!==null&&(i.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(i.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(i.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(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(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),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(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),f=a(e.skeletons),d=a(e.animations),g=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=i,n;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Hn.DEFAULT_UP=new X(0,1,0);Hn.DEFAULT_MATRIX_AUTO_UPDATE=!0;Hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class bo extends Hn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const ix={type:"move"};class ic{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new bo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const p=t.getJointPose(_,n),m=this._getHandJoint(c,_);p!==null&&(m.matrix.fromArray(p.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=p.radius),m.visible=p!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),d=.02,g=.005;c.inputState.pinching&&f>d+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=d-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(ix)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new bo;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const Sm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},dr={h:0,s:0,l:0},yo={h:0,s:0,l:0};function rc(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class ht{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ci){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ft.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=ft.workingColorSpace){return this.r=e,this.g=t,this.b=n,ft.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=ft.workingColorSpace){if(e=wf(e,1),t=ct(t,0,1),n=ct(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=rc(a,s,e+1/3),this.g=rc(a,s,e),this.b=rc(a,s,e-1/3)}return ft.colorSpaceToWorking(this,i),this}setStyle(e,t=ci){function n(s){s!==void 0&&parseFloat(s)<1&&$e("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(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,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(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,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:$e("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);$e("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ci){const n=Sm[e.toLowerCase()];return n!==void 0?this.setHex(n,t):$e("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=tr(e.r),this.g=tr(e.g),this.b=tr(e.b),this}copyLinearToSRGB(e){return this.r=Ks(e.r),this.g=Ks(e.g),this.b=Ks(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ci){return ft.workingToColorSpace(_n.copy(this),e),Math.round(ct(_n.r*255,0,255))*65536+Math.round(ct(_n.g*255,0,255))*256+Math.round(ct(_n.b*255,0,255))}getHexString(e=ci){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ft.workingColorSpace){ft.workingToColorSpace(_n.copy(this),t);const n=_n.r,i=_n.g,s=_n.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case n:l=(i-s)/h+(i<s?6:0);break;case i:l=(s-n)/h+2;break;case s:l=(n-i)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=ft.workingColorSpace){return ft.workingToColorSpace(_n.copy(this),t),e.r=_n.r,e.g=_n.g,e.b=_n.b,e}getStyle(e=ci){ft.workingToColorSpace(_n.copy(this),e);const t=_n.r,n=_n.g,i=_n.b;return e!==ci?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(dr),this.setHSL(dr.h+e,dr.s+t,dr.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(dr),e.getHSL(yo);const n=Ga(dr.h,yo.h,t),i=Ga(dr.s,yo.s,t),s=Ga(dr.l,yo.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const _n=new ht;ht.NAMES=Sm;class rx extends Hn{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 cs,this.environmentIntensity=1,this.environmentRotation=new cs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const xi=new X,Hi=new X,sc=new X,Wi=new X,Es=new X,Ts=new X,Xd=new X,ac=new X,oc=new X,lc=new X,cc=new kt,uc=new kt,fc=new kt;class Si{constructor(e=new X,t=new X,n=new X){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),xi.subVectors(e,t),i.cross(xi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){xi.subVectors(i,t),Hi.subVectors(n,t),sc.subVectors(e,t);const a=xi.dot(xi),o=xi.dot(Hi),l=xi.dot(sc),c=Hi.dot(Hi),u=Hi.dot(sc),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,d=(c*l-o*u)*f,g=(a*u-o*l)*f;return s.set(1-d-g,g,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Wi)===null?!1:Wi.x>=0&&Wi.y>=0&&Wi.x+Wi.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,Wi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Wi.x),l.addScaledVector(a,Wi.y),l.addScaledVector(o,Wi.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return cc.setScalar(0),uc.setScalar(0),fc.setScalar(0),cc.fromBufferAttribute(e,t),uc.fromBufferAttribute(e,n),fc.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(cc,s.x),a.addScaledVector(uc,s.y),a.addScaledVector(fc,s.z),a}static isFrontFacing(e,t,n,i){return xi.subVectors(n,t),Hi.subVectors(e,t),xi.cross(Hi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return xi.subVectors(this.c,this.b),Hi.subVectors(this.a,this.b),xi.cross(Hi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Si.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Si.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return Si.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Si.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Si.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;Es.subVectors(i,n),Ts.subVectors(s,n),ac.subVectors(e,n);const l=Es.dot(ac),c=Ts.dot(ac);if(l<=0&&c<=0)return t.copy(n);oc.subVectors(e,i);const u=Es.dot(oc),h=Ts.dot(oc);if(u>=0&&h<=u)return t.copy(i);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(n).addScaledVector(Es,a);lc.subVectors(e,s);const d=Es.dot(lc),g=Ts.dot(lc);if(g>=0&&d<=g)return t.copy(s);const _=d*c-l*g;if(_<=0&&c>=0&&g<=0)return o=c/(c-g),t.copy(n).addScaledVector(Ts,o);const p=u*g-d*h;if(p<=0&&h-u>=0&&d-g>=0)return Xd.subVectors(s,i),o=(h-u)/(h-u+(d-g)),t.copy(i).addScaledVector(Xd,o);const m=1/(p+_+f);return a=_*m,o=f*m,t.copy(n).addScaledVector(Es,a).addScaledVector(Ts,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class no{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(vi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(vi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=vi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,vi):vi.fromBufferAttribute(s,a),vi.applyMatrix4(e.matrixWorld),this.expandByPoint(vi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Eo.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Eo.copy(n.boundingBox)),Eo.applyMatrix4(e.matrixWorld),this.union(Eo)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,vi),vi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ha),To.subVectors(this.max,ha),ws.subVectors(e.a,ha),As.subVectors(e.b,ha),Rs.subVectors(e.c,ha),hr.subVectors(As,ws),pr.subVectors(Rs,As),Or.subVectors(ws,Rs);let t=[0,-hr.z,hr.y,0,-pr.z,pr.y,0,-Or.z,Or.y,hr.z,0,-hr.x,pr.z,0,-pr.x,Or.z,0,-Or.x,-hr.y,hr.x,0,-pr.y,pr.x,0,-Or.y,Or.x,0];return!dc(t,ws,As,Rs,To)||(t=[1,0,0,0,1,0,0,0,1],!dc(t,ws,As,Rs,To))?!1:(wo.crossVectors(hr,pr),t=[wo.x,wo.y,wo.z],dc(t,ws,As,Rs,To))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,vi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(vi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Xi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Xi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Xi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Xi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Xi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Xi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Xi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Xi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Xi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Xi=[new X,new X,new X,new X,new X,new X,new X,new X],vi=new X,Eo=new no,ws=new X,As=new X,Rs=new X,hr=new X,pr=new X,Or=new X,ha=new X,To=new X,wo=new X,Br=new X;function dc(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Br.fromArray(r,s);const o=i.x*Math.abs(Br.x)+i.y*Math.abs(Br.y)+i.z*Math.abs(Br.z),l=e.dot(Br),c=t.dot(Br),u=n.dot(Br);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const Kt=new X,Ao=new gt;let sx=0;class Mn extends fs{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:sx++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Pd,this.updateRanges=[],this.gpuType=Ui,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Ao.fromBufferAttribute(this,t),Ao.applyMatrix3(e),this.setXY(t,Ao.x,Ao.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.applyMatrix3(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.applyMatrix4(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.applyNormalMatrix(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Kt.fromBufferAttribute(this,t),Kt.transformDirection(e),this.setXYZ(t,Kt.x,Kt.y,Kt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Fs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Cn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Fs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Fs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Fs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Fs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Cn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Cn(t,this.array),n=Cn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Cn(t,this.array),n=Cn(n,this.array),i=Cn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Cn(t,this.array),n=Cn(n,this.array),i=Cn(i,this.array),s=Cn(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Pd&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class bm extends Mn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class ym extends Mn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class nr extends Mn{constructor(e,t,n){super(new Float32Array(e),t,n)}}const ax=new no,pa=new X,hc=new X;class Pl{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):ax.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;pa.subVectors(e,this.center);const t=pa.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(pa,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(hc.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pa.copy(e.center).add(hc)),this.expandByPoint(pa.copy(e.center).sub(hc))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let ox=0;const oi=new Yt,pc=new Hn,Cs=new X,qn=new no,ma=new no,an=new X;class Ei extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ox++}),this.uuid=aa(),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(e){return Array.isArray(e)?this.index=new(T0(e)?ym:bm)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new je().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return oi.makeRotationFromQuaternion(e),this.applyMatrix4(oi),this}rotateX(e){return oi.makeRotationX(e),this.applyMatrix4(oi),this}rotateY(e){return oi.makeRotationY(e),this.applyMatrix4(oi),this}rotateZ(e){return oi.makeRotationZ(e),this.applyMatrix4(oi),this}translate(e,t,n){return oi.makeTranslation(e,t,n),this.applyMatrix4(oi),this}scale(e,t,n){return oi.makeScale(e,t,n),this.applyMatrix4(oi),this}lookAt(e){return pc.lookAt(e),pc.updateMatrix(),this.applyMatrix4(pc.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Cs).negate(),this.translate(Cs.x,Cs.y,Cs.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,s=e.length;i<s;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new nr(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&$e("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new no);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){mt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];qn.setFromBufferAttribute(s),this.morphTargetsRelative?(an.addVectors(this.boundingBox.min,qn.min),this.boundingBox.expandByPoint(an),an.addVectors(this.boundingBox.max,qn.max),this.boundingBox.expandByPoint(an)):(this.boundingBox.expandByPoint(qn.min),this.boundingBox.expandByPoint(qn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&mt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Pl);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){mt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new X,1/0);return}if(e){const n=this.boundingSphere.center;if(qn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];ma.setFromBufferAttribute(o),this.morphTargetsRelative?(an.addVectors(qn.min,ma.min),qn.expandByPoint(an),an.addVectors(qn.max,ma.max),qn.expandByPoint(an)):(qn.expandByPoint(ma.min),qn.expandByPoint(ma.max))}qn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)an.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(an));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)an.fromBufferAttribute(o,c),l&&(Cs.fromBufferAttribute(e,c),an.add(Cs)),i=Math.max(i,n.distanceToSquared(an))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&mt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){mt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;let a=this.getAttribute("tangent");(a===void 0||a.count!==n.count)&&(a=new Mn(new Float32Array(4*n.count),4),this.setAttribute("tangent",a));const o=[],l=[];for(let v=0;v<n.count;v++)o[v]=new X,l[v]=new X;const c=new X,u=new X,h=new X,f=new gt,d=new gt,g=new gt,_=new X,p=new X;function m(v,w,C){c.fromBufferAttribute(n,v),u.fromBufferAttribute(n,w),h.fromBufferAttribute(n,C),f.fromBufferAttribute(s,v),d.fromBufferAttribute(s,w),g.fromBufferAttribute(s,C),u.sub(c),h.sub(c),d.sub(f),g.sub(f);const L=1/(d.x*g.y-g.x*d.y);isFinite(L)&&(_.copy(u).multiplyScalar(g.y).addScaledVector(h,-d.y).multiplyScalar(L),p.copy(h).multiplyScalar(d.x).addScaledVector(u,-g.x).multiplyScalar(L),o[v].add(_),o[w].add(_),o[C].add(_),l[v].add(p),l[w].add(p),l[C].add(p))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let v=0,w=b.length;v<w;++v){const C=b[v],L=C.start,N=C.count;for(let Y=L,H=L+N;Y<H;Y+=3)m(e.getX(Y+0),e.getX(Y+1),e.getX(Y+2))}const y=new X,M=new X,E=new X,T=new X;function A(v){E.fromBufferAttribute(i,v),T.copy(E);const w=o[v];y.copy(w),y.sub(E.multiplyScalar(E.dot(w))).normalize(),M.crossVectors(T,w);const L=M.dot(l[v])<0?-1:1;a.setXYZW(v,y.x,y.y,y.z,L)}for(let v=0,w=b.length;v<w;++v){const C=b[v],L=C.start,N=C.count;for(let Y=L,H=L+N;Y<H;Y+=3)A(e.getX(Y+0)),A(e.getX(Y+1)),A(e.getX(Y+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0||n.count!==t.count)n=new Mn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let f=0,d=n.count;f<d;f++)n.setXYZ(f,0,0,0);const i=new X,s=new X,a=new X,o=new X,l=new X,c=new X,u=new X,h=new X;if(e)for(let f=0,d=e.count;f<d;f+=3){const g=e.getX(f+0),_=e.getX(f+1),p=e.getX(f+2);i.fromBufferAttribute(t,g),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,p),u.subVectors(a,s),h.subVectors(i,s),u.cross(h),o.fromBufferAttribute(n,g),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,p),o.add(u),l.add(u),c.add(u),n.setXYZ(g,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let f=0,d=t.count;f<d;f+=3)i.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),h.subVectors(i,s),u.cross(h),n.setXYZ(f+0,u.x,u.y,u.z),n.setXYZ(f+1,u.x,u.y,u.z),n.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)an.fromBufferAttribute(e,t),an.normalize(),e.setXYZ(t,an.x,an.y,an.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,f=new c.constructor(l.length*u);let d=0,g=0;for(let _=0,p=l.length;_<p;_++){o.isInterleavedBufferAttribute?d=l[_]*o.data.stride+o.offset:d=l[_]*u;for(let m=0;m<u;m++)f[g++]=c[d++]}return new Mn(f,u,h)}if(this.index===null)return $e("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Ei,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const f=c[u],d=e(f,n);l.push(d)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?"BufferGeometry":this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){const d=c[h];u.push(d.toJSON(e.data))}u.length>0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,d=h.length;f<d;f++)u.push(h[f].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let lx=0;class io extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:lx++}),this.uuid=aa(),this.name="",this.type="Material",this.blending=qs,this.side=Lr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Qc,this.blendDst=eu,this.blendEquation=Xr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ht(0,0,0),this.blendAlpha=0,this.depthFunc=na,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Cd,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=vs,this.stencilZFail=vs,this.stencilZPass=vs,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(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){$e(`Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){$e(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector2&&n&&n.isVector2||i&&i.isEuler&&n&&n.isEuler||i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==qs&&(n.blending=this.blending),this.side!==Lr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Qc&&(n.blendSrc=this.blendSrc),this.blendDst!==eu&&(n.blendDst=this.blendDst),this.blendEquation!==Xr&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==na&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Cd&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==vs&&(n.stencilFail=this.stencilFail),this.stencilZFail!==vs&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==vs&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new ht().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let n=e.normalScale;Array.isArray(n)===!1&&(n=[n,n]),this.normalScale=new gt().fromArray(n)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new gt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const Yi=new X,mc=new X,Ro=new X,mr=new X,gc=new X,Co=new X,_c=new X;class Em{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Yi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Yi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Yi.copy(this.origin).addScaledVector(this.direction,t),Yi.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){mc.copy(e).add(t).multiplyScalar(.5),Ro.copy(t).sub(e).normalize(),mr.copy(this.origin).sub(mc);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Ro),o=mr.dot(this.direction),l=-mr.dot(Ro),c=mr.lengthSq(),u=Math.abs(1-a*a);let h,f,d,g;if(u>0)if(h=a*l-o,f=a*o-l,g=s*u,h>=0)if(f>=-g)if(f<=g){const _=1/u;h*=_,f*=_,d=h*(h+a*f+2*o)+f*(a*h+f+2*l)+c}else f=s,h=Math.max(0,-(a*f+o)),d=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(a*f+o)),d=-h*h+f*(f+2*l)+c;else f<=-g?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c):f<=g?(h=0,f=Math.min(Math.max(-s,-l),s),d=f*(f+2*l)+c):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),d=-h*h+f*(f+2*l)+c);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),d=-h*h+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(mc).addScaledVector(Ro,f),d}intersectSphere(e,t){Yi.subVectors(e.center,this.origin);const n=Yi.dot(this.direction),i=Yi.dot(Yi)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Yi)!==null}intersectTriangle(e,t,n,i,s){gc.subVectors(t,e),Co.subVectors(n,e),_c.crossVectors(gc,Co);let a=this.direction.dot(_c),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;mr.subVectors(this.origin,e);const l=o*this.direction.dot(Co.crossVectors(mr,Co));if(l<0)return null;const c=o*this.direction.dot(gc.cross(mr));if(c<0||l+c>a)return null;const u=-o*mr.dot(_c);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Tm extends io{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cs,this.combine=nm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Yd=new Yt,kr=new Em,Po=new Pl,qd=new X,Do=new X,Lo=new X,No=new X,xc=new X,Io=new X,$d=new X,Uo=new X;class or extends Hn{constructor(e=new Ei,t=new Tm){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Io.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(xc.fromBufferAttribute(h,e),a?Io.addScaledVector(xc,u):Io.addScaledVector(xc.sub(t),u))}t.add(Io)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Po.copy(n.boundingSphere),Po.applyMatrix4(s),kr.copy(e.ray).recast(e.near),!(Po.containsPoint(kr.origin)===!1&&(kr.intersectSphere(Po,qd)===null||kr.origin.distanceToSquared(qd)>(e.far-e.near)**2))&&(Yd.copy(s).invert(),kr.copy(e.ray).applyMatrix4(Yd),!(n.boundingBox!==null&&kr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,kr)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(a))for(let g=0,_=f.length;g<_;g++){const p=f[g],m=a[p.materialIndex],b=Math.max(p.start,d.start),y=Math.min(o.count,Math.min(p.start+p.count,d.start+d.count));for(let M=b,E=y;M<E;M+=3){const T=o.getX(M),A=o.getX(M+1),v=o.getX(M+2);i=Fo(this,m,e,n,c,u,h,T,A,v),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),_=Math.min(o.count,d.start+d.count);for(let p=g,m=_;p<m;p+=3){const b=o.getX(p),y=o.getX(p+1),M=o.getX(p+2);i=Fo(this,a,e,n,c,u,h,b,y,M),i&&(i.faceIndex=Math.floor(p/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let g=0,_=f.length;g<_;g++){const p=f[g],m=a[p.materialIndex],b=Math.max(p.start,d.start),y=Math.min(l.count,Math.min(p.start+p.count,d.start+d.count));for(let M=b,E=y;M<E;M+=3){const T=M,A=M+1,v=M+2;i=Fo(this,m,e,n,c,u,h,T,A,v),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=p.materialIndex,t.push(i))}}else{const g=Math.max(0,d.start),_=Math.min(l.count,d.start+d.count);for(let p=g,m=_;p<m;p+=3){const b=p,y=p+1,M=p+2;i=Fo(this,a,e,n,c,u,h,b,y,M),i&&(i.faceIndex=Math.floor(p/3),t.push(i))}}}}function cx(r,e,t,n,i,s,a,o){let l;if(e.side===Vn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,e.side===Lr,o),l===null)return null;Uo.copy(o),Uo.applyMatrix4(r.matrixWorld);const c=t.ray.origin.distanceTo(Uo);return c<t.near||c>t.far?null:{distance:c,point:Uo.clone(),object:r}}function Fo(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,Do),r.getVertexPosition(l,Lo),r.getVertexPosition(c,No);const u=cx(r,e,t,n,Do,Lo,No,$d);if(u){const h=new X;Si.getBarycoord($d,Do,Lo,No,h),i&&(u.uv=Si.getInterpolatedAttribute(i,o,l,c,h,new gt)),s&&(u.uv1=Si.getInterpolatedAttribute(s,o,l,c,h,new gt)),a&&(u.normal=Si.getInterpolatedAttribute(a,o,l,c,h,new X),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new X,materialIndex:0};Si.getNormal(Do,Lo,No,f.normal),u.face=f,u.barycoord=h}return u}class ux extends Un{constructor(e=null,t=1,n=1,i,s,a,o,l,c=dn,u=dn,h,f){super(null,a,o,l,c,u,i,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const vc=new X,fx=new X,dx=new je;class Wr{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=vc.subVectors(n,t).cross(fx.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){const i=e.delta(vc),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||dx.getNormalMatrix(e),i=this.coplanarPoint(vc).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const zr=new Pl,hx=new gt(.5,.5),Oo=new X;class wm{constructor(e=new Wr,t=new Wr,n=new Wr,i=new Wr,s=new Wr,a=new Wr){this.planes=[e,t,n,i,s,a]}set(e,t,n,i,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Fi,n=!1){const i=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],d=s[7],g=s[8],_=s[9],p=s[10],m=s[11],b=s[12],y=s[13],M=s[14],E=s[15];if(i[0].setComponents(c-a,d-u,m-g,E-b).normalize(),i[1].setComponents(c+a,d+u,m+g,E+b).normalize(),i[2].setComponents(c+o,d+h,m+_,E+y).normalize(),i[3].setComponents(c-o,d-h,m-_,E-y).normalize(),n)i[4].setComponents(l,f,p,M).normalize(),i[5].setComponents(c-l,d-f,m-p,E-M).normalize();else if(i[4].setComponents(c-l,d-f,m-p,E-M).normalize(),t===Fi)i[5].setComponents(c+l,d+f,m+p,E+M).normalize();else if(t===bl)i[5].setComponents(l,f,p,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),zr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),zr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zr)}intersectsSprite(e){zr.center.set(0,0,0);const t=hx.distanceTo(e.center);return zr.radius=.7071067811865476+t,zr.applyMatrix4(e.matrixWorld),this.intersectsSphere(zr)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Oo.x=i.normal.x>0?e.max.x:e.min.x,Oo.y=i.normal.y>0?e.max.y:e.min.y,Oo.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Oo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class px extends io{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ht(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Kd=new Yt,zu=new Em,Bo=new Pl,ko=new X;class mx extends Hn{constructor(e=new Ei,t=new px){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Bo.copy(n.boundingSphere),Bo.applyMatrix4(i),Bo.radius+=s,e.ray.intersectsSphere(Bo)===!1)return;Kd.copy(i).invert(),zu.copy(e.ray).applyMatrix4(Kd);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,h=n.attributes.position;if(c!==null){const f=Math.max(0,a.start),d=Math.min(c.count,a.start+a.count);for(let g=f,_=d;g<_;g++){const p=c.getX(g);ko.fromBufferAttribute(h,p),Zd(ko,p,l,i,e,t,this)}}else{const f=Math.max(0,a.start),d=Math.min(h.count,a.start+a.count);for(let g=f,_=d;g<_;g++)ko.fromBufferAttribute(h,g),Zd(ko,g,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function Zd(r,e,t,n,i,s,a){const o=zu.distanceSqToPoint(r);if(o<t){const l=new X;zu.closestPointToPoint(r,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Am extends Un{constructor(e=[],t=os,n,i,s,a,o,l,c,u){super(e,t,n,i,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ra extends Un{constructor(e,t,n=Gi,i,s,a,o=dn,l=dn,c,u=ar,h=1){if(u!==ar&&u!==Zr)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,i,s,a,o,l,u,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Af(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class gx extends ra{constructor(e,t=Gi,n=os,i,s,a=dn,o=dn,l,c=ar){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,n,i,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Rm extends Un{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ro extends Ei{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let f=0,d=0;g("z","y","x",-1,-1,n,t,e,a,s,0),g("z","y","x",1,-1,n,t,-e,a,s,1),g("x","z","y",1,1,e,n,t,i,a,2),g("x","z","y",1,-1,e,n,-t,i,a,3),g("x","y","z",1,-1,e,t,n,i,s,4),g("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new nr(c,3)),this.setAttribute("normal",new nr(u,3)),this.setAttribute("uv",new nr(h,2));function g(_,p,m,b,y,M,E,T,A,v,w){const C=M/A,L=E/v,N=M/2,Y=E/2,H=T/2,O=A+1,z=v+1;let I=0,q=0;const j=new X;for(let D=0;D<z;D++){const se=D*L-Y;for(let pe=0;pe<O;pe++){const Ve=pe*C-N;j[_]=Ve*b,j[p]=se*y,j[m]=H,c.push(j.x,j.y,j.z),j[_]=0,j[p]=0,j[m]=T>0?1:-1,u.push(j.x,j.y,j.z),h.push(pe/A),h.push(1-D/v),I+=1}}for(let D=0;D<v;D++)for(let se=0;se<A;se++){const pe=f+se+O*D,Ve=f+se+O*(D+1),He=f+(se+1)+O*(D+1),Le=f+(se+1)+O*D;l.push(pe,Ve,Le),l.push(Ve,He,Le),q+=6}o.addGroup(d,q,w),d+=q,f+=I}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ro(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Dl extends Ei{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,u=l+1,h=e/o,f=t/l,d=[],g=[],_=[],p=[];for(let m=0;m<u;m++){const b=m*f-a;for(let y=0;y<c;y++){const M=y*h-s;g.push(M,-b,0),_.push(0,0,1),p.push(y/o),p.push(1-m/l)}}for(let m=0;m<l;m++)for(let b=0;b<o;b++){const y=b+c*m,M=b+c*(m+1),E=b+1+c*(m+1),T=b+1+c*m;d.push(y,M,T),d.push(M,E,T)}this.setIndex(d),this.setAttribute("position",new nr(g,3)),this.setAttribute("normal",new nr(_,3)),this.setAttribute("uv",new nr(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Dl(e.width,e.height,e.widthSegments,e.heightSegments)}}function sa(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];if(jd(i))i.isRenderTargetTexture?($e("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone();else if(Array.isArray(i))if(jd(i[0])){const s=[];for(let a=0,o=i.length;a<o;a++)s[a]=i[a].clone();e[t][n]=s}else e[t][n]=i.slice();else e[t][n]=i}}return e}function Pn(r){const e={};for(let t=0;t<r.length;t++){const n=sa(r[t]);for(const i in n)e[i]=n[i]}return e}function jd(r){return r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)}function _x(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Cm(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:ft.workingColorSpace}const xx={clone:sa,merge:Pn};var vx=`void main() {
2
2
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3
- }`,vx=`void main() {
3
+ }`,Mx=`void main() {
4
4
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
5
- }`;class yi extends io{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=xx,this.fragmentShader=vx,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=sa(e.uniforms),this.uniformsGroups=gx(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(const n in e.uniforms){const i=e.uniforms[n];switch(this.uniforms[n]={},i.type){case"t":this.uniforms[n].value=t[i.value]||null;break;case"c":this.uniforms[n].value=new ht().setHex(i.value);break;case"v2":this.uniforms[n].value=new gt().fromArray(i.value);break;case"v3":this.uniforms[n].value=new X().fromArray(i.value);break;case"v4":this.uniforms[n].value=new kt().fromArray(i.value);break;case"m3":this.uniforms[n].value=new je().fromArray(i.value);break;case"m4":this.uniforms[n].value=new Yt().fromArray(i.value);break;default:this.uniforms[n].value=i.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const n in e.extensions)this.extensions[n]=e.extensions[n];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class Mx extends yi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Sx extends io{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=g_,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class bx extends io{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const zo=new X,Go=new oa,Ai=new X;class Pm extends Hn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Yt,this.projectionMatrix=new Yt,this.projectionMatrixInverse=new Yt,this.coordinateSystem=Fi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(zo,Go,Ai),Ai.x===1&&Ai.y===1&&Ai.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(zo,Go,Ai.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(zo,Go,Ai),Ai.x===1&&Ai.y===1&&Ai.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(zo,Go,Ai.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const gr=new X,Kd=new gt,jd=new gt;class di extends Pm{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=eo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(za*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return eo*2*Math.atan(Math.tan(za*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){gr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(gr.x,gr.y).multiplyScalar(-e/gr.z),gr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(gr.x,gr.y).multiplyScalar(-e/gr.z)}getViewSize(e,t){return this.getViewBounds(e,Kd,jd),t.subVectors(jd,Kd)}setViewOffset(e,t,n,i,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(za*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class Dm extends Pm{constructor(e=-1,t=1,n=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,a=n+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ps=-90,Ds=1;class yx extends Hn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new di(Ps,Ds,e,t);i.layers=this.layers,this.add(i);const s=new di(Ps,Ds,e,t);s.layers=this.layers,this.add(s);const a=new di(Ps,Ds,e,t);a.layers=this.layers,this.add(a);const o=new di(Ps,Ds,e,t);o.layers=this.layers,this.add(o);const l=new di(Ps,Ds,e,t);l.layers=this.layers,this.add(l);const c=new di(Ps,Ds,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,a,o,l]=t;for(const c of t)this.remove(c);if(e===Fi)n.up.set(0,1,0),n.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),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===bl)n.up.set(0,-1,0),n.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),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,c,u]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let p=!1;e.isWebGLRenderer===!0?p=e.state.buffers.depth.getReversed():p=e.reversedDepthBuffer,e.setRenderTarget(n,0,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,1,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(n,4,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=_,e.setRenderTarget(n,5,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,u),e.setRenderTarget(h,f,d),e.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class Ex extends di{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Tx{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,$e("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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const If=class If{constructor(e,t,n,i){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const s=this.elements;return s[0]=e,s[2]=t,s[1]=n,s[3]=i,this}};If.prototype.isMatrix2=!0;let Jd=If;function Qd(r,e,t,n){const i=wx(n);switch(t){case mm:return r*e;case _m:return r*e/i.components*i.byteLength;case Sf:return r*e/i.components*i.byteLength;case ls:return r*e*2/i.components*i.byteLength;case bf:return r*e*2/i.components*i.byteLength;case gm:return r*e*3/i.components*i.byteLength;case bi:return r*e*4/i.components*i.byteLength;case yf:return r*e*4/i.components*i.byteLength;case nl:case il:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case rl:case sl:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case fu:case hu:return Math.max(r,16)*Math.max(e,8)/4;case uu:case du:return Math.max(r,8)*Math.max(e,8)/2;case pu:case mu:case _u:case xu:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case gu:case xl:case vu:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Mu:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Su:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case bu:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case yu:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case Eu:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case Tu:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case wu:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case Au:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case Ru:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case Cu:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case Pu:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case Du:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case Lu:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case Nu:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case Iu:case Uu:case Fu:return Math.ceil(r/4)*Math.ceil(e/4)*16;case Ou:case Bu:return Math.ceil(r/4)*Math.ceil(e/4)*8;case vl:case ku:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function wx(r){switch(r){case hi:case fm:return{byteLength:1,components:1};case Ja:case dm:case sr:return{byteLength:2,components:1};case vf:case Mf:return{byteLength:2,components:4};case Gi:case xf:case Ui:return{byteLength:4,components:1};case hm:case pm:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_f}}));typeof window<"u"&&(window.__THREE__?$e("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_f);function Lm(){let r=null,e=!1,t=null,n=null;function i(s,a){t(s,a),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&r!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r!==null&&r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function Ax(r){const e=new WeakMap;function t(o,l){const c=o.array,u=o.usage,h=c.byteLength,f=r.createBuffer();r.bindBuffer(l,f),r.bufferData(l,c,u),o.onUploadCallback();let d;if(c instanceof Float32Array)d=r.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)d=r.HALF_FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=r.HALF_FLOAT:d=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=r.SHORT;else if(c instanceof Uint32Array)d=r.UNSIGNED_INT;else if(c instanceof Int32Array)d=r.INT;else if(c instanceof Int8Array)d=r.BYTE;else if(c instanceof Uint8Array)d=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:h}}function n(o,l,c){const u=l.array,h=l.updateRanges;if(r.bindBuffer(c,o),h.length===0)r.bufferSubData(c,0,u);else{h.sort((d,g)=>d.start-g.start);let f=0;for(let d=1;d<h.length;d++){const g=h[f],_=h[d];_.start<=g.start+g.count+1?g.count=Math.max(g.count,_.start+_.count-g.start):(++f,h[f]=_)}h.length=f+1;for(let d=0,g=h.length;d<g;d++){const _=h[d];r.bufferSubData(c,_.start*u.BYTES_PER_ELEMENT,u,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(r.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,t(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:s,update:a}}var Rx=`#ifdef USE_ALPHAHASH
5
+ }`;class yi extends io{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=vx,this.fragmentShader=Mx,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,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=sa(e.uniforms),this.uniformsGroups=_x(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(const n in e.uniforms){const i=e.uniforms[n];switch(this.uniforms[n]={},i.type){case"t":this.uniforms[n].value=t[i.value]||null;break;case"c":this.uniforms[n].value=new ht().setHex(i.value);break;case"v2":this.uniforms[n].value=new gt().fromArray(i.value);break;case"v3":this.uniforms[n].value=new X().fromArray(i.value);break;case"v4":this.uniforms[n].value=new kt().fromArray(i.value);break;case"m3":this.uniforms[n].value=new je().fromArray(i.value);break;case"m4":this.uniforms[n].value=new Yt().fromArray(i.value);break;default:this.uniforms[n].value=i.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const n in e.extensions)this.extensions[n]=e.extensions[n];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class Sx extends yi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class bx extends io{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=_0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class yx extends io{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const zo=new X,Go=new oa,Ai=new X;class Pm extends Hn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Yt,this.projectionMatrix=new Yt,this.projectionMatrixInverse=new Yt,this.coordinateSystem=Fi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(zo,Go,Ai),Ai.x===1&&Ai.y===1&&Ai.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(zo,Go,Ai.set(1,1,1)).invert()}updateWorldMatrix(e,t,n=!1){super.updateWorldMatrix(e,t,n),this.matrixWorld.decompose(zo,Go,Ai),Ai.x===1&&Ai.y===1&&Ai.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(zo,Go,Ai.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const gr=new X,Jd=new gt,Qd=new gt;class di extends Pm{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=eo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(za*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return eo*2*Math.atan(Math.tan(za*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){gr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(gr.x,gr.y).multiplyScalar(-e/gr.z),gr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(gr.x,gr.y).multiplyScalar(-e/gr.z)}getViewSize(e,t){return this.getViewBounds(e,Jd,Qd),t.subVectors(Qd,Jd)}setViewOffset(e,t,n,i,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(za*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class Dm extends Pm{constructor(e=-1,t=1,n=1,i=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,a=n+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ps=-90,Ds=1;class Ex extends Hn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new di(Ps,Ds,e,t);i.layers=this.layers,this.add(i);const s=new di(Ps,Ds,e,t);s.layers=this.layers,this.add(s);const a=new di(Ps,Ds,e,t);a.layers=this.layers,this.add(a);const o=new di(Ps,Ds,e,t);o.layers=this.layers,this.add(o);const l=new di(Ps,Ds,e,t);l.layers=this.layers,this.add(l);const c=new di(Ps,Ds,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,a,o,l]=t;for(const c of t)this.remove(c);if(e===Fi)n.up.set(0,1,0),n.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),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===bl)n.up.set(0,-1,0),n.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),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,c,u]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let p=!1;e.isWebGLRenderer===!0?p=e.state.buffers.depth.getReversed():p=e.reversedDepthBuffer,e.setRenderTarget(n,0,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,1,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(n,4,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=_,e.setRenderTarget(n,5,i),p&&e.autoClear===!1&&e.clearDepth(),e.render(t,u),e.setRenderTarget(h,f,d),e.xr.enabled=g,n.texture.needsPMREMUpdate=!0}}class Tx extends di{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class wx{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,$e("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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}const If=class If{constructor(e,t,n,i){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,i){const s=this.elements;return s[0]=e,s[2]=t,s[1]=n,s[3]=i,this}};If.prototype.isMatrix2=!0;let eh=If;function th(r,e,t,n){const i=Ax(n);switch(t){case mm:return r*e;case _m:return r*e/i.components*i.byteLength;case Sf:return r*e/i.components*i.byteLength;case ls:return r*e*2/i.components*i.byteLength;case bf:return r*e*2/i.components*i.byteLength;case gm:return r*e*3/i.components*i.byteLength;case bi:return r*e*4/i.components*i.byteLength;case yf:return r*e*4/i.components*i.byteLength;case nl:case il:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case rl:case sl:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case fu:case hu:return Math.max(r,16)*Math.max(e,8)/4;case uu:case du:return Math.max(r,8)*Math.max(e,8)/2;case pu:case mu:case _u:case xu:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*8;case gu:case xl:case vu:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Mu:return Math.floor((r+3)/4)*Math.floor((e+3)/4)*16;case Su:return Math.floor((r+4)/5)*Math.floor((e+3)/4)*16;case bu:return Math.floor((r+4)/5)*Math.floor((e+4)/5)*16;case yu:return Math.floor((r+5)/6)*Math.floor((e+4)/5)*16;case Eu:return Math.floor((r+5)/6)*Math.floor((e+5)/6)*16;case Tu:return Math.floor((r+7)/8)*Math.floor((e+4)/5)*16;case wu:return Math.floor((r+7)/8)*Math.floor((e+5)/6)*16;case Au:return Math.floor((r+7)/8)*Math.floor((e+7)/8)*16;case Ru:return Math.floor((r+9)/10)*Math.floor((e+4)/5)*16;case Cu:return Math.floor((r+9)/10)*Math.floor((e+5)/6)*16;case Pu:return Math.floor((r+9)/10)*Math.floor((e+7)/8)*16;case Du:return Math.floor((r+9)/10)*Math.floor((e+9)/10)*16;case Lu:return Math.floor((r+11)/12)*Math.floor((e+9)/10)*16;case Nu:return Math.floor((r+11)/12)*Math.floor((e+11)/12)*16;case Iu:case Uu:case Fu:return Math.ceil(r/4)*Math.ceil(e/4)*16;case Ou:case Bu:return Math.ceil(r/4)*Math.ceil(e/4)*8;case vl:case ku:return Math.ceil(r/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Ax(r){switch(r){case hi:case fm:return{byteLength:1,components:1};case Ja:case dm:case sr:return{byteLength:2,components:1};case vf:case Mf:return{byteLength:2,components:4};case Gi:case xf:case Ui:return{byteLength:4,components:1};case hm:case pm:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${r}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:_f}}));typeof window<"u"&&(window.__THREE__?$e("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=_f);function Lm(){let r=null,e=!1,t=null,n=null;function i(s,a){t(s,a),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&r!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r!==null&&r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function Rx(r){const e=new WeakMap;function t(o,l){const c=o.array,u=o.usage,h=c.byteLength,f=r.createBuffer();r.bindBuffer(l,f),r.bufferData(l,c,u),o.onUploadCallback();let d;if(c instanceof Float32Array)d=r.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)d=r.HALF_FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=r.HALF_FLOAT:d=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=r.SHORT;else if(c instanceof Uint32Array)d=r.UNSIGNED_INT;else if(c instanceof Int32Array)d=r.INT;else if(c instanceof Int8Array)d=r.BYTE;else if(c instanceof Uint8Array)d=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:f,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:h}}function n(o,l,c){const u=l.array,h=l.updateRanges;if(r.bindBuffer(c,o),h.length===0)r.bufferSubData(c,0,u);else{h.sort((d,g)=>d.start-g.start);let f=0;for(let d=1;d<h.length;d++){const g=h[f],_=h[d];_.start<=g.start+g.count+1?g.count=Math.max(g.count,_.start+_.count-g.start):(++f,h[f]=_)}h.length=f+1;for(let d=0,g=h.length;d<g;d++){const _=h[d];r.bufferSubData(c,_.start*u.BYTES_PER_ELEMENT,u,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(r.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,t(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:s,update:a}}var Cx=`#ifdef USE_ALPHAHASH
6
6
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
7
- #endif`,Cx=`#ifdef USE_ALPHAHASH
7
+ #endif`,Px=`#ifdef USE_ALPHAHASH
8
8
  const float ALPHA_HASH_SCALE = 0.05;
9
9
  float hash2D( vec2 value ) {
10
10
  return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
@@ -39,20 +39,20 @@ import{r as Fe,j as P,S as Xm,m as Nh,ao as Ac,ap as Ff,aq as Of,ar as Ym,R as q
39
39
  : cases.z;
40
40
  return clamp( threshold , 1.0e-6, 1.0 );
41
41
  }
42
- #endif`,Px=`#ifdef USE_ALPHAMAP
43
- diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
44
42
  #endif`,Dx=`#ifdef USE_ALPHAMAP
43
+ diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
44
+ #endif`,Lx=`#ifdef USE_ALPHAMAP
45
45
  uniform sampler2D alphaMap;
46
- #endif`,Lx=`#ifdef USE_ALPHATEST
46
+ #endif`,Nx=`#ifdef USE_ALPHATEST
47
47
  #ifdef ALPHA_TO_COVERAGE
48
48
  diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
49
49
  if ( diffuseColor.a == 0.0 ) discard;
50
50
  #else
51
51
  if ( diffuseColor.a < alphaTest ) discard;
52
52
  #endif
53
- #endif`,Nx=`#ifdef USE_ALPHATEST
53
+ #endif`,Ix=`#ifdef USE_ALPHATEST
54
54
  uniform float alphaTest;
55
- #endif`,Ix=`#ifdef USE_AOMAP
55
+ #endif`,Ux=`#ifdef USE_AOMAP
56
56
  float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
57
57
  reflectedLight.indirectDiffuse *= ambientOcclusion;
58
58
  #if defined( USE_CLEARCOAT )
@@ -65,10 +65,10 @@ import{r as Fe,j as P,S as Xm,m as Nh,ao as Ac,ap as Ff,aq as Of,ar as Ym,R as q
65
65
  float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
66
66
  reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
67
67
  #endif
68
- #endif`,Ux=`#ifdef USE_AOMAP
68
+ #endif`,Fx=`#ifdef USE_AOMAP
69
69
  uniform sampler2D aoMap;
70
70
  uniform float aoMapIntensity;
71
- #endif`,Fx=`#ifdef USE_BATCHING
71
+ #endif`,Ox=`#ifdef USE_BATCHING
72
72
  #if ! defined( GL_ANGLE_multi_draw )
73
73
  #define gl_DrawID _gl_DrawID
74
74
  uniform int _gl_DrawID;
@@ -102,15 +102,15 @@ import{r as Fe,j as P,S as Xm,m as Nh,ao as Ac,ap as Ff,aq as Of,ar as Ym,R as q
102
102
  int y = j / size;
103
103
  return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
104
104
  }
105
- #endif`,Ox=`#ifdef USE_BATCHING
105
+ #endif`,Bx=`#ifdef USE_BATCHING
106
106
  mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
107
- #endif`,Bx=`vec3 transformed = vec3( position );
107
+ #endif`,kx=`vec3 transformed = vec3( position );
108
108
  #ifdef USE_ALPHAHASH
109
109
  vPosition = vec3( position );
110
- #endif`,kx=`vec3 objectNormal = vec3( normal );
110
+ #endif`,zx=`vec3 objectNormal = vec3( normal );
111
111
  #ifdef USE_TANGENT
112
112
  vec3 objectTangent = vec3( tangent.xyz );
113
- #endif`,zx=`float G_BlinnPhong_Implicit( ) {
113
+ #endif`,Gx=`float G_BlinnPhong_Implicit( ) {
114
114
  return 0.25;
115
115
  }
116
116
  float D_BlinnPhong( const in float shininess, const in float dotNH ) {
@@ -124,7 +124,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
124
124
  float G = G_BlinnPhong_Implicit( );
125
125
  float D = D_BlinnPhong( shininess, dotNH );
126
126
  return F * ( G * D );
127
- } // validated`,Gx=`#ifdef USE_IRIDESCENCE
127
+ } // validated`,Vx=`#ifdef USE_IRIDESCENCE
128
128
  const mat3 XYZ_TO_REC709 = mat3(
129
129
  3.2404542, -0.9692660, 0.0556434,
130
130
  -1.5371385, 1.8760108, -0.2040259,
@@ -187,7 +187,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
187
187
  }
188
188
  return max( I, vec3( 0.0 ) );
189
189
  }
190
- #endif`,Vx=`#ifdef USE_BUMPMAP
190
+ #endif`,Hx=`#ifdef USE_BUMPMAP
191
191
  uniform sampler2D bumpMap;
192
192
  uniform float bumpScale;
193
193
  vec2 dHdxy_fwd() {
@@ -208,7 +208,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
208
208
  vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
209
209
  return normalize( abs( fDet ) * surf_norm - vGrad );
210
210
  }
211
- #endif`,Hx=`#if NUM_CLIPPING_PLANES > 0
211
+ #endif`,Wx=`#if NUM_CLIPPING_PLANES > 0
212
212
  vec4 plane;
213
213
  #ifdef ALPHA_TO_COVERAGE
214
214
  float distanceToPlane, distanceGradient;
@@ -254,20 +254,20 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
254
254
  if ( clipped ) discard;
255
255
  #endif
256
256
  #endif
257
- #endif`,Wx=`#if NUM_CLIPPING_PLANES > 0
258
- varying vec3 vClipPosition;
259
- uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
260
257
  #endif`,Xx=`#if NUM_CLIPPING_PLANES > 0
261
258
  varying vec3 vClipPosition;
259
+ uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
262
260
  #endif`,Yx=`#if NUM_CLIPPING_PLANES > 0
261
+ varying vec3 vClipPosition;
262
+ #endif`,qx=`#if NUM_CLIPPING_PLANES > 0
263
263
  vClipPosition = - mvPosition.xyz;
264
- #endif`,qx=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
265
- diffuseColor *= vColor;
266
264
  #endif`,$x=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
265
+ diffuseColor *= vColor;
266
+ #endif`,Kx=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
267
267
  varying vec4 vColor;
268
268
  #endif`,Zx=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
269
269
  varying vec4 vColor;
270
- #endif`,Kx=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
270
+ #endif`,jx=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
271
271
  vColor = vec4( 1.0 );
272
272
  #endif
273
273
  #ifdef USE_COLOR_ALPHA
@@ -280,7 +280,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
280
280
  #endif
281
281
  #ifdef USE_BATCHING_COLOR
282
282
  vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
283
- #endif`,jx=`#define PI 3.141592653589793
283
+ #endif`,Jx=`#define PI 3.141592653589793
284
284
  #define PI2 6.283185307179586
285
285
  #define PI_HALF 1.5707963267948966
286
286
  #define RECIPROCAL_PI 0.3183098861837907
@@ -351,7 +351,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
351
351
  float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
352
352
  float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
353
353
  return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
354
- } // validated`,Jx=`#ifdef ENVMAP_TYPE_CUBE_UV
354
+ } // validated`,Qx=`#ifdef ENVMAP_TYPE_CUBE_UV
355
355
  #define cubeUV_minMipLevel 4.0
356
356
  #define cubeUV_minTileSize 16.0
357
357
  float getFace( vec3 direction ) {
@@ -444,7 +444,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
444
444
  return vec4( mix( color0, color1, mipF ), 1.0 );
445
445
  }
446
446
  }
447
- #endif`,Qx=`vec3 transformedNormal = objectNormal;
447
+ #endif`,ev=`vec3 transformedNormal = objectNormal;
448
448
  #ifdef USE_TANGENT
449
449
  vec3 transformedTangent = objectTangent;
450
450
  #endif
@@ -470,21 +470,21 @@ transformedNormal = normalMatrix * transformedNormal;
470
470
  #endif
471
471
  #ifdef USE_TANGENT
472
472
  transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
473
- #endif`,ev=`#ifdef USE_DISPLACEMENTMAP
473
+ #endif`,tv=`#ifdef USE_DISPLACEMENTMAP
474
474
  uniform sampler2D displacementMap;
475
475
  uniform float displacementScale;
476
476
  uniform float displacementBias;
477
- #endif`,tv=`#ifdef USE_DISPLACEMENTMAP
477
+ #endif`,nv=`#ifdef USE_DISPLACEMENTMAP
478
478
  transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
479
- #endif`,nv=`#ifdef USE_EMISSIVEMAP
479
+ #endif`,iv=`#ifdef USE_EMISSIVEMAP
480
480
  vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
481
481
  #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
482
482
  emissiveColor = sRGBTransferEOTF( emissiveColor );
483
483
  #endif
484
484
  totalEmissiveRadiance *= emissiveColor.rgb;
485
- #endif`,iv=`#ifdef USE_EMISSIVEMAP
485
+ #endif`,rv=`#ifdef USE_EMISSIVEMAP
486
486
  uniform sampler2D emissiveMap;
487
- #endif`,rv="gl_FragColor = linearToOutputTexel( gl_FragColor );",sv=`vec4 LinearTransferOETF( in vec4 value ) {
487
+ #endif`,sv="gl_FragColor = linearToOutputTexel( gl_FragColor );",av=`vec4 LinearTransferOETF( in vec4 value ) {
488
488
  return value;
489
489
  }
490
490
  vec4 sRGBTransferEOTF( in vec4 value ) {
@@ -492,7 +492,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) {
492
492
  }
493
493
  vec4 sRGBTransferOETF( in vec4 value ) {
494
494
  return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
495
- }`,av=`#ifdef USE_ENVMAP
495
+ }`,ov=`#ifdef USE_ENVMAP
496
496
  #ifdef ENV_WORLDPOS
497
497
  vec3 cameraToFrag;
498
498
  if ( isOrthographic ) {
@@ -519,7 +519,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
519
519
  outgoingLight += envColor.xyz * specularStrength * reflectivity;
520
520
  #endif
521
521
  #endif
522
- #endif`,ov=`#ifdef USE_ENVMAP
522
+ #endif`,lv=`#ifdef USE_ENVMAP
523
523
  uniform float envMapIntensity;
524
524
  uniform mat3 envMapRotation;
525
525
  #ifdef ENVMAP_TYPE_CUBE
@@ -527,7 +527,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
527
527
  #else
528
528
  uniform sampler2D envMap;
529
529
  #endif
530
- #endif`,lv=`#ifdef USE_ENVMAP
530
+ #endif`,cv=`#ifdef USE_ENVMAP
531
531
  uniform float reflectivity;
532
532
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
533
533
  #define ENV_WORLDPOS
@@ -538,7 +538,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
538
538
  #else
539
539
  varying vec3 vReflect;
540
540
  #endif
541
- #endif`,cv=`#ifdef USE_ENVMAP
541
+ #endif`,uv=`#ifdef USE_ENVMAP
542
542
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
543
543
  #define ENV_WORLDPOS
544
544
  #endif
@@ -549,7 +549,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
549
549
  varying vec3 vReflect;
550
550
  uniform float refractionRatio;
551
551
  #endif
552
- #endif`,uv=`#ifdef USE_ENVMAP
552
+ #endif`,fv=`#ifdef USE_ENVMAP
553
553
  #ifdef ENV_WORLDPOS
554
554
  vWorldPosition = worldPosition.xyz;
555
555
  #else
@@ -566,18 +566,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {
566
566
  vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
567
567
  #endif
568
568
  #endif
569
- #endif`,fv=`#ifdef USE_FOG
570
- vFogDepth = - mvPosition.z;
571
569
  #endif`,dv=`#ifdef USE_FOG
572
- varying float vFogDepth;
570
+ vFogDepth = - mvPosition.z;
573
571
  #endif`,hv=`#ifdef USE_FOG
572
+ varying float vFogDepth;
573
+ #endif`,pv=`#ifdef USE_FOG
574
574
  #ifdef FOG_EXP2
575
575
  float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
576
576
  #else
577
577
  float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
578
578
  #endif
579
579
  gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
580
- #endif`,pv=`#ifdef USE_FOG
580
+ #endif`,mv=`#ifdef USE_FOG
581
581
  uniform vec3 fogColor;
582
582
  varying float vFogDepth;
583
583
  #ifdef FOG_EXP2
@@ -586,7 +586,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
586
586
  uniform float fogNear;
587
587
  uniform float fogFar;
588
588
  #endif
589
- #endif`,mv=`#ifdef USE_GRADIENTMAP
589
+ #endif`,gv=`#ifdef USE_GRADIENTMAP
590
590
  uniform sampler2D gradientMap;
591
591
  #endif
592
592
  vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
@@ -598,12 +598,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
598
598
  vec2 fw = fwidth( coord ) * 0.5;
599
599
  return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
600
600
  #endif
601
- }`,gv=`#ifdef USE_LIGHTMAP
601
+ }`,_v=`#ifdef USE_LIGHTMAP
602
602
  uniform sampler2D lightMap;
603
603
  uniform float lightMapIntensity;
604
- #endif`,_v=`LambertMaterial material;
604
+ #endif`,xv=`LambertMaterial material;
605
605
  material.diffuseColor = diffuseColor.rgb;
606
- material.specularStrength = specularStrength;`,xv=`varying vec3 vViewPosition;
606
+ material.specularStrength = specularStrength;`,vv=`varying vec3 vViewPosition;
607
607
  struct LambertMaterial {
608
608
  vec3 diffuseColor;
609
609
  float specularStrength;
@@ -617,7 +617,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
617
617
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
618
618
  }
619
619
  #define RE_Direct RE_Direct_Lambert
620
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,vv=`uniform bool receiveShadow;
620
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Mv=`uniform bool receiveShadow;
621
621
  uniform vec3 ambientLightColor;
622
622
  #if defined( USE_LIGHT_PROBES )
623
623
  uniform vec3 lightProbe[ 9 ];
@@ -734,7 +734,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
734
734
  return irradiance;
735
735
  }
736
736
  #endif
737
- #include <lightprobes_pars_fragment>`,Mv=`#ifdef USE_ENVMAP
737
+ #include <lightprobes_pars_fragment>`,Sv=`#ifdef USE_ENVMAP
738
738
  vec3 getIBLIrradiance( const in vec3 normal ) {
739
739
  #ifdef ENVMAP_TYPE_CUBE_UV
740
740
  vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
@@ -767,8 +767,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
767
767
  #endif
768
768
  }
769
769
  #endif
770
- #endif`,Sv=`ToonMaterial material;
771
- material.diffuseColor = diffuseColor.rgb;`,bv=`varying vec3 vViewPosition;
770
+ #endif`,bv=`ToonMaterial material;
771
+ material.diffuseColor = diffuseColor.rgb;`,yv=`varying vec3 vViewPosition;
772
772
  struct ToonMaterial {
773
773
  vec3 diffuseColor;
774
774
  };
@@ -780,11 +780,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
780
780
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
781
781
  }
782
782
  #define RE_Direct RE_Direct_Toon
783
- #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,yv=`BlinnPhongMaterial material;
783
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Ev=`BlinnPhongMaterial material;
784
784
  material.diffuseColor = diffuseColor.rgb;
785
785
  material.specularColor = specular;
786
786
  material.specularShininess = shininess;
787
- material.specularStrength = specularStrength;`,Ev=`varying vec3 vViewPosition;
787
+ material.specularStrength = specularStrength;`,Tv=`varying vec3 vViewPosition;
788
788
  struct BlinnPhongMaterial {
789
789
  vec3 diffuseColor;
790
790
  vec3 specularColor;
@@ -801,7 +801,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
801
801
  reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
802
802
  }
803
803
  #define RE_Direct RE_Direct_BlinnPhong
804
- #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Tv=`PhysicalMaterial material;
804
+ #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,wv=`PhysicalMaterial material;
805
805
  material.diffuseColor = diffuseColor.rgb;
806
806
  material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
807
807
  material.metalness = metalnessFactor;
@@ -891,7 +891,7 @@ material.roughness = min( material.roughness, 1.0 );
891
891
  material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
892
892
  material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
893
893
  material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
894
- #endif`,wv=`uniform sampler2D dfgLUT;
894
+ #endif`,Av=`uniform sampler2D dfgLUT;
895
895
  struct PhysicalMaterial {
896
896
  vec3 diffuseColor;
897
897
  vec3 diffuseContribution;
@@ -1251,7 +1251,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
1251
1251
  #define RE_IndirectSpecular RE_IndirectSpecular_Physical
1252
1252
  float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1253
1253
  return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1254
- }`,Av=`
1254
+ }`,Rv=`
1255
1255
  vec3 geometryPosition = - vViewPosition;
1256
1256
  vec3 geometryNormal = normal;
1257
1257
  vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
@@ -1373,7 +1373,7 @@ IncidentLight directLight;
1373
1373
  #if defined( RE_IndirectSpecular )
1374
1374
  vec3 radiance = vec3( 0.0 );
1375
1375
  vec3 clearcoatRadiance = vec3( 0.0 );
1376
- #endif`,Rv=`#if defined( RE_IndirectDiffuse )
1376
+ #endif`,Cv=`#if defined( RE_IndirectDiffuse )
1377
1377
  #ifdef USE_LIGHTMAP
1378
1378
  vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1379
1379
  vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
@@ -1394,7 +1394,7 @@ IncidentLight directLight;
1394
1394
  #ifdef USE_CLEARCOAT
1395
1395
  clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1396
1396
  #endif
1397
- #endif`,Cv=`#if defined( RE_IndirectDiffuse )
1397
+ #endif`,Pv=`#if defined( RE_IndirectDiffuse )
1398
1398
  #if defined( LAMBERT ) || defined( PHONG )
1399
1399
  irradiance += iblIrradiance;
1400
1400
  #endif
@@ -1402,7 +1402,7 @@ IncidentLight directLight;
1402
1402
  #endif
1403
1403
  #if defined( RE_IndirectSpecular )
1404
1404
  RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1405
- #endif`,Pv=`#ifdef USE_LIGHT_PROBES_GRID
1405
+ #endif`,Dv=`#ifdef USE_LIGHT_PROBES_GRID
1406
1406
  uniform highp sampler3D probesSH;
1407
1407
  uniform vec3 probesMin;
1408
1408
  uniform vec3 probesMax;
@@ -1447,27 +1447,27 @@ vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1447
1447
  result += c8 * 0.429043 * ( x * x - y * y );
1448
1448
  return max( result, vec3( 0.0 ) );
1449
1449
  }
1450
- #endif`,Dv=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1451
- gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1452
1450
  #endif`,Lv=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1451
+ gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1452
+ #endif`,Nv=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1453
1453
  uniform float logDepthBufFC;
1454
1454
  varying float vFragDepth;
1455
1455
  varying float vIsPerspective;
1456
- #endif`,Nv=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1456
+ #endif`,Iv=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1457
1457
  varying float vFragDepth;
1458
1458
  varying float vIsPerspective;
1459
- #endif`,Iv=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1459
+ #endif`,Uv=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1460
1460
  vFragDepth = 1.0 + gl_Position.w;
1461
1461
  vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1462
- #endif`,Uv=`#ifdef USE_MAP
1462
+ #endif`,Fv=`#ifdef USE_MAP
1463
1463
  vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1464
1464
  #ifdef DECODE_VIDEO_TEXTURE
1465
1465
  sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1466
1466
  #endif
1467
1467
  diffuseColor *= sampledDiffuseColor;
1468
- #endif`,Fv=`#ifdef USE_MAP
1468
+ #endif`,Ov=`#ifdef USE_MAP
1469
1469
  uniform sampler2D map;
1470
- #endif`,Ov=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1470
+ #endif`,Bv=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1471
1471
  #if defined( USE_POINTS_UV )
1472
1472
  vec2 uv = vUv;
1473
1473
  #else
@@ -1479,7 +1479,7 @@ vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1479
1479
  #endif
1480
1480
  #ifdef USE_ALPHAMAP
1481
1481
  diffuseColor.a *= texture2D( alphaMap, uv ).g;
1482
- #endif`,Bv=`#if defined( USE_POINTS_UV )
1482
+ #endif`,kv=`#if defined( USE_POINTS_UV )
1483
1483
  varying vec2 vUv;
1484
1484
  #else
1485
1485
  #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
@@ -1491,19 +1491,19 @@ vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1491
1491
  #endif
1492
1492
  #ifdef USE_ALPHAMAP
1493
1493
  uniform sampler2D alphaMap;
1494
- #endif`,kv=`float metalnessFactor = metalness;
1494
+ #endif`,zv=`float metalnessFactor = metalness;
1495
1495
  #ifdef USE_METALNESSMAP
1496
1496
  vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1497
1497
  metalnessFactor *= texelMetalness.b;
1498
- #endif`,zv=`#ifdef USE_METALNESSMAP
1498
+ #endif`,Gv=`#ifdef USE_METALNESSMAP
1499
1499
  uniform sampler2D metalnessMap;
1500
- #endif`,Gv=`#ifdef USE_INSTANCING_MORPH
1500
+ #endif`,Vv=`#ifdef USE_INSTANCING_MORPH
1501
1501
  float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1502
1502
  float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1503
1503
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1504
1504
  morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1505
1505
  }
1506
- #endif`,Vv=`#if defined( USE_MORPHCOLORS )
1506
+ #endif`,Hv=`#if defined( USE_MORPHCOLORS )
1507
1507
  vColor *= morphTargetBaseInfluence;
1508
1508
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1509
1509
  #if defined( USE_COLOR_ALPHA )
@@ -1512,12 +1512,12 @@ vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1512
1512
  if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1513
1513
  #endif
1514
1514
  }
1515
- #endif`,Hv=`#ifdef USE_MORPHNORMALS
1515
+ #endif`,Wv=`#ifdef USE_MORPHNORMALS
1516
1516
  objectNormal *= morphTargetBaseInfluence;
1517
1517
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1518
1518
  if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1519
1519
  }
1520
- #endif`,Wv=`#ifdef USE_MORPHTARGETS
1520
+ #endif`,Xv=`#ifdef USE_MORPHTARGETS
1521
1521
  #ifndef USE_INSTANCING_MORPH
1522
1522
  uniform float morphTargetBaseInfluence;
1523
1523
  uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
@@ -1531,12 +1531,12 @@ vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1531
1531
  ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1532
1532
  return texelFetch( morphTargetsTexture, morphUV, 0 );
1533
1533
  }
1534
- #endif`,Xv=`#ifdef USE_MORPHTARGETS
1534
+ #endif`,Yv=`#ifdef USE_MORPHTARGETS
1535
1535
  transformed *= morphTargetBaseInfluence;
1536
1536
  for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1537
1537
  if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1538
1538
  }
1539
- #endif`,Yv=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1539
+ #endif`,qv=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1540
1540
  #ifdef FLAT_SHADED
1541
1541
  vec3 fdx = dFdx( vViewPosition );
1542
1542
  vec3 fdy = dFdy( vViewPosition );
@@ -1577,7 +1577,7 @@ vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) {
1577
1577
  tbn2[1] *= faceDirection;
1578
1578
  #endif
1579
1579
  #endif
1580
- vec3 nonPerturbedNormal = normal;`,qv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1580
+ vec3 nonPerturbedNormal = normal;`,$v=`#ifdef USE_NORMALMAP_OBJECTSPACE
1581
1581
  normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1582
1582
  #ifdef FLIP_SIDED
1583
1583
  normal = - normal;
@@ -1595,7 +1595,7 @@ vec3 nonPerturbedNormal = normal;`,qv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1595
1595
  normal = normalize( tbn * mapN );
1596
1596
  #elif defined( USE_BUMPMAP )
1597
1597
  normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1598
- #endif`,$v=`#ifndef FLAT_SHADED
1598
+ #endif`,Kv=`#ifndef FLAT_SHADED
1599
1599
  varying vec3 vNormal;
1600
1600
  #ifdef USE_TANGENT
1601
1601
  varying vec3 vTangent;
@@ -1607,7 +1607,7 @@ vec3 nonPerturbedNormal = normal;`,qv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1607
1607
  varying vec3 vTangent;
1608
1608
  varying vec3 vBitangent;
1609
1609
  #endif
1610
- #endif`,Kv=`#ifndef FLAT_SHADED
1610
+ #endif`,jv=`#ifndef FLAT_SHADED
1611
1611
  vNormal = normalize( transformedNormal );
1612
1612
  #ifdef USE_TANGENT
1613
1613
  vTangent = normalize( transformedTangent );
@@ -1616,7 +1616,7 @@ vec3 nonPerturbedNormal = normal;`,qv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1616
1616
  vBitangent = - vBitangent;
1617
1617
  #endif
1618
1618
  #endif
1619
- #endif`,jv=`#ifdef USE_NORMALMAP
1619
+ #endif`,Jv=`#ifdef USE_NORMALMAP
1620
1620
  uniform sampler2D normalMap;
1621
1621
  uniform vec2 normalScale;
1622
1622
  #endif
@@ -1638,13 +1638,13 @@ vec3 nonPerturbedNormal = normal;`,qv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1638
1638
  float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1639
1639
  return mat3( T * scale, B * scale, N );
1640
1640
  }
1641
- #endif`,Jv=`#ifdef USE_CLEARCOAT
1641
+ #endif`,Qv=`#ifdef USE_CLEARCOAT
1642
1642
  vec3 clearcoatNormal = nonPerturbedNormal;
1643
- #endif`,Qv=`#ifdef USE_CLEARCOAT_NORMALMAP
1643
+ #endif`,eM=`#ifdef USE_CLEARCOAT_NORMALMAP
1644
1644
  vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1645
1645
  clearcoatMapN.xy *= clearcoatNormalScale;
1646
1646
  clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1647
- #endif`,eM=`#ifdef USE_CLEARCOATMAP
1647
+ #endif`,tM=`#ifdef USE_CLEARCOATMAP
1648
1648
  uniform sampler2D clearcoatMap;
1649
1649
  #endif
1650
1650
  #ifdef USE_CLEARCOAT_NORMALMAP
@@ -1653,18 +1653,18 @@ vec3 nonPerturbedNormal = normal;`,qv=`#ifdef USE_NORMALMAP_OBJECTSPACE
1653
1653
  #endif
1654
1654
  #ifdef USE_CLEARCOAT_ROUGHNESSMAP
1655
1655
  uniform sampler2D clearcoatRoughnessMap;
1656
- #endif`,tM=`#ifdef USE_IRIDESCENCEMAP
1656
+ #endif`,nM=`#ifdef USE_IRIDESCENCEMAP
1657
1657
  uniform sampler2D iridescenceMap;
1658
1658
  #endif
1659
1659
  #ifdef USE_IRIDESCENCE_THICKNESSMAP
1660
1660
  uniform sampler2D iridescenceThicknessMap;
1661
- #endif`,nM=`#ifdef OPAQUE
1661
+ #endif`,iM=`#ifdef OPAQUE
1662
1662
  diffuseColor.a = 1.0;
1663
1663
  #endif
1664
1664
  #ifdef USE_TRANSMISSION
1665
1665
  diffuseColor.a *= material.transmissionAlpha;
1666
1666
  #endif
1667
- gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,iM=`vec3 packNormalToRGB( const in vec3 normal ) {
1667
+ gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rM=`vec3 packNormalToRGB( const in vec3 normal ) {
1668
1668
  return normalize( normal ) * 0.5 + 0.5;
1669
1669
  }
1670
1670
  vec3 unpackRGBToNormal( const in vec3 rgb ) {
@@ -1743,9 +1743,9 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
1743
1743
  #else
1744
1744
  return ( near * far ) / ( ( far - near ) * depth - far );
1745
1745
  #endif
1746
- }`,rM=`#ifdef PREMULTIPLIED_ALPHA
1746
+ }`,sM=`#ifdef PREMULTIPLIED_ALPHA
1747
1747
  gl_FragColor.rgb *= gl_FragColor.a;
1748
- #endif`,sM=`vec4 mvPosition = vec4( transformed, 1.0 );
1748
+ #endif`,aM=`vec4 mvPosition = vec4( transformed, 1.0 );
1749
1749
  #ifdef USE_BATCHING
1750
1750
  mvPosition = batchingMatrix * mvPosition;
1751
1751
  #endif
@@ -1753,22 +1753,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
1753
1753
  mvPosition = instanceMatrix * mvPosition;
1754
1754
  #endif
1755
1755
  mvPosition = modelViewMatrix * mvPosition;
1756
- gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
1756
+ gl_Position = projectionMatrix * mvPosition;`,oM=`#ifdef DITHERING
1757
1757
  gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1758
- #endif`,oM=`#ifdef DITHERING
1758
+ #endif`,lM=`#ifdef DITHERING
1759
1759
  vec3 dithering( vec3 color ) {
1760
1760
  float grid_position = rand( gl_FragCoord.xy );
1761
1761
  vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1762
1762
  dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1763
1763
  return color + dither_shift_RGB;
1764
1764
  }
1765
- #endif`,lM=`float roughnessFactor = roughness;
1765
+ #endif`,cM=`float roughnessFactor = roughness;
1766
1766
  #ifdef USE_ROUGHNESSMAP
1767
1767
  vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1768
1768
  roughnessFactor *= texelRoughness.g;
1769
- #endif`,cM=`#ifdef USE_ROUGHNESSMAP
1769
+ #endif`,uM=`#ifdef USE_ROUGHNESSMAP
1770
1770
  uniform sampler2D roughnessMap;
1771
- #endif`,uM=`#if NUM_SPOT_LIGHT_COORDS > 0
1771
+ #endif`,fM=`#if NUM_SPOT_LIGHT_COORDS > 0
1772
1772
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1773
1773
  #endif
1774
1774
  #if NUM_SPOT_LIGHT_MAPS > 0
@@ -1968,7 +1968,7 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
1968
1968
  }
1969
1969
  #endif
1970
1970
  #endif
1971
- #endif`,fM=`#if NUM_SPOT_LIGHT_COORDS > 0
1971
+ #endif`,dM=`#if NUM_SPOT_LIGHT_COORDS > 0
1972
1972
  uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1973
1973
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1974
1974
  #endif
@@ -2009,7 +2009,7 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
2009
2009
  };
2010
2010
  uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2011
2011
  #endif
2012
- #endif`,dM=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2012
+ #endif`,hM=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2013
2013
  #ifdef HAS_NORMAL
2014
2014
  vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix );
2015
2015
  #else
@@ -2045,7 +2045,7 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
2045
2045
  vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2046
2046
  }
2047
2047
  #pragma unroll_loop_end
2048
- #endif`,hM=`float getShadowMask() {
2048
+ #endif`,pM=`float getShadowMask() {
2049
2049
  float shadow = 1.0;
2050
2050
  #ifdef USE_SHADOWMAP
2051
2051
  #if NUM_DIR_LIGHT_SHADOWS > 0
@@ -2077,12 +2077,12 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
2077
2077
  #endif
2078
2078
  #endif
2079
2079
  return shadow;
2080
- }`,pM=`#ifdef USE_SKINNING
2080
+ }`,mM=`#ifdef USE_SKINNING
2081
2081
  mat4 boneMatX = getBoneMatrix( skinIndex.x );
2082
2082
  mat4 boneMatY = getBoneMatrix( skinIndex.y );
2083
2083
  mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2084
2084
  mat4 boneMatW = getBoneMatrix( skinIndex.w );
2085
- #endif`,mM=`#ifdef USE_SKINNING
2085
+ #endif`,gM=`#ifdef USE_SKINNING
2086
2086
  uniform mat4 bindMatrix;
2087
2087
  uniform mat4 bindMatrixInverse;
2088
2088
  uniform highp sampler2D boneTexture;
@@ -2097,7 +2097,7 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
2097
2097
  vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2098
2098
  return mat4( v1, v2, v3, v4 );
2099
2099
  }
2100
- #endif`,gM=`#ifdef USE_SKINNING
2100
+ #endif`,_M=`#ifdef USE_SKINNING
2101
2101
  vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2102
2102
  vec4 skinned = vec4( 0.0 );
2103
2103
  skinned += boneMatX * skinVertex * skinWeight.x;
@@ -2105,7 +2105,7 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
2105
2105
  skinned += boneMatZ * skinVertex * skinWeight.z;
2106
2106
  skinned += boneMatW * skinVertex * skinWeight.w;
2107
2107
  transformed = ( bindMatrixInverse * skinned ).xyz;
2108
- #endif`,_M=`#ifdef USE_SKINNING
2108
+ #endif`,xM=`#ifdef USE_SKINNING
2109
2109
  mat4 skinMatrix = mat4( 0.0 );
2110
2110
  skinMatrix += skinWeight.x * boneMatX;
2111
2111
  skinMatrix += skinWeight.y * boneMatY;
@@ -2116,17 +2116,17 @@ gl_Position = projectionMatrix * mvPosition;`,aM=`#ifdef DITHERING
2116
2116
  #ifdef USE_TANGENT
2117
2117
  objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2118
2118
  #endif
2119
- #endif`,xM=`float specularStrength;
2119
+ #endif`,vM=`float specularStrength;
2120
2120
  #ifdef USE_SPECULARMAP
2121
2121
  vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2122
2122
  specularStrength = texelSpecular.r;
2123
2123
  #else
2124
2124
  specularStrength = 1.0;
2125
- #endif`,vM=`#ifdef USE_SPECULARMAP
2125
+ #endif`,MM=`#ifdef USE_SPECULARMAP
2126
2126
  uniform sampler2D specularMap;
2127
- #endif`,MM=`#if defined( TONE_MAPPING )
2127
+ #endif`,SM=`#if defined( TONE_MAPPING )
2128
2128
  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2129
- #endif`,SM=`#ifndef saturate
2129
+ #endif`,bM=`#ifndef saturate
2130
2130
  #define saturate( a ) clamp( a, 0.0, 1.0 )
2131
2131
  #endif
2132
2132
  uniform float toneMappingExposure;
@@ -2223,7 +2223,7 @@ vec3 NeutralToneMapping( vec3 color ) {
2223
2223
  float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2224
2224
  return mix( color, vec3( newPeak ), g );
2225
2225
  }
2226
- vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISSION
2226
+ vec3 CustomToneMapping( vec3 color ) { return color; }`,yM=`#ifdef USE_TRANSMISSION
2227
2227
  material.transmission = transmission;
2228
2228
  material.transmissionAlpha = 1.0;
2229
2229
  material.thickness = thickness;
@@ -2244,7 +2244,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISS
2244
2244
  material.attenuationColor, material.attenuationDistance );
2245
2245
  material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2246
2246
  totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2247
- #endif`,yM=`#ifdef USE_TRANSMISSION
2247
+ #endif`,EM=`#ifdef USE_TRANSMISSION
2248
2248
  uniform float transmission;
2249
2249
  uniform float thickness;
2250
2250
  uniform float attenuationDistance;
@@ -2370,7 +2370,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISS
2370
2370
  float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2371
2371
  return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2372
2372
  }
2373
- #endif`,EM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2373
+ #endif`,TM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2374
2374
  varying vec2 vUv;
2375
2375
  #endif
2376
2376
  #ifdef USE_MAP
@@ -2440,7 +2440,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISS
2440
2440
  #ifdef USE_THICKNESSMAP
2441
2441
  uniform mat3 thicknessMapTransform;
2442
2442
  varying vec2 vThicknessMapUv;
2443
- #endif`,TM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2443
+ #endif`,wM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2444
2444
  varying vec2 vUv;
2445
2445
  #endif
2446
2446
  #ifdef USE_MAP
@@ -2534,7 +2534,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISS
2534
2534
  #ifdef USE_THICKNESSMAP
2535
2535
  uniform mat3 thicknessMapTransform;
2536
2536
  varying vec2 vThicknessMapUv;
2537
- #endif`,wM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2537
+ #endif`,AM=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2538
2538
  vUv = vec3( uv, 1 ).xy;
2539
2539
  #endif
2540
2540
  #ifdef USE_MAP
@@ -2605,7 +2605,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISS
2605
2605
  #endif
2606
2606
  #ifdef USE_THICKNESSMAP
2607
2607
  vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2608
- #endif`,AM=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2608
+ #endif`,RM=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2609
2609
  vec4 worldPosition = vec4( transformed, 1.0 );
2610
2610
  #ifdef USE_BATCHING
2611
2611
  worldPosition = batchingMatrix * worldPosition;
@@ -2614,12 +2614,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,bM=`#ifdef USE_TRANSMISS
2614
2614
  worldPosition = instanceMatrix * worldPosition;
2615
2615
  #endif
2616
2616
  worldPosition = modelMatrix * worldPosition;
2617
- #endif`;const RM=`varying vec2 vUv;
2617
+ #endif`;const CM=`varying vec2 vUv;
2618
2618
  uniform mat3 uvTransform;
2619
2619
  void main() {
2620
2620
  vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2621
2621
  gl_Position = vec4( position.xy, 1.0, 1.0 );
2622
- }`,CM=`uniform sampler2D t2D;
2622
+ }`,PM=`uniform sampler2D t2D;
2623
2623
  uniform float backgroundIntensity;
2624
2624
  varying vec2 vUv;
2625
2625
  void main() {
@@ -2631,14 +2631,14 @@ void main() {
2631
2631
  gl_FragColor = texColor;
2632
2632
  #include <tonemapping_fragment>
2633
2633
  #include <colorspace_fragment>
2634
- }`,PM=`varying vec3 vWorldDirection;
2634
+ }`,DM=`varying vec3 vWorldDirection;
2635
2635
  #include <common>
2636
2636
  void main() {
2637
2637
  vWorldDirection = transformDirection( position, modelMatrix );
2638
2638
  #include <begin_vertex>
2639
2639
  #include <project_vertex>
2640
2640
  gl_Position.z = gl_Position.w;
2641
- }`,DM=`#ifdef ENVMAP_TYPE_CUBE
2641
+ }`,LM=`#ifdef ENVMAP_TYPE_CUBE
2642
2642
  uniform samplerCube envMap;
2643
2643
  #elif defined( ENVMAP_TYPE_CUBE_UV )
2644
2644
  uniform sampler2D envMap;
@@ -2660,14 +2660,14 @@ void main() {
2660
2660
  gl_FragColor = texColor;
2661
2661
  #include <tonemapping_fragment>
2662
2662
  #include <colorspace_fragment>
2663
- }`,LM=`varying vec3 vWorldDirection;
2663
+ }`,NM=`varying vec3 vWorldDirection;
2664
2664
  #include <common>
2665
2665
  void main() {
2666
2666
  vWorldDirection = transformDirection( position, modelMatrix );
2667
2667
  #include <begin_vertex>
2668
2668
  #include <project_vertex>
2669
2669
  gl_Position.z = gl_Position.w;
2670
- }`,NM=`uniform samplerCube tCube;
2670
+ }`,IM=`uniform samplerCube tCube;
2671
2671
  uniform float tFlip;
2672
2672
  uniform float opacity;
2673
2673
  varying vec3 vWorldDirection;
@@ -2677,7 +2677,7 @@ void main() {
2677
2677
  gl_FragColor.a *= opacity;
2678
2678
  #include <tonemapping_fragment>
2679
2679
  #include <colorspace_fragment>
2680
- }`,IM=`#include <common>
2680
+ }`,UM=`#include <common>
2681
2681
  #include <batching_pars_vertex>
2682
2682
  #include <uv_pars_vertex>
2683
2683
  #include <displacementmap_pars_vertex>
@@ -2704,7 +2704,7 @@ void main() {
2704
2704
  #include <logdepthbuf_vertex>
2705
2705
  #include <clipping_planes_vertex>
2706
2706
  vHighPrecisionZW = gl_Position.zw;
2707
- }`,UM=`#if DEPTH_PACKING == 3200
2707
+ }`,FM=`#if DEPTH_PACKING == 3200
2708
2708
  uniform float opacity;
2709
2709
  #endif
2710
2710
  #include <common>
@@ -2742,7 +2742,7 @@ void main() {
2742
2742
  #elif DEPTH_PACKING == 3203
2743
2743
  gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2744
2744
  #endif
2745
- }`,FM=`#define DISTANCE
2745
+ }`,OM=`#define DISTANCE
2746
2746
  varying vec3 vWorldPosition;
2747
2747
  #include <common>
2748
2748
  #include <batching_pars_vertex>
@@ -2769,7 +2769,7 @@ void main() {
2769
2769
  #include <worldpos_vertex>
2770
2770
  #include <clipping_planes_vertex>
2771
2771
  vWorldPosition = worldPosition.xyz;
2772
- }`,OM=`#define DISTANCE
2772
+ }`,BM=`#define DISTANCE
2773
2773
  uniform vec3 referencePosition;
2774
2774
  uniform float nearDistance;
2775
2775
  uniform float farDistance;
@@ -2792,13 +2792,13 @@ void main() {
2792
2792
  dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2793
2793
  dist = saturate( dist );
2794
2794
  gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2795
- }`,BM=`varying vec3 vWorldDirection;
2795
+ }`,kM=`varying vec3 vWorldDirection;
2796
2796
  #include <common>
2797
2797
  void main() {
2798
2798
  vWorldDirection = transformDirection( position, modelMatrix );
2799
2799
  #include <begin_vertex>
2800
2800
  #include <project_vertex>
2801
- }`,kM=`uniform sampler2D tEquirect;
2801
+ }`,zM=`uniform sampler2D tEquirect;
2802
2802
  varying vec3 vWorldDirection;
2803
2803
  #include <common>
2804
2804
  void main() {
@@ -2807,7 +2807,7 @@ void main() {
2807
2807
  gl_FragColor = texture2D( tEquirect, sampleUV );
2808
2808
  #include <tonemapping_fragment>
2809
2809
  #include <colorspace_fragment>
2810
- }`,zM=`uniform float scale;
2810
+ }`,GM=`uniform float scale;
2811
2811
  attribute float lineDistance;
2812
2812
  varying float vLineDistance;
2813
2813
  #include <common>
@@ -2829,7 +2829,7 @@ void main() {
2829
2829
  #include <logdepthbuf_vertex>
2830
2830
  #include <clipping_planes_vertex>
2831
2831
  #include <fog_vertex>
2832
- }`,GM=`uniform vec3 diffuse;
2832
+ }`,VM=`uniform vec3 diffuse;
2833
2833
  uniform float opacity;
2834
2834
  uniform float dashSize;
2835
2835
  uniform float totalSize;
@@ -2857,7 +2857,7 @@ void main() {
2857
2857
  #include <colorspace_fragment>
2858
2858
  #include <fog_fragment>
2859
2859
  #include <premultiplied_alpha_fragment>
2860
- }`,VM=`#include <common>
2860
+ }`,HM=`#include <common>
2861
2861
  #include <batching_pars_vertex>
2862
2862
  #include <uv_pars_vertex>
2863
2863
  #include <envmap_pars_vertex>
@@ -2889,7 +2889,7 @@ void main() {
2889
2889
  #include <worldpos_vertex>
2890
2890
  #include <envmap_vertex>
2891
2891
  #include <fog_vertex>
2892
- }`,HM=`uniform vec3 diffuse;
2892
+ }`,WM=`uniform vec3 diffuse;
2893
2893
  uniform float opacity;
2894
2894
  #ifndef FLAT_SHADED
2895
2895
  varying vec3 vNormal;
@@ -2937,7 +2937,7 @@ void main() {
2937
2937
  #include <fog_fragment>
2938
2938
  #include <premultiplied_alpha_fragment>
2939
2939
  #include <dithering_fragment>
2940
- }`,WM=`#define LAMBERT
2940
+ }`,XM=`#define LAMBERT
2941
2941
  varying vec3 vViewPosition;
2942
2942
  #include <common>
2943
2943
  #include <batching_pars_vertex>
@@ -2976,7 +2976,7 @@ void main() {
2976
2976
  #include <envmap_vertex>
2977
2977
  #include <shadowmap_vertex>
2978
2978
  #include <fog_vertex>
2979
- }`,XM=`#define LAMBERT
2979
+ }`,YM=`#define LAMBERT
2980
2980
  uniform vec3 diffuse;
2981
2981
  uniform vec3 emissive;
2982
2982
  uniform float opacity;
@@ -3034,7 +3034,7 @@ void main() {
3034
3034
  #include <fog_fragment>
3035
3035
  #include <premultiplied_alpha_fragment>
3036
3036
  #include <dithering_fragment>
3037
- }`,YM=`#define MATCAP
3037
+ }`,qM=`#define MATCAP
3038
3038
  varying vec3 vViewPosition;
3039
3039
  #include <common>
3040
3040
  #include <batching_pars_vertex>
@@ -3068,7 +3068,7 @@ void main() {
3068
3068
  #include <clipping_planes_vertex>
3069
3069
  #include <fog_vertex>
3070
3070
  vViewPosition = - mvPosition.xyz;
3071
- }`,qM=`#define MATCAP
3071
+ }`,$M=`#define MATCAP
3072
3072
  uniform vec3 diffuse;
3073
3073
  uniform float opacity;
3074
3074
  uniform sampler2D matcap;
@@ -3114,7 +3114,7 @@ void main() {
3114
3114
  #include <fog_fragment>
3115
3115
  #include <premultiplied_alpha_fragment>
3116
3116
  #include <dithering_fragment>
3117
- }`,$M=`#define NORMAL
3117
+ }`,KM=`#define NORMAL
3118
3118
  #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3119
3119
  varying vec3 vViewPosition;
3120
3120
  #endif
@@ -3168,7 +3168,7 @@ void main() {
3168
3168
  #ifdef OPAQUE
3169
3169
  gl_FragColor.a = 1.0;
3170
3170
  #endif
3171
- }`,KM=`#define PHONG
3171
+ }`,jM=`#define PHONG
3172
3172
  varying vec3 vViewPosition;
3173
3173
  #include <common>
3174
3174
  #include <batching_pars_vertex>
@@ -3207,7 +3207,7 @@ void main() {
3207
3207
  #include <envmap_vertex>
3208
3208
  #include <shadowmap_vertex>
3209
3209
  #include <fog_vertex>
3210
- }`,jM=`#define PHONG
3210
+ }`,JM=`#define PHONG
3211
3211
  uniform vec3 diffuse;
3212
3212
  uniform vec3 emissive;
3213
3213
  uniform vec3 specular;
@@ -3267,7 +3267,7 @@ void main() {
3267
3267
  #include <fog_fragment>
3268
3268
  #include <premultiplied_alpha_fragment>
3269
3269
  #include <dithering_fragment>
3270
- }`,JM=`#define STANDARD
3270
+ }`,QM=`#define STANDARD
3271
3271
  varying vec3 vViewPosition;
3272
3272
  #ifdef USE_TRANSMISSION
3273
3273
  varying vec3 vWorldPosition;
@@ -3310,7 +3310,7 @@ void main() {
3310
3310
  #ifdef USE_TRANSMISSION
3311
3311
  vWorldPosition = worldPosition.xyz;
3312
3312
  #endif
3313
- }`,QM=`#define STANDARD
3313
+ }`,eS=`#define STANDARD
3314
3314
  #ifdef PHYSICAL
3315
3315
  #define IOR
3316
3316
  #define USE_SPECULAR
@@ -3435,7 +3435,7 @@ void main() {
3435
3435
  #include <fog_fragment>
3436
3436
  #include <premultiplied_alpha_fragment>
3437
3437
  #include <dithering_fragment>
3438
- }`,eS=`#define TOON
3438
+ }`,tS=`#define TOON
3439
3439
  varying vec3 vViewPosition;
3440
3440
  #include <common>
3441
3441
  #include <batching_pars_vertex>
@@ -3472,7 +3472,7 @@ void main() {
3472
3472
  #include <worldpos_vertex>
3473
3473
  #include <shadowmap_vertex>
3474
3474
  #include <fog_vertex>
3475
- }`,tS=`#define TOON
3475
+ }`,nS=`#define TOON
3476
3476
  uniform vec3 diffuse;
3477
3477
  uniform vec3 emissive;
3478
3478
  uniform float opacity;
@@ -3524,7 +3524,7 @@ void main() {
3524
3524
  #include <fog_fragment>
3525
3525
  #include <premultiplied_alpha_fragment>
3526
3526
  #include <dithering_fragment>
3527
- }`,nS=`uniform float size;
3527
+ }`,iS=`uniform float size;
3528
3528
  uniform float scale;
3529
3529
  #include <common>
3530
3530
  #include <color_pars_vertex>
@@ -3555,7 +3555,7 @@ void main() {
3555
3555
  #include <clipping_planes_vertex>
3556
3556
  #include <worldpos_vertex>
3557
3557
  #include <fog_vertex>
3558
- }`,iS=`uniform vec3 diffuse;
3558
+ }`,rS=`uniform vec3 diffuse;
3559
3559
  uniform float opacity;
3560
3560
  #include <common>
3561
3561
  #include <color_pars_fragment>
@@ -3580,7 +3580,7 @@ void main() {
3580
3580
  #include <colorspace_fragment>
3581
3581
  #include <fog_fragment>
3582
3582
  #include <premultiplied_alpha_fragment>
3583
- }`,rS=`#include <common>
3583
+ }`,sS=`#include <common>
3584
3584
  #include <batching_pars_vertex>
3585
3585
  #include <fog_pars_vertex>
3586
3586
  #include <morphtarget_pars_vertex>
@@ -3603,7 +3603,7 @@ void main() {
3603
3603
  #include <worldpos_vertex>
3604
3604
  #include <shadowmap_vertex>
3605
3605
  #include <fog_vertex>
3606
- }`,sS=`uniform vec3 color;
3606
+ }`,aS=`uniform vec3 color;
3607
3607
  uniform float opacity;
3608
3608
  #include <common>
3609
3609
  #include <fog_pars_fragment>
@@ -3619,7 +3619,7 @@ void main() {
3619
3619
  #include <colorspace_fragment>
3620
3620
  #include <fog_fragment>
3621
3621
  #include <premultiplied_alpha_fragment>
3622
- }`,aS=`uniform float rotation;
3622
+ }`,oS=`uniform float rotation;
3623
3623
  uniform vec2 center;
3624
3624
  #include <common>
3625
3625
  #include <uv_pars_vertex>
@@ -3643,7 +3643,7 @@ void main() {
3643
3643
  #include <logdepthbuf_vertex>
3644
3644
  #include <clipping_planes_vertex>
3645
3645
  #include <fog_vertex>
3646
- }`,oS=`uniform vec3 diffuse;
3646
+ }`,lS=`uniform vec3 diffuse;
3647
3647
  uniform float opacity;
3648
3648
  #include <common>
3649
3649
  #include <uv_pars_fragment>
@@ -3668,7 +3668,7 @@ void main() {
3668
3668
  #include <tonemapping_fragment>
3669
3669
  #include <colorspace_fragment>
3670
3670
  #include <fog_fragment>
3671
- }`,et={alphahash_fragment:Rx,alphahash_pars_fragment:Cx,alphamap_fragment:Px,alphamap_pars_fragment:Dx,alphatest_fragment:Lx,alphatest_pars_fragment:Nx,aomap_fragment:Ix,aomap_pars_fragment:Ux,batching_pars_vertex:Fx,batching_vertex:Ox,begin_vertex:Bx,beginnormal_vertex:kx,bsdfs:zx,iridescence_fragment:Gx,bumpmap_pars_fragment:Vx,clipping_planes_fragment:Hx,clipping_planes_pars_fragment:Wx,clipping_planes_pars_vertex:Xx,clipping_planes_vertex:Yx,color_fragment:qx,color_pars_fragment:$x,color_pars_vertex:Zx,color_vertex:Kx,common:jx,cube_uv_reflection_fragment:Jx,defaultnormal_vertex:Qx,displacementmap_pars_vertex:ev,displacementmap_vertex:tv,emissivemap_fragment:nv,emissivemap_pars_fragment:iv,colorspace_fragment:rv,colorspace_pars_fragment:sv,envmap_fragment:av,envmap_common_pars_fragment:ov,envmap_pars_fragment:lv,envmap_pars_vertex:cv,envmap_physical_pars_fragment:Mv,envmap_vertex:uv,fog_vertex:fv,fog_pars_vertex:dv,fog_fragment:hv,fog_pars_fragment:pv,gradientmap_pars_fragment:mv,lightmap_pars_fragment:gv,lights_lambert_fragment:_v,lights_lambert_pars_fragment:xv,lights_pars_begin:vv,lights_toon_fragment:Sv,lights_toon_pars_fragment:bv,lights_phong_fragment:yv,lights_phong_pars_fragment:Ev,lights_physical_fragment:Tv,lights_physical_pars_fragment:wv,lights_fragment_begin:Av,lights_fragment_maps:Rv,lights_fragment_end:Cv,lightprobes_pars_fragment:Pv,logdepthbuf_fragment:Dv,logdepthbuf_pars_fragment:Lv,logdepthbuf_pars_vertex:Nv,logdepthbuf_vertex:Iv,map_fragment:Uv,map_pars_fragment:Fv,map_particle_fragment:Ov,map_particle_pars_fragment:Bv,metalnessmap_fragment:kv,metalnessmap_pars_fragment:zv,morphinstance_vertex:Gv,morphcolor_vertex:Vv,morphnormal_vertex:Hv,morphtarget_pars_vertex:Wv,morphtarget_vertex:Xv,normal_fragment_begin:Yv,normal_fragment_maps:qv,normal_pars_fragment:$v,normal_pars_vertex:Zv,normal_vertex:Kv,normalmap_pars_fragment:jv,clearcoat_normal_fragment_begin:Jv,clearcoat_normal_fragment_maps:Qv,clearcoat_pars_fragment:eM,iridescence_pars_fragment:tM,opaque_fragment:nM,packing:iM,premultiplied_alpha_fragment:rM,project_vertex:sM,dithering_fragment:aM,dithering_pars_fragment:oM,roughnessmap_fragment:lM,roughnessmap_pars_fragment:cM,shadowmap_pars_fragment:uM,shadowmap_pars_vertex:fM,shadowmap_vertex:dM,shadowmask_pars_fragment:hM,skinbase_vertex:pM,skinning_pars_vertex:mM,skinning_vertex:gM,skinnormal_vertex:_M,specularmap_fragment:xM,specularmap_pars_fragment:vM,tonemapping_fragment:MM,tonemapping_pars_fragment:SM,transmission_fragment:bM,transmission_pars_fragment:yM,uv_pars_fragment:EM,uv_pars_vertex:TM,uv_vertex:wM,worldpos_vertex:AM,background_vert:RM,background_frag:CM,backgroundCube_vert:PM,backgroundCube_frag:DM,cube_vert:LM,cube_frag:NM,depth_vert:IM,depth_frag:UM,distance_vert:FM,distance_frag:OM,equirect_vert:BM,equirect_frag:kM,linedashed_vert:zM,linedashed_frag:GM,meshbasic_vert:VM,meshbasic_frag:HM,meshlambert_vert:WM,meshlambert_frag:XM,meshmatcap_vert:YM,meshmatcap_frag:qM,meshnormal_vert:$M,meshnormal_frag:ZM,meshphong_vert:KM,meshphong_frag:jM,meshphysical_vert:JM,meshphysical_frag:QM,meshtoon_vert:eS,meshtoon_frag:tS,points_vert:nS,points_frag:iS,shadow_vert:rS,shadow_frag:sS,sprite_vert:aS,sprite_frag:oS},be={common:{diffuse:{value:new ht(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new je}},envmap:{envMap:{value:null},envMapRotation:{value:new je},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new je},normalScale:{value:new gt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ht(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new X},probesMax:{value:new X},probesResolution:{value:new X}},points:{diffuse:{value:new ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0},uvTransform:{value:new je}},sprite:{diffuse:{value:new ht(16777215)},opacity:{value:1},center:{value:new gt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}}},Di={basic:{uniforms:Pn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:et.meshbasic_vert,fragmentShader:et.meshbasic_frag},lambert:{uniforms:Pn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new ht(0)},envMapIntensity:{value:1}}]),vertexShader:et.meshlambert_vert,fragmentShader:et.meshlambert_frag},phong:{uniforms:Pn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new ht(0)},specular:{value:new ht(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:et.meshphong_vert,fragmentShader:et.meshphong_frag},standard:{uniforms:Pn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag},toon:{uniforms:Pn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new ht(0)}}]),vertexShader:et.meshtoon_vert,fragmentShader:et.meshtoon_frag},matcap:{uniforms:Pn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:et.meshmatcap_vert,fragmentShader:et.meshmatcap_frag},points:{uniforms:Pn([be.points,be.fog]),vertexShader:et.points_vert,fragmentShader:et.points_frag},dashed:{uniforms:Pn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:et.linedashed_vert,fragmentShader:et.linedashed_frag},depth:{uniforms:Pn([be.common,be.displacementmap]),vertexShader:et.depth_vert,fragmentShader:et.depth_frag},normal:{uniforms:Pn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:et.meshnormal_vert,fragmentShader:et.meshnormal_frag},sprite:{uniforms:Pn([be.sprite,be.fog]),vertexShader:et.sprite_vert,fragmentShader:et.sprite_frag},background:{uniforms:{uvTransform:{value:new je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:et.background_vert,fragmentShader:et.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new je}},vertexShader:et.backgroundCube_vert,fragmentShader:et.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:et.cube_vert,fragmentShader:et.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:et.equirect_vert,fragmentShader:et.equirect_frag},distance:{uniforms:Pn([be.common,be.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:et.distance_vert,fragmentShader:et.distance_frag},shadow:{uniforms:Pn([be.lights,be.fog,{color:{value:new ht(0)},opacity:{value:1}}]),vertexShader:et.shadow_vert,fragmentShader:et.shadow_frag}};Di.physical={uniforms:Pn([Di.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new je},clearcoatNormalScale:{value:new gt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new je},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new je},sheen:{value:0},sheenColor:{value:new ht(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new je},transmissionSamplerSize:{value:new gt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new je},attenuationDistance:{value:0},attenuationColor:{value:new ht(0)},specularColor:{value:new ht(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new je},anisotropyVector:{value:new gt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new je}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag};const Vo={r:0,b:0,g:0},lS=new Yt,Nm=new je;Nm.set(-1,0,0,0,1,0,0,0,1);function cS(r,e,t,n,i,s){const a=new ht(0);let o=i===!0?0:1,l,c,u=null,h=0,f=null;function d(b){let y=b.isScene===!0?b.background:null;if(y&&y.isTexture){const M=b.backgroundBlurriness>0;y=e.get(y,M)}return y}function g(b){let y=!1;const M=d(b);M===null?p(a,o):M&&M.isColor&&(p(M,1),y=!0);const E=r.xr.getEnvironmentBlendMode();E==="additive"?t.buffers.color.setClear(0,0,0,1,s):E==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,s),(r.autoClear||y)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function _(b,y){const M=d(y);M&&(M.isCubeTexture||M.mapping===Cl)?(c===void 0&&(c=new or(new ro(1,1,1),new yi({name:"BackgroundCubeMaterial",uniforms:sa(Di.backgroundCube.uniforms),vertexShader:Di.backgroundCube.vertexShader,fragmentShader:Di.backgroundCube.fragmentShader,side:Vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=M,c.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(lS.makeRotationFromEuler(y.backgroundRotation)).transpose(),M.isCubeTexture&&M.isRenderTargetTexture===!1&&c.material.uniforms.backgroundRotation.value.premultiply(Nm),c.material.toneMapped=ft.getTransfer(M.colorSpace)!==vt,(u!==M||h!==M.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=M,h=M.version,f=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null)):M&&M.isTexture&&(l===void 0&&(l=new or(new Dl(2,2),new yi({name:"BackgroundMaterial",uniforms:sa(Di.background.uniforms),vertexShader:Di.background.vertexShader,fragmentShader:Di.background.fragmentShader,side:Lr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=M,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.toneMapped=ft.getTransfer(M.colorSpace)!==vt,M.matrixAutoUpdate===!0&&M.updateMatrix(),l.material.uniforms.uvTransform.value.copy(M.matrix),(u!==M||h!==M.version||f!==r.toneMapping)&&(l.material.needsUpdate=!0,u=M,h=M.version,f=r.toneMapping),l.layers.enableAll(),b.unshift(l,l.geometry,l.material,0,0,null))}function p(b,y){b.getRGB(Vo,Cm(r)),t.buffers.color.setClear(Vo.r,Vo.g,Vo.b,y,s)}function m(){c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return a},setClearColor:function(b,y=1){a.set(b),o=y,p(a,o)},getClearAlpha:function(){return o},setClearAlpha:function(b){o=b,p(a,o)},render:g,addToRenderList:_,dispose:m}}function uS(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=f(null);let s=i,a=!1;function o(L,N,Y,H,O){let z=!1;const I=h(L,H,Y,N);s!==I&&(s=I,c(s.object)),z=d(L,H,Y,O),z&&g(L,H,Y,O),O!==null&&e.update(O,r.ELEMENT_ARRAY_BUFFER),(z||a)&&(a=!1,M(L,N,Y,H),O!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(O).buffer))}function l(){return r.createVertexArray()}function c(L){return r.bindVertexArray(L)}function u(L){return r.deleteVertexArray(L)}function h(L,N,Y,H){const O=H.wireframe===!0;let z=n[N.id];z===void 0&&(z={},n[N.id]=z);const I=L.isInstancedMesh===!0?L.id:0;let q=z[I];q===void 0&&(q={},z[I]=q);let j=q[Y.id];j===void 0&&(j={},q[Y.id]=j);let D=j[O];return D===void 0&&(D=f(l()),j[O]=D),D}function f(L){const N=[],Y=[],H=[];for(let O=0;O<t;O++)N[O]=0,Y[O]=0,H[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:Y,attributeDivisors:H,object:L,attributes:{},index:null}}function d(L,N,Y,H){const O=s.attributes,z=N.attributes;let I=0;const q=Y.getAttributes();for(const j in q)if(q[j].location>=0){const se=O[j];let pe=z[j];if(pe===void 0&&(j==="instanceMatrix"&&L.instanceMatrix&&(pe=L.instanceMatrix),j==="instanceColor"&&L.instanceColor&&(pe=L.instanceColor)),se===void 0||se.attribute!==pe||pe&&se.data!==pe.data)return!0;I++}return s.attributesNum!==I||s.index!==H}function g(L,N,Y,H){const O={},z=N.attributes;let I=0;const q=Y.getAttributes();for(const j in q)if(q[j].location>=0){let se=z[j];se===void 0&&(j==="instanceMatrix"&&L.instanceMatrix&&(se=L.instanceMatrix),j==="instanceColor"&&L.instanceColor&&(se=L.instanceColor));const pe={};pe.attribute=se,se&&se.data&&(pe.data=se.data),O[j]=pe,I++}s.attributes=O,s.attributesNum=I,s.index=H}function _(){const L=s.newAttributes;for(let N=0,Y=L.length;N<Y;N++)L[N]=0}function p(L){m(L,0)}function m(L,N){const Y=s.newAttributes,H=s.enabledAttributes,O=s.attributeDivisors;Y[L]=1,H[L]===0&&(r.enableVertexAttribArray(L),H[L]=1),O[L]!==N&&(r.vertexAttribDivisor(L,N),O[L]=N)}function b(){const L=s.newAttributes,N=s.enabledAttributes;for(let Y=0,H=N.length;Y<H;Y++)N[Y]!==L[Y]&&(r.disableVertexAttribArray(Y),N[Y]=0)}function y(L,N,Y,H,O,z,I){I===!0?r.vertexAttribIPointer(L,N,Y,O,z):r.vertexAttribPointer(L,N,Y,H,O,z)}function M(L,N,Y,H){_();const O=H.attributes,z=Y.getAttributes(),I=N.defaultAttributeValues;for(const q in z){const j=z[q];if(j.location>=0){let D=O[q];if(D===void 0&&(q==="instanceMatrix"&&L.instanceMatrix&&(D=L.instanceMatrix),q==="instanceColor"&&L.instanceColor&&(D=L.instanceColor)),D!==void 0){const se=D.normalized,pe=D.itemSize,Ve=e.get(D);if(Ve===void 0)continue;const He=Ve.buffer,Le=Ve.type,Q=Ve.bytesPerElement,oe=Le===r.INT||Le===r.UNSIGNED_INT||D.gpuType===xf;if(D.isInterleavedBufferAttribute){const ne=D.data,Ee=ne.stride,Oe=D.offset;if(ne.isInstancedInterleavedBuffer){for(let Te=0;Te<j.locationSize;Te++)m(j.location+Te,ne.meshPerAttribute);L.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=ne.meshPerAttribute*ne.count)}else for(let Te=0;Te<j.locationSize;Te++)p(j.location+Te);r.bindBuffer(r.ARRAY_BUFFER,He);for(let Te=0;Te<j.locationSize;Te++)y(j.location+Te,pe/j.locationSize,Le,se,Ee*Q,(Oe+pe/j.locationSize*Te)*Q,oe)}else{if(D.isInstancedBufferAttribute){for(let ne=0;ne<j.locationSize;ne++)m(j.location+ne,D.meshPerAttribute);L.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=D.meshPerAttribute*D.count)}else for(let ne=0;ne<j.locationSize;ne++)p(j.location+ne);r.bindBuffer(r.ARRAY_BUFFER,He);for(let ne=0;ne<j.locationSize;ne++)y(j.location+ne,pe/j.locationSize,Le,se,pe*Q,pe/j.locationSize*ne*Q,oe)}}else if(I!==void 0){const se=I[q];if(se!==void 0)switch(se.length){case 2:r.vertexAttrib2fv(j.location,se);break;case 3:r.vertexAttrib3fv(j.location,se);break;case 4:r.vertexAttrib4fv(j.location,se);break;default:r.vertexAttrib1fv(j.location,se)}}}}b()}function E(){w();for(const L in n){const N=n[L];for(const Y in N){const H=N[Y];for(const O in H){const z=H[O];for(const I in z)u(z[I].object),delete z[I];delete H[O]}}delete n[L]}}function T(L){if(n[L.id]===void 0)return;const N=n[L.id];for(const Y in N){const H=N[Y];for(const O in H){const z=H[O];for(const I in z)u(z[I].object),delete z[I];delete H[O]}}delete n[L.id]}function A(L){for(const N in n){const Y=n[N];for(const H in Y){const O=Y[H];if(O[L.id]===void 0)continue;const z=O[L.id];for(const I in z)u(z[I].object),delete z[I];delete O[L.id]}}}function v(L){for(const N in n){const Y=n[N],H=L.isInstancedMesh===!0?L.id:0,O=Y[H];if(O!==void 0){for(const z in O){const I=O[z];for(const q in I)u(I[q].object),delete I[q];delete O[z]}delete Y[H],Object.keys(Y).length===0&&delete n[N]}}}function w(){C(),a=!0,s!==i&&(s=i,c(s.object))}function C(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:w,resetDefaultState:C,dispose:E,releaseStatesOfGeometry:T,releaseStatesOfObject:v,releaseStatesOfProgram:A,initAttributes:_,enableAttribute:p,disableUnusedAttributes:b}}function fS(r,e,t){let n;function i(l){n=l}function s(l,c){r.drawArrays(n,l,c),t.update(c,n,1)}function a(l,c,u){u!==0&&(r.drawArraysInstanced(n,l,c,u),t.update(c,n,u))}function o(l,c,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,c,0,u);let f=0;for(let d=0;d<u;d++)f+=c[d];t.update(f,n,1)}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o}function dS(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(A){return!(A!==bi&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const v=A===sr&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==hi&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==Ui&&!v)}function l(A){if(A==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&($e("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,f=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&f===!1&&$e("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),g=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),b=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),y=r.getParameter(r.MAX_VARYING_VECTORS),M=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),E=r.getParameter(r.MAX_SAMPLES),T=r.getParameter(r.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:h,reversedDepthBuffer:f,maxTextures:d,maxVertexTextures:g,maxTextureSize:_,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:b,maxVaryings:y,maxFragmentUniforms:M,maxSamples:E,samples:T}}function hS(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Wr,o=new je,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const d=h.length!==0||f||n!==0||i;return i=f,n=h.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){t=u(h,f,0)},this.setState=function(h,f,d){const g=h.clippingPlanes,_=h.clipIntersection,p=h.clipShadows,m=r.get(h);if(!i||g===null||g.length===0||s&&!p)s?u(null):c();else{const b=s?0:n,y=b*4;let M=m.clippingState||null;l.value=M,M=u(g,f,y,d);for(let E=0;E!==y;++E)M[E]=t[E];m.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,f,d,g){const _=h!==null?h.length:0;let p=null;if(_!==0){if(p=l.value,g!==!0||p===null){const m=d+_*4,b=f.matrixWorldInverse;o.getNormalMatrix(b),(p===null||p.length<m)&&(p=new Float32Array(m));for(let y=0,M=d;y!==_;++y,M+=4)a.copy(h[y]).applyMatrix4(b,o),a.normal.toArray(p,M),p[M+3]=a.constant}l.value=p,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,p}}const Er=4,eh=[.125,.215,.35,.446,.526,.582],Yr=20,pS=256,ga=new Dm,th=new ht;let Mc=null,Sc=0,bc=0,yc=!1;const mS=new X;class nh{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,s={}){const{size:a=256,position:o=mS}=s;Mc=this._renderer.getRenderTarget(),Sc=this._renderer.getActiveCubeFace(),bc=this._renderer.getActiveMipmapLevel(),yc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=rh(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(Mc,Sc,bc),this._renderer.xr.enabled=yc,e.scissorTest=!1,Ls(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===os||e.mapping===ia?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Mc=this._renderer.getRenderTarget(),Sc=this._renderer.getActiveCubeFace(),bc=this._renderer.getActiveMipmapLevel(),yc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:yn,minFilter:yn,generateMipmaps:!1,type:sr,format:bi,colorSpace:Ml,depthBuffer:!1},i=ih(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ih(e,t,n);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=gS(s)),this._blurMaterial=xS(s,e,t),this._ggxMaterial=_S(s,e,t)}return i}_compileMaterial(e){const t=new or(new Ei,e);this._renderer.compile(t,ga)}_sceneToCubeUV(e,t,n,i,s){const l=new di(90,1,t,n),c=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,d=h.toneMapping;h.getClearColor(th),h.toneMapping=Bi,h.autoClear=!1,h.state.buffers.depth.getReversed()&&(h.setRenderTarget(i),h.clearDepth(),h.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new or(new ro,new Tm({name:"PMREM.Background",side:Vn,depthWrite:!1,depthTest:!1})));const _=this._backgroundBox,p=_.material;let m=!1;const b=e.background;b?b.isColor&&(p.color.copy(b),e.background=null,m=!0):(p.color.copy(th),m=!0);for(let y=0;y<6;y++){const M=y%3;M===0?(l.up.set(0,c[y],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[y],s.y,s.z)):M===1?(l.up.set(0,0,c[y]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[y],s.z)):(l.up.set(0,c[y],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[y]));const E=this._cubeSize;Ls(i,M*E,y>2?E:0,E,E),h.setRenderTarget(i),m&&h.render(_,l),h.render(e,l)}h.toneMapping=d,h.autoClear=f,e.background=b}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===os||e.mapping===ia;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=sh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=rh());const s=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=s;const o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;Ls(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,ga)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let s=1;s<i;s++)this._applyGGXFilter(e,s-1,s);t.autoClear=n}_applyGGXFilter(e,t,n){const i=this._renderer,s=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;const l=a.uniforms,c=n/(this._lodMeshes.length-1),u=t/(this._lodMeshes.length-1),h=Math.sqrt(c*c-u*u),f=0+c*1.25,d=h*f,{_lodMax:g}=this,_=this._sizeLods[n],p=3*_*(n>g-Er?n-g+Er:0),m=4*(this._cubeSize-_);l.envMap.value=e.texture,l.roughness.value=d,l.mipInt.value=g-t,Ls(s,p,m,3*_,2*_),i.setRenderTarget(s),i.render(o,ga),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-n,Ls(e,p,m,3*_,2*_),i.setRenderTarget(e),i.render(o,ga)}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&mt("blur direction must be either latitudinal or longitudinal!");const u=3,h=this._lodMeshes[i];h.material=c;const f=c.uniforms,d=this._sizeLods[n]-1,g=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*Yr-1),_=s/g,p=isFinite(s)?1+Math.floor(u*_):Yr;p>Yr&&$e(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Yr}`);const m=[];let b=0;for(let A=0;A<Yr;++A){const v=A/_,w=Math.exp(-v*v/2);m.push(w),A===0?b+=w:A<p&&(b+=2*w)}for(let A=0;A<m.length;A++)m[A]=m[A]/b;f.envMap.value=e.texture,f.samples.value=p,f.weights.value=m,f.latitudinal.value=a==="latitudinal",o&&(f.poleAxis.value=o);const{_lodMax:y}=this;f.dTheta.value=g,f.mipInt.value=y-n;const M=this._sizeLods[i],E=3*M*(i>y-Er?i-y+Er:0),T=4*(this._cubeSize-M);Ls(t,E,T,3*M,2*M),l.setRenderTarget(t),l.render(h,ga)}}function gS(r){const e=[],t=[],n=[];let i=r;const s=r-Er+1+eh.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);e.push(o);let l=1/o;a>r-Er?l=eh[a-r+Er-1]:a===0&&(l=0),t.push(l);const c=1/(o-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],d=6,g=6,_=3,p=2,m=1,b=new Float32Array(_*g*d),y=new Float32Array(p*g*d),M=new Float32Array(m*g*d);for(let T=0;T<d;T++){const A=T%3*2/3-1,v=T>2?0:-1,w=[A,v,0,A+2/3,v,0,A+2/3,v+1,0,A,v,0,A+2/3,v+1,0,A,v+1,0];b.set(w,_*g*T),y.set(f,p*g*T);const C=[T,T,T,T,T,T];M.set(C,m*g*T)}const E=new Ei;E.setAttribute("position",new Mn(b,_)),E.setAttribute("uv",new Mn(y,p)),E.setAttribute("faceIndex",new Mn(M,m)),n.push(new or(E,null)),i>Er&&i--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function ih(r,e,t){const n=new ki(r,e,t);return n.texture.mapping=Cl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ls(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function _S(r,e,t){return new yi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:pS,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Ll(),fragmentShader:`
3671
+ }`,et={alphahash_fragment:Cx,alphahash_pars_fragment:Px,alphamap_fragment:Dx,alphamap_pars_fragment:Lx,alphatest_fragment:Nx,alphatest_pars_fragment:Ix,aomap_fragment:Ux,aomap_pars_fragment:Fx,batching_pars_vertex:Ox,batching_vertex:Bx,begin_vertex:kx,beginnormal_vertex:zx,bsdfs:Gx,iridescence_fragment:Vx,bumpmap_pars_fragment:Hx,clipping_planes_fragment:Wx,clipping_planes_pars_fragment:Xx,clipping_planes_pars_vertex:Yx,clipping_planes_vertex:qx,color_fragment:$x,color_pars_fragment:Kx,color_pars_vertex:Zx,color_vertex:jx,common:Jx,cube_uv_reflection_fragment:Qx,defaultnormal_vertex:ev,displacementmap_pars_vertex:tv,displacementmap_vertex:nv,emissivemap_fragment:iv,emissivemap_pars_fragment:rv,colorspace_fragment:sv,colorspace_pars_fragment:av,envmap_fragment:ov,envmap_common_pars_fragment:lv,envmap_pars_fragment:cv,envmap_pars_vertex:uv,envmap_physical_pars_fragment:Sv,envmap_vertex:fv,fog_vertex:dv,fog_pars_vertex:hv,fog_fragment:pv,fog_pars_fragment:mv,gradientmap_pars_fragment:gv,lightmap_pars_fragment:_v,lights_lambert_fragment:xv,lights_lambert_pars_fragment:vv,lights_pars_begin:Mv,lights_toon_fragment:bv,lights_toon_pars_fragment:yv,lights_phong_fragment:Ev,lights_phong_pars_fragment:Tv,lights_physical_fragment:wv,lights_physical_pars_fragment:Av,lights_fragment_begin:Rv,lights_fragment_maps:Cv,lights_fragment_end:Pv,lightprobes_pars_fragment:Dv,logdepthbuf_fragment:Lv,logdepthbuf_pars_fragment:Nv,logdepthbuf_pars_vertex:Iv,logdepthbuf_vertex:Uv,map_fragment:Fv,map_pars_fragment:Ov,map_particle_fragment:Bv,map_particle_pars_fragment:kv,metalnessmap_fragment:zv,metalnessmap_pars_fragment:Gv,morphinstance_vertex:Vv,morphcolor_vertex:Hv,morphnormal_vertex:Wv,morphtarget_pars_vertex:Xv,morphtarget_vertex:Yv,normal_fragment_begin:qv,normal_fragment_maps:$v,normal_pars_fragment:Kv,normal_pars_vertex:Zv,normal_vertex:jv,normalmap_pars_fragment:Jv,clearcoat_normal_fragment_begin:Qv,clearcoat_normal_fragment_maps:eM,clearcoat_pars_fragment:tM,iridescence_pars_fragment:nM,opaque_fragment:iM,packing:rM,premultiplied_alpha_fragment:sM,project_vertex:aM,dithering_fragment:oM,dithering_pars_fragment:lM,roughnessmap_fragment:cM,roughnessmap_pars_fragment:uM,shadowmap_pars_fragment:fM,shadowmap_pars_vertex:dM,shadowmap_vertex:hM,shadowmask_pars_fragment:pM,skinbase_vertex:mM,skinning_pars_vertex:gM,skinning_vertex:_M,skinnormal_vertex:xM,specularmap_fragment:vM,specularmap_pars_fragment:MM,tonemapping_fragment:SM,tonemapping_pars_fragment:bM,transmission_fragment:yM,transmission_pars_fragment:EM,uv_pars_fragment:TM,uv_pars_vertex:wM,uv_vertex:AM,worldpos_vertex:RM,background_vert:CM,background_frag:PM,backgroundCube_vert:DM,backgroundCube_frag:LM,cube_vert:NM,cube_frag:IM,depth_vert:UM,depth_frag:FM,distance_vert:OM,distance_frag:BM,equirect_vert:kM,equirect_frag:zM,linedashed_vert:GM,linedashed_frag:VM,meshbasic_vert:HM,meshbasic_frag:WM,meshlambert_vert:XM,meshlambert_frag:YM,meshmatcap_vert:qM,meshmatcap_frag:$M,meshnormal_vert:KM,meshnormal_frag:ZM,meshphong_vert:jM,meshphong_frag:JM,meshphysical_vert:QM,meshphysical_frag:eS,meshtoon_vert:tS,meshtoon_frag:nS,points_vert:iS,points_frag:rS,shadow_vert:sS,shadow_frag:aS,sprite_vert:oS,sprite_frag:lS},be={common:{diffuse:{value:new ht(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new je}},envmap:{envMap:{value:null},envMapRotation:{value:new je},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new je},normalScale:{value:new gt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ht(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new X},probesMax:{value:new X},probesResolution:{value:new X}},points:{diffuse:{value:new ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0},uvTransform:{value:new je}},sprite:{diffuse:{value:new ht(16777215)},opacity:{value:1},center:{value:new gt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}}},Di={basic:{uniforms:Pn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:et.meshbasic_vert,fragmentShader:et.meshbasic_frag},lambert:{uniforms:Pn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new ht(0)},envMapIntensity:{value:1}}]),vertexShader:et.meshlambert_vert,fragmentShader:et.meshlambert_frag},phong:{uniforms:Pn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new ht(0)},specular:{value:new ht(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:et.meshphong_vert,fragmentShader:et.meshphong_frag},standard:{uniforms:Pn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag},toon:{uniforms:Pn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new ht(0)}}]),vertexShader:et.meshtoon_vert,fragmentShader:et.meshtoon_frag},matcap:{uniforms:Pn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:et.meshmatcap_vert,fragmentShader:et.meshmatcap_frag},points:{uniforms:Pn([be.points,be.fog]),vertexShader:et.points_vert,fragmentShader:et.points_frag},dashed:{uniforms:Pn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:et.linedashed_vert,fragmentShader:et.linedashed_frag},depth:{uniforms:Pn([be.common,be.displacementmap]),vertexShader:et.depth_vert,fragmentShader:et.depth_frag},normal:{uniforms:Pn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:et.meshnormal_vert,fragmentShader:et.meshnormal_frag},sprite:{uniforms:Pn([be.sprite,be.fog]),vertexShader:et.sprite_vert,fragmentShader:et.sprite_frag},background:{uniforms:{uvTransform:{value:new je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:et.background_vert,fragmentShader:et.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new je}},vertexShader:et.backgroundCube_vert,fragmentShader:et.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:et.cube_vert,fragmentShader:et.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:et.equirect_vert,fragmentShader:et.equirect_frag},distance:{uniforms:Pn([be.common,be.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:et.distance_vert,fragmentShader:et.distance_frag},shadow:{uniforms:Pn([be.lights,be.fog,{color:{value:new ht(0)},opacity:{value:1}}]),vertexShader:et.shadow_vert,fragmentShader:et.shadow_frag}};Di.physical={uniforms:Pn([Di.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new je},clearcoatNormalScale:{value:new gt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new je},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new je},sheen:{value:0},sheenColor:{value:new ht(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new je},transmissionSamplerSize:{value:new gt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new je},attenuationDistance:{value:0},attenuationColor:{value:new ht(0)},specularColor:{value:new ht(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new je},anisotropyVector:{value:new gt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new je}}]),vertexShader:et.meshphysical_vert,fragmentShader:et.meshphysical_frag};const Vo={r:0,b:0,g:0},cS=new Yt,Nm=new je;Nm.set(-1,0,0,0,1,0,0,0,1);function uS(r,e,t,n,i,s){const a=new ht(0);let o=i===!0?0:1,l,c,u=null,h=0,f=null;function d(b){let y=b.isScene===!0?b.background:null;if(y&&y.isTexture){const M=b.backgroundBlurriness>0;y=e.get(y,M)}return y}function g(b){let y=!1;const M=d(b);M===null?p(a,o):M&&M.isColor&&(p(M,1),y=!0);const E=r.xr.getEnvironmentBlendMode();E==="additive"?t.buffers.color.setClear(0,0,0,1,s):E==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,s),(r.autoClear||y)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function _(b,y){const M=d(y);M&&(M.isCubeTexture||M.mapping===Cl)?(c===void 0&&(c=new or(new ro(1,1,1),new yi({name:"BackgroundCubeMaterial",uniforms:sa(Di.backgroundCube.uniforms),vertexShader:Di.backgroundCube.vertexShader,fragmentShader:Di.backgroundCube.fragmentShader,side:Vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=M,c.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(cS.makeRotationFromEuler(y.backgroundRotation)).transpose(),M.isCubeTexture&&M.isRenderTargetTexture===!1&&c.material.uniforms.backgroundRotation.value.premultiply(Nm),c.material.toneMapped=ft.getTransfer(M.colorSpace)!==vt,(u!==M||h!==M.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=M,h=M.version,f=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null)):M&&M.isTexture&&(l===void 0&&(l=new or(new Dl(2,2),new yi({name:"BackgroundMaterial",uniforms:sa(Di.background.uniforms),vertexShader:Di.background.vertexShader,fragmentShader:Di.background.fragmentShader,side:Lr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=M,l.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,l.material.toneMapped=ft.getTransfer(M.colorSpace)!==vt,M.matrixAutoUpdate===!0&&M.updateMatrix(),l.material.uniforms.uvTransform.value.copy(M.matrix),(u!==M||h!==M.version||f!==r.toneMapping)&&(l.material.needsUpdate=!0,u=M,h=M.version,f=r.toneMapping),l.layers.enableAll(),b.unshift(l,l.geometry,l.material,0,0,null))}function p(b,y){b.getRGB(Vo,Cm(r)),t.buffers.color.setClear(Vo.r,Vo.g,Vo.b,y,s)}function m(){c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return a},setClearColor:function(b,y=1){a.set(b),o=y,p(a,o)},getClearAlpha:function(){return o},setClearAlpha:function(b){o=b,p(a,o)},render:g,addToRenderList:_,dispose:m}}function fS(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=f(null);let s=i,a=!1;function o(L,N,Y,H,O){let z=!1;const I=h(L,H,Y,N);s!==I&&(s=I,c(s.object)),z=d(L,H,Y,O),z&&g(L,H,Y,O),O!==null&&e.update(O,r.ELEMENT_ARRAY_BUFFER),(z||a)&&(a=!1,M(L,N,Y,H),O!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(O).buffer))}function l(){return r.createVertexArray()}function c(L){return r.bindVertexArray(L)}function u(L){return r.deleteVertexArray(L)}function h(L,N,Y,H){const O=H.wireframe===!0;let z=n[N.id];z===void 0&&(z={},n[N.id]=z);const I=L.isInstancedMesh===!0?L.id:0;let q=z[I];q===void 0&&(q={},z[I]=q);let j=q[Y.id];j===void 0&&(j={},q[Y.id]=j);let D=j[O];return D===void 0&&(D=f(l()),j[O]=D),D}function f(L){const N=[],Y=[],H=[];for(let O=0;O<t;O++)N[O]=0,Y[O]=0,H[O]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:Y,attributeDivisors:H,object:L,attributes:{},index:null}}function d(L,N,Y,H){const O=s.attributes,z=N.attributes;let I=0;const q=Y.getAttributes();for(const j in q)if(q[j].location>=0){const se=O[j];let pe=z[j];if(pe===void 0&&(j==="instanceMatrix"&&L.instanceMatrix&&(pe=L.instanceMatrix),j==="instanceColor"&&L.instanceColor&&(pe=L.instanceColor)),se===void 0||se.attribute!==pe||pe&&se.data!==pe.data)return!0;I++}return s.attributesNum!==I||s.index!==H}function g(L,N,Y,H){const O={},z=N.attributes;let I=0;const q=Y.getAttributes();for(const j in q)if(q[j].location>=0){let se=z[j];se===void 0&&(j==="instanceMatrix"&&L.instanceMatrix&&(se=L.instanceMatrix),j==="instanceColor"&&L.instanceColor&&(se=L.instanceColor));const pe={};pe.attribute=se,se&&se.data&&(pe.data=se.data),O[j]=pe,I++}s.attributes=O,s.attributesNum=I,s.index=H}function _(){const L=s.newAttributes;for(let N=0,Y=L.length;N<Y;N++)L[N]=0}function p(L){m(L,0)}function m(L,N){const Y=s.newAttributes,H=s.enabledAttributes,O=s.attributeDivisors;Y[L]=1,H[L]===0&&(r.enableVertexAttribArray(L),H[L]=1),O[L]!==N&&(r.vertexAttribDivisor(L,N),O[L]=N)}function b(){const L=s.newAttributes,N=s.enabledAttributes;for(let Y=0,H=N.length;Y<H;Y++)N[Y]!==L[Y]&&(r.disableVertexAttribArray(Y),N[Y]=0)}function y(L,N,Y,H,O,z,I){I===!0?r.vertexAttribIPointer(L,N,Y,O,z):r.vertexAttribPointer(L,N,Y,H,O,z)}function M(L,N,Y,H){_();const O=H.attributes,z=Y.getAttributes(),I=N.defaultAttributeValues;for(const q in z){const j=z[q];if(j.location>=0){let D=O[q];if(D===void 0&&(q==="instanceMatrix"&&L.instanceMatrix&&(D=L.instanceMatrix),q==="instanceColor"&&L.instanceColor&&(D=L.instanceColor)),D!==void 0){const se=D.normalized,pe=D.itemSize,Ve=e.get(D);if(Ve===void 0)continue;const He=Ve.buffer,Le=Ve.type,Q=Ve.bytesPerElement,oe=Le===r.INT||Le===r.UNSIGNED_INT||D.gpuType===xf;if(D.isInterleavedBufferAttribute){const ne=D.data,Ee=ne.stride,Oe=D.offset;if(ne.isInstancedInterleavedBuffer){for(let Te=0;Te<j.locationSize;Te++)m(j.location+Te,ne.meshPerAttribute);L.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=ne.meshPerAttribute*ne.count)}else for(let Te=0;Te<j.locationSize;Te++)p(j.location+Te);r.bindBuffer(r.ARRAY_BUFFER,He);for(let Te=0;Te<j.locationSize;Te++)y(j.location+Te,pe/j.locationSize,Le,se,Ee*Q,(Oe+pe/j.locationSize*Te)*Q,oe)}else{if(D.isInstancedBufferAttribute){for(let ne=0;ne<j.locationSize;ne++)m(j.location+ne,D.meshPerAttribute);L.isInstancedMesh!==!0&&H._maxInstanceCount===void 0&&(H._maxInstanceCount=D.meshPerAttribute*D.count)}else for(let ne=0;ne<j.locationSize;ne++)p(j.location+ne);r.bindBuffer(r.ARRAY_BUFFER,He);for(let ne=0;ne<j.locationSize;ne++)y(j.location+ne,pe/j.locationSize,Le,se,pe*Q,pe/j.locationSize*ne*Q,oe)}}else if(I!==void 0){const se=I[q];if(se!==void 0)switch(se.length){case 2:r.vertexAttrib2fv(j.location,se);break;case 3:r.vertexAttrib3fv(j.location,se);break;case 4:r.vertexAttrib4fv(j.location,se);break;default:r.vertexAttrib1fv(j.location,se)}}}}b()}function E(){w();for(const L in n){const N=n[L];for(const Y in N){const H=N[Y];for(const O in H){const z=H[O];for(const I in z)u(z[I].object),delete z[I];delete H[O]}}delete n[L]}}function T(L){if(n[L.id]===void 0)return;const N=n[L.id];for(const Y in N){const H=N[Y];for(const O in H){const z=H[O];for(const I in z)u(z[I].object),delete z[I];delete H[O]}}delete n[L.id]}function A(L){for(const N in n){const Y=n[N];for(const H in Y){const O=Y[H];if(O[L.id]===void 0)continue;const z=O[L.id];for(const I in z)u(z[I].object),delete z[I];delete O[L.id]}}}function v(L){for(const N in n){const Y=n[N],H=L.isInstancedMesh===!0?L.id:0,O=Y[H];if(O!==void 0){for(const z in O){const I=O[z];for(const q in I)u(I[q].object),delete I[q];delete O[z]}delete Y[H],Object.keys(Y).length===0&&delete n[N]}}}function w(){C(),a=!0,s!==i&&(s=i,c(s.object))}function C(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:w,resetDefaultState:C,dispose:E,releaseStatesOfGeometry:T,releaseStatesOfObject:v,releaseStatesOfProgram:A,initAttributes:_,enableAttribute:p,disableUnusedAttributes:b}}function dS(r,e,t){let n;function i(l){n=l}function s(l,c){r.drawArrays(n,l,c),t.update(c,n,1)}function a(l,c,u){u!==0&&(r.drawArraysInstanced(n,l,c,u),t.update(c,n,u))}function o(l,c,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,c,0,u);let f=0;for(let d=0;d<u;d++)f+=c[d];t.update(f,n,1)}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o}function hS(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(A){return!(A!==bi&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const v=A===sr&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==hi&&n.convert(A)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==Ui&&!v)}function l(A){if(A==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&($e("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,f=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&f===!1&&$e("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),g=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),b=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),y=r.getParameter(r.MAX_VARYING_VECTORS),M=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),E=r.getParameter(r.MAX_SAMPLES),T=r.getParameter(r.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:h,reversedDepthBuffer:f,maxTextures:d,maxVertexTextures:g,maxTextureSize:_,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:b,maxVaryings:y,maxFragmentUniforms:M,maxSamples:E,samples:T}}function pS(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Wr,o=new je,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const d=h.length!==0||f||n!==0||i;return i=f,n=h.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,f){t=u(h,f,0)},this.setState=function(h,f,d){const g=h.clippingPlanes,_=h.clipIntersection,p=h.clipShadows,m=r.get(h);if(!i||g===null||g.length===0||s&&!p)s?u(null):c();else{const b=s?0:n,y=b*4;let M=m.clippingState||null;l.value=M,M=u(g,f,y,d);for(let E=0;E!==y;++E)M[E]=t[E];m.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,f,d,g){const _=h!==null?h.length:0;let p=null;if(_!==0){if(p=l.value,g!==!0||p===null){const m=d+_*4,b=f.matrixWorldInverse;o.getNormalMatrix(b),(p===null||p.length<m)&&(p=new Float32Array(m));for(let y=0,M=d;y!==_;++y,M+=4)a.copy(h[y]).applyMatrix4(b,o),a.normal.toArray(p,M),p[M+3]=a.constant}l.value=p,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,p}}const Er=4,nh=[.125,.215,.35,.446,.526,.582],Yr=20,mS=256,ga=new Dm,ih=new ht;let Mc=null,Sc=0,bc=0,yc=!1;const gS=new X;class rh{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,s={}){const{size:a=256,position:o=gS}=s;Mc=this._renderer.getRenderTarget(),Sc=this._renderer.getActiveCubeFace(),bc=this._renderer.getActiveMipmapLevel(),yc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=oh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ah(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(Mc,Sc,bc),this._renderer.xr.enabled=yc,e.scissorTest=!1,Ls(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===os||e.mapping===ia?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Mc=this._renderer.getRenderTarget(),Sc=this._renderer.getActiveCubeFace(),bc=this._renderer.getActiveMipmapLevel(),yc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:yn,minFilter:yn,generateMipmaps:!1,type:sr,format:bi,colorSpace:Ml,depthBuffer:!1},i=sh(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=sh(e,t,n);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=_S(s)),this._blurMaterial=vS(s,e,t),this._ggxMaterial=xS(s,e,t)}return i}_compileMaterial(e){const t=new or(new Ei,e);this._renderer.compile(t,ga)}_sceneToCubeUV(e,t,n,i,s){const l=new di(90,1,t,n),c=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,d=h.toneMapping;h.getClearColor(ih),h.toneMapping=Bi,h.autoClear=!1,h.state.buffers.depth.getReversed()&&(h.setRenderTarget(i),h.clearDepth(),h.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new or(new ro,new Tm({name:"PMREM.Background",side:Vn,depthWrite:!1,depthTest:!1})));const _=this._backgroundBox,p=_.material;let m=!1;const b=e.background;b?b.isColor&&(p.color.copy(b),e.background=null,m=!0):(p.color.copy(ih),m=!0);for(let y=0;y<6;y++){const M=y%3;M===0?(l.up.set(0,c[y],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[y],s.y,s.z)):M===1?(l.up.set(0,0,c[y]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[y],s.z)):(l.up.set(0,c[y],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[y]));const E=this._cubeSize;Ls(i,M*E,y>2?E:0,E,E),h.setRenderTarget(i),m&&h.render(_,l),h.render(e,l)}h.toneMapping=d,h.autoClear=f,e.background=b}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===os||e.mapping===ia;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=oh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ah());const s=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=s;const o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;Ls(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,ga)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodMeshes.length;for(let s=1;s<i;s++)this._applyGGXFilter(e,s-1,s);t.autoClear=n}_applyGGXFilter(e,t,n){const i=this._renderer,s=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;const l=a.uniforms,c=n/(this._lodMeshes.length-1),u=t/(this._lodMeshes.length-1),h=Math.sqrt(c*c-u*u),f=0+c*1.25,d=h*f,{_lodMax:g}=this,_=this._sizeLods[n],p=3*_*(n>g-Er?n-g+Er:0),m=4*(this._cubeSize-_);l.envMap.value=e.texture,l.roughness.value=d,l.mipInt.value=g-t,Ls(s,p,m,3*_,2*_),i.setRenderTarget(s),i.render(o,ga),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-n,Ls(e,p,m,3*_,2*_),i.setRenderTarget(e),i.render(o,ga)}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&mt("blur direction must be either latitudinal or longitudinal!");const u=3,h=this._lodMeshes[i];h.material=c;const f=c.uniforms,d=this._sizeLods[n]-1,g=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*Yr-1),_=s/g,p=isFinite(s)?1+Math.floor(u*_):Yr;p>Yr&&$e(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Yr}`);const m=[];let b=0;for(let A=0;A<Yr;++A){const v=A/_,w=Math.exp(-v*v/2);m.push(w),A===0?b+=w:A<p&&(b+=2*w)}for(let A=0;A<m.length;A++)m[A]=m[A]/b;f.envMap.value=e.texture,f.samples.value=p,f.weights.value=m,f.latitudinal.value=a==="latitudinal",o&&(f.poleAxis.value=o);const{_lodMax:y}=this;f.dTheta.value=g,f.mipInt.value=y-n;const M=this._sizeLods[i],E=3*M*(i>y-Er?i-y+Er:0),T=4*(this._cubeSize-M);Ls(t,E,T,3*M,2*M),l.setRenderTarget(t),l.render(h,ga)}}function _S(r){const e=[],t=[],n=[];let i=r;const s=r-Er+1+nh.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);e.push(o);let l=1/o;a>r-Er?l=nh[a-r+Er-1]:a===0&&(l=0),t.push(l);const c=1/(o-2),u=-c,h=1+c,f=[u,u,h,u,h,h,u,u,h,h,u,h],d=6,g=6,_=3,p=2,m=1,b=new Float32Array(_*g*d),y=new Float32Array(p*g*d),M=new Float32Array(m*g*d);for(let T=0;T<d;T++){const A=T%3*2/3-1,v=T>2?0:-1,w=[A,v,0,A+2/3,v,0,A+2/3,v+1,0,A,v,0,A+2/3,v+1,0,A,v+1,0];b.set(w,_*g*T),y.set(f,p*g*T);const C=[T,T,T,T,T,T];M.set(C,m*g*T)}const E=new Ei;E.setAttribute("position",new Mn(b,_)),E.setAttribute("uv",new Mn(y,p)),E.setAttribute("faceIndex",new Mn(M,m)),n.push(new or(E,null)),i>Er&&i--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function sh(r,e,t){const n=new ki(r,e,t);return n.texture.mapping=Cl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ls(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function xS(r,e,t){return new yi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:mS,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Ll(),fragmentShader:`
3672
3672
 
3673
3673
  precision highp float;
3674
3674
  precision highp int;
@@ -3772,7 +3772,7 @@ void main() {
3772
3772
 
3773
3773
  gl_FragColor = vec4(prefilteredColor, 1.0);
3774
3774
  }
3775
- `,blending:er,depthTest:!1,depthWrite:!1})}function xS(r,e,t){const n=new Float32Array(Yr),i=new X(0,1,0);return new yi({name:"SphericalGaussianBlur",defines:{n:Yr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ll(),fragmentShader:`
3775
+ `,blending:er,depthTest:!1,depthWrite:!1})}function vS(r,e,t){const n=new Float32Array(Yr),i=new X(0,1,0);return new yi({name:"SphericalGaussianBlur",defines:{n:Yr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ll(),fragmentShader:`
3776
3776
 
3777
3777
  precision mediump float;
3778
3778
  precision mediump int;
@@ -3832,7 +3832,7 @@ void main() {
3832
3832
  }
3833
3833
 
3834
3834
  }
3835
- `,blending:er,depthTest:!1,depthWrite:!1})}function rh(){return new yi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ll(),fragmentShader:`
3835
+ `,blending:er,depthTest:!1,depthWrite:!1})}function ah(){return new yi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ll(),fragmentShader:`
3836
3836
 
3837
3837
  precision mediump float;
3838
3838
  precision mediump int;
@@ -3851,7 +3851,7 @@ void main() {
3851
3851
  gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3852
3852
 
3853
3853
  }
3854
- `,blending:er,depthTest:!1,depthWrite:!1})}function sh(){return new yi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ll(),fragmentShader:`
3854
+ `,blending:er,depthTest:!1,depthWrite:!1})}function oh(){return new yi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ll(),fragmentShader:`
3855
3855
 
3856
3856
  precision mediump float;
3857
3857
  precision mediump int;
@@ -3957,7 +3957,7 @@ void main() {
3957
3957
  gl_FragColor = texture2D( tEquirect, sampleUV );
3958
3958
 
3959
3959
  }
3960
- `},i=new ro(5,5,5),s=new yi({name:"CubemapFromEquirect",uniforms:sa(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Vn,blending:er});s.uniforms.tEquirect.value=t;const a=new or(i,s),o=t.minFilter;return t.minFilter===Zr&&(t.minFilter=yn),new yx(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(s)}}function vS(r){let e=new WeakMap,t=new WeakMap,n=null;function i(f,d=!1){return f==null?null:d?a(f):s(f)}function s(f){if(f&&f.isTexture){const d=f.mapping;if(d===Zl||d===Kl)if(e.has(f)){const g=e.get(f).texture;return o(g,f.mapping)}else{const g=f.image;if(g&&g.height>0){const _=new Im(g.height);return _.fromEquirectangularTexture(r,f),e.set(f,_),f.addEventListener("dispose",c),o(_.texture,f.mapping)}else return null}}return f}function a(f){if(f&&f.isTexture){const d=f.mapping,g=d===Zl||d===Kl,_=d===os||d===ia;if(g||_){let p=t.get(f);const m=p!==void 0?p.texture.pmremVersion:0;if(f.isRenderTargetTexture&&f.pmremVersion!==m)return n===null&&(n=new nh(r)),p=g?n.fromEquirectangular(f,p):n.fromCubemap(f,p),p.texture.pmremVersion=f.pmremVersion,t.set(f,p),p.texture;if(p!==void 0)return p.texture;{const b=f.image;return g&&b&&b.height>0||_&&b&&l(b)?(n===null&&(n=new nh(r)),p=g?n.fromEquirectangular(f):n.fromCubemap(f),p.texture.pmremVersion=f.pmremVersion,t.set(f,p),f.addEventListener("dispose",u),p.texture):null}}}return f}function o(f,d){return d===Zl?f.mapping=os:d===Kl&&(f.mapping=ia),f}function l(f){let d=0;const g=6;for(let _=0;_<g;_++)f[_]!==void 0&&d++;return d===g}function c(f){const d=f.target;d.removeEventListener("dispose",c);const g=e.get(d);g!==void 0&&(e.delete(d),g.dispose())}function u(f){const d=f.target;d.removeEventListener("dispose",u);const g=t.get(d);g!==void 0&&(t.delete(d),g.dispose())}function h(){e=new WeakMap,t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:h}}function MS(r){const e={};function t(n){if(e[n]!==void 0)return e[n];const i=r.getExtension(n);return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&$s("WebGLRenderer: "+n+" extension not supported."),i}}}function SS(r,e,t,n){const i={},s=new WeakMap;function a(h){const f=h.target;f.index!==null&&e.remove(f.index);for(const g in f.attributes)e.remove(f.attributes[g]);f.removeEventListener("dispose",a),delete i[f.id];const d=s.get(f);d&&(e.remove(d),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function o(h,f){return i[f.id]===!0||(f.addEventListener("dispose",a),i[f.id]=!0,t.memory.geometries++),f}function l(h){const f=h.attributes;for(const d in f)e.update(f[d],r.ARRAY_BUFFER)}function c(h){const f=[],d=h.index,g=h.attributes.position;let _=0;if(g===void 0)return;if(d!==null){const b=d.array;_=d.version;for(let y=0,M=b.length;y<M;y+=3){const E=b[y+0],T=b[y+1],A=b[y+2];f.push(E,T,T,A,A,E)}}else{const b=g.array;_=g.version;for(let y=0,M=b.length/3-1;y<M;y+=3){const E=y+0,T=y+1,A=y+2;f.push(E,T,T,A,A,E)}}const p=new(g.count>=65535?ym:bm)(f,1);p.version=_;const m=s.get(h);m&&e.remove(m),s.set(h,p)}function u(h){const f=s.get(h);if(f){const d=h.index;d!==null&&f.version<d.version&&c(h)}else c(h);return s.get(h)}return{get:o,update:l,getWireframeAttribute:u}}function bS(r,e,t){let n;function i(h){n=h}let s,a;function o(h){s=h.type,a=h.bytesPerElement}function l(h,f){r.drawElements(n,f,s,h*a),t.update(f,n,1)}function c(h,f,d){d!==0&&(r.drawElementsInstanced(n,f,s,h*a,d),t.update(f,n,d))}function u(h,f,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,s,h,0,d);let _=0;for(let p=0;p<d;p++)_+=f[p];t.update(_,n,1)}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u}function yS(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case r.TRIANGLES:t.triangles+=o*(s/3);break;case r.LINES:t.lines+=o*(s/2);break;case r.LINE_STRIP:t.lines+=o*(s-1);break;case r.LINE_LOOP:t.lines+=o*s;break;case r.POINTS:t.points+=o*s;break;default:mt("WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function ES(r,e,t){const n=new WeakMap,i=new kt;function s(a,o,l){const c=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,h=u!==void 0?u.length:0;let f=n.get(o);if(f===void 0||f.count!==h){let w=function(){A.dispose(),n.delete(o),o.removeEventListener("dispose",w)};f!==void 0&&f.texture.dispose();const d=o.morphAttributes.position!==void 0,g=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,p=o.morphAttributes.position||[],m=o.morphAttributes.normal||[],b=o.morphAttributes.color||[];let y=0;d===!0&&(y=1),g===!0&&(y=2),_===!0&&(y=3);let M=o.attributes.position.count*y,E=1;M>e.maxTextureSize&&(E=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const T=new Float32Array(M*E*4*h),A=new vm(T,M,E,h);A.type=Ui,A.needsUpdate=!0;const v=y*4;for(let C=0;C<h;C++){const L=p[C],N=m[C],Y=b[C],H=M*E*4*C;for(let O=0;O<L.count;O++){const z=O*v;d===!0&&(i.fromBufferAttribute(L,O),T[H+z+0]=i.x,T[H+z+1]=i.y,T[H+z+2]=i.z,T[H+z+3]=0),g===!0&&(i.fromBufferAttribute(N,O),T[H+z+4]=i.x,T[H+z+5]=i.y,T[H+z+6]=i.z,T[H+z+7]=0),_===!0&&(i.fromBufferAttribute(Y,O),T[H+z+8]=i.x,T[H+z+9]=i.y,T[H+z+10]=i.z,T[H+z+11]=Y.itemSize===4?i.w:1)}}f={count:h,texture:A,size:new gt(M,E)},n.set(o,f),o.addEventListener("dispose",w)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",a.morphTexture,t);else{let d=0;for(let _=0;_<c.length;_++)d+=c[_];const g=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(r,"morphTargetBaseInfluence",g),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",f.texture,t),l.getUniforms().setValue(r,"morphTargetsTextureSize",f.size)}return{update:s}}function TS(r,e,t,n,i){let s=new WeakMap;function a(c){const u=i.render.frame,h=c.geometry,f=e.get(c,h);if(s.get(f)!==u&&(e.update(f),s.set(f,u)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),s.get(c)!==u&&(t.update(c.instanceMatrix,r.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,r.ARRAY_BUFFER),s.set(c,u))),c.isSkinnedMesh){const d=c.skeleton;s.get(d)!==u&&(d.update(),s.set(d,u))}return f}function o(){s=new WeakMap}function l(c){const u=c.target;u.removeEventListener("dispose",l),n.releaseStatesOfObject(u),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:a,dispose:o}}const wS={[im]:"LINEAR_TONE_MAPPING",[rm]:"REINHARD_TONE_MAPPING",[sm]:"CINEON_TONE_MAPPING",[am]:"ACES_FILMIC_TONE_MAPPING",[lm]:"AGX_TONE_MAPPING",[cm]:"NEUTRAL_TONE_MAPPING",[om]:"CUSTOM_TONE_MAPPING"};function AS(r,e,t,n,i,s){const a=new ki(e,t,{type:r,depthBuffer:i,stencilBuffer:s,samples:n?4:0,depthTexture:i?new ra(e,t):void 0}),o=new ki(e,t,{type:sr,depthBuffer:!1,stencilBuffer:!1}),l=new Ei;l.setAttribute("position",new nr([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new nr([0,2,0,0,2,0],2));const c=new Mx({uniforms:{tDiffuse:{value:null}},vertexShader:`
3960
+ `},i=new ro(5,5,5),s=new yi({name:"CubemapFromEquirect",uniforms:sa(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Vn,blending:er});s.uniforms.tEquirect.value=t;const a=new or(i,s),o=t.minFilter;return t.minFilter===Kr&&(t.minFilter=yn),new Ex(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(s)}}function MS(r){let e=new WeakMap,t=new WeakMap,n=null;function i(f,d=!1){return f==null?null:d?a(f):s(f)}function s(f){if(f&&f.isTexture){const d=f.mapping;if(d===Kl||d===Zl)if(e.has(f)){const g=e.get(f).texture;return o(g,f.mapping)}else{const g=f.image;if(g&&g.height>0){const _=new Im(g.height);return _.fromEquirectangularTexture(r,f),e.set(f,_),f.addEventListener("dispose",c),o(_.texture,f.mapping)}else return null}}return f}function a(f){if(f&&f.isTexture){const d=f.mapping,g=d===Kl||d===Zl,_=d===os||d===ia;if(g||_){let p=t.get(f);const m=p!==void 0?p.texture.pmremVersion:0;if(f.isRenderTargetTexture&&f.pmremVersion!==m)return n===null&&(n=new rh(r)),p=g?n.fromEquirectangular(f,p):n.fromCubemap(f,p),p.texture.pmremVersion=f.pmremVersion,t.set(f,p),p.texture;if(p!==void 0)return p.texture;{const b=f.image;return g&&b&&b.height>0||_&&b&&l(b)?(n===null&&(n=new rh(r)),p=g?n.fromEquirectangular(f):n.fromCubemap(f),p.texture.pmremVersion=f.pmremVersion,t.set(f,p),f.addEventListener("dispose",u),p.texture):null}}}return f}function o(f,d){return d===Kl?f.mapping=os:d===Zl&&(f.mapping=ia),f}function l(f){let d=0;const g=6;for(let _=0;_<g;_++)f[_]!==void 0&&d++;return d===g}function c(f){const d=f.target;d.removeEventListener("dispose",c);const g=e.get(d);g!==void 0&&(e.delete(d),g.dispose())}function u(f){const d=f.target;d.removeEventListener("dispose",u);const g=t.get(d);g!==void 0&&(t.delete(d),g.dispose())}function h(){e=new WeakMap,t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:h}}function SS(r){const e={};function t(n){if(e[n]!==void 0)return e[n];const i=r.getExtension(n);return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&$s("WebGLRenderer: "+n+" extension not supported."),i}}}function bS(r,e,t,n){const i={},s=new WeakMap;function a(h){const f=h.target;f.index!==null&&e.remove(f.index);for(const g in f.attributes)e.remove(f.attributes[g]);f.removeEventListener("dispose",a),delete i[f.id];const d=s.get(f);d&&(e.remove(d),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function o(h,f){return i[f.id]===!0||(f.addEventListener("dispose",a),i[f.id]=!0,t.memory.geometries++),f}function l(h){const f=h.attributes;for(const d in f)e.update(f[d],r.ARRAY_BUFFER)}function c(h){const f=[],d=h.index,g=h.attributes.position;let _=0;if(g===void 0)return;if(d!==null){const b=d.array;_=d.version;for(let y=0,M=b.length;y<M;y+=3){const E=b[y+0],T=b[y+1],A=b[y+2];f.push(E,T,T,A,A,E)}}else{const b=g.array;_=g.version;for(let y=0,M=b.length/3-1;y<M;y+=3){const E=y+0,T=y+1,A=y+2;f.push(E,T,T,A,A,E)}}const p=new(g.count>=65535?ym:bm)(f,1);p.version=_;const m=s.get(h);m&&e.remove(m),s.set(h,p)}function u(h){const f=s.get(h);if(f){const d=h.index;d!==null&&f.version<d.version&&c(h)}else c(h);return s.get(h)}return{get:o,update:l,getWireframeAttribute:u}}function yS(r,e,t){let n;function i(h){n=h}let s,a;function o(h){s=h.type,a=h.bytesPerElement}function l(h,f){r.drawElements(n,f,s,h*a),t.update(f,n,1)}function c(h,f,d){d!==0&&(r.drawElementsInstanced(n,f,s,h*a,d),t.update(f,n,d))}function u(h,f,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,s,h,0,d);let _=0;for(let p=0;p<d;p++)_+=f[p];t.update(_,n,1)}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u}function ES(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case r.TRIANGLES:t.triangles+=o*(s/3);break;case r.LINES:t.lines+=o*(s/2);break;case r.LINE_STRIP:t.lines+=o*(s-1);break;case r.LINE_LOOP:t.lines+=o*s;break;case r.POINTS:t.points+=o*s;break;default:mt("WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function TS(r,e,t){const n=new WeakMap,i=new kt;function s(a,o,l){const c=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,h=u!==void 0?u.length:0;let f=n.get(o);if(f===void 0||f.count!==h){let w=function(){A.dispose(),n.delete(o),o.removeEventListener("dispose",w)};f!==void 0&&f.texture.dispose();const d=o.morphAttributes.position!==void 0,g=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,p=o.morphAttributes.position||[],m=o.morphAttributes.normal||[],b=o.morphAttributes.color||[];let y=0;d===!0&&(y=1),g===!0&&(y=2),_===!0&&(y=3);let M=o.attributes.position.count*y,E=1;M>e.maxTextureSize&&(E=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const T=new Float32Array(M*E*4*h),A=new vm(T,M,E,h);A.type=Ui,A.needsUpdate=!0;const v=y*4;for(let C=0;C<h;C++){const L=p[C],N=m[C],Y=b[C],H=M*E*4*C;for(let O=0;O<L.count;O++){const z=O*v;d===!0&&(i.fromBufferAttribute(L,O),T[H+z+0]=i.x,T[H+z+1]=i.y,T[H+z+2]=i.z,T[H+z+3]=0),g===!0&&(i.fromBufferAttribute(N,O),T[H+z+4]=i.x,T[H+z+5]=i.y,T[H+z+6]=i.z,T[H+z+7]=0),_===!0&&(i.fromBufferAttribute(Y,O),T[H+z+8]=i.x,T[H+z+9]=i.y,T[H+z+10]=i.z,T[H+z+11]=Y.itemSize===4?i.w:1)}}f={count:h,texture:A,size:new gt(M,E)},n.set(o,f),o.addEventListener("dispose",w)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",a.morphTexture,t);else{let d=0;for(let _=0;_<c.length;_++)d+=c[_];const g=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(r,"morphTargetBaseInfluence",g),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",f.texture,t),l.getUniforms().setValue(r,"morphTargetsTextureSize",f.size)}return{update:s}}function wS(r,e,t,n,i){let s=new WeakMap;function a(c){const u=i.render.frame,h=c.geometry,f=e.get(c,h);if(s.get(f)!==u&&(e.update(f),s.set(f,u)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),s.get(c)!==u&&(t.update(c.instanceMatrix,r.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,r.ARRAY_BUFFER),s.set(c,u))),c.isSkinnedMesh){const d=c.skeleton;s.get(d)!==u&&(d.update(),s.set(d,u))}return f}function o(){s=new WeakMap}function l(c){const u=c.target;u.removeEventListener("dispose",l),n.releaseStatesOfObject(u),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:a,dispose:o}}const AS={[im]:"LINEAR_TONE_MAPPING",[rm]:"REINHARD_TONE_MAPPING",[sm]:"CINEON_TONE_MAPPING",[am]:"ACES_FILMIC_TONE_MAPPING",[lm]:"AGX_TONE_MAPPING",[cm]:"NEUTRAL_TONE_MAPPING",[om]:"CUSTOM_TONE_MAPPING"};function RS(r,e,t,n,i,s){const a=new ki(e,t,{type:r,depthBuffer:i,stencilBuffer:s,samples:n?4:0,depthTexture:i?new ra(e,t):void 0}),o=new ki(e,t,{type:sr,depthBuffer:!1,stencilBuffer:!1}),l=new Ei;l.setAttribute("position",new nr([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new nr([0,2,0,0,2,0],2));const c=new Sx({uniforms:{tDiffuse:{value:null}},vertexShader:`
3961
3961
  precision highp float;
3962
3962
 
3963
3963
  uniform mat4 modelViewMatrix;
@@ -4003,17 +4003,17 @@ void main() {
4003
4003
  #ifdef SRGB_TRANSFER
4004
4004
  gl_FragColor = sRGBTransferOETF( gl_FragColor );
4005
4005
  #endif
4006
- }`,depthTest:!1,depthWrite:!1}),u=new or(l,c),h=new Dm(-1,1,1,-1,0,1);let f=null,d=null,g=!1,_,p=null,m=[],b=!1;this.setSize=function(y,M){a.setSize(y,M),o.setSize(y,M);for(let E=0;E<m.length;E++){const T=m[E];T.setSize&&T.setSize(y,M)}},this.setEffects=function(y){m=y,b=m.length>0&&m[0].isRenderPass===!0;const M=a.width,E=a.height;for(let T=0;T<m.length;T++){const A=m[T];A.setSize&&A.setSize(M,E)}},this.begin=function(y,M){if(g||y.toneMapping===Bi&&m.length===0)return!1;if(p=M,M!==null){const E=M.width,T=M.height;(a.width!==E||a.height!==T)&&this.setSize(E,T)}return b===!1&&y.setRenderTarget(a),_=y.toneMapping,y.toneMapping=Bi,!0},this.hasRenderPass=function(){return b},this.end=function(y,M){y.toneMapping=_,g=!0;let E=a,T=o;for(let A=0;A<m.length;A++){const v=m[A];if(v.enabled!==!1&&(v.render(y,T,E,M),v.needsSwap!==!1)){const w=E;E=T,T=w}}if(f!==y.outputColorSpace||d!==y.toneMapping){f=y.outputColorSpace,d=y.toneMapping,c.defines={},ft.getTransfer(f)===vt&&(c.defines.SRGB_TRANSFER="");const A=wS[d];A&&(c.defines[A]=""),c.needsUpdate=!0}c.uniforms.tDiffuse.value=E.texture,y.setRenderTarget(p),y.render(u,h),p=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){a.depthTexture&&a.depthTexture.dispose(),a.dispose(),o.dispose(),l.dispose(),c.dispose()}}const Um=new Un,Gu=new ra(1,1),Fm=new vm,Om=new Z_,Bm=new Am,ah=[],oh=[],lh=new Float32Array(16),ch=new Float32Array(9),uh=new Float32Array(4);function la(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=ah[i];if(s===void 0&&(s=new Float32Array(i),ah[i]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,r[a].toArray(s,o)}return s}function tn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function nn(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Nl(r,e){let t=oh[e];t===void 0&&(t=new Int32Array(e),oh[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function RS(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function CS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(tn(t,e))return;r.uniform2fv(this.addr,e),nn(t,e)}}function PS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(tn(t,e))return;r.uniform3fv(this.addr,e),nn(t,e)}}function DS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(tn(t,e))return;r.uniform4fv(this.addr,e),nn(t,e)}}function LS(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(tn(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),nn(t,e)}else{if(tn(t,n))return;uh.set(n),r.uniformMatrix2fv(this.addr,!1,uh),nn(t,n)}}function NS(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(tn(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),nn(t,e)}else{if(tn(t,n))return;ch.set(n),r.uniformMatrix3fv(this.addr,!1,ch),nn(t,n)}}function IS(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(tn(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),nn(t,e)}else{if(tn(t,n))return;lh.set(n),r.uniformMatrix4fv(this.addr,!1,lh),nn(t,n)}}function US(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function FS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(tn(t,e))return;r.uniform2iv(this.addr,e),nn(t,e)}}function OS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(tn(t,e))return;r.uniform3iv(this.addr,e),nn(t,e)}}function BS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(tn(t,e))return;r.uniform4iv(this.addr,e),nn(t,e)}}function kS(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function zS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(tn(t,e))return;r.uniform2uiv(this.addr,e),nn(t,e)}}function GS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(tn(t,e))return;r.uniform3uiv(this.addr,e),nn(t,e)}}function VS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(tn(t,e))return;r.uniform4uiv(this.addr,e),nn(t,e)}}function HS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s;this.type===r.SAMPLER_2D_SHADOW?(Gu.compareFunction=t.isReversedDepthBuffer()?Tf:Ef,s=Gu):s=Um,t.setTexture2D(e||s,i)}function WS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Om,i)}function XS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Bm,i)}function YS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Fm,i)}function qS(r){switch(r){case 5126:return RS;case 35664:return CS;case 35665:return PS;case 35666:return DS;case 35674:return LS;case 35675:return NS;case 35676:return IS;case 5124:case 35670:return US;case 35667:case 35671:return FS;case 35668:case 35672:return OS;case 35669:case 35673:return BS;case 5125:return kS;case 36294:return zS;case 36295:return GS;case 36296:return VS;case 35678:case 36198:case 36298:case 36306:case 35682:return HS;case 35679:case 36299:case 36307:return WS;case 35680:case 36300:case 36308:case 36293:return XS;case 36289:case 36303:case 36311:case 36292:return YS}}function $S(r,e){r.uniform1fv(this.addr,e)}function ZS(r,e){const t=la(e,this.size,2);r.uniform2fv(this.addr,t)}function KS(r,e){const t=la(e,this.size,3);r.uniform3fv(this.addr,t)}function jS(r,e){const t=la(e,this.size,4);r.uniform4fv(this.addr,t)}function JS(r,e){const t=la(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function QS(r,e){const t=la(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function eb(r,e){const t=la(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function tb(r,e){r.uniform1iv(this.addr,e)}function nb(r,e){r.uniform2iv(this.addr,e)}function ib(r,e){r.uniform3iv(this.addr,e)}function rb(r,e){r.uniform4iv(this.addr,e)}function sb(r,e){r.uniform1uiv(this.addr,e)}function ab(r,e){r.uniform2uiv(this.addr,e)}function ob(r,e){r.uniform3uiv(this.addr,e)}function lb(r,e){r.uniform4uiv(this.addr,e)}function cb(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));let a;this.type===r.SAMPLER_2D_SHADOW?a=Gu:a=Um;for(let o=0;o!==i;++o)t.setTexture2D(e[o]||a,s[o])}function ub(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Om,s[a])}function fb(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Bm,s[a])}function db(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Fm,s[a])}function hb(r){switch(r){case 5126:return $S;case 35664:return ZS;case 35665:return KS;case 35666:return jS;case 35674:return JS;case 35675:return QS;case 35676:return eb;case 5124:case 35670:return tb;case 35667:case 35671:return nb;case 35668:case 35672:return ib;case 35669:case 35673:return rb;case 5125:return sb;case 36294:return ab;case 36295:return ob;case 36296:return lb;case 35678:case 36198:case 36298:case 36306:case 35682:return cb;case 35679:case 36299:case 36307:return ub;case 35680:case 36300:case 36308:case 36293:return fb;case 36289:case 36303:case 36311:case 36292:return db}}class pb{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=qS(t.type)}}class mb{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=hb(t.type)}}class gb{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,t[o.id],n)}}}const Ec=/(\w+)(\])?(\[|\.)?/g;function fh(r,e){r.seq.push(e),r.map[e.id]=e}function _b(r,e,t){const n=r.name,i=n.length;for(Ec.lastIndex=0;;){const s=Ec.exec(n),a=Ec.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){fh(t,c===void 0?new pb(o,r,e):new mb(o,r,e));break}else{let h=t.map[o];h===void 0&&(h=new gb(o),fh(t,h)),t=h}}}class al{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){const o=e.getActiveUniform(t,a),l=e.getUniformLocation(t,o.name);_b(o,l,this)}const i=[],s=[];for(const a of this.seq)a.type===e.SAMPLER_2D_SHADOW||a.type===e.SAMPLER_CUBE_SHADOW||a.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(a):s.push(a);i.length>0&&(this.seq=i.concat(s))}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function dh(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const xb=37297;let vb=0;function Mb(r,e){const t=r.split(`
4006
+ }`,depthTest:!1,depthWrite:!1}),u=new or(l,c),h=new Dm(-1,1,1,-1,0,1);let f=null,d=null,g=!1,_,p=null,m=[],b=!1;this.setSize=function(y,M){a.setSize(y,M),o.setSize(y,M);for(let E=0;E<m.length;E++){const T=m[E];T.setSize&&T.setSize(y,M)}},this.setEffects=function(y){m=y,b=m.length>0&&m[0].isRenderPass===!0;const M=a.width,E=a.height;for(let T=0;T<m.length;T++){const A=m[T];A.setSize&&A.setSize(M,E)}},this.begin=function(y,M){if(g||y.toneMapping===Bi&&m.length===0)return!1;if(p=M,M!==null){const E=M.width,T=M.height;(a.width!==E||a.height!==T)&&this.setSize(E,T)}return b===!1&&y.setRenderTarget(a),_=y.toneMapping,y.toneMapping=Bi,!0},this.hasRenderPass=function(){return b},this.end=function(y,M){y.toneMapping=_,g=!0;let E=a,T=o;for(let A=0;A<m.length;A++){const v=m[A];if(v.enabled!==!1&&(v.render(y,T,E,M),v.needsSwap!==!1)){const w=E;E=T,T=w}}if(f!==y.outputColorSpace||d!==y.toneMapping){f=y.outputColorSpace,d=y.toneMapping,c.defines={},ft.getTransfer(f)===vt&&(c.defines.SRGB_TRANSFER="");const A=AS[d];A&&(c.defines[A]=""),c.needsUpdate=!0}c.uniforms.tDiffuse.value=E.texture,y.setRenderTarget(p),y.render(u,h),p=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){a.depthTexture&&a.depthTexture.dispose(),a.dispose(),o.dispose(),l.dispose(),c.dispose()}}const Um=new Un,Gu=new ra(1,1),Fm=new vm,Om=new Z0,Bm=new Am,lh=[],ch=[],uh=new Float32Array(16),fh=new Float32Array(9),dh=new Float32Array(4);function la(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=lh[i];if(s===void 0&&(s=new Float32Array(i),lh[i]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,r[a].toArray(s,o)}return s}function tn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function nn(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Nl(r,e){let t=ch[e];t===void 0&&(t=new Int32Array(e),ch[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function CS(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function PS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(tn(t,e))return;r.uniform2fv(this.addr,e),nn(t,e)}}function DS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(tn(t,e))return;r.uniform3fv(this.addr,e),nn(t,e)}}function LS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(tn(t,e))return;r.uniform4fv(this.addr,e),nn(t,e)}}function NS(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(tn(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),nn(t,e)}else{if(tn(t,n))return;dh.set(n),r.uniformMatrix2fv(this.addr,!1,dh),nn(t,n)}}function IS(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(tn(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),nn(t,e)}else{if(tn(t,n))return;fh.set(n),r.uniformMatrix3fv(this.addr,!1,fh),nn(t,n)}}function US(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(tn(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),nn(t,e)}else{if(tn(t,n))return;uh.set(n),r.uniformMatrix4fv(this.addr,!1,uh),nn(t,n)}}function FS(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function OS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(tn(t,e))return;r.uniform2iv(this.addr,e),nn(t,e)}}function BS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(tn(t,e))return;r.uniform3iv(this.addr,e),nn(t,e)}}function kS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(tn(t,e))return;r.uniform4iv(this.addr,e),nn(t,e)}}function zS(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function GS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(tn(t,e))return;r.uniform2uiv(this.addr,e),nn(t,e)}}function VS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(tn(t,e))return;r.uniform3uiv(this.addr,e),nn(t,e)}}function HS(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(tn(t,e))return;r.uniform4uiv(this.addr,e),nn(t,e)}}function WS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s;this.type===r.SAMPLER_2D_SHADOW?(Gu.compareFunction=t.isReversedDepthBuffer()?Tf:Ef,s=Gu):s=Um,t.setTexture2D(e||s,i)}function XS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Om,i)}function YS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Bm,i)}function qS(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Fm,i)}function $S(r){switch(r){case 5126:return CS;case 35664:return PS;case 35665:return DS;case 35666:return LS;case 35674:return NS;case 35675:return IS;case 35676:return US;case 5124:case 35670:return FS;case 35667:case 35671:return OS;case 35668:case 35672:return BS;case 35669:case 35673:return kS;case 5125:return zS;case 36294:return GS;case 36295:return VS;case 36296:return HS;case 35678:case 36198:case 36298:case 36306:case 35682:return WS;case 35679:case 36299:case 36307:return XS;case 35680:case 36300:case 36308:case 36293:return YS;case 36289:case 36303:case 36311:case 36292:return qS}}function KS(r,e){r.uniform1fv(this.addr,e)}function ZS(r,e){const t=la(e,this.size,2);r.uniform2fv(this.addr,t)}function jS(r,e){const t=la(e,this.size,3);r.uniform3fv(this.addr,t)}function JS(r,e){const t=la(e,this.size,4);r.uniform4fv(this.addr,t)}function QS(r,e){const t=la(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function eb(r,e){const t=la(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function tb(r,e){const t=la(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function nb(r,e){r.uniform1iv(this.addr,e)}function ib(r,e){r.uniform2iv(this.addr,e)}function rb(r,e){r.uniform3iv(this.addr,e)}function sb(r,e){r.uniform4iv(this.addr,e)}function ab(r,e){r.uniform1uiv(this.addr,e)}function ob(r,e){r.uniform2uiv(this.addr,e)}function lb(r,e){r.uniform3uiv(this.addr,e)}function cb(r,e){r.uniform4uiv(this.addr,e)}function ub(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));let a;this.type===r.SAMPLER_2D_SHADOW?a=Gu:a=Um;for(let o=0;o!==i;++o)t.setTexture2D(e[o]||a,s[o])}function fb(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Om,s[a])}function db(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Bm,s[a])}function hb(r,e,t){const n=this.cache,i=e.length,s=Nl(t,i);tn(n,s)||(r.uniform1iv(this.addr,s),nn(n,s));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Fm,s[a])}function pb(r){switch(r){case 5126:return KS;case 35664:return ZS;case 35665:return jS;case 35666:return JS;case 35674:return QS;case 35675:return eb;case 35676:return tb;case 5124:case 35670:return nb;case 35667:case 35671:return ib;case 35668:case 35672:return rb;case 35669:case 35673:return sb;case 5125:return ab;case 36294:return ob;case 36295:return lb;case 36296:return cb;case 35678:case 36198:case 36298:case 36306:case 35682:return ub;case 35679:case 36299:case 36307:return fb;case 35680:case 36300:case 36308:case 36293:return db;case 36289:case 36303:case 36311:case 36292:return hb}}class mb{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=$S(t.type)}}class gb{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=pb(t.type)}}class _b{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,t[o.id],n)}}}const Ec=/(\w+)(\])?(\[|\.)?/g;function hh(r,e){r.seq.push(e),r.map[e.id]=e}function xb(r,e,t){const n=r.name,i=n.length;for(Ec.lastIndex=0;;){const s=Ec.exec(n),a=Ec.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){hh(t,c===void 0?new mb(o,r,e):new gb(o,r,e));break}else{let h=t.map[o];h===void 0&&(h=new _b(o),hh(t,h)),t=h}}}class al{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){const o=e.getActiveUniform(t,a),l=e.getUniformLocation(t,o.name);xb(o,l,this)}const i=[],s=[];for(const a of this.seq)a.type===e.SAMPLER_2D_SHADOW||a.type===e.SAMPLER_CUBE_SHADOW||a.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(a):s.push(a);i.length>0&&(this.seq=i.concat(s))}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function ph(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const vb=37297;let Mb=0;function Sb(r,e){const t=r.split(`
4007
4007
  `),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=i;a<s;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`
4008
- `)}const hh=new je;function Sb(r){ft._getMatrix(hh,ft.workingColorSpace,r);const e=`mat3( ${hh.elements.map(t=>t.toFixed(4))} )`;switch(ft.getTransfer(r)){case Sl:return[e,"LinearTransferOETF"];case vt:return[e,"sRGBTransferOETF"];default:return $e("WebGLProgram: Unsupported color space: ",r),[e,"LinearTransferOETF"]}}function ph(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),s=(r.getShaderInfoLog(e)||"").trim();if(n&&s==="")return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const o=parseInt(a[1]);return t.toUpperCase()+`
4008
+ `)}const mh=new je;function bb(r){ft._getMatrix(mh,ft.workingColorSpace,r);const e=`mat3( ${mh.elements.map(t=>t.toFixed(4))} )`;switch(ft.getTransfer(r)){case Sl:return[e,"LinearTransferOETF"];case vt:return[e,"sRGBTransferOETF"];default:return $e("WebGLProgram: Unsupported color space: ",r),[e,"LinearTransferOETF"]}}function gh(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),s=(r.getShaderInfoLog(e)||"").trim();if(n&&s==="")return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const o=parseInt(a[1]);return t.toUpperCase()+`
4009
4009
 
4010
4010
  `+s+`
4011
4011
 
4012
- `+Mb(r.getShaderSource(e),o)}else return s}function bb(r,e){const t=Sb(e);return[`vec4 ${r}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
4013
- `)}const yb={[im]:"Linear",[rm]:"Reinhard",[sm]:"Cineon",[am]:"ACESFilmic",[lm]:"AgX",[cm]:"Neutral",[om]:"Custom"};function Eb(r,e){const t=yb[e];return t===void 0?($e("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ho=new X;function Tb(){ft.getLuminanceCoefficients(Ho);const r=Ho.x.toFixed(4),e=Ho.y.toFixed(4),t=Ho.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`
4014
- `)}function wb(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(wa).join(`
4015
- `)}function Ab(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
4016
- `)}function Rb(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),a=s.name;let o=1;s.type===r.FLOAT_MAT2&&(o=2),s.type===r.FLOAT_MAT3&&(o=3),s.type===r.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:r.getAttribLocation(e,a),locationSize:o}}return t}function wa(r){return r!==""}function mh(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function gh(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Cb=/^[ \t]*#include +<([\w\d./]+)>/gm;function Vu(r){return r.replace(Cb,Db)}const Pb=new Map;function Db(r,e){let t=et[e];if(t===void 0){const n=Pb.get(e);if(n!==void 0)t=et[n],$e('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return Vu(t)}const Lb=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function _h(r){return r.replace(Lb,Nb)}function Nb(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function xh(r){let e=`precision ${r.precision} float;
4012
+ `+Sb(r.getShaderSource(e),o)}else return s}function yb(r,e){const t=bb(e);return[`vec4 ${r}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
4013
+ `)}const Eb={[im]:"Linear",[rm]:"Reinhard",[sm]:"Cineon",[am]:"ACESFilmic",[lm]:"AgX",[cm]:"Neutral",[om]:"Custom"};function Tb(r,e){const t=Eb[e];return t===void 0?($e("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ho=new X;function wb(){ft.getLuminanceCoefficients(Ho);const r=Ho.x.toFixed(4),e=Ho.y.toFixed(4),t=Ho.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${r}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`
4014
+ `)}function Ab(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(wa).join(`
4015
+ `)}function Rb(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
4016
+ `)}function Cb(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),a=s.name;let o=1;s.type===r.FLOAT_MAT2&&(o=2),s.type===r.FLOAT_MAT3&&(o=3),s.type===r.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:r.getAttribLocation(e,a),locationSize:o}}return t}function wa(r){return r!==""}function _h(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function xh(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Pb=/^[ \t]*#include +<([\w\d./]+)>/gm;function Vu(r){return r.replace(Pb,Lb)}const Db=new Map;function Lb(r,e){let t=et[e];if(t===void 0){const n=Db.get(e);if(n!==void 0)t=et[n],$e('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return Vu(t)}const Nb=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function vh(r){return r.replace(Nb,Ib)}function Ib(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function Mh(r){let e=`precision ${r.precision} float;
4017
4017
  precision ${r.precision} int;
4018
4018
  precision ${r.precision} sampler2D;
4019
4019
  precision ${r.precision} samplerCube;
@@ -4033,30 +4033,30 @@ void main() {
4033
4033
  `;return r.precision==="highp"?e+=`
4034
4034
  #define HIGH_PRECISION`:r.precision==="mediump"?e+=`
4035
4035
  #define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
4036
- #define LOW_PRECISION`),e}const Ib={[tl]:"SHADOWMAP_TYPE_PCF",[Ta]:"SHADOWMAP_TYPE_VSM"};function Ub(r){return Ib[r.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const Fb={[os]:"ENVMAP_TYPE_CUBE",[ia]:"ENVMAP_TYPE_CUBE",[Cl]:"ENVMAP_TYPE_CUBE_UV"};function Ob(r){return r.envMap===!1?"ENVMAP_TYPE_CUBE":Fb[r.envMapMode]||"ENVMAP_TYPE_CUBE"}const Bb={[ia]:"ENVMAP_MODE_REFRACTION"};function kb(r){return r.envMap===!1?"ENVMAP_MODE_REFLECTION":Bb[r.envMapMode]||"ENVMAP_MODE_REFLECTION"}const zb={[nm]:"ENVMAP_BLENDING_MULTIPLY",[h_]:"ENVMAP_BLENDING_MIX",[p_]:"ENVMAP_BLENDING_ADD"};function Gb(r){return r.envMap===!1?"ENVMAP_BLENDING_NONE":zb[r.combine]||"ENVMAP_BLENDING_NONE"}function Vb(r){const e=r.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function Hb(r,e,t,n){const i=r.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=Ub(t),c=Ob(t),u=kb(t),h=Gb(t),f=Vb(t),d=wb(t),g=Ab(s),_=i.createProgram();let p,m,b=t.glslVersion?"#version "+t.glslVersion+`
4036
+ #define LOW_PRECISION`),e}const Ub={[tl]:"SHADOWMAP_TYPE_PCF",[Ta]:"SHADOWMAP_TYPE_VSM"};function Fb(r){return Ub[r.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const Ob={[os]:"ENVMAP_TYPE_CUBE",[ia]:"ENVMAP_TYPE_CUBE",[Cl]:"ENVMAP_TYPE_CUBE_UV"};function Bb(r){return r.envMap===!1?"ENVMAP_TYPE_CUBE":Ob[r.envMapMode]||"ENVMAP_TYPE_CUBE"}const kb={[ia]:"ENVMAP_MODE_REFRACTION"};function zb(r){return r.envMap===!1?"ENVMAP_MODE_REFLECTION":kb[r.envMapMode]||"ENVMAP_MODE_REFLECTION"}const Gb={[nm]:"ENVMAP_BLENDING_MULTIPLY",[p0]:"ENVMAP_BLENDING_MIX",[m0]:"ENVMAP_BLENDING_ADD"};function Vb(r){return r.envMap===!1?"ENVMAP_BLENDING_NONE":Gb[r.combine]||"ENVMAP_BLENDING_NONE"}function Hb(r){const e=r.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function Wb(r,e,t,n){const i=r.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=Fb(t),c=Bb(t),u=zb(t),h=Vb(t),f=Hb(t),d=Ab(t),g=Rb(s),_=i.createProgram();let p,m,b=t.glslVersion?"#version "+t.glslVersion+`
4037
4037
  `:"";t.isRawShaderMaterial?(p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(wa).join(`
4038
4038
  `),p.length>0&&(p+=`
4039
4039
  `),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(wa).join(`
4040
4040
  `),m.length>0&&(m+=`
4041
- `)):(p=[xh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexNormals?"#define HAS_NORMAL":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
4041
+ `)):(p=[Mh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexNormals?"#define HAS_NORMAL":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
4042
4042
  `].filter(wa).join(`
4043
- `),m=[xh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Bi?"#define TONE_MAPPING":"",t.toneMapping!==Bi?et.tonemapping_pars_fragment:"",t.toneMapping!==Bi?Eb("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",et.colorspace_pars_fragment,bb("linearToOutputTexel",t.outputColorSpace),Tb(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
4043
+ `),m=[Mh(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Bi?"#define TONE_MAPPING":"",t.toneMapping!==Bi?et.tonemapping_pars_fragment:"",t.toneMapping!==Bi?Tb("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",et.colorspace_pars_fragment,yb("linearToOutputTexel",t.outputColorSpace),wb(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
4044
4044
  `].filter(wa).join(`
4045
- `)),a=Vu(a),a=mh(a,t),a=gh(a,t),o=Vu(o),o=mh(o,t),o=gh(o,t),a=_h(a),o=_h(o),t.isRawShaderMaterial!==!0&&(b=`#version 300 es
4045
+ `)),a=Vu(a),a=_h(a,t),a=xh(a,t),o=Vu(o),o=_h(o,t),o=xh(o,t),a=vh(a),o=vh(o),t.isRawShaderMaterial!==!0&&(b=`#version 300 es
4046
4046
  `,p=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
4047
4047
  `)+`
4048
- `+p,m=["#define varying in",t.glslVersion===Cd?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Cd?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
4048
+ `+p,m=["#define varying in",t.glslVersion===Dd?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Dd?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
4049
4049
  `)+`
4050
- `+m);const y=b+p+a,M=b+m+o,E=dh(i,i.VERTEX_SHADER,y),T=dh(i,i.FRAGMENT_SHADER,M);i.attachShader(_,E),i.attachShader(_,T),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.hasPositionAttribute===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function A(L){if(r.debug.checkShaderErrors){const N=i.getProgramInfoLog(_)||"",Y=i.getShaderInfoLog(E)||"",H=i.getShaderInfoLog(T)||"",O=N.trim(),z=Y.trim(),I=H.trim();let q=!0,j=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(q=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,_,E,T);else{const D=ph(i,E,"vertex"),se=ph(i,T,"fragment");mt("WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+`
4050
+ `+m);const y=b+p+a,M=b+m+o,E=ph(i,i.VERTEX_SHADER,y),T=ph(i,i.FRAGMENT_SHADER,M);i.attachShader(_,E),i.attachShader(_,T),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.hasPositionAttribute===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function A(L){if(r.debug.checkShaderErrors){const N=i.getProgramInfoLog(_)||"",Y=i.getShaderInfoLog(E)||"",H=i.getShaderInfoLog(T)||"",O=N.trim(),z=Y.trim(),I=H.trim();let q=!0,j=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(q=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,_,E,T);else{const D=gh(i,E,"vertex"),se=gh(i,T,"fragment");mt("WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+`
4051
4051
 
4052
4052
  Material Name: `+L.name+`
4053
4053
  Material Type: `+L.type+`
4054
4054
 
4055
4055
  Program Info Log: `+O+`
4056
4056
  `+D+`
4057
- `+se)}else O!==""?$e("WebGLProgram: Program Info Log:",O):(z===""||I==="")&&(j=!1);j&&(L.diagnostics={runnable:q,programLog:O,vertexShader:{log:z,prefix:p},fragmentShader:{log:I,prefix:m}})}i.deleteShader(E),i.deleteShader(T),v=new al(i,_),w=Rb(i,_)}let v;this.getUniforms=function(){return v===void 0&&A(this),v};let w;this.getAttributes=function(){return w===void 0&&A(this),w};let C=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(_,xb)),C},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=vb++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let Wb=0;class Xb{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){const i=this._getShaderCacheForMaterial(e);return i.has(t)===!1&&(i.add(t),t.usedTimes++),i.has(n)===!1&&(i.add(n),n.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new Yb(e),t.set(e,n)),n}}class Yb{constructor(e){this.id=Wb++,this.code=e,this.usedTimes=0}}function qb(r){return r===ls||r===xl||r===vl}function $b(r,e,t,n,i,s){const a=new Mm,o=new Xb,l=new Set,c=[],u=new Map,h=n.logarithmicDepthBuffer;let f=n.precision;const d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(v){return l.add(v),v===0?"uv":`uv${v}`}function _(v,w,C,L,N,Y){const H=L.fog,O=N.geometry,z=v.isMeshStandardMaterial||v.isMeshLambertMaterial||v.isMeshPhongMaterial?L.environment:null,I=v.isMeshStandardMaterial||v.isMeshLambertMaterial&&!v.envMap||v.isMeshPhongMaterial&&!v.envMap,q=e.get(v.envMap||z,I),j=q&&q.mapping===Cl?q.image.height:null,D=d[v.type];v.precision!==null&&(f=n.getMaxPrecision(v.precision),f!==v.precision&&$e("WebGLProgram.getParameters:",v.precision,"not supported, using",f,"instead."));const se=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,pe=se!==void 0?se.length:0;let Ve=0;O.morphAttributes.position!==void 0&&(Ve=1),O.morphAttributes.normal!==void 0&&(Ve=2),O.morphAttributes.color!==void 0&&(Ve=3);let He,Le,Q,oe;if(D){const re=Di[D];He=re.vertexShader,Le=re.fragmentShader}else{He=v.vertexShader,Le=v.fragmentShader;const re=o.getVertexShaderStage(v),Be=o.getFragmentShaderStage(v);o.update(v,re,Be),Q=re.id,oe=Be.id}const ne=r.getRenderTarget(),Ee=r.state.buffers.depth.getReversed(),Oe=N.isInstancedMesh===!0,Te=N.isBatchedMesh===!0,tt=!!v.map,Me=!!v.matcap,ze=!!q,qe=!!v.aoMap,Ye=!!v.lightMap,$=!!v.bumpMap&&v.wireframe===!1,lt=!!v.normalMap,We=!!v.displacementMap,Qe=!!v.emissiveMap,Ge=!!v.metalnessMap,Ze=!!v.roughnessMap,F=v.anisotropy>0,Ct=v.clearcoat>0,Xe=v.dispersion>0,R=v.iridescence>0,x=v.sheen>0,k=v.transmission>0,V=F&&!!v.anisotropyMap,K=Ct&&!!v.clearcoatMap,ce=Ct&&!!v.clearcoatNormalMap,ae=Ct&&!!v.clearcoatRoughnessMap,J=R&&!!v.iridescenceMap,ee=R&&!!v.iridescenceThicknessMap,he=x&&!!v.sheenColorMap,Ae=x&&!!v.sheenRoughnessMap,ge=!!v.specularMap,me=!!v.specularColorMap,fe=!!v.specularIntensityMap,Pe=k&&!!v.transmissionMap,Ie=k&&!!v.thicknessMap,U=!!v.gradientMap,de=!!v.alphaMap,te=v.alphaTest>0,_e=!!v.alphaHash,xe=!!v.extensions;let ie=Bi;v.toneMapped&&(ne===null||ne.isXRRenderTarget===!0)&&(ie=r.toneMapping);const le={shaderID:D,shaderType:v.type,shaderName:v.name,vertexShader:He,fragmentShader:Le,defines:v.defines,customVertexShaderID:Q,customFragmentShaderID:oe,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:f,batching:Te,batchingColor:Te&&N._colorsTexture!==null,instancing:Oe,instancingColor:Oe&&N.instanceColor!==null,instancingMorph:Oe&&N.morphTexture!==null,outputColorSpace:ne===null?r.outputColorSpace:ne.isXRRenderTarget===!0?ne.texture.colorSpace:ft.workingColorSpace,alphaToCoverage:!!v.alphaToCoverage,map:tt,matcap:Me,envMap:ze,envMapMode:ze&&q.mapping,envMapCubeUVHeight:j,aoMap:qe,lightMap:Ye,bumpMap:$,normalMap:lt,displacementMap:We,emissiveMap:Qe,normalMapObjectSpace:lt&&v.normalMapType===__,normalMapTangentSpace:lt&&v.normalMapType===wd,packedNormalMap:lt&&v.normalMapType===wd&&qb(v.normalMap.format),metalnessMap:Ge,roughnessMap:Ze,anisotropy:F,anisotropyMap:V,clearcoat:Ct,clearcoatMap:K,clearcoatNormalMap:ce,clearcoatRoughnessMap:ae,dispersion:Xe,iridescence:R,iridescenceMap:J,iridescenceThicknessMap:ee,sheen:x,sheenColorMap:he,sheenRoughnessMap:Ae,specularMap:ge,specularColorMap:me,specularIntensityMap:fe,transmission:k,transmissionMap:Pe,thicknessMap:Ie,gradientMap:U,opaque:v.transparent===!1&&v.blending===qs&&v.alphaToCoverage===!1,alphaMap:de,alphaTest:te,alphaHash:_e,combine:v.combine,mapUv:tt&&g(v.map.channel),aoMapUv:qe&&g(v.aoMap.channel),lightMapUv:Ye&&g(v.lightMap.channel),bumpMapUv:$&&g(v.bumpMap.channel),normalMapUv:lt&&g(v.normalMap.channel),displacementMapUv:We&&g(v.displacementMap.channel),emissiveMapUv:Qe&&g(v.emissiveMap.channel),metalnessMapUv:Ge&&g(v.metalnessMap.channel),roughnessMapUv:Ze&&g(v.roughnessMap.channel),anisotropyMapUv:V&&g(v.anisotropyMap.channel),clearcoatMapUv:K&&g(v.clearcoatMap.channel),clearcoatNormalMapUv:ce&&g(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ae&&g(v.clearcoatRoughnessMap.channel),iridescenceMapUv:J&&g(v.iridescenceMap.channel),iridescenceThicknessMapUv:ee&&g(v.iridescenceThicknessMap.channel),sheenColorMapUv:he&&g(v.sheenColorMap.channel),sheenRoughnessMapUv:Ae&&g(v.sheenRoughnessMap.channel),specularMapUv:ge&&g(v.specularMap.channel),specularColorMapUv:me&&g(v.specularColorMap.channel),specularIntensityMapUv:fe&&g(v.specularIntensityMap.channel),transmissionMapUv:Pe&&g(v.transmissionMap.channel),thicknessMapUv:Ie&&g(v.thicknessMap.channel),alphaMapUv:de&&g(v.alphaMap.channel),vertexTangents:!!O.attributes.tangent&&(lt||F),vertexNormals:!!O.attributes.normal,vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!O.attributes.uv&&(tt||de),fog:!!H,useFog:v.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:v.wireframe===!1&&(v.flatShading===!0||O.attributes.normal===void 0&&lt===!1&&(v.isMeshLambertMaterial||v.isMeshPhongMaterial||v.isMeshStandardMaterial||v.isMeshPhysicalMaterial)),sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:h,reversedDepthBuffer:Ee,skinning:N.isSkinnedMesh===!0,hasPositionAttribute:O.attributes.position!==void 0,morphTargets:O.morphAttributes.position!==void 0,morphNormals:O.morphAttributes.normal!==void 0,morphColors:O.morphAttributes.color!==void 0,morphTargetsCount:pe,morphTextureStride:Ve,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numLightProbeGrids:Y.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:v.dithering,shadowMapEnabled:r.shadowMap.enabled&&C.length>0,shadowMapType:r.shadowMap.type,toneMapping:ie,decodeVideoTexture:tt&&v.map.isVideoTexture===!0&&ft.getTransfer(v.map.colorSpace)===vt,decodeVideoTextureEmissive:Qe&&v.emissiveMap.isVideoTexture===!0&&ft.getTransfer(v.emissiveMap.colorSpace)===vt,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Ki,flipSided:v.side===Vn,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionClipCullDistance:xe&&v.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(xe&&v.extensions.multiDraw===!0||Te)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()};return le.vertexUv1s=l.has(1),le.vertexUv2s=l.has(2),le.vertexUv3s=l.has(3),l.clear(),le}function p(v){const w=[];if(v.shaderID?w.push(v.shaderID):(w.push(v.customVertexShaderID),w.push(v.customFragmentShaderID)),v.defines!==void 0)for(const C in v.defines)w.push(C),w.push(v.defines[C]);return v.isRawShaderMaterial===!1&&(m(w,v),b(w,v),w.push(r.outputColorSpace)),w.push(v.customProgramCacheKey),w.join()}function m(v,w){v.push(w.precision),v.push(w.outputColorSpace),v.push(w.envMapMode),v.push(w.envMapCubeUVHeight),v.push(w.mapUv),v.push(w.alphaMapUv),v.push(w.lightMapUv),v.push(w.aoMapUv),v.push(w.bumpMapUv),v.push(w.normalMapUv),v.push(w.displacementMapUv),v.push(w.emissiveMapUv),v.push(w.metalnessMapUv),v.push(w.roughnessMapUv),v.push(w.anisotropyMapUv),v.push(w.clearcoatMapUv),v.push(w.clearcoatNormalMapUv),v.push(w.clearcoatRoughnessMapUv),v.push(w.iridescenceMapUv),v.push(w.iridescenceThicknessMapUv),v.push(w.sheenColorMapUv),v.push(w.sheenRoughnessMapUv),v.push(w.specularMapUv),v.push(w.specularColorMapUv),v.push(w.specularIntensityMapUv),v.push(w.transmissionMapUv),v.push(w.thicknessMapUv),v.push(w.combine),v.push(w.fogExp2),v.push(w.sizeAttenuation),v.push(w.morphTargetsCount),v.push(w.morphAttributeCount),v.push(w.numDirLights),v.push(w.numPointLights),v.push(w.numSpotLights),v.push(w.numSpotLightMaps),v.push(w.numHemiLights),v.push(w.numRectAreaLights),v.push(w.numDirLightShadows),v.push(w.numPointLightShadows),v.push(w.numSpotLightShadows),v.push(w.numSpotLightShadowsWithMaps),v.push(w.numLightProbes),v.push(w.shadowMapType),v.push(w.toneMapping),v.push(w.numClippingPlanes),v.push(w.numClipIntersection),v.push(w.depthPacking)}function b(v,w){a.disableAll(),w.instancing&&a.enable(0),w.instancingColor&&a.enable(1),w.instancingMorph&&a.enable(2),w.matcap&&a.enable(3),w.envMap&&a.enable(4),w.normalMapObjectSpace&&a.enable(5),w.normalMapTangentSpace&&a.enable(6),w.clearcoat&&a.enable(7),w.iridescence&&a.enable(8),w.alphaTest&&a.enable(9),w.vertexColors&&a.enable(10),w.vertexAlphas&&a.enable(11),w.vertexUv1s&&a.enable(12),w.vertexUv2s&&a.enable(13),w.vertexUv3s&&a.enable(14),w.vertexTangents&&a.enable(15),w.anisotropy&&a.enable(16),w.alphaHash&&a.enable(17),w.batching&&a.enable(18),w.dispersion&&a.enable(19),w.batchingColor&&a.enable(20),w.gradientMap&&a.enable(21),w.packedNormalMap&&a.enable(22),w.vertexNormals&&a.enable(23),v.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.reversedDepthBuffer&&a.enable(4),w.skinning&&a.enable(5),w.morphTargets&&a.enable(6),w.morphNormals&&a.enable(7),w.morphColors&&a.enable(8),w.premultipliedAlpha&&a.enable(9),w.shadowMapEnabled&&a.enable(10),w.doubleSided&&a.enable(11),w.flipSided&&a.enable(12),w.useDepthPacking&&a.enable(13),w.dithering&&a.enable(14),w.transmission&&a.enable(15),w.sheen&&a.enable(16),w.opaque&&a.enable(17),w.pointsUvs&&a.enable(18),w.decodeVideoTexture&&a.enable(19),w.decodeVideoTextureEmissive&&a.enable(20),w.alphaToCoverage&&a.enable(21),w.numLightProbeGrids>0&&a.enable(22),w.hasPositionAttribute&&a.enable(23),v.push(a.mask)}function y(v){const w=d[v.type];let C;if(w){const L=Di[w];C=_x.clone(L.uniforms)}else C=v.uniforms;return C}function M(v,w){let C=u.get(w);return C!==void 0?++C.usedTimes:(C=new Hb(r,w,v,i),c.push(C),u.set(w,C)),C}function E(v){if(--v.usedTimes===0){const w=c.indexOf(v);c[w]=c[c.length-1],c.pop(),u.delete(v.cacheKey),v.destroy()}}function T(v){o.remove(v)}function A(){o.dispose()}return{getParameters:_,getProgramCacheKey:p,getUniforms:y,acquireProgram:M,releaseProgram:E,releaseShaderCache:T,programs:c,dispose:A}}function Zb(){let r=new WeakMap;function e(a){return r.has(a)}function t(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function n(a){r.delete(a)}function i(a,o,l){r.get(a)[o]=l}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function Kb(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.materialVariant!==e.materialVariant?r.materialVariant-e.materialVariant:r.z!==e.z?r.z-e.z:r.id-e.id}function vh(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Mh(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function a(f){let d=0;return f.isInstancedMesh&&(d+=2),f.isSkinnedMesh&&(d+=1),d}function o(f,d,g,_,p,m){let b=r[e];return b===void 0?(b={id:f.id,object:f,geometry:d,material:g,materialVariant:a(f),groupOrder:_,renderOrder:f.renderOrder,z:p,group:m},r[e]=b):(b.id=f.id,b.object=f,b.geometry=d,b.material=g,b.materialVariant=a(f),b.groupOrder=_,b.renderOrder=f.renderOrder,b.z=p,b.group=m),e++,b}function l(f,d,g,_,p,m){const b=o(f,d,g,_,p,m);g.transmission>0?n.push(b):g.transparent===!0?i.push(b):t.push(b)}function c(f,d,g,_,p,m){const b=o(f,d,g,_,p,m);g.transmission>0?n.unshift(b):g.transparent===!0?i.unshift(b):t.unshift(b)}function u(f,d,g){t.length>1&&t.sort(f||Kb),n.length>1&&n.sort(d||vh),i.length>1&&i.sort(d||vh),g&&(t.reverse(),n.reverse(),i.reverse())}function h(){for(let f=e,d=r.length;f<d;f++){const g=r[f];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:l,unshift:c,finish:h,sort:u}}function jb(){let r=new WeakMap;function e(n,i){const s=r.get(n);let a;return s===void 0?(a=new Mh,r.set(n,[a])):i>=s.length?(a=new Mh,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function Jb(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new X,color:new ht};break;case"SpotLight":t={position:new X,direction:new X,color:new ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new X,color:new ht,distance:0,decay:0};break;case"HemisphereLight":t={direction:new X,skyColor:new ht,groundColor:new ht};break;case"RectAreaLight":t={color:new ht,position:new X,halfWidth:new X,halfHeight:new X};break}return r[e.id]=t,t}}}function Qb(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let ey=0;function ty(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function ny(r){const e=new Jb,t=Qb(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new X);const i=new X,s=new Yt,a=new Yt;function o(c){let u=0,h=0,f=0;for(let w=0;w<9;w++)n.probe[w].set(0,0,0);let d=0,g=0,_=0,p=0,m=0,b=0,y=0,M=0,E=0,T=0,A=0;c.sort(ty);for(let w=0,C=c.length;w<C;w++){const L=c[w],N=L.color,Y=L.intensity,H=L.distance;let O=null;if(L.shadow&&L.shadow.map&&(L.shadow.map.texture.format===ls?O=L.shadow.map.texture:O=L.shadow.map.depthTexture||L.shadow.map.texture),L.isAmbientLight)u+=N.r*Y,h+=N.g*Y,f+=N.b*Y;else if(L.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(L.sh.coefficients[z],Y);A++}else if(L.isDirectionalLight){const z=e.get(L);if(z.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const I=L.shadow,q=t.get(L);q.shadowIntensity=I.intensity,q.shadowBias=I.bias,q.shadowNormalBias=I.normalBias,q.shadowRadius=I.radius,q.shadowMapSize=I.mapSize,n.directionalShadow[d]=q,n.directionalShadowMap[d]=O,n.directionalShadowMatrix[d]=L.shadow.matrix,b++}n.directional[d]=z,d++}else if(L.isSpotLight){const z=e.get(L);z.position.setFromMatrixPosition(L.matrixWorld),z.color.copy(N).multiplyScalar(Y),z.distance=H,z.coneCos=Math.cos(L.angle),z.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),z.decay=L.decay,n.spot[_]=z;const I=L.shadow;if(L.map&&(n.spotLightMap[E]=L.map,E++,I.updateMatrices(L),L.castShadow&&T++),n.spotLightMatrix[_]=I.matrix,L.castShadow){const q=t.get(L);q.shadowIntensity=I.intensity,q.shadowBias=I.bias,q.shadowNormalBias=I.normalBias,q.shadowRadius=I.radius,q.shadowMapSize=I.mapSize,n.spotShadow[_]=q,n.spotShadowMap[_]=O,M++}_++}else if(L.isRectAreaLight){const z=e.get(L);z.color.copy(N).multiplyScalar(Y),z.halfWidth.set(L.width*.5,0,0),z.halfHeight.set(0,L.height*.5,0),n.rectArea[p]=z,p++}else if(L.isPointLight){const z=e.get(L);if(z.color.copy(L.color).multiplyScalar(L.intensity),z.distance=L.distance,z.decay=L.decay,L.castShadow){const I=L.shadow,q=t.get(L);q.shadowIntensity=I.intensity,q.shadowBias=I.bias,q.shadowNormalBias=I.normalBias,q.shadowRadius=I.radius,q.shadowMapSize=I.mapSize,q.shadowCameraNear=I.camera.near,q.shadowCameraFar=I.camera.far,n.pointShadow[g]=q,n.pointShadowMap[g]=O,n.pointShadowMatrix[g]=L.shadow.matrix,y++}n.point[g]=z,g++}else if(L.isHemisphereLight){const z=e.get(L);z.skyColor.copy(L.color).multiplyScalar(Y),z.groundColor.copy(L.groundColor).multiplyScalar(Y),n.hemi[m]=z,m++}}p>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=be.LTC_FLOAT_1,n.rectAreaLTC2=be.LTC_FLOAT_2):(n.rectAreaLTC1=be.LTC_HALF_1,n.rectAreaLTC2=be.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=h,n.ambient[2]=f;const v=n.hash;(v.directionalLength!==d||v.pointLength!==g||v.spotLength!==_||v.rectAreaLength!==p||v.hemiLength!==m||v.numDirectionalShadows!==b||v.numPointShadows!==y||v.numSpotShadows!==M||v.numSpotMaps!==E||v.numLightProbes!==A)&&(n.directional.length=d,n.spot.length=_,n.rectArea.length=p,n.point.length=g,n.hemi.length=m,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=M,n.spotShadowMap.length=M,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=y,n.spotLightMatrix.length=M+E-T,n.spotLightMap.length=E,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=A,v.directionalLength=d,v.pointLength=g,v.spotLength=_,v.rectAreaLength=p,v.hemiLength=m,v.numDirectionalShadows=b,v.numPointShadows=y,v.numSpotShadows=M,v.numSpotMaps=E,v.numLightProbes=A,n.version=ey++)}function l(c,u){let h=0,f=0,d=0,g=0,_=0;const p=u.matrixWorldInverse;for(let m=0,b=c.length;m<b;m++){const y=c[m];if(y.isDirectionalLight){const M=n.directional[h];M.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),h++}else if(y.isSpotLight){const M=n.spot[d];M.position.setFromMatrixPosition(y.matrixWorld),M.position.applyMatrix4(p),M.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),d++}else if(y.isRectAreaLight){const M=n.rectArea[g];M.position.setFromMatrixPosition(y.matrixWorld),M.position.applyMatrix4(p),a.identity(),s.copy(y.matrixWorld),s.premultiply(p),a.extractRotation(s),M.halfWidth.set(y.width*.5,0,0),M.halfHeight.set(0,y.height*.5,0),M.halfWidth.applyMatrix4(a),M.halfHeight.applyMatrix4(a),g++}else if(y.isPointLight){const M=n.point[f];M.position.setFromMatrixPosition(y.matrixWorld),M.position.applyMatrix4(p),f++}else if(y.isHemisphereLight){const M=n.hemi[_];M.direction.setFromMatrixPosition(y.matrixWorld),M.direction.transformDirection(p),_++}}}return{setup:o,setupView:l,state:n}}function Sh(r){const e=new ny(r),t=[],n=[],i=[];function s(f){h.camera=f,t.length=0,n.length=0,i.length=0}function a(f){t.push(f)}function o(f){n.push(f)}function l(f){i.push(f)}function c(){e.setup(t)}function u(f){e.setupView(t,f)}const h={lightsArray:t,shadowsArray:n,lightProbeGridArray:i,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:s,state:h,setupLights:c,setupLightsView:u,pushLight:a,pushShadow:o,pushLightProbeGrid:l}}function iy(r){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new Sh(r),e.set(i,[o])):s>=a.length?(o=new Sh(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const ry=`void main() {
4057
+ `+se)}else O!==""?$e("WebGLProgram: Program Info Log:",O):(z===""||I==="")&&(j=!1);j&&(L.diagnostics={runnable:q,programLog:O,vertexShader:{log:z,prefix:p},fragmentShader:{log:I,prefix:m}})}i.deleteShader(E),i.deleteShader(T),v=new al(i,_),w=Cb(i,_)}let v;this.getUniforms=function(){return v===void 0&&A(this),v};let w;this.getAttributes=function(){return w===void 0&&A(this),w};let C=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(_,vb)),C},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Mb++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let Xb=0;class Yb{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){const i=this._getShaderCacheForMaterial(e);return i.has(t)===!1&&(i.add(t),t.usedTimes++),i.has(n)===!1&&(i.add(n),n.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new qb(e),t.set(e,n)),n}}class qb{constructor(e){this.id=Xb++,this.code=e,this.usedTimes=0}}function $b(r){return r===ls||r===xl||r===vl}function Kb(r,e,t,n,i,s){const a=new Mm,o=new Yb,l=new Set,c=[],u=new Map,h=n.logarithmicDepthBuffer;let f=n.precision;const d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(v){return l.add(v),v===0?"uv":`uv${v}`}function _(v,w,C,L,N,Y){const H=L.fog,O=N.geometry,z=v.isMeshStandardMaterial||v.isMeshLambertMaterial||v.isMeshPhongMaterial?L.environment:null,I=v.isMeshStandardMaterial||v.isMeshLambertMaterial&&!v.envMap||v.isMeshPhongMaterial&&!v.envMap,q=e.get(v.envMap||z,I),j=q&&q.mapping===Cl?q.image.height:null,D=d[v.type];v.precision!==null&&(f=n.getMaxPrecision(v.precision),f!==v.precision&&$e("WebGLProgram.getParameters:",v.precision,"not supported, using",f,"instead."));const se=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,pe=se!==void 0?se.length:0;let Ve=0;O.morphAttributes.position!==void 0&&(Ve=1),O.morphAttributes.normal!==void 0&&(Ve=2),O.morphAttributes.color!==void 0&&(Ve=3);let He,Le,Q,oe;if(D){const re=Di[D];He=re.vertexShader,Le=re.fragmentShader}else{He=v.vertexShader,Le=v.fragmentShader;const re=o.getVertexShaderStage(v),Be=o.getFragmentShaderStage(v);o.update(v,re,Be),Q=re.id,oe=Be.id}const ne=r.getRenderTarget(),Ee=r.state.buffers.depth.getReversed(),Oe=N.isInstancedMesh===!0,Te=N.isBatchedMesh===!0,tt=!!v.map,Me=!!v.matcap,ze=!!q,qe=!!v.aoMap,Ye=!!v.lightMap,$=!!v.bumpMap&&v.wireframe===!1,lt=!!v.normalMap,We=!!v.displacementMap,Qe=!!v.emissiveMap,Ge=!!v.metalnessMap,Ke=!!v.roughnessMap,F=v.anisotropy>0,Ct=v.clearcoat>0,Xe=v.dispersion>0,R=v.iridescence>0,x=v.sheen>0,k=v.transmission>0,V=F&&!!v.anisotropyMap,Z=Ct&&!!v.clearcoatMap,ce=Ct&&!!v.clearcoatNormalMap,ae=Ct&&!!v.clearcoatRoughnessMap,J=R&&!!v.iridescenceMap,ee=R&&!!v.iridescenceThicknessMap,he=x&&!!v.sheenColorMap,Ae=x&&!!v.sheenRoughnessMap,ge=!!v.specularMap,me=!!v.specularColorMap,fe=!!v.specularIntensityMap,Pe=k&&!!v.transmissionMap,Ie=k&&!!v.thicknessMap,U=!!v.gradientMap,de=!!v.alphaMap,te=v.alphaTest>0,_e=!!v.alphaHash,xe=!!v.extensions;let ie=Bi;v.toneMapped&&(ne===null||ne.isXRRenderTarget===!0)&&(ie=r.toneMapping);const le={shaderID:D,shaderType:v.type,shaderName:v.name,vertexShader:He,fragmentShader:Le,defines:v.defines,customVertexShaderID:Q,customFragmentShaderID:oe,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:f,batching:Te,batchingColor:Te&&N._colorsTexture!==null,instancing:Oe,instancingColor:Oe&&N.instanceColor!==null,instancingMorph:Oe&&N.morphTexture!==null,outputColorSpace:ne===null?r.outputColorSpace:ne.isXRRenderTarget===!0?ne.texture.colorSpace:ft.workingColorSpace,alphaToCoverage:!!v.alphaToCoverage,map:tt,matcap:Me,envMap:ze,envMapMode:ze&&q.mapping,envMapCubeUVHeight:j,aoMap:qe,lightMap:Ye,bumpMap:$,normalMap:lt,displacementMap:We,emissiveMap:Qe,normalMapObjectSpace:lt&&v.normalMapType===x0,normalMapTangentSpace:lt&&v.normalMapType===Rd,packedNormalMap:lt&&v.normalMapType===Rd&&$b(v.normalMap.format),metalnessMap:Ge,roughnessMap:Ke,anisotropy:F,anisotropyMap:V,clearcoat:Ct,clearcoatMap:Z,clearcoatNormalMap:ce,clearcoatRoughnessMap:ae,dispersion:Xe,iridescence:R,iridescenceMap:J,iridescenceThicknessMap:ee,sheen:x,sheenColorMap:he,sheenRoughnessMap:Ae,specularMap:ge,specularColorMap:me,specularIntensityMap:fe,transmission:k,transmissionMap:Pe,thicknessMap:Ie,gradientMap:U,opaque:v.transparent===!1&&v.blending===qs&&v.alphaToCoverage===!1,alphaMap:de,alphaTest:te,alphaHash:_e,combine:v.combine,mapUv:tt&&g(v.map.channel),aoMapUv:qe&&g(v.aoMap.channel),lightMapUv:Ye&&g(v.lightMap.channel),bumpMapUv:$&&g(v.bumpMap.channel),normalMapUv:lt&&g(v.normalMap.channel),displacementMapUv:We&&g(v.displacementMap.channel),emissiveMapUv:Qe&&g(v.emissiveMap.channel),metalnessMapUv:Ge&&g(v.metalnessMap.channel),roughnessMapUv:Ke&&g(v.roughnessMap.channel),anisotropyMapUv:V&&g(v.anisotropyMap.channel),clearcoatMapUv:Z&&g(v.clearcoatMap.channel),clearcoatNormalMapUv:ce&&g(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ae&&g(v.clearcoatRoughnessMap.channel),iridescenceMapUv:J&&g(v.iridescenceMap.channel),iridescenceThicknessMapUv:ee&&g(v.iridescenceThicknessMap.channel),sheenColorMapUv:he&&g(v.sheenColorMap.channel),sheenRoughnessMapUv:Ae&&g(v.sheenRoughnessMap.channel),specularMapUv:ge&&g(v.specularMap.channel),specularColorMapUv:me&&g(v.specularColorMap.channel),specularIntensityMapUv:fe&&g(v.specularIntensityMap.channel),transmissionMapUv:Pe&&g(v.transmissionMap.channel),thicknessMapUv:Ie&&g(v.thicknessMap.channel),alphaMapUv:de&&g(v.alphaMap.channel),vertexTangents:!!O.attributes.tangent&&(lt||F),vertexNormals:!!O.attributes.normal,vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!O.attributes.uv&&(tt||de),fog:!!H,useFog:v.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:v.wireframe===!1&&(v.flatShading===!0||O.attributes.normal===void 0&&lt===!1&&(v.isMeshLambertMaterial||v.isMeshPhongMaterial||v.isMeshStandardMaterial||v.isMeshPhysicalMaterial)),sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:h,reversedDepthBuffer:Ee,skinning:N.isSkinnedMesh===!0,hasPositionAttribute:O.attributes.position!==void 0,morphTargets:O.morphAttributes.position!==void 0,morphNormals:O.morphAttributes.normal!==void 0,morphColors:O.morphAttributes.color!==void 0,morphTargetsCount:pe,morphTextureStride:Ve,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numLightProbeGrids:Y.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:v.dithering,shadowMapEnabled:r.shadowMap.enabled&&C.length>0,shadowMapType:r.shadowMap.type,toneMapping:ie,decodeVideoTexture:tt&&v.map.isVideoTexture===!0&&ft.getTransfer(v.map.colorSpace)===vt,decodeVideoTextureEmissive:Qe&&v.emissiveMap.isVideoTexture===!0&&ft.getTransfer(v.emissiveMap.colorSpace)===vt,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Zi,flipSided:v.side===Vn,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionClipCullDistance:xe&&v.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(xe&&v.extensions.multiDraw===!0||Te)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()};return le.vertexUv1s=l.has(1),le.vertexUv2s=l.has(2),le.vertexUv3s=l.has(3),l.clear(),le}function p(v){const w=[];if(v.shaderID?w.push(v.shaderID):(w.push(v.customVertexShaderID),w.push(v.customFragmentShaderID)),v.defines!==void 0)for(const C in v.defines)w.push(C),w.push(v.defines[C]);return v.isRawShaderMaterial===!1&&(m(w,v),b(w,v),w.push(r.outputColorSpace)),w.push(v.customProgramCacheKey),w.join()}function m(v,w){v.push(w.precision),v.push(w.outputColorSpace),v.push(w.envMapMode),v.push(w.envMapCubeUVHeight),v.push(w.mapUv),v.push(w.alphaMapUv),v.push(w.lightMapUv),v.push(w.aoMapUv),v.push(w.bumpMapUv),v.push(w.normalMapUv),v.push(w.displacementMapUv),v.push(w.emissiveMapUv),v.push(w.metalnessMapUv),v.push(w.roughnessMapUv),v.push(w.anisotropyMapUv),v.push(w.clearcoatMapUv),v.push(w.clearcoatNormalMapUv),v.push(w.clearcoatRoughnessMapUv),v.push(w.iridescenceMapUv),v.push(w.iridescenceThicknessMapUv),v.push(w.sheenColorMapUv),v.push(w.sheenRoughnessMapUv),v.push(w.specularMapUv),v.push(w.specularColorMapUv),v.push(w.specularIntensityMapUv),v.push(w.transmissionMapUv),v.push(w.thicknessMapUv),v.push(w.combine),v.push(w.fogExp2),v.push(w.sizeAttenuation),v.push(w.morphTargetsCount),v.push(w.morphAttributeCount),v.push(w.numDirLights),v.push(w.numPointLights),v.push(w.numSpotLights),v.push(w.numSpotLightMaps),v.push(w.numHemiLights),v.push(w.numRectAreaLights),v.push(w.numDirLightShadows),v.push(w.numPointLightShadows),v.push(w.numSpotLightShadows),v.push(w.numSpotLightShadowsWithMaps),v.push(w.numLightProbes),v.push(w.shadowMapType),v.push(w.toneMapping),v.push(w.numClippingPlanes),v.push(w.numClipIntersection),v.push(w.depthPacking)}function b(v,w){a.disableAll(),w.instancing&&a.enable(0),w.instancingColor&&a.enable(1),w.instancingMorph&&a.enable(2),w.matcap&&a.enable(3),w.envMap&&a.enable(4),w.normalMapObjectSpace&&a.enable(5),w.normalMapTangentSpace&&a.enable(6),w.clearcoat&&a.enable(7),w.iridescence&&a.enable(8),w.alphaTest&&a.enable(9),w.vertexColors&&a.enable(10),w.vertexAlphas&&a.enable(11),w.vertexUv1s&&a.enable(12),w.vertexUv2s&&a.enable(13),w.vertexUv3s&&a.enable(14),w.vertexTangents&&a.enable(15),w.anisotropy&&a.enable(16),w.alphaHash&&a.enable(17),w.batching&&a.enable(18),w.dispersion&&a.enable(19),w.batchingColor&&a.enable(20),w.gradientMap&&a.enable(21),w.packedNormalMap&&a.enable(22),w.vertexNormals&&a.enable(23),v.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.reversedDepthBuffer&&a.enable(4),w.skinning&&a.enable(5),w.morphTargets&&a.enable(6),w.morphNormals&&a.enable(7),w.morphColors&&a.enable(8),w.premultipliedAlpha&&a.enable(9),w.shadowMapEnabled&&a.enable(10),w.doubleSided&&a.enable(11),w.flipSided&&a.enable(12),w.useDepthPacking&&a.enable(13),w.dithering&&a.enable(14),w.transmission&&a.enable(15),w.sheen&&a.enable(16),w.opaque&&a.enable(17),w.pointsUvs&&a.enable(18),w.decodeVideoTexture&&a.enable(19),w.decodeVideoTextureEmissive&&a.enable(20),w.alphaToCoverage&&a.enable(21),w.numLightProbeGrids>0&&a.enable(22),w.hasPositionAttribute&&a.enable(23),v.push(a.mask)}function y(v){const w=d[v.type];let C;if(w){const L=Di[w];C=xx.clone(L.uniforms)}else C=v.uniforms;return C}function M(v,w){let C=u.get(w);return C!==void 0?++C.usedTimes:(C=new Wb(r,w,v,i),c.push(C),u.set(w,C)),C}function E(v){if(--v.usedTimes===0){const w=c.indexOf(v);c[w]=c[c.length-1],c.pop(),u.delete(v.cacheKey),v.destroy()}}function T(v){o.remove(v)}function A(){o.dispose()}return{getParameters:_,getProgramCacheKey:p,getUniforms:y,acquireProgram:M,releaseProgram:E,releaseShaderCache:T,programs:c,dispose:A}}function Zb(){let r=new WeakMap;function e(a){return r.has(a)}function t(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function n(a){r.delete(a)}function i(a,o,l){r.get(a)[o]=l}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function jb(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.materialVariant!==e.materialVariant?r.materialVariant-e.materialVariant:r.z!==e.z?r.z-e.z:r.id-e.id}function Sh(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function bh(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function a(f){let d=0;return f.isInstancedMesh&&(d+=2),f.isSkinnedMesh&&(d+=1),d}function o(f,d,g,_,p,m){let b=r[e];return b===void 0?(b={id:f.id,object:f,geometry:d,material:g,materialVariant:a(f),groupOrder:_,renderOrder:f.renderOrder,z:p,group:m},r[e]=b):(b.id=f.id,b.object=f,b.geometry=d,b.material=g,b.materialVariant=a(f),b.groupOrder=_,b.renderOrder=f.renderOrder,b.z=p,b.group=m),e++,b}function l(f,d,g,_,p,m){const b=o(f,d,g,_,p,m);g.transmission>0?n.push(b):g.transparent===!0?i.push(b):t.push(b)}function c(f,d,g,_,p,m){const b=o(f,d,g,_,p,m);g.transmission>0?n.unshift(b):g.transparent===!0?i.unshift(b):t.unshift(b)}function u(f,d,g){t.length>1&&t.sort(f||jb),n.length>1&&n.sort(d||Sh),i.length>1&&i.sort(d||Sh),g&&(t.reverse(),n.reverse(),i.reverse())}function h(){for(let f=e,d=r.length;f<d;f++){const g=r[f];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:l,unshift:c,finish:h,sort:u}}function Jb(){let r=new WeakMap;function e(n,i){const s=r.get(n);let a;return s===void 0?(a=new bh,r.set(n,[a])):i>=s.length?(a=new bh,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function Qb(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new X,color:new ht};break;case"SpotLight":t={position:new X,direction:new X,color:new ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new X,color:new ht,distance:0,decay:0};break;case"HemisphereLight":t={direction:new X,skyColor:new ht,groundColor:new ht};break;case"RectAreaLight":t={color:new ht,position:new X,halfWidth:new X,halfHeight:new X};break}return r[e.id]=t,t}}}function ey(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let ty=0;function ny(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function iy(r){const e=new Qb,t=ey(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new X);const i=new X,s=new Yt,a=new Yt;function o(c){let u=0,h=0,f=0;for(let w=0;w<9;w++)n.probe[w].set(0,0,0);let d=0,g=0,_=0,p=0,m=0,b=0,y=0,M=0,E=0,T=0,A=0;c.sort(ny);for(let w=0,C=c.length;w<C;w++){const L=c[w],N=L.color,Y=L.intensity,H=L.distance;let O=null;if(L.shadow&&L.shadow.map&&(L.shadow.map.texture.format===ls?O=L.shadow.map.texture:O=L.shadow.map.depthTexture||L.shadow.map.texture),L.isAmbientLight)u+=N.r*Y,h+=N.g*Y,f+=N.b*Y;else if(L.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(L.sh.coefficients[z],Y);A++}else if(L.isDirectionalLight){const z=e.get(L);if(z.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const I=L.shadow,q=t.get(L);q.shadowIntensity=I.intensity,q.shadowBias=I.bias,q.shadowNormalBias=I.normalBias,q.shadowRadius=I.radius,q.shadowMapSize=I.mapSize,n.directionalShadow[d]=q,n.directionalShadowMap[d]=O,n.directionalShadowMatrix[d]=L.shadow.matrix,b++}n.directional[d]=z,d++}else if(L.isSpotLight){const z=e.get(L);z.position.setFromMatrixPosition(L.matrixWorld),z.color.copy(N).multiplyScalar(Y),z.distance=H,z.coneCos=Math.cos(L.angle),z.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),z.decay=L.decay,n.spot[_]=z;const I=L.shadow;if(L.map&&(n.spotLightMap[E]=L.map,E++,I.updateMatrices(L),L.castShadow&&T++),n.spotLightMatrix[_]=I.matrix,L.castShadow){const q=t.get(L);q.shadowIntensity=I.intensity,q.shadowBias=I.bias,q.shadowNormalBias=I.normalBias,q.shadowRadius=I.radius,q.shadowMapSize=I.mapSize,n.spotShadow[_]=q,n.spotShadowMap[_]=O,M++}_++}else if(L.isRectAreaLight){const z=e.get(L);z.color.copy(N).multiplyScalar(Y),z.halfWidth.set(L.width*.5,0,0),z.halfHeight.set(0,L.height*.5,0),n.rectArea[p]=z,p++}else if(L.isPointLight){const z=e.get(L);if(z.color.copy(L.color).multiplyScalar(L.intensity),z.distance=L.distance,z.decay=L.decay,L.castShadow){const I=L.shadow,q=t.get(L);q.shadowIntensity=I.intensity,q.shadowBias=I.bias,q.shadowNormalBias=I.normalBias,q.shadowRadius=I.radius,q.shadowMapSize=I.mapSize,q.shadowCameraNear=I.camera.near,q.shadowCameraFar=I.camera.far,n.pointShadow[g]=q,n.pointShadowMap[g]=O,n.pointShadowMatrix[g]=L.shadow.matrix,y++}n.point[g]=z,g++}else if(L.isHemisphereLight){const z=e.get(L);z.skyColor.copy(L.color).multiplyScalar(Y),z.groundColor.copy(L.groundColor).multiplyScalar(Y),n.hemi[m]=z,m++}}p>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=be.LTC_FLOAT_1,n.rectAreaLTC2=be.LTC_FLOAT_2):(n.rectAreaLTC1=be.LTC_HALF_1,n.rectAreaLTC2=be.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=h,n.ambient[2]=f;const v=n.hash;(v.directionalLength!==d||v.pointLength!==g||v.spotLength!==_||v.rectAreaLength!==p||v.hemiLength!==m||v.numDirectionalShadows!==b||v.numPointShadows!==y||v.numSpotShadows!==M||v.numSpotMaps!==E||v.numLightProbes!==A)&&(n.directional.length=d,n.spot.length=_,n.rectArea.length=p,n.point.length=g,n.hemi.length=m,n.directionalShadow.length=b,n.directionalShadowMap.length=b,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=M,n.spotShadowMap.length=M,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=y,n.spotLightMatrix.length=M+E-T,n.spotLightMap.length=E,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=A,v.directionalLength=d,v.pointLength=g,v.spotLength=_,v.rectAreaLength=p,v.hemiLength=m,v.numDirectionalShadows=b,v.numPointShadows=y,v.numSpotShadows=M,v.numSpotMaps=E,v.numLightProbes=A,n.version=ty++)}function l(c,u){let h=0,f=0,d=0,g=0,_=0;const p=u.matrixWorldInverse;for(let m=0,b=c.length;m<b;m++){const y=c[m];if(y.isDirectionalLight){const M=n.directional[h];M.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),h++}else if(y.isSpotLight){const M=n.spot[d];M.position.setFromMatrixPosition(y.matrixWorld),M.position.applyMatrix4(p),M.direction.setFromMatrixPosition(y.matrixWorld),i.setFromMatrixPosition(y.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(p),d++}else if(y.isRectAreaLight){const M=n.rectArea[g];M.position.setFromMatrixPosition(y.matrixWorld),M.position.applyMatrix4(p),a.identity(),s.copy(y.matrixWorld),s.premultiply(p),a.extractRotation(s),M.halfWidth.set(y.width*.5,0,0),M.halfHeight.set(0,y.height*.5,0),M.halfWidth.applyMatrix4(a),M.halfHeight.applyMatrix4(a),g++}else if(y.isPointLight){const M=n.point[f];M.position.setFromMatrixPosition(y.matrixWorld),M.position.applyMatrix4(p),f++}else if(y.isHemisphereLight){const M=n.hemi[_];M.direction.setFromMatrixPosition(y.matrixWorld),M.direction.transformDirection(p),_++}}}return{setup:o,setupView:l,state:n}}function yh(r){const e=new iy(r),t=[],n=[],i=[];function s(f){h.camera=f,t.length=0,n.length=0,i.length=0}function a(f){t.push(f)}function o(f){n.push(f)}function l(f){i.push(f)}function c(){e.setup(t)}function u(f){e.setupView(t,f)}const h={lightsArray:t,shadowsArray:n,lightProbeGridArray:i,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:s,state:h,setupLights:c,setupLightsView:u,pushLight:a,pushShadow:o,pushLightProbeGrid:l}}function ry(r){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new yh(r),e.set(i,[o])):s>=a.length?(o=new yh(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const sy=`void main() {
4058
4058
  gl_Position = vec4( position, 1.0 );
4059
- }`,sy=`uniform sampler2D shadow_pass;
4059
+ }`,ay=`uniform sampler2D shadow_pass;
4060
4060
  uniform vec2 resolution;
4061
4061
  uniform float radius;
4062
4062
  void main() {
@@ -4081,12 +4081,12 @@ void main() {
4081
4081
  squared_mean = squared_mean / samples;
4082
4082
  float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4083
4083
  gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4084
- }`,ay=[new X(1,0,0),new X(-1,0,0),new X(0,1,0),new X(0,-1,0),new X(0,0,1),new X(0,0,-1)],oy=[new X(0,-1,0),new X(0,-1,0),new X(0,0,1),new X(0,0,-1),new X(0,-1,0),new X(0,-1,0)],bh=new Yt,_a=new X,Tc=new X;function ly(r,e,t){let n=new wm;const i=new gt,s=new gt,a=new kt,o=new Sx,l=new bx,c={},u=t.maxTextureSize,h={[Lr]:Vn,[Vn]:Lr,[Ki]:Ki},f=new yi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new gt},radius:{value:4}},vertexShader:ry,fragmentShader:sy}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const g=new Ei;g.setAttribute("position",new Mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new or(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tl;let m=this.type;this.render=function(T,A,v){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;this.type===$0&&($e("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=tl);const w=r.getRenderTarget(),C=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),N=r.state;N.setBlending(er),N.buffers.depth.getReversed()===!0?N.buffers.color.setClear(0,0,0,0):N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const Y=m!==this.type;Y&&A.traverse(function(H){H.material&&(Array.isArray(H.material)?H.material.forEach(O=>O.needsUpdate=!0):H.material.needsUpdate=!0)});for(let H=0,O=T.length;H<O;H++){const z=T[H],I=z.shadow;if(I===void 0){$e("WebGLShadowMap:",z,"has no shadow.");continue}if(I.autoUpdate===!1&&I.needsUpdate===!1)continue;i.copy(I.mapSize);const q=I.getFrameExtents();i.multiply(q),s.copy(I.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/q.x),i.x=s.x*q.x,I.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/q.y),i.y=s.y*q.y,I.mapSize.y=s.y));const j=r.state.buffers.depth.getReversed();if(I.camera._reversedDepth=j,I.map===null||Y===!0){if(I.map!==null&&(I.map.depthTexture!==null&&(I.map.depthTexture.dispose(),I.map.depthTexture=null),I.map.dispose()),this.type===Ta){if(z.isPointLight){$e("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}I.map=new ki(i.x,i.y,{format:ls,type:sr,minFilter:yn,magFilter:yn,generateMipmaps:!1}),I.map.texture.name=z.name+".shadowMap",I.map.depthTexture=new ra(i.x,i.y,Ui),I.map.depthTexture.name=z.name+".shadowMapDepth",I.map.depthTexture.format=ar,I.map.depthTexture.compareFunction=null,I.map.depthTexture.minFilter=dn,I.map.depthTexture.magFilter=dn}else z.isPointLight?(I.map=new Im(i.x),I.map.depthTexture=new mx(i.x,Gi)):(I.map=new ki(i.x,i.y),I.map.depthTexture=new ra(i.x,i.y,Gi)),I.map.depthTexture.name=z.name+".shadowMap",I.map.depthTexture.format=ar,this.type===tl?(I.map.depthTexture.compareFunction=j?Tf:Ef,I.map.depthTexture.minFilter=yn,I.map.depthTexture.magFilter=yn):(I.map.depthTexture.compareFunction=null,I.map.depthTexture.minFilter=dn,I.map.depthTexture.magFilter=dn);I.camera.updateProjectionMatrix()}const D=I.map.isWebGLCubeRenderTarget?6:1;for(let se=0;se<D;se++){if(I.map.isWebGLCubeRenderTarget)r.setRenderTarget(I.map,se),r.clear();else{se===0&&(r.setRenderTarget(I.map),r.clear());const pe=I.getViewport(se);a.set(s.x*pe.x,s.y*pe.y,s.x*pe.z,s.y*pe.w),N.viewport(a)}if(z.isPointLight){const pe=I.camera,Ve=I.matrix,He=z.distance||pe.far;He!==pe.far&&(pe.far=He,pe.updateProjectionMatrix()),_a.setFromMatrixPosition(z.matrixWorld),pe.position.copy(_a),Tc.copy(pe.position),Tc.add(ay[se]),pe.up.copy(oy[se]),pe.lookAt(Tc),pe.updateMatrixWorld(),Ve.makeTranslation(-_a.x,-_a.y,-_a.z),bh.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),I._frustum.setFromProjectionMatrix(bh,pe.coordinateSystem,pe.reversedDepth)}else I.updateMatrices(z);n=I.getFrustum(),M(A,v,I.camera,z,this.type)}I.isPointLightShadow!==!0&&this.type===Ta&&b(I,v),I.needsUpdate=!1}m=this.type,p.needsUpdate=!1,r.setRenderTarget(w,C,L)};function b(T,A){const v=e.update(_);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,d.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new ki(i.x,i.y,{format:ls,type:sr})),f.uniforms.shadow_pass.value=T.map.depthTexture,f.uniforms.resolution.value=T.mapSize,f.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(A,null,v,f,_,null),d.uniforms.shadow_pass.value=T.mapPass.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(A,null,v,d,_,null)}function y(T,A,v,w){let C=null;const L=v.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(L!==void 0)C=L;else if(C=v.isPointLight===!0?l:o,r.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const N=C.uuid,Y=A.uuid;let H=c[N];H===void 0&&(H={},c[N]=H);let O=H[Y];O===void 0&&(O=C.clone(),H[Y]=O,A.addEventListener("dispose",E)),C=O}if(C.visible=A.visible,C.wireframe=A.wireframe,w===Ta?C.side=A.shadowSide!==null?A.shadowSide:A.side:C.side=A.shadowSide!==null?A.shadowSide:h[A.side],C.alphaMap=A.alphaMap,C.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,C.map=A.map,C.clipShadows=A.clipShadows,C.clippingPlanes=A.clippingPlanes,C.clipIntersection=A.clipIntersection,C.displacementMap=A.displacementMap,C.displacementScale=A.displacementScale,C.displacementBias=A.displacementBias,C.wireframeLinewidth=A.wireframeLinewidth,C.linewidth=A.linewidth,v.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const N=r.properties.get(C);N.light=v}return C}function M(T,A,v,w,C){if(T.visible===!1)return;if(T.layers.test(A.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&C===Ta)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,T.matrixWorld);const Y=e.update(T),H=T.material;if(Array.isArray(H)){const O=Y.groups;for(let z=0,I=O.length;z<I;z++){const q=O[z],j=H[q.materialIndex];if(j&&j.visible){const D=y(T,j,w,C);T.onBeforeShadow(r,T,A,v,Y,D,q),r.renderBufferDirect(v,null,Y,D,T,q),T.onAfterShadow(r,T,A,v,Y,D,q)}}}else if(H.visible){const O=y(T,H,w,C);T.onBeforeShadow(r,T,A,v,Y,O,null),r.renderBufferDirect(v,null,Y,O,T,null),T.onAfterShadow(r,T,A,v,Y,O,null)}}const N=T.children;for(let Y=0,H=N.length;Y<H;Y++)M(N[Y],A,v,w,C)}function E(T){T.target.removeEventListener("dispose",E);for(const v in c){const w=c[v],C=T.target.uuid;C in w&&(w[C].dispose(),delete w[C])}}}function cy(r,e){function t(){let U=!1;const de=new kt;let te=null;const _e=new kt(0,0,0,0);return{setMask:function(xe){te!==xe&&!U&&(r.colorMask(xe,xe,xe,xe),te=xe)},setLocked:function(xe){U=xe},setClear:function(xe,ie,le,re,Be){Be===!0&&(xe*=re,ie*=re,le*=re),de.set(xe,ie,le,re),_e.equals(de)===!1&&(r.clearColor(xe,ie,le,re),_e.copy(de))},reset:function(){U=!1,te=null,_e.set(-1,0,0,0)}}}function n(){let U=!1,de=!1,te=null,_e=null,xe=null;return{setReversed:function(ie){if(de!==ie){const le=e.get("EXT_clip_control");ie?le.clipControlEXT(le.LOWER_LEFT_EXT,le.ZERO_TO_ONE_EXT):le.clipControlEXT(le.LOWER_LEFT_EXT,le.NEGATIVE_ONE_TO_ONE_EXT),de=ie;const re=xe;xe=null,this.setClear(re)}},getReversed:function(){return de},setTest:function(ie){ie?ne(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(ie){te!==ie&&!U&&(r.depthMask(ie),te=ie)},setFunc:function(ie){if(de&&(ie=A_[ie]),_e!==ie){switch(ie){case tu:r.depthFunc(r.NEVER);break;case nu:r.depthFunc(r.ALWAYS);break;case iu:r.depthFunc(r.LESS);break;case na:r.depthFunc(r.LEQUAL);break;case ru:r.depthFunc(r.EQUAL);break;case su:r.depthFunc(r.GEQUAL);break;case au:r.depthFunc(r.GREATER);break;case ou:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=ie}},setLocked:function(ie){U=ie},setClear:function(ie){xe!==ie&&(xe=ie,de&&(ie=1-ie),r.clearDepth(ie))},reset:function(){U=!1,te=null,_e=null,xe=null,de=!1}}}function i(){let U=!1,de=null,te=null,_e=null,xe=null,ie=null,le=null,re=null,Be=null;return{setTest:function(ue){U||(ue?ne(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(ue){de!==ue&&!U&&(r.stencilMask(ue),de=ue)},setFunc:function(ue,ke,Ce){(te!==ue||_e!==ke||xe!==Ce)&&(r.stencilFunc(ue,ke,Ce),te=ue,_e=ke,xe=Ce)},setOp:function(ue,ke,Ce){(ie!==ue||le!==ke||re!==Ce)&&(r.stencilOp(ue,ke,Ce),ie=ue,le=ke,re=Ce)},setLocked:function(ue){U=ue},setClear:function(ue){Be!==ue&&(r.clearStencil(ue),Be=ue)},reset:function(){U=!1,de=null,te=null,_e=null,xe=null,ie=null,le=null,re=null,Be=null}}}const s=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let u={},h={},f={},d=new WeakMap,g=[],_=null,p=!1,m=null,b=null,y=null,M=null,E=null,T=null,A=null,v=new ht(0,0,0),w=0,C=!1,L=null,N=null,Y=null,H=null,O=null;const z=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let I=!1,q=0;const j=r.getParameter(r.VERSION);j.indexOf("WebGL")!==-1?(q=parseFloat(/^WebGL (\d)/.exec(j)[1]),I=q>=1):j.indexOf("OpenGL ES")!==-1&&(q=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),I=q>=2);let D=null,se={};const pe=r.getParameter(r.SCISSOR_BOX),Ve=r.getParameter(r.VIEWPORT),He=new kt().fromArray(pe),Le=new kt().fromArray(Ve);function Q(U,de,te,_e){const xe=new Uint8Array(4),ie=r.createTexture();r.bindTexture(U,ie),r.texParameteri(U,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(U,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let le=0;le<te;le++)U===r.TEXTURE_3D||U===r.TEXTURE_2D_ARRAY?r.texImage3D(de,0,r.RGBA,1,1,_e,0,r.RGBA,r.UNSIGNED_BYTE,xe):r.texImage2D(de+le,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,xe);return ie}const oe={};oe[r.TEXTURE_2D]=Q(r.TEXTURE_2D,r.TEXTURE_2D,1),oe[r.TEXTURE_CUBE_MAP]=Q(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),oe[r.TEXTURE_2D_ARRAY]=Q(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),oe[r.TEXTURE_3D]=Q(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),ne(r.DEPTH_TEST),a.setFunc(na),$(!1),lt(yd),ne(r.CULL_FACE),qe(er);function ne(U){u[U]!==!0&&(r.enable(U),u[U]=!0)}function Ee(U){u[U]!==!1&&(r.disable(U),u[U]=!1)}function Oe(U,de){return f[U]!==de?(r.bindFramebuffer(U,de),f[U]=de,U===r.DRAW_FRAMEBUFFER&&(f[r.FRAMEBUFFER]=de),U===r.FRAMEBUFFER&&(f[r.DRAW_FRAMEBUFFER]=de),!0):!1}function Te(U,de){let te=g,_e=!1;if(U){te=d.get(de),te===void 0&&(te=[],d.set(de,te));const xe=U.textures;if(te.length!==xe.length||te[0]!==r.COLOR_ATTACHMENT0){for(let ie=0,le=xe.length;ie<le;ie++)te[ie]=r.COLOR_ATTACHMENT0+ie;te.length=xe.length,_e=!0}}else te[0]!==r.BACK&&(te[0]=r.BACK,_e=!0);_e&&r.drawBuffers(te)}function tt(U){return _!==U?(r.useProgram(U),_=U,!0):!1}const Me={[Xr]:r.FUNC_ADD,[K0]:r.FUNC_SUBTRACT,[j0]:r.FUNC_REVERSE_SUBTRACT};Me[J0]=r.MIN,Me[Q0]=r.MAX;const ze={[e_]:r.ZERO,[t_]:r.ONE,[n_]:r.SRC_COLOR,[Qc]:r.SRC_ALPHA,[l_]:r.SRC_ALPHA_SATURATE,[a_]:r.DST_COLOR,[r_]:r.DST_ALPHA,[i_]:r.ONE_MINUS_SRC_COLOR,[eu]:r.ONE_MINUS_SRC_ALPHA,[o_]:r.ONE_MINUS_DST_COLOR,[s_]:r.ONE_MINUS_DST_ALPHA,[c_]:r.CONSTANT_COLOR,[u_]:r.ONE_MINUS_CONSTANT_COLOR,[f_]:r.CONSTANT_ALPHA,[d_]:r.ONE_MINUS_CONSTANT_ALPHA};function qe(U,de,te,_e,xe,ie,le,re,Be,ue){if(U===er){p===!0&&(Ee(r.BLEND),p=!1);return}if(p===!1&&(ne(r.BLEND),p=!0),U!==Z0){if(U!==m||ue!==C){if((b!==Xr||E!==Xr)&&(r.blendEquation(r.FUNC_ADD),b=Xr,E=Xr),ue)switch(U){case qs:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Jc:r.blendFunc(r.ONE,r.ONE);break;case Ed:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Td:r.blendFuncSeparate(r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:mt("WebGLState: Invalid blending: ",U);break}else switch(U){case qs:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Jc:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE,r.ONE,r.ONE);break;case Ed:mt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case Td:mt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:mt("WebGLState: Invalid blending: ",U);break}y=null,M=null,T=null,A=null,v.set(0,0,0),w=0,m=U,C=ue}return}xe=xe||de,ie=ie||te,le=le||_e,(de!==b||xe!==E)&&(r.blendEquationSeparate(Me[de],Me[xe]),b=de,E=xe),(te!==y||_e!==M||ie!==T||le!==A)&&(r.blendFuncSeparate(ze[te],ze[_e],ze[ie],ze[le]),y=te,M=_e,T=ie,A=le),(re.equals(v)===!1||Be!==w)&&(r.blendColor(re.r,re.g,re.b,Be),v.copy(re),w=Be),m=U,C=!1}function Ye(U,de){U.side===Ki?Ee(r.CULL_FACE):ne(r.CULL_FACE);let te=U.side===Vn;de&&(te=!te),$(te),U.blending===qs&&U.transparent===!1?qe(er):qe(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.blendColor,U.blendAlpha,U.premultipliedAlpha),a.setFunc(U.depthFunc),a.setTest(U.depthTest),a.setMask(U.depthWrite),s.setMask(U.colorWrite);const _e=U.stencilWrite;o.setTest(_e),_e&&(o.setMask(U.stencilWriteMask),o.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),o.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),Qe(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?ne(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function $(U){L!==U&&(U?r.frontFace(r.CW):r.frontFace(r.CCW),L=U)}function lt(U){U!==Y0?(ne(r.CULL_FACE),U!==N&&(U===yd?r.cullFace(r.BACK):U===q0?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),N=U}function We(U){U!==Y&&(I&&r.lineWidth(U),Y=U)}function Qe(U,de,te){U?(ne(r.POLYGON_OFFSET_FILL),(H!==de||O!==te)&&(H=de,O=te,a.getReversed()&&(de=-de),r.polygonOffset(de,te))):Ee(r.POLYGON_OFFSET_FILL)}function Ge(U){U?ne(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function Ze(U){U===void 0&&(U=r.TEXTURE0+z-1),D!==U&&(r.activeTexture(U),D=U)}function F(U,de,te){te===void 0&&(D===null?te=r.TEXTURE0+z-1:te=D);let _e=se[te];_e===void 0&&(_e={type:void 0,texture:void 0},se[te]=_e),(_e.type!==U||_e.texture!==de)&&(D!==te&&(r.activeTexture(te),D=te),r.bindTexture(U,de||oe[U]),_e.type=U,_e.texture=de)}function Ct(){const U=se[D];U!==void 0&&U.type!==void 0&&(r.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function Xe(){try{r.compressedTexImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function R(){try{r.compressedTexImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function x(){try{r.texSubImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function k(){try{r.texSubImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function V(){try{r.compressedTexSubImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function K(){try{r.compressedTexSubImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function ce(){try{r.texStorage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function ae(){try{r.texStorage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function J(){try{r.texImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function ee(){try{r.texImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function he(U){return h[U]!==void 0?h[U]:r.getParameter(U)}function Ae(U,de){h[U]!==de&&(r.pixelStorei(U,de),h[U]=de)}function ge(U){He.equals(U)===!1&&(r.scissor(U.x,U.y,U.z,U.w),He.copy(U))}function me(U){Le.equals(U)===!1&&(r.viewport(U.x,U.y,U.z,U.w),Le.copy(U))}function fe(U,de){let te=c.get(de);te===void 0&&(te=new WeakMap,c.set(de,te));let _e=te.get(U);_e===void 0&&(_e=r.getUniformBlockIndex(de,U.name),te.set(U,_e))}function Pe(U,de){const _e=c.get(de).get(U);l.get(de)!==_e&&(r.uniformBlockBinding(de,_e,U.__bindingPointIndex),l.set(de,_e))}function Ie(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),a.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),r.pixelStorei(r.PACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL),r.pixelStorei(r.PACK_ROW_LENGTH,0),r.pixelStorei(r.PACK_SKIP_PIXELS,0),r.pixelStorei(r.PACK_SKIP_ROWS,0),r.pixelStorei(r.UNPACK_ROW_LENGTH,0),r.pixelStorei(r.UNPACK_IMAGE_HEIGHT,0),r.pixelStorei(r.UNPACK_SKIP_PIXELS,0),r.pixelStorei(r.UNPACK_SKIP_ROWS,0),r.pixelStorei(r.UNPACK_SKIP_IMAGES,0),u={},h={},D=null,se={},f={},d=new WeakMap,g=[],_=null,p=!1,m=null,b=null,y=null,M=null,E=null,T=null,A=null,v=new ht(0,0,0),w=0,C=!1,L=null,N=null,Y=null,H=null,O=null,He.set(0,0,r.canvas.width,r.canvas.height),Le.set(0,0,r.canvas.width,r.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:ne,disable:Ee,bindFramebuffer:Oe,drawBuffers:Te,useProgram:tt,setBlending:qe,setMaterial:Ye,setFlipSided:$,setCullFace:lt,setLineWidth:We,setPolygonOffset:Qe,setScissorTest:Ge,activeTexture:Ze,bindTexture:F,unbindTexture:Ct,compressedTexImage2D:Xe,compressedTexImage3D:R,texImage2D:J,texImage3D:ee,pixelStorei:Ae,getParameter:he,updateUBOMapping:fe,uniformBlockBinding:Pe,texStorage2D:ce,texStorage3D:ae,texSubImage2D:x,texSubImage3D:k,compressedTexSubImage2D:V,compressedTexSubImage3D:K,scissor:ge,viewport:me,reset:Ie}}function uy(r,e,t,n,i,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new gt,u=new WeakMap,h=new Set;let f;const d=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(R,x){return g?new OffscreenCanvas(R,x):yl("canvas")}function p(R,x,k){let V=1;const K=Xe(R);if((K.width>k||K.height>k)&&(V=k/Math.max(K.width,K.height)),V<1)if(typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&R instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&R instanceof ImageBitmap||typeof VideoFrame<"u"&&R instanceof VideoFrame){const ce=Math.floor(V*K.width),ae=Math.floor(V*K.height);f===void 0&&(f=_(ce,ae));const J=x?_(ce,ae):f;return J.width=ce,J.height=ae,J.getContext("2d").drawImage(R,0,0,ce,ae),$e("WebGLRenderer: Texture has been resized from ("+K.width+"x"+K.height+") to ("+ce+"x"+ae+")."),J}else return"data"in R&&$e("WebGLRenderer: Image in DataTexture is too big ("+K.width+"x"+K.height+")."),R;return R}function m(R){return R.generateMipmaps}function b(R){r.generateMipmap(R)}function y(R){return R.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:R.isWebGL3DRenderTarget?r.TEXTURE_3D:R.isWebGLArrayRenderTarget||R.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function M(R,x,k,V,K,ce=!1){if(R!==null){if(r[R]!==void 0)return r[R];$e("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let ae;V&&(ae=e.get("EXT_texture_norm16"),ae||$e("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let J=x;if(x===r.RED&&(k===r.FLOAT&&(J=r.R32F),k===r.HALF_FLOAT&&(J=r.R16F),k===r.UNSIGNED_BYTE&&(J=r.R8),k===r.UNSIGNED_SHORT&&ae&&(J=ae.R16_EXT),k===r.SHORT&&ae&&(J=ae.R16_SNORM_EXT)),x===r.RED_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.R8UI),k===r.UNSIGNED_SHORT&&(J=r.R16UI),k===r.UNSIGNED_INT&&(J=r.R32UI),k===r.BYTE&&(J=r.R8I),k===r.SHORT&&(J=r.R16I),k===r.INT&&(J=r.R32I)),x===r.RG&&(k===r.FLOAT&&(J=r.RG32F),k===r.HALF_FLOAT&&(J=r.RG16F),k===r.UNSIGNED_BYTE&&(J=r.RG8),k===r.UNSIGNED_SHORT&&ae&&(J=ae.RG16_EXT),k===r.SHORT&&ae&&(J=ae.RG16_SNORM_EXT)),x===r.RG_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.RG8UI),k===r.UNSIGNED_SHORT&&(J=r.RG16UI),k===r.UNSIGNED_INT&&(J=r.RG32UI),k===r.BYTE&&(J=r.RG8I),k===r.SHORT&&(J=r.RG16I),k===r.INT&&(J=r.RG32I)),x===r.RGB_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.RGB8UI),k===r.UNSIGNED_SHORT&&(J=r.RGB16UI),k===r.UNSIGNED_INT&&(J=r.RGB32UI),k===r.BYTE&&(J=r.RGB8I),k===r.SHORT&&(J=r.RGB16I),k===r.INT&&(J=r.RGB32I)),x===r.RGBA_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.RGBA8UI),k===r.UNSIGNED_SHORT&&(J=r.RGBA16UI),k===r.UNSIGNED_INT&&(J=r.RGBA32UI),k===r.BYTE&&(J=r.RGBA8I),k===r.SHORT&&(J=r.RGBA16I),k===r.INT&&(J=r.RGBA32I)),x===r.RGB&&(k===r.UNSIGNED_SHORT&&ae&&(J=ae.RGB16_EXT),k===r.SHORT&&ae&&(J=ae.RGB16_SNORM_EXT),k===r.UNSIGNED_INT_5_9_9_9_REV&&(J=r.RGB9_E5),k===r.UNSIGNED_INT_10F_11F_11F_REV&&(J=r.R11F_G11F_B10F)),x===r.RGBA){const ee=ce?Sl:ft.getTransfer(K);k===r.FLOAT&&(J=r.RGBA32F),k===r.HALF_FLOAT&&(J=r.RGBA16F),k===r.UNSIGNED_BYTE&&(J=ee===vt?r.SRGB8_ALPHA8:r.RGBA8),k===r.UNSIGNED_SHORT&&ae&&(J=ae.RGBA16_EXT),k===r.SHORT&&ae&&(J=ae.RGBA16_SNORM_EXT),k===r.UNSIGNED_SHORT_4_4_4_4&&(J=r.RGBA4),k===r.UNSIGNED_SHORT_5_5_5_1&&(J=r.RGB5_A1)}return(J===r.R16F||J===r.R32F||J===r.RG16F||J===r.RG32F||J===r.RGBA16F||J===r.RGBA32F)&&e.get("EXT_color_buffer_float"),J}function E(R,x){let k;return R?x===null||x===Gi||x===Qa?k=r.DEPTH24_STENCIL8:x===Ui?k=r.DEPTH32F_STENCIL8:x===Ja&&(k=r.DEPTH24_STENCIL8,$e("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):x===null||x===Gi||x===Qa?k=r.DEPTH_COMPONENT24:x===Ui?k=r.DEPTH_COMPONENT32F:x===Ja&&(k=r.DEPTH_COMPONENT16),k}function T(R,x){return m(R)===!0||R.isFramebufferTexture&&R.minFilter!==dn&&R.minFilter!==yn?Math.log2(Math.max(x.width,x.height))+1:R.mipmaps!==void 0&&R.mipmaps.length>0?R.mipmaps.length:R.isCompressedTexture&&Array.isArray(R.image)?x.mipmaps.length:1}function A(R){const x=R.target;x.removeEventListener("dispose",A),w(x),x.isVideoTexture&&u.delete(x),x.isHTMLTexture&&h.delete(x)}function v(R){const x=R.target;x.removeEventListener("dispose",v),L(x)}function w(R){const x=n.get(R);if(x.__webglInit===void 0)return;const k=R.source,V=d.get(k);if(V){const K=V[x.__cacheKey];K.usedTimes--,K.usedTimes===0&&C(R),Object.keys(V).length===0&&d.delete(k)}n.remove(R)}function C(R){const x=n.get(R);r.deleteTexture(x.__webglTexture);const k=R.source,V=d.get(k);delete V[x.__cacheKey],a.memory.textures--}function L(R){const x=n.get(R);if(R.depthTexture&&(R.depthTexture.dispose(),n.remove(R.depthTexture)),R.isWebGLCubeRenderTarget)for(let V=0;V<6;V++){if(Array.isArray(x.__webglFramebuffer[V]))for(let K=0;K<x.__webglFramebuffer[V].length;K++)r.deleteFramebuffer(x.__webglFramebuffer[V][K]);else r.deleteFramebuffer(x.__webglFramebuffer[V]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[V])}else{if(Array.isArray(x.__webglFramebuffer))for(let V=0;V<x.__webglFramebuffer.length;V++)r.deleteFramebuffer(x.__webglFramebuffer[V]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let V=0;V<x.__webglColorRenderbuffer.length;V++)x.__webglColorRenderbuffer[V]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[V]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}const k=R.textures;for(let V=0,K=k.length;V<K;V++){const ce=n.get(k[V]);ce.__webglTexture&&(r.deleteTexture(ce.__webglTexture),a.memory.textures--),n.remove(k[V])}n.remove(R)}let N=0;function Y(){N=0}function H(){return N}function O(R){N=R}function z(){const R=N;return R>=i.maxTextures&&$e("WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+i.maxTextures),N+=1,R}function I(R){const x=[];return x.push(R.wrapS),x.push(R.wrapT),x.push(R.wrapR||0),x.push(R.magFilter),x.push(R.minFilter),x.push(R.anisotropy),x.push(R.internalFormat),x.push(R.format),x.push(R.type),x.push(R.generateMipmaps),x.push(R.premultiplyAlpha),x.push(R.flipY),x.push(R.unpackAlignment),x.push(R.colorSpace),x.join()}function q(R,x){const k=n.get(R);if(R.isVideoTexture&&F(R),R.isRenderTargetTexture===!1&&R.isExternalTexture!==!0&&R.version>0&&k.__version!==R.version){const V=R.image;if(V===null)$e("WebGLRenderer: Texture marked for update but no image data found.");else if(V.complete===!1)$e("WebGLRenderer: Texture marked for update but image is incomplete");else{Ee(k,R,x);return}}else R.isExternalTexture&&(k.__webglTexture=R.sourceTexture?R.sourceTexture:null);t.bindTexture(r.TEXTURE_2D,k.__webglTexture,r.TEXTURE0+x)}function j(R,x){const k=n.get(R);if(R.isRenderTargetTexture===!1&&R.version>0&&k.__version!==R.version){Ee(k,R,x);return}else R.isExternalTexture&&(k.__webglTexture=R.sourceTexture?R.sourceTexture:null);t.bindTexture(r.TEXTURE_2D_ARRAY,k.__webglTexture,r.TEXTURE0+x)}function D(R,x){const k=n.get(R);if(R.isRenderTargetTexture===!1&&R.version>0&&k.__version!==R.version){Ee(k,R,x);return}t.bindTexture(r.TEXTURE_3D,k.__webglTexture,r.TEXTURE0+x)}function se(R,x){const k=n.get(R);if(R.isCubeDepthTexture!==!0&&R.version>0&&k.__version!==R.version){Oe(k,R,x);return}t.bindTexture(r.TEXTURE_CUBE_MAP,k.__webglTexture,r.TEXTURE0+x)}const pe={[lu]:r.REPEAT,[Ji]:r.CLAMP_TO_EDGE,[cu]:r.MIRRORED_REPEAT},Ve={[dn]:r.NEAREST,[m_]:r.NEAREST_MIPMAP_NEAREST,[vo]:r.NEAREST_MIPMAP_LINEAR,[yn]:r.LINEAR,[jl]:r.LINEAR_MIPMAP_NEAREST,[Zr]:r.LINEAR_MIPMAP_LINEAR},He={[x_]:r.NEVER,[y_]:r.ALWAYS,[v_]:r.LESS,[Ef]:r.LEQUAL,[M_]:r.EQUAL,[Tf]:r.GEQUAL,[S_]:r.GREATER,[b_]:r.NOTEQUAL};function Le(R,x){if(x.type===Ui&&e.has("OES_texture_float_linear")===!1&&(x.magFilter===yn||x.magFilter===jl||x.magFilter===vo||x.magFilter===Zr||x.minFilter===yn||x.minFilter===jl||x.minFilter===vo||x.minFilter===Zr)&&$e("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(R,r.TEXTURE_WRAP_S,pe[x.wrapS]),r.texParameteri(R,r.TEXTURE_WRAP_T,pe[x.wrapT]),(R===r.TEXTURE_3D||R===r.TEXTURE_2D_ARRAY)&&r.texParameteri(R,r.TEXTURE_WRAP_R,pe[x.wrapR]),r.texParameteri(R,r.TEXTURE_MAG_FILTER,Ve[x.magFilter]),r.texParameteri(R,r.TEXTURE_MIN_FILTER,Ve[x.minFilter]),x.compareFunction&&(r.texParameteri(R,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(R,r.TEXTURE_COMPARE_FUNC,He[x.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===dn||x.minFilter!==vo&&x.minFilter!==Zr||x.type===Ui&&e.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");r.texParameterf(R,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function Q(R,x){let k=!1;R.__webglInit===void 0&&(R.__webglInit=!0,x.addEventListener("dispose",A));const V=x.source;let K=d.get(V);K===void 0&&(K={},d.set(V,K));const ce=I(x);if(ce!==R.__cacheKey){K[ce]===void 0&&(K[ce]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,k=!0),K[ce].usedTimes++;const ae=K[R.__cacheKey];ae!==void 0&&(K[R.__cacheKey].usedTimes--,ae.usedTimes===0&&C(x)),R.__cacheKey=ce,R.__webglTexture=K[ce].texture}return k}function oe(R,x,k){return Math.floor(Math.floor(R/k)/x)}function ne(R,x,k,V){const ce=R.updateRanges;if(ce.length===0)t.texSubImage2D(r.TEXTURE_2D,0,0,0,x.width,x.height,k,V,x.data);else{ce.sort((Ae,ge)=>Ae.start-ge.start);let ae=0;for(let Ae=1;Ae<ce.length;Ae++){const ge=ce[ae],me=ce[Ae],fe=ge.start+ge.count,Pe=oe(me.start,x.width,4),Ie=oe(ge.start,x.width,4);me.start<=fe+1&&Pe===Ie&&oe(me.start+me.count-1,x.width,4)===Pe?ge.count=Math.max(ge.count,me.start+me.count-ge.start):(++ae,ce[ae]=me)}ce.length=ae+1;const J=t.getParameter(r.UNPACK_ROW_LENGTH),ee=t.getParameter(r.UNPACK_SKIP_PIXELS),he=t.getParameter(r.UNPACK_SKIP_ROWS);t.pixelStorei(r.UNPACK_ROW_LENGTH,x.width);for(let Ae=0,ge=ce.length;Ae<ge;Ae++){const me=ce[Ae],fe=Math.floor(me.start/4),Pe=Math.ceil(me.count/4),Ie=fe%x.width,U=Math.floor(fe/x.width),de=Pe,te=1;t.pixelStorei(r.UNPACK_SKIP_PIXELS,Ie),t.pixelStorei(r.UNPACK_SKIP_ROWS,U),t.texSubImage2D(r.TEXTURE_2D,0,Ie,U,de,te,k,V,x.data)}R.clearUpdateRanges(),t.pixelStorei(r.UNPACK_ROW_LENGTH,J),t.pixelStorei(r.UNPACK_SKIP_PIXELS,ee),t.pixelStorei(r.UNPACK_SKIP_ROWS,he)}}function Ee(R,x,k){let V=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(V=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(V=r.TEXTURE_3D);const K=Q(R,x),ce=x.source;t.bindTexture(V,R.__webglTexture,r.TEXTURE0+k);const ae=n.get(ce);if(ce.version!==ae.__version||K===!0){if(t.activeTexture(r.TEXTURE0+k),(typeof ImageBitmap<"u"&&x.image instanceof ImageBitmap)===!1){const te=ft.getPrimaries(ft.workingColorSpace),_e=x.colorSpace===xr?null:ft.getPrimaries(x.colorSpace),xe=x.colorSpace===xr||te===_e?r.NONE:r.BROWSER_DEFAULT_WEBGL;t.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),t.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),t.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,xe)}t.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment);let ee=p(x.image,!1,i.maxTextureSize);ee=Ct(x,ee);const he=s.convert(x.format,x.colorSpace),Ae=s.convert(x.type);let ge=M(x.internalFormat,he,Ae,x.normalized,x.colorSpace,x.isVideoTexture);Le(V,x);let me;const fe=x.mipmaps,Pe=x.isVideoTexture!==!0,Ie=ae.__version===void 0||K===!0,U=ce.dataReady,de=T(x,ee);if(x.isDepthTexture)ge=E(x.format===Kr,x.type),Ie&&(Pe?t.texStorage2D(r.TEXTURE_2D,1,ge,ee.width,ee.height):t.texImage2D(r.TEXTURE_2D,0,ge,ee.width,ee.height,0,he,Ae,null));else if(x.isDataTexture)if(fe.length>0){Pe&&Ie&&t.texStorage2D(r.TEXTURE_2D,de,ge,fe[0].width,fe[0].height);for(let te=0,_e=fe.length;te<_e;te++)me=fe[te],Pe?U&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,me.width,me.height,he,Ae,me.data):t.texImage2D(r.TEXTURE_2D,te,ge,me.width,me.height,0,he,Ae,me.data);x.generateMipmaps=!1}else Pe?(Ie&&t.texStorage2D(r.TEXTURE_2D,de,ge,ee.width,ee.height),U&&ne(x,ee,he,Ae)):t.texImage2D(r.TEXTURE_2D,0,ge,ee.width,ee.height,0,he,Ae,ee.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){Pe&&Ie&&t.texStorage3D(r.TEXTURE_2D_ARRAY,de,ge,fe[0].width,fe[0].height,ee.depth);for(let te=0,_e=fe.length;te<_e;te++)if(me=fe[te],x.format!==bi)if(he!==null)if(Pe){if(U)if(x.layerUpdates.size>0){const xe=Qd(me.width,me.height,x.format,x.type);for(const ie of x.layerUpdates){const le=me.data.subarray(ie*xe/me.data.BYTES_PER_ELEMENT,(ie+1)*xe/me.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,ie,me.width,me.height,1,he,le)}x.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,me.width,me.height,ee.depth,he,me.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,te,ge,me.width,me.height,ee.depth,0,me.data,0,0);else $e("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Pe?U&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,me.width,me.height,ee.depth,he,Ae,me.data):t.texImage3D(r.TEXTURE_2D_ARRAY,te,ge,me.width,me.height,ee.depth,0,he,Ae,me.data)}else{Pe&&Ie&&t.texStorage2D(r.TEXTURE_2D,de,ge,fe[0].width,fe[0].height);for(let te=0,_e=fe.length;te<_e;te++)me=fe[te],x.format!==bi?he!==null?Pe?U&&t.compressedTexSubImage2D(r.TEXTURE_2D,te,0,0,me.width,me.height,he,me.data):t.compressedTexImage2D(r.TEXTURE_2D,te,ge,me.width,me.height,0,me.data):$e("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Pe?U&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,me.width,me.height,he,Ae,me.data):t.texImage2D(r.TEXTURE_2D,te,ge,me.width,me.height,0,he,Ae,me.data)}else if(x.isDataArrayTexture)if(Pe){if(Ie&&t.texStorage3D(r.TEXTURE_2D_ARRAY,de,ge,ee.width,ee.height,ee.depth),U)if(x.layerUpdates.size>0){const te=Qd(ee.width,ee.height,x.format,x.type);for(const _e of x.layerUpdates){const xe=ee.data.subarray(_e*te/ee.data.BYTES_PER_ELEMENT,(_e+1)*te/ee.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,_e,ee.width,ee.height,1,he,Ae,xe)}x.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,ee.width,ee.height,ee.depth,he,Ae,ee.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,ge,ee.width,ee.height,ee.depth,0,he,Ae,ee.data);else if(x.isData3DTexture)Pe?(Ie&&t.texStorage3D(r.TEXTURE_3D,de,ge,ee.width,ee.height,ee.depth),U&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,ee.width,ee.height,ee.depth,he,Ae,ee.data)):t.texImage3D(r.TEXTURE_3D,0,ge,ee.width,ee.height,ee.depth,0,he,Ae,ee.data);else if(x.isFramebufferTexture){if(Ie)if(Pe)t.texStorage2D(r.TEXTURE_2D,de,ge,ee.width,ee.height);else{let te=ee.width,_e=ee.height;for(let xe=0;xe<de;xe++)t.texImage2D(r.TEXTURE_2D,xe,ge,te,_e,0,he,Ae,null),te>>=1,_e>>=1}}else if(x.isHTMLTexture){if("texElementImage2D"in r){const te=r.canvas;if(te.hasAttribute("layoutsubtree")||te.setAttribute("layoutsubtree","true"),ee.parentNode!==te){te.appendChild(ee),h.add(x),te.onpaint=_e=>{const xe=_e.changedElements;for(const ie of h)xe.includes(ie.image)&&(ie.needsUpdate=!0)},te.requestPaint();return}if(r.texElementImage2D.length===3)r.texElementImage2D(r.TEXTURE_2D,r.RGBA8,ee);else{const xe=r.RGBA,ie=r.RGBA,le=r.UNSIGNED_BYTE;r.texElementImage2D(r.TEXTURE_2D,0,xe,ie,le,ee)}r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}}else if(fe.length>0){if(Pe&&Ie){const te=Xe(fe[0]);t.texStorage2D(r.TEXTURE_2D,de,ge,te.width,te.height)}for(let te=0,_e=fe.length;te<_e;te++)me=fe[te],Pe?U&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,he,Ae,me):t.texImage2D(r.TEXTURE_2D,te,ge,he,Ae,me);x.generateMipmaps=!1}else if(Pe){if(Ie){const te=Xe(ee);t.texStorage2D(r.TEXTURE_2D,de,ge,te.width,te.height)}U&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,he,Ae,ee)}else t.texImage2D(r.TEXTURE_2D,0,ge,he,Ae,ee);m(x)&&b(V),ae.__version=ce.version,x.onUpdate&&x.onUpdate(x)}R.__version=x.version}function Oe(R,x,k){if(x.image.length!==6)return;const V=Q(R,x),K=x.source;t.bindTexture(r.TEXTURE_CUBE_MAP,R.__webglTexture,r.TEXTURE0+k);const ce=n.get(K);if(K.version!==ce.__version||V===!0){t.activeTexture(r.TEXTURE0+k);const ae=ft.getPrimaries(ft.workingColorSpace),J=x.colorSpace===xr?null:ft.getPrimaries(x.colorSpace),ee=x.colorSpace===xr||ae===J?r.NONE:r.BROWSER_DEFAULT_WEBGL;t.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),t.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),t.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),t.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,ee);const he=x.isCompressedTexture||x.image[0].isCompressedTexture,Ae=x.image[0]&&x.image[0].isDataTexture,ge=[];for(let ie=0;ie<6;ie++)!he&&!Ae?ge[ie]=p(x.image[ie],!0,i.maxCubemapSize):ge[ie]=Ae?x.image[ie].image:x.image[ie],ge[ie]=Ct(x,ge[ie]);const me=ge[0],fe=s.convert(x.format,x.colorSpace),Pe=s.convert(x.type),Ie=M(x.internalFormat,fe,Pe,x.normalized,x.colorSpace),U=x.isVideoTexture!==!0,de=ce.__version===void 0||V===!0,te=K.dataReady;let _e=T(x,me);Le(r.TEXTURE_CUBE_MAP,x);let xe;if(he){U&&de&&t.texStorage2D(r.TEXTURE_CUBE_MAP,_e,Ie,me.width,me.height);for(let ie=0;ie<6;ie++){xe=ge[ie].mipmaps;for(let le=0;le<xe.length;le++){const re=xe[le];x.format!==bi?fe!==null?U?te&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,0,0,re.width,re.height,fe,re.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,Ie,re.width,re.height,0,re.data):$e("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,0,0,re.width,re.height,fe,Pe,re.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,Ie,re.width,re.height,0,fe,Pe,re.data)}}}else{if(xe=x.mipmaps,U&&de){xe.length>0&&_e++;const ie=Xe(ge[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,_e,Ie,ie.width,ie.height)}for(let ie=0;ie<6;ie++)if(Ae){U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,ge[ie].width,ge[ie].height,fe,Pe,ge[ie].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ie,ge[ie].width,ge[ie].height,0,fe,Pe,ge[ie].data);for(let le=0;le<xe.length;le++){const Be=xe[le].image[ie].image;U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,0,0,Be.width,Be.height,fe,Pe,Be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,Ie,Be.width,Be.height,0,fe,Pe,Be.data)}}else{U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,fe,Pe,ge[ie]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ie,fe,Pe,ge[ie]);for(let le=0;le<xe.length;le++){const re=xe[le];U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,0,0,fe,Pe,re.image[ie]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,Ie,fe,Pe,re.image[ie])}}}m(x)&&b(r.TEXTURE_CUBE_MAP),ce.__version=K.version,x.onUpdate&&x.onUpdate(x)}R.__version=x.version}function Te(R,x,k,V,K,ce){const ae=s.convert(k.format,k.colorSpace),J=s.convert(k.type),ee=M(k.internalFormat,ae,J,k.normalized,k.colorSpace),he=n.get(x),Ae=n.get(k);if(Ae.__renderTarget=x,!he.__hasExternalTextures){const ge=Math.max(1,x.width>>ce),me=Math.max(1,x.height>>ce);K===r.TEXTURE_3D||K===r.TEXTURE_2D_ARRAY?t.texImage3D(K,ce,ee,ge,me,x.depth,0,ae,J,null):t.texImage2D(K,ce,ee,ge,me,0,ae,J,null)}t.bindFramebuffer(r.FRAMEBUFFER,R),Ze(x)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,V,K,Ae.__webglTexture,0,Ge(x)):(K===r.TEXTURE_2D||K>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,V,K,Ae.__webglTexture,ce),t.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(R,x,k){if(r.bindRenderbuffer(r.RENDERBUFFER,R),x.depthBuffer){const V=x.depthTexture,K=V&&V.isDepthTexture?V.type:null,ce=E(x.stencilBuffer,K),ae=x.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;Ze(x)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ge(x),ce,x.width,x.height):k?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ge(x),ce,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,ce,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,ae,r.RENDERBUFFER,R)}else{const V=x.textures;for(let K=0;K<V.length;K++){const ce=V[K],ae=s.convert(ce.format,ce.colorSpace),J=s.convert(ce.type),ee=M(ce.internalFormat,ae,J,ce.normalized,ce.colorSpace);Ze(x)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ge(x),ee,x.width,x.height):k?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ge(x),ee,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,ee,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Me(R,x,k){const V=x.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(r.FRAMEBUFFER,R),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const K=n.get(x.depthTexture);if(K.__renderTarget=x,(!K.__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),V){if(K.__webglInit===void 0&&(K.__webglInit=!0,x.depthTexture.addEventListener("dispose",A)),K.__webglTexture===void 0){K.__webglTexture=r.createTexture(),t.bindTexture(r.TEXTURE_CUBE_MAP,K.__webglTexture),Le(r.TEXTURE_CUBE_MAP,x.depthTexture);const he=s.convert(x.depthTexture.format),Ae=s.convert(x.depthTexture.type);let ge;x.depthTexture.format===ar?ge=r.DEPTH_COMPONENT24:x.depthTexture.format===Kr&&(ge=r.DEPTH24_STENCIL8);for(let me=0;me<6;me++)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+me,0,ge,x.width,x.height,0,he,Ae,null)}}else q(x.depthTexture,0);const ce=K.__webglTexture,ae=Ge(x),J=V?r.TEXTURE_CUBE_MAP_POSITIVE_X+k:r.TEXTURE_2D,ee=x.depthTexture.format===Kr?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;if(x.depthTexture.format===ar)Ze(x)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ee,J,ce,0,ae):r.framebufferTexture2D(r.FRAMEBUFFER,ee,J,ce,0);else if(x.depthTexture.format===Kr)Ze(x)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ee,J,ce,0,ae):r.framebufferTexture2D(r.FRAMEBUFFER,ee,J,ce,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function ze(R){const x=n.get(R),k=R.isWebGLCubeRenderTarget===!0;if(x.__boundDepthTexture!==R.depthTexture){const V=R.depthTexture;if(x.__depthDisposeCallback&&x.__depthDisposeCallback(),V){const K=()=>{delete x.__boundDepthTexture,delete x.__depthDisposeCallback,V.removeEventListener("dispose",K)};V.addEventListener("dispose",K),x.__depthDisposeCallback=K}x.__boundDepthTexture=V}if(R.depthTexture&&!x.__autoAllocateDepthBuffer)if(k)for(let V=0;V<6;V++)Me(x.__webglFramebuffer[V],R,V);else{const V=R.texture.mipmaps;V&&V.length>0?Me(x.__webglFramebuffer[0],R,0):Me(x.__webglFramebuffer,R,0)}else if(k){x.__webglDepthbuffer=[];for(let V=0;V<6;V++)if(t.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[V]),x.__webglDepthbuffer[V]===void 0)x.__webglDepthbuffer[V]=r.createRenderbuffer(),tt(x.__webglDepthbuffer[V],R,!1);else{const K=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ce=x.__webglDepthbuffer[V];r.bindRenderbuffer(r.RENDERBUFFER,ce),r.framebufferRenderbuffer(r.FRAMEBUFFER,K,r.RENDERBUFFER,ce)}}else{const V=R.texture.mipmaps;if(V&&V.length>0?t.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[0]):t.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer===void 0)x.__webglDepthbuffer=r.createRenderbuffer(),tt(x.__webglDepthbuffer,R,!1);else{const K=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ce=x.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ce),r.framebufferRenderbuffer(r.FRAMEBUFFER,K,r.RENDERBUFFER,ce)}}t.bindFramebuffer(r.FRAMEBUFFER,null)}function qe(R,x,k){const V=n.get(R);x!==void 0&&Te(V.__webglFramebuffer,R,R.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),k!==void 0&&ze(R)}function Ye(R){const x=R.texture,k=n.get(R),V=n.get(x);R.addEventListener("dispose",v);const K=R.textures,ce=R.isWebGLCubeRenderTarget===!0,ae=K.length>1;if(ae||(V.__webglTexture===void 0&&(V.__webglTexture=r.createTexture()),V.__version=x.version,a.memory.textures++),ce){k.__webglFramebuffer=[];for(let J=0;J<6;J++)if(x.mipmaps&&x.mipmaps.length>0){k.__webglFramebuffer[J]=[];for(let ee=0;ee<x.mipmaps.length;ee++)k.__webglFramebuffer[J][ee]=r.createFramebuffer()}else k.__webglFramebuffer[J]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){k.__webglFramebuffer=[];for(let J=0;J<x.mipmaps.length;J++)k.__webglFramebuffer[J]=r.createFramebuffer()}else k.__webglFramebuffer=r.createFramebuffer();if(ae)for(let J=0,ee=K.length;J<ee;J++){const he=n.get(K[J]);he.__webglTexture===void 0&&(he.__webglTexture=r.createTexture(),a.memory.textures++)}if(R.samples>0&&Ze(R)===!1){k.__webglMultisampledFramebuffer=r.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let J=0;J<K.length;J++){const ee=K[J];k.__webglColorRenderbuffer[J]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,k.__webglColorRenderbuffer[J]);const he=s.convert(ee.format,ee.colorSpace),Ae=s.convert(ee.type),ge=M(ee.internalFormat,he,Ae,ee.normalized,ee.colorSpace,R.isXRRenderTarget===!0),me=Ge(R);r.renderbufferStorageMultisample(r.RENDERBUFFER,me,ge,R.width,R.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+J,r.RENDERBUFFER,k.__webglColorRenderbuffer[J])}r.bindRenderbuffer(r.RENDERBUFFER,null),R.depthBuffer&&(k.__webglDepthRenderbuffer=r.createRenderbuffer(),tt(k.__webglDepthRenderbuffer,R,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ce){t.bindTexture(r.TEXTURE_CUBE_MAP,V.__webglTexture),Le(r.TEXTURE_CUBE_MAP,x);for(let J=0;J<6;J++)if(x.mipmaps&&x.mipmaps.length>0)for(let ee=0;ee<x.mipmaps.length;ee++)Te(k.__webglFramebuffer[J][ee],R,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+J,ee);else Te(k.__webglFramebuffer[J],R,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+J,0);m(x)&&b(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ae){for(let J=0,ee=K.length;J<ee;J++){const he=K[J],Ae=n.get(he);let ge=r.TEXTURE_2D;(R.isWebGL3DRenderTarget||R.isWebGLArrayRenderTarget)&&(ge=R.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(ge,Ae.__webglTexture),Le(ge,he),Te(k.__webglFramebuffer,R,he,r.COLOR_ATTACHMENT0+J,ge,0),m(he)&&b(ge)}t.unbindTexture()}else{let J=r.TEXTURE_2D;if((R.isWebGL3DRenderTarget||R.isWebGLArrayRenderTarget)&&(J=R.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(J,V.__webglTexture),Le(J,x),x.mipmaps&&x.mipmaps.length>0)for(let ee=0;ee<x.mipmaps.length;ee++)Te(k.__webglFramebuffer[ee],R,x,r.COLOR_ATTACHMENT0,J,ee);else Te(k.__webglFramebuffer,R,x,r.COLOR_ATTACHMENT0,J,0);m(x)&&b(J),t.unbindTexture()}R.depthBuffer&&ze(R)}function $(R){const x=R.textures;for(let k=0,V=x.length;k<V;k++){const K=x[k];if(m(K)){const ce=y(R),ae=n.get(K).__webglTexture;t.bindTexture(ce,ae),b(ce),t.unbindTexture()}}}const lt=[],We=[];function Qe(R){if(R.samples>0){if(Ze(R)===!1){const x=R.textures,k=R.width,V=R.height;let K=r.COLOR_BUFFER_BIT;const ce=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ae=n.get(R),J=x.length>1;if(J)for(let he=0;he<x.length;he++)t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,ae.__webglMultisampledFramebuffer);const ee=R.texture.mipmaps;ee&&ee.length>0?t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ae.__webglFramebuffer[0]):t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ae.__webglFramebuffer);for(let he=0;he<x.length;he++){if(R.resolveDepthBuffer&&(R.depthBuffer&&(K|=r.DEPTH_BUFFER_BIT),R.stencilBuffer&&R.resolveStencilBuffer&&(K|=r.STENCIL_BUFFER_BIT)),J){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,ae.__webglColorRenderbuffer[he]);const Ae=n.get(x[he]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Ae,0)}r.blitFramebuffer(0,0,k,V,0,0,k,V,K,r.NEAREST),l===!0&&(lt.length=0,We.length=0,lt.push(r.COLOR_ATTACHMENT0+he),R.depthBuffer&&R.resolveDepthBuffer===!1&&(lt.push(ce),We.push(ce),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,We)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,lt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),J)for(let he=0;he<x.length;he++){t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.RENDERBUFFER,ae.__webglColorRenderbuffer[he]);const Ae=n.get(x[he]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.TEXTURE_2D,Ae,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ae.__webglMultisampledFramebuffer)}else if(R.depthBuffer&&R.resolveDepthBuffer===!1&&l){const x=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function Ge(R){return Math.min(i.maxSamples,R.samples)}function Ze(R){const x=n.get(R);return R.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function F(R){const x=a.render.frame;u.get(R)!==x&&(u.set(R,x),R.update())}function Ct(R,x){const k=R.colorSpace,V=R.format,K=R.type;return R.isCompressedTexture===!0||R.isVideoTexture===!0||k!==Ml&&k!==xr&&(ft.getTransfer(k)===vt?(V!==bi||K!==hi)&&$e("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):mt("WebGLTextures: Unsupported texture color space:",k)),x}function Xe(R){return typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement?(c.width=R.naturalWidth||R.width,c.height=R.naturalHeight||R.height):typeof VideoFrame<"u"&&R instanceof VideoFrame?(c.width=R.displayWidth,c.height=R.displayHeight):(c.width=R.width,c.height=R.height),c}this.allocateTextureUnit=z,this.resetTextureUnits=Y,this.getTextureUnits=H,this.setTextureUnits=O,this.setTexture2D=q,this.setTexture2DArray=j,this.setTexture3D=D,this.setTextureCube=se,this.rebindTextures=qe,this.setupRenderTarget=Ye,this.updateRenderTargetMipmap=$,this.updateMultisampleRenderTarget=Qe,this.setupDepthRenderbuffer=ze,this.setupFrameBufferTexture=Te,this.useMultisampledRTT=Ze,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function fy(r,e){function t(n,i=xr){let s;const a=ft.getTransfer(i);if(n===hi)return r.UNSIGNED_BYTE;if(n===vf)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Mf)return r.UNSIGNED_SHORT_5_5_5_1;if(n===hm)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===pm)return r.UNSIGNED_INT_10F_11F_11F_REV;if(n===fm)return r.BYTE;if(n===dm)return r.SHORT;if(n===Ja)return r.UNSIGNED_SHORT;if(n===xf)return r.INT;if(n===Gi)return r.UNSIGNED_INT;if(n===Ui)return r.FLOAT;if(n===sr)return r.HALF_FLOAT;if(n===mm)return r.ALPHA;if(n===gm)return r.RGB;if(n===bi)return r.RGBA;if(n===ar)return r.DEPTH_COMPONENT;if(n===Kr)return r.DEPTH_STENCIL;if(n===_m)return r.RED;if(n===Sf)return r.RED_INTEGER;if(n===ls)return r.RG;if(n===bf)return r.RG_INTEGER;if(n===yf)return r.RGBA_INTEGER;if(n===nl||n===il||n===rl||n===sl)if(a===vt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===nl)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===il)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===rl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===sl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===nl)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===il)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===rl)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===sl)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===uu||n===fu||n===du||n===hu)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===uu)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===fu)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===du)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===hu)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===pu||n===mu||n===gu||n===_u||n===xu||n===xl||n===vu)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===pu||n===mu)return a===vt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===gu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(n===_u)return s.COMPRESSED_R11_EAC;if(n===xu)return s.COMPRESSED_SIGNED_R11_EAC;if(n===xl)return s.COMPRESSED_RG11_EAC;if(n===vu)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===Mu||n===Su||n===bu||n===yu||n===Eu||n===Tu||n===wu||n===Au||n===Ru||n===Cu||n===Pu||n===Du||n===Lu||n===Nu)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Mu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Su)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===bu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===yu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Eu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Tu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===wu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Au)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ru)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Cu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Pu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Du)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Lu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Nu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Iu||n===Uu||n===Fu)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Iu)return a===vt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Uu)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Fu)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Ou||n===Bu||n===vl||n===ku)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Ou)return s.COMPRESSED_RED_RGTC1_EXT;if(n===Bu)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===vl)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===ku)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Qa?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const dy=`
4084
+ }`,oy=[new X(1,0,0),new X(-1,0,0),new X(0,1,0),new X(0,-1,0),new X(0,0,1),new X(0,0,-1)],ly=[new X(0,-1,0),new X(0,-1,0),new X(0,0,1),new X(0,0,-1),new X(0,-1,0),new X(0,-1,0)],Eh=new Yt,_a=new X,Tc=new X;function cy(r,e,t){let n=new wm;const i=new gt,s=new gt,a=new kt,o=new bx,l=new yx,c={},u=t.maxTextureSize,h={[Lr]:Vn,[Vn]:Lr,[Zi]:Zi},f=new yi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new gt},radius:{value:4}},vertexShader:sy,fragmentShader:ay}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const g=new Ei;g.setAttribute("position",new Mn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new or(g,f),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tl;let m=this.type;this.render=function(T,A,v){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;this.type===K_&&($e("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=tl);const w=r.getRenderTarget(),C=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),N=r.state;N.setBlending(er),N.buffers.depth.getReversed()===!0?N.buffers.color.setClear(0,0,0,0):N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const Y=m!==this.type;Y&&A.traverse(function(H){H.material&&(Array.isArray(H.material)?H.material.forEach(O=>O.needsUpdate=!0):H.material.needsUpdate=!0)});for(let H=0,O=T.length;H<O;H++){const z=T[H],I=z.shadow;if(I===void 0){$e("WebGLShadowMap:",z,"has no shadow.");continue}if(I.autoUpdate===!1&&I.needsUpdate===!1)continue;i.copy(I.mapSize);const q=I.getFrameExtents();i.multiply(q),s.copy(I.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/q.x),i.x=s.x*q.x,I.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/q.y),i.y=s.y*q.y,I.mapSize.y=s.y));const j=r.state.buffers.depth.getReversed();if(I.camera._reversedDepth=j,I.map===null||Y===!0){if(I.map!==null&&(I.map.depthTexture!==null&&(I.map.depthTexture.dispose(),I.map.depthTexture=null),I.map.dispose()),this.type===Ta){if(z.isPointLight){$e("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}I.map=new ki(i.x,i.y,{format:ls,type:sr,minFilter:yn,magFilter:yn,generateMipmaps:!1}),I.map.texture.name=z.name+".shadowMap",I.map.depthTexture=new ra(i.x,i.y,Ui),I.map.depthTexture.name=z.name+".shadowMapDepth",I.map.depthTexture.format=ar,I.map.depthTexture.compareFunction=null,I.map.depthTexture.minFilter=dn,I.map.depthTexture.magFilter=dn}else z.isPointLight?(I.map=new Im(i.x),I.map.depthTexture=new gx(i.x,Gi)):(I.map=new ki(i.x,i.y),I.map.depthTexture=new ra(i.x,i.y,Gi)),I.map.depthTexture.name=z.name+".shadowMap",I.map.depthTexture.format=ar,this.type===tl?(I.map.depthTexture.compareFunction=j?Tf:Ef,I.map.depthTexture.minFilter=yn,I.map.depthTexture.magFilter=yn):(I.map.depthTexture.compareFunction=null,I.map.depthTexture.minFilter=dn,I.map.depthTexture.magFilter=dn);I.camera.updateProjectionMatrix()}const D=I.map.isWebGLCubeRenderTarget?6:1;for(let se=0;se<D;se++){if(I.map.isWebGLCubeRenderTarget)r.setRenderTarget(I.map,se),r.clear();else{se===0&&(r.setRenderTarget(I.map),r.clear());const pe=I.getViewport(se);a.set(s.x*pe.x,s.y*pe.y,s.x*pe.z,s.y*pe.w),N.viewport(a)}if(z.isPointLight){const pe=I.camera,Ve=I.matrix,He=z.distance||pe.far;He!==pe.far&&(pe.far=He,pe.updateProjectionMatrix()),_a.setFromMatrixPosition(z.matrixWorld),pe.position.copy(_a),Tc.copy(pe.position),Tc.add(oy[se]),pe.up.copy(ly[se]),pe.lookAt(Tc),pe.updateMatrixWorld(),Ve.makeTranslation(-_a.x,-_a.y,-_a.z),Eh.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),I._frustum.setFromProjectionMatrix(Eh,pe.coordinateSystem,pe.reversedDepth)}else I.updateMatrices(z);n=I.getFrustum(),M(A,v,I.camera,z,this.type)}I.isPointLightShadow!==!0&&this.type===Ta&&b(I,v),I.needsUpdate=!1}m=this.type,p.needsUpdate=!1,r.setRenderTarget(w,C,L)};function b(T,A){const v=e.update(_);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,d.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new ki(i.x,i.y,{format:ls,type:sr})),f.uniforms.shadow_pass.value=T.map.depthTexture,f.uniforms.resolution.value=T.mapSize,f.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(A,null,v,f,_,null),d.uniforms.shadow_pass.value=T.mapPass.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(A,null,v,d,_,null)}function y(T,A,v,w){let C=null;const L=v.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(L!==void 0)C=L;else if(C=v.isPointLight===!0?l:o,r.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const N=C.uuid,Y=A.uuid;let H=c[N];H===void 0&&(H={},c[N]=H);let O=H[Y];O===void 0&&(O=C.clone(),H[Y]=O,A.addEventListener("dispose",E)),C=O}if(C.visible=A.visible,C.wireframe=A.wireframe,w===Ta?C.side=A.shadowSide!==null?A.shadowSide:A.side:C.side=A.shadowSide!==null?A.shadowSide:h[A.side],C.alphaMap=A.alphaMap,C.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,C.map=A.map,C.clipShadows=A.clipShadows,C.clippingPlanes=A.clippingPlanes,C.clipIntersection=A.clipIntersection,C.displacementMap=A.displacementMap,C.displacementScale=A.displacementScale,C.displacementBias=A.displacementBias,C.wireframeLinewidth=A.wireframeLinewidth,C.linewidth=A.linewidth,v.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const N=r.properties.get(C);N.light=v}return C}function M(T,A,v,w,C){if(T.visible===!1)return;if(T.layers.test(A.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&C===Ta)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,T.matrixWorld);const Y=e.update(T),H=T.material;if(Array.isArray(H)){const O=Y.groups;for(let z=0,I=O.length;z<I;z++){const q=O[z],j=H[q.materialIndex];if(j&&j.visible){const D=y(T,j,w,C);T.onBeforeShadow(r,T,A,v,Y,D,q),r.renderBufferDirect(v,null,Y,D,T,q),T.onAfterShadow(r,T,A,v,Y,D,q)}}}else if(H.visible){const O=y(T,H,w,C);T.onBeforeShadow(r,T,A,v,Y,O,null),r.renderBufferDirect(v,null,Y,O,T,null),T.onAfterShadow(r,T,A,v,Y,O,null)}}const N=T.children;for(let Y=0,H=N.length;Y<H;Y++)M(N[Y],A,v,w,C)}function E(T){T.target.removeEventListener("dispose",E);for(const v in c){const w=c[v],C=T.target.uuid;C in w&&(w[C].dispose(),delete w[C])}}}function uy(r,e){function t(){let U=!1;const de=new kt;let te=null;const _e=new kt(0,0,0,0);return{setMask:function(xe){te!==xe&&!U&&(r.colorMask(xe,xe,xe,xe),te=xe)},setLocked:function(xe){U=xe},setClear:function(xe,ie,le,re,Be){Be===!0&&(xe*=re,ie*=re,le*=re),de.set(xe,ie,le,re),_e.equals(de)===!1&&(r.clearColor(xe,ie,le,re),_e.copy(de))},reset:function(){U=!1,te=null,_e.set(-1,0,0,0)}}}function n(){let U=!1,de=!1,te=null,_e=null,xe=null;return{setReversed:function(ie){if(de!==ie){const le=e.get("EXT_clip_control");ie?le.clipControlEXT(le.LOWER_LEFT_EXT,le.ZERO_TO_ONE_EXT):le.clipControlEXT(le.LOWER_LEFT_EXT,le.NEGATIVE_ONE_TO_ONE_EXT),de=ie;const re=xe;xe=null,this.setClear(re)}},getReversed:function(){return de},setTest:function(ie){ie?ne(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(ie){te!==ie&&!U&&(r.depthMask(ie),te=ie)},setFunc:function(ie){if(de&&(ie=R0[ie]),_e!==ie){switch(ie){case tu:r.depthFunc(r.NEVER);break;case nu:r.depthFunc(r.ALWAYS);break;case iu:r.depthFunc(r.LESS);break;case na:r.depthFunc(r.LEQUAL);break;case ru:r.depthFunc(r.EQUAL);break;case su:r.depthFunc(r.GEQUAL);break;case au:r.depthFunc(r.GREATER);break;case ou:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=ie}},setLocked:function(ie){U=ie},setClear:function(ie){xe!==ie&&(xe=ie,de&&(ie=1-ie),r.clearDepth(ie))},reset:function(){U=!1,te=null,_e=null,xe=null,de=!1}}}function i(){let U=!1,de=null,te=null,_e=null,xe=null,ie=null,le=null,re=null,Be=null;return{setTest:function(ue){U||(ue?ne(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(ue){de!==ue&&!U&&(r.stencilMask(ue),de=ue)},setFunc:function(ue,ke,Ce){(te!==ue||_e!==ke||xe!==Ce)&&(r.stencilFunc(ue,ke,Ce),te=ue,_e=ke,xe=Ce)},setOp:function(ue,ke,Ce){(ie!==ue||le!==ke||re!==Ce)&&(r.stencilOp(ue,ke,Ce),ie=ue,le=ke,re=Ce)},setLocked:function(ue){U=ue},setClear:function(ue){Be!==ue&&(r.clearStencil(ue),Be=ue)},reset:function(){U=!1,de=null,te=null,_e=null,xe=null,ie=null,le=null,re=null,Be=null}}}const s=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let u={},h={},f={},d=new WeakMap,g=[],_=null,p=!1,m=null,b=null,y=null,M=null,E=null,T=null,A=null,v=new ht(0,0,0),w=0,C=!1,L=null,N=null,Y=null,H=null,O=null;const z=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let I=!1,q=0;const j=r.getParameter(r.VERSION);j.indexOf("WebGL")!==-1?(q=parseFloat(/^WebGL (\d)/.exec(j)[1]),I=q>=1):j.indexOf("OpenGL ES")!==-1&&(q=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),I=q>=2);let D=null,se={};const pe=r.getParameter(r.SCISSOR_BOX),Ve=r.getParameter(r.VIEWPORT),He=new kt().fromArray(pe),Le=new kt().fromArray(Ve);function Q(U,de,te,_e){const xe=new Uint8Array(4),ie=r.createTexture();r.bindTexture(U,ie),r.texParameteri(U,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(U,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let le=0;le<te;le++)U===r.TEXTURE_3D||U===r.TEXTURE_2D_ARRAY?r.texImage3D(de,0,r.RGBA,1,1,_e,0,r.RGBA,r.UNSIGNED_BYTE,xe):r.texImage2D(de+le,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,xe);return ie}const oe={};oe[r.TEXTURE_2D]=Q(r.TEXTURE_2D,r.TEXTURE_2D,1),oe[r.TEXTURE_CUBE_MAP]=Q(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),oe[r.TEXTURE_2D_ARRAY]=Q(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),oe[r.TEXTURE_3D]=Q(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),ne(r.DEPTH_TEST),a.setFunc(na),$(!1),lt(Td),ne(r.CULL_FACE),qe(er);function ne(U){u[U]!==!0&&(r.enable(U),u[U]=!0)}function Ee(U){u[U]!==!1&&(r.disable(U),u[U]=!1)}function Oe(U,de){return f[U]!==de?(r.bindFramebuffer(U,de),f[U]=de,U===r.DRAW_FRAMEBUFFER&&(f[r.FRAMEBUFFER]=de),U===r.FRAMEBUFFER&&(f[r.DRAW_FRAMEBUFFER]=de),!0):!1}function Te(U,de){let te=g,_e=!1;if(U){te=d.get(de),te===void 0&&(te=[],d.set(de,te));const xe=U.textures;if(te.length!==xe.length||te[0]!==r.COLOR_ATTACHMENT0){for(let ie=0,le=xe.length;ie<le;ie++)te[ie]=r.COLOR_ATTACHMENT0+ie;te.length=xe.length,_e=!0}}else te[0]!==r.BACK&&(te[0]=r.BACK,_e=!0);_e&&r.drawBuffers(te)}function tt(U){return _!==U?(r.useProgram(U),_=U,!0):!1}const Me={[Xr]:r.FUNC_ADD,[j_]:r.FUNC_SUBTRACT,[J_]:r.FUNC_REVERSE_SUBTRACT};Me[Q_]=r.MIN,Me[e0]=r.MAX;const ze={[t0]:r.ZERO,[n0]:r.ONE,[i0]:r.SRC_COLOR,[Qc]:r.SRC_ALPHA,[c0]:r.SRC_ALPHA_SATURATE,[o0]:r.DST_COLOR,[s0]:r.DST_ALPHA,[r0]:r.ONE_MINUS_SRC_COLOR,[eu]:r.ONE_MINUS_SRC_ALPHA,[l0]:r.ONE_MINUS_DST_COLOR,[a0]:r.ONE_MINUS_DST_ALPHA,[u0]:r.CONSTANT_COLOR,[f0]:r.ONE_MINUS_CONSTANT_COLOR,[d0]:r.CONSTANT_ALPHA,[h0]:r.ONE_MINUS_CONSTANT_ALPHA};function qe(U,de,te,_e,xe,ie,le,re,Be,ue){if(U===er){p===!0&&(Ee(r.BLEND),p=!1);return}if(p===!1&&(ne(r.BLEND),p=!0),U!==Z_){if(U!==m||ue!==C){if((b!==Xr||E!==Xr)&&(r.blendEquation(r.FUNC_ADD),b=Xr,E=Xr),ue)switch(U){case qs:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Jc:r.blendFunc(r.ONE,r.ONE);break;case wd:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Ad:r.blendFuncSeparate(r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ZERO,r.ONE);break;default:mt("WebGLState: Invalid blending: ",U);break}else switch(U){case qs:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Jc:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE,r.ONE,r.ONE);break;case wd:mt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case Ad:mt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:mt("WebGLState: Invalid blending: ",U);break}y=null,M=null,T=null,A=null,v.set(0,0,0),w=0,m=U,C=ue}return}xe=xe||de,ie=ie||te,le=le||_e,(de!==b||xe!==E)&&(r.blendEquationSeparate(Me[de],Me[xe]),b=de,E=xe),(te!==y||_e!==M||ie!==T||le!==A)&&(r.blendFuncSeparate(ze[te],ze[_e],ze[ie],ze[le]),y=te,M=_e,T=ie,A=le),(re.equals(v)===!1||Be!==w)&&(r.blendColor(re.r,re.g,re.b,Be),v.copy(re),w=Be),m=U,C=!1}function Ye(U,de){U.side===Zi?Ee(r.CULL_FACE):ne(r.CULL_FACE);let te=U.side===Vn;de&&(te=!te),$(te),U.blending===qs&&U.transparent===!1?qe(er):qe(U.blending,U.blendEquation,U.blendSrc,U.blendDst,U.blendEquationAlpha,U.blendSrcAlpha,U.blendDstAlpha,U.blendColor,U.blendAlpha,U.premultipliedAlpha),a.setFunc(U.depthFunc),a.setTest(U.depthTest),a.setMask(U.depthWrite),s.setMask(U.colorWrite);const _e=U.stencilWrite;o.setTest(_e),_e&&(o.setMask(U.stencilWriteMask),o.setFunc(U.stencilFunc,U.stencilRef,U.stencilFuncMask),o.setOp(U.stencilFail,U.stencilZFail,U.stencilZPass)),Qe(U.polygonOffset,U.polygonOffsetFactor,U.polygonOffsetUnits),U.alphaToCoverage===!0?ne(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function $(U){L!==U&&(U?r.frontFace(r.CW):r.frontFace(r.CCW),L=U)}function lt(U){U!==q_?(ne(r.CULL_FACE),U!==N&&(U===Td?r.cullFace(r.BACK):U===$_?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),N=U}function We(U){U!==Y&&(I&&r.lineWidth(U),Y=U)}function Qe(U,de,te){U?(ne(r.POLYGON_OFFSET_FILL),(H!==de||O!==te)&&(H=de,O=te,a.getReversed()&&(de=-de),r.polygonOffset(de,te))):Ee(r.POLYGON_OFFSET_FILL)}function Ge(U){U?ne(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function Ke(U){U===void 0&&(U=r.TEXTURE0+z-1),D!==U&&(r.activeTexture(U),D=U)}function F(U,de,te){te===void 0&&(D===null?te=r.TEXTURE0+z-1:te=D);let _e=se[te];_e===void 0&&(_e={type:void 0,texture:void 0},se[te]=_e),(_e.type!==U||_e.texture!==de)&&(D!==te&&(r.activeTexture(te),D=te),r.bindTexture(U,de||oe[U]),_e.type=U,_e.texture=de)}function Ct(){const U=se[D];U!==void 0&&U.type!==void 0&&(r.bindTexture(U.type,null),U.type=void 0,U.texture=void 0)}function Xe(){try{r.compressedTexImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function R(){try{r.compressedTexImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function x(){try{r.texSubImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function k(){try{r.texSubImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function V(){try{r.compressedTexSubImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function Z(){try{r.compressedTexSubImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function ce(){try{r.texStorage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function ae(){try{r.texStorage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function J(){try{r.texImage2D(...arguments)}catch(U){mt("WebGLState:",U)}}function ee(){try{r.texImage3D(...arguments)}catch(U){mt("WebGLState:",U)}}function he(U){return h[U]!==void 0?h[U]:r.getParameter(U)}function Ae(U,de){h[U]!==de&&(r.pixelStorei(U,de),h[U]=de)}function ge(U){He.equals(U)===!1&&(r.scissor(U.x,U.y,U.z,U.w),He.copy(U))}function me(U){Le.equals(U)===!1&&(r.viewport(U.x,U.y,U.z,U.w),Le.copy(U))}function fe(U,de){let te=c.get(de);te===void 0&&(te=new WeakMap,c.set(de,te));let _e=te.get(U);_e===void 0&&(_e=r.getUniformBlockIndex(de,U.name),te.set(U,_e))}function Pe(U,de){const _e=c.get(de).get(U);l.get(de)!==_e&&(r.uniformBlockBinding(de,_e,U.__bindingPointIndex),l.set(de,_e))}function Ie(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),a.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),r.pixelStorei(r.PACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL),r.pixelStorei(r.PACK_ROW_LENGTH,0),r.pixelStorei(r.PACK_SKIP_PIXELS,0),r.pixelStorei(r.PACK_SKIP_ROWS,0),r.pixelStorei(r.UNPACK_ROW_LENGTH,0),r.pixelStorei(r.UNPACK_IMAGE_HEIGHT,0),r.pixelStorei(r.UNPACK_SKIP_PIXELS,0),r.pixelStorei(r.UNPACK_SKIP_ROWS,0),r.pixelStorei(r.UNPACK_SKIP_IMAGES,0),u={},h={},D=null,se={},f={},d=new WeakMap,g=[],_=null,p=!1,m=null,b=null,y=null,M=null,E=null,T=null,A=null,v=new ht(0,0,0),w=0,C=!1,L=null,N=null,Y=null,H=null,O=null,He.set(0,0,r.canvas.width,r.canvas.height),Le.set(0,0,r.canvas.width,r.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:ne,disable:Ee,bindFramebuffer:Oe,drawBuffers:Te,useProgram:tt,setBlending:qe,setMaterial:Ye,setFlipSided:$,setCullFace:lt,setLineWidth:We,setPolygonOffset:Qe,setScissorTest:Ge,activeTexture:Ke,bindTexture:F,unbindTexture:Ct,compressedTexImage2D:Xe,compressedTexImage3D:R,texImage2D:J,texImage3D:ee,pixelStorei:Ae,getParameter:he,updateUBOMapping:fe,uniformBlockBinding:Pe,texStorage2D:ce,texStorage3D:ae,texSubImage2D:x,texSubImage3D:k,compressedTexSubImage2D:V,compressedTexSubImage3D:Z,scissor:ge,viewport:me,reset:Ie}}function fy(r,e,t,n,i,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new gt,u=new WeakMap,h=new Set;let f;const d=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(R,x){return g?new OffscreenCanvas(R,x):yl("canvas")}function p(R,x,k){let V=1;const Z=Xe(R);if((Z.width>k||Z.height>k)&&(V=k/Math.max(Z.width,Z.height)),V<1)if(typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&R instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&R instanceof ImageBitmap||typeof VideoFrame<"u"&&R instanceof VideoFrame){const ce=Math.floor(V*Z.width),ae=Math.floor(V*Z.height);f===void 0&&(f=_(ce,ae));const J=x?_(ce,ae):f;return J.width=ce,J.height=ae,J.getContext("2d").drawImage(R,0,0,ce,ae),$e("WebGLRenderer: Texture has been resized from ("+Z.width+"x"+Z.height+") to ("+ce+"x"+ae+")."),J}else return"data"in R&&$e("WebGLRenderer: Image in DataTexture is too big ("+Z.width+"x"+Z.height+")."),R;return R}function m(R){return R.generateMipmaps}function b(R){r.generateMipmap(R)}function y(R){return R.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:R.isWebGL3DRenderTarget?r.TEXTURE_3D:R.isWebGLArrayRenderTarget||R.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function M(R,x,k,V,Z,ce=!1){if(R!==null){if(r[R]!==void 0)return r[R];$e("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+R+"'")}let ae;V&&(ae=e.get("EXT_texture_norm16"),ae||$e("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let J=x;if(x===r.RED&&(k===r.FLOAT&&(J=r.R32F),k===r.HALF_FLOAT&&(J=r.R16F),k===r.UNSIGNED_BYTE&&(J=r.R8),k===r.UNSIGNED_SHORT&&ae&&(J=ae.R16_EXT),k===r.SHORT&&ae&&(J=ae.R16_SNORM_EXT)),x===r.RED_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.R8UI),k===r.UNSIGNED_SHORT&&(J=r.R16UI),k===r.UNSIGNED_INT&&(J=r.R32UI),k===r.BYTE&&(J=r.R8I),k===r.SHORT&&(J=r.R16I),k===r.INT&&(J=r.R32I)),x===r.RG&&(k===r.FLOAT&&(J=r.RG32F),k===r.HALF_FLOAT&&(J=r.RG16F),k===r.UNSIGNED_BYTE&&(J=r.RG8),k===r.UNSIGNED_SHORT&&ae&&(J=ae.RG16_EXT),k===r.SHORT&&ae&&(J=ae.RG16_SNORM_EXT)),x===r.RG_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.RG8UI),k===r.UNSIGNED_SHORT&&(J=r.RG16UI),k===r.UNSIGNED_INT&&(J=r.RG32UI),k===r.BYTE&&(J=r.RG8I),k===r.SHORT&&(J=r.RG16I),k===r.INT&&(J=r.RG32I)),x===r.RGB_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.RGB8UI),k===r.UNSIGNED_SHORT&&(J=r.RGB16UI),k===r.UNSIGNED_INT&&(J=r.RGB32UI),k===r.BYTE&&(J=r.RGB8I),k===r.SHORT&&(J=r.RGB16I),k===r.INT&&(J=r.RGB32I)),x===r.RGBA_INTEGER&&(k===r.UNSIGNED_BYTE&&(J=r.RGBA8UI),k===r.UNSIGNED_SHORT&&(J=r.RGBA16UI),k===r.UNSIGNED_INT&&(J=r.RGBA32UI),k===r.BYTE&&(J=r.RGBA8I),k===r.SHORT&&(J=r.RGBA16I),k===r.INT&&(J=r.RGBA32I)),x===r.RGB&&(k===r.UNSIGNED_SHORT&&ae&&(J=ae.RGB16_EXT),k===r.SHORT&&ae&&(J=ae.RGB16_SNORM_EXT),k===r.UNSIGNED_INT_5_9_9_9_REV&&(J=r.RGB9_E5),k===r.UNSIGNED_INT_10F_11F_11F_REV&&(J=r.R11F_G11F_B10F)),x===r.RGBA){const ee=ce?Sl:ft.getTransfer(Z);k===r.FLOAT&&(J=r.RGBA32F),k===r.HALF_FLOAT&&(J=r.RGBA16F),k===r.UNSIGNED_BYTE&&(J=ee===vt?r.SRGB8_ALPHA8:r.RGBA8),k===r.UNSIGNED_SHORT&&ae&&(J=ae.RGBA16_EXT),k===r.SHORT&&ae&&(J=ae.RGBA16_SNORM_EXT),k===r.UNSIGNED_SHORT_4_4_4_4&&(J=r.RGBA4),k===r.UNSIGNED_SHORT_5_5_5_1&&(J=r.RGB5_A1)}return(J===r.R16F||J===r.R32F||J===r.RG16F||J===r.RG32F||J===r.RGBA16F||J===r.RGBA32F)&&e.get("EXT_color_buffer_float"),J}function E(R,x){let k;return R?x===null||x===Gi||x===Qa?k=r.DEPTH24_STENCIL8:x===Ui?k=r.DEPTH32F_STENCIL8:x===Ja&&(k=r.DEPTH24_STENCIL8,$e("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):x===null||x===Gi||x===Qa?k=r.DEPTH_COMPONENT24:x===Ui?k=r.DEPTH_COMPONENT32F:x===Ja&&(k=r.DEPTH_COMPONENT16),k}function T(R,x){return m(R)===!0||R.isFramebufferTexture&&R.minFilter!==dn&&R.minFilter!==yn?Math.log2(Math.max(x.width,x.height))+1:R.mipmaps!==void 0&&R.mipmaps.length>0?R.mipmaps.length:R.isCompressedTexture&&Array.isArray(R.image)?x.mipmaps.length:1}function A(R){const x=R.target;x.removeEventListener("dispose",A),w(x),x.isVideoTexture&&u.delete(x),x.isHTMLTexture&&h.delete(x)}function v(R){const x=R.target;x.removeEventListener("dispose",v),L(x)}function w(R){const x=n.get(R);if(x.__webglInit===void 0)return;const k=R.source,V=d.get(k);if(V){const Z=V[x.__cacheKey];Z.usedTimes--,Z.usedTimes===0&&C(R),Object.keys(V).length===0&&d.delete(k)}n.remove(R)}function C(R){const x=n.get(R);r.deleteTexture(x.__webglTexture);const k=R.source,V=d.get(k);delete V[x.__cacheKey],a.memory.textures--}function L(R){const x=n.get(R);if(R.depthTexture&&(R.depthTexture.dispose(),n.remove(R.depthTexture)),R.isWebGLCubeRenderTarget)for(let V=0;V<6;V++){if(Array.isArray(x.__webglFramebuffer[V]))for(let Z=0;Z<x.__webglFramebuffer[V].length;Z++)r.deleteFramebuffer(x.__webglFramebuffer[V][Z]);else r.deleteFramebuffer(x.__webglFramebuffer[V]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[V])}else{if(Array.isArray(x.__webglFramebuffer))for(let V=0;V<x.__webglFramebuffer.length;V++)r.deleteFramebuffer(x.__webglFramebuffer[V]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let V=0;V<x.__webglColorRenderbuffer.length;V++)x.__webglColorRenderbuffer[V]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[V]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}const k=R.textures;for(let V=0,Z=k.length;V<Z;V++){const ce=n.get(k[V]);ce.__webglTexture&&(r.deleteTexture(ce.__webglTexture),a.memory.textures--),n.remove(k[V])}n.remove(R)}let N=0;function Y(){N=0}function H(){return N}function O(R){N=R}function z(){const R=N;return R>=i.maxTextures&&$e("WebGLTextures: Trying to use "+R+" texture units while this GPU supports only "+i.maxTextures),N+=1,R}function I(R){const x=[];return x.push(R.wrapS),x.push(R.wrapT),x.push(R.wrapR||0),x.push(R.magFilter),x.push(R.minFilter),x.push(R.anisotropy),x.push(R.internalFormat),x.push(R.format),x.push(R.type),x.push(R.generateMipmaps),x.push(R.premultiplyAlpha),x.push(R.flipY),x.push(R.unpackAlignment),x.push(R.colorSpace),x.join()}function q(R,x){const k=n.get(R);if(R.isVideoTexture&&F(R),R.isRenderTargetTexture===!1&&R.isExternalTexture!==!0&&R.version>0&&k.__version!==R.version){const V=R.image;if(V===null)$e("WebGLRenderer: Texture marked for update but no image data found.");else if(V.complete===!1)$e("WebGLRenderer: Texture marked for update but image is incomplete");else{Ee(k,R,x);return}}else R.isExternalTexture&&(k.__webglTexture=R.sourceTexture?R.sourceTexture:null);t.bindTexture(r.TEXTURE_2D,k.__webglTexture,r.TEXTURE0+x)}function j(R,x){const k=n.get(R);if(R.isRenderTargetTexture===!1&&R.version>0&&k.__version!==R.version){Ee(k,R,x);return}else R.isExternalTexture&&(k.__webglTexture=R.sourceTexture?R.sourceTexture:null);t.bindTexture(r.TEXTURE_2D_ARRAY,k.__webglTexture,r.TEXTURE0+x)}function D(R,x){const k=n.get(R);if(R.isRenderTargetTexture===!1&&R.version>0&&k.__version!==R.version){Ee(k,R,x);return}t.bindTexture(r.TEXTURE_3D,k.__webglTexture,r.TEXTURE0+x)}function se(R,x){const k=n.get(R);if(R.isCubeDepthTexture!==!0&&R.version>0&&k.__version!==R.version){Oe(k,R,x);return}t.bindTexture(r.TEXTURE_CUBE_MAP,k.__webglTexture,r.TEXTURE0+x)}const pe={[lu]:r.REPEAT,[Ji]:r.CLAMP_TO_EDGE,[cu]:r.MIRRORED_REPEAT},Ve={[dn]:r.NEAREST,[g0]:r.NEAREST_MIPMAP_NEAREST,[vo]:r.NEAREST_MIPMAP_LINEAR,[yn]:r.LINEAR,[jl]:r.LINEAR_MIPMAP_NEAREST,[Kr]:r.LINEAR_MIPMAP_LINEAR},He={[v0]:r.NEVER,[E0]:r.ALWAYS,[M0]:r.LESS,[Ef]:r.LEQUAL,[S0]:r.EQUAL,[Tf]:r.GEQUAL,[b0]:r.GREATER,[y0]:r.NOTEQUAL};function Le(R,x){if(x.type===Ui&&e.has("OES_texture_float_linear")===!1&&(x.magFilter===yn||x.magFilter===jl||x.magFilter===vo||x.magFilter===Kr||x.minFilter===yn||x.minFilter===jl||x.minFilter===vo||x.minFilter===Kr)&&$e("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(R,r.TEXTURE_WRAP_S,pe[x.wrapS]),r.texParameteri(R,r.TEXTURE_WRAP_T,pe[x.wrapT]),(R===r.TEXTURE_3D||R===r.TEXTURE_2D_ARRAY)&&r.texParameteri(R,r.TEXTURE_WRAP_R,pe[x.wrapR]),r.texParameteri(R,r.TEXTURE_MAG_FILTER,Ve[x.magFilter]),r.texParameteri(R,r.TEXTURE_MIN_FILTER,Ve[x.minFilter]),x.compareFunction&&(r.texParameteri(R,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(R,r.TEXTURE_COMPARE_FUNC,He[x.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===dn||x.minFilter!==vo&&x.minFilter!==Kr||x.type===Ui&&e.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){const k=e.get("EXT_texture_filter_anisotropic");r.texParameterf(R,k.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function Q(R,x){let k=!1;R.__webglInit===void 0&&(R.__webglInit=!0,x.addEventListener("dispose",A));const V=x.source;let Z=d.get(V);Z===void 0&&(Z={},d.set(V,Z));const ce=I(x);if(ce!==R.__cacheKey){Z[ce]===void 0&&(Z[ce]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,k=!0),Z[ce].usedTimes++;const ae=Z[R.__cacheKey];ae!==void 0&&(Z[R.__cacheKey].usedTimes--,ae.usedTimes===0&&C(x)),R.__cacheKey=ce,R.__webglTexture=Z[ce].texture}return k}function oe(R,x,k){return Math.floor(Math.floor(R/k)/x)}function ne(R,x,k,V){const ce=R.updateRanges;if(ce.length===0)t.texSubImage2D(r.TEXTURE_2D,0,0,0,x.width,x.height,k,V,x.data);else{ce.sort((Ae,ge)=>Ae.start-ge.start);let ae=0;for(let Ae=1;Ae<ce.length;Ae++){const ge=ce[ae],me=ce[Ae],fe=ge.start+ge.count,Pe=oe(me.start,x.width,4),Ie=oe(ge.start,x.width,4);me.start<=fe+1&&Pe===Ie&&oe(me.start+me.count-1,x.width,4)===Pe?ge.count=Math.max(ge.count,me.start+me.count-ge.start):(++ae,ce[ae]=me)}ce.length=ae+1;const J=t.getParameter(r.UNPACK_ROW_LENGTH),ee=t.getParameter(r.UNPACK_SKIP_PIXELS),he=t.getParameter(r.UNPACK_SKIP_ROWS);t.pixelStorei(r.UNPACK_ROW_LENGTH,x.width);for(let Ae=0,ge=ce.length;Ae<ge;Ae++){const me=ce[Ae],fe=Math.floor(me.start/4),Pe=Math.ceil(me.count/4),Ie=fe%x.width,U=Math.floor(fe/x.width),de=Pe,te=1;t.pixelStorei(r.UNPACK_SKIP_PIXELS,Ie),t.pixelStorei(r.UNPACK_SKIP_ROWS,U),t.texSubImage2D(r.TEXTURE_2D,0,Ie,U,de,te,k,V,x.data)}R.clearUpdateRanges(),t.pixelStorei(r.UNPACK_ROW_LENGTH,J),t.pixelStorei(r.UNPACK_SKIP_PIXELS,ee),t.pixelStorei(r.UNPACK_SKIP_ROWS,he)}}function Ee(R,x,k){let V=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(V=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(V=r.TEXTURE_3D);const Z=Q(R,x),ce=x.source;t.bindTexture(V,R.__webglTexture,r.TEXTURE0+k);const ae=n.get(ce);if(ce.version!==ae.__version||Z===!0){if(t.activeTexture(r.TEXTURE0+k),(typeof ImageBitmap<"u"&&x.image instanceof ImageBitmap)===!1){const te=ft.getPrimaries(ft.workingColorSpace),_e=x.colorSpace===xr?null:ft.getPrimaries(x.colorSpace),xe=x.colorSpace===xr||te===_e?r.NONE:r.BROWSER_DEFAULT_WEBGL;t.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),t.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),t.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,xe)}t.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment);let ee=p(x.image,!1,i.maxTextureSize);ee=Ct(x,ee);const he=s.convert(x.format,x.colorSpace),Ae=s.convert(x.type);let ge=M(x.internalFormat,he,Ae,x.normalized,x.colorSpace,x.isVideoTexture);Le(V,x);let me;const fe=x.mipmaps,Pe=x.isVideoTexture!==!0,Ie=ae.__version===void 0||Z===!0,U=ce.dataReady,de=T(x,ee);if(x.isDepthTexture)ge=E(x.format===Zr,x.type),Ie&&(Pe?t.texStorage2D(r.TEXTURE_2D,1,ge,ee.width,ee.height):t.texImage2D(r.TEXTURE_2D,0,ge,ee.width,ee.height,0,he,Ae,null));else if(x.isDataTexture)if(fe.length>0){Pe&&Ie&&t.texStorage2D(r.TEXTURE_2D,de,ge,fe[0].width,fe[0].height);for(let te=0,_e=fe.length;te<_e;te++)me=fe[te],Pe?U&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,me.width,me.height,he,Ae,me.data):t.texImage2D(r.TEXTURE_2D,te,ge,me.width,me.height,0,he,Ae,me.data);x.generateMipmaps=!1}else Pe?(Ie&&t.texStorage2D(r.TEXTURE_2D,de,ge,ee.width,ee.height),U&&ne(x,ee,he,Ae)):t.texImage2D(r.TEXTURE_2D,0,ge,ee.width,ee.height,0,he,Ae,ee.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){Pe&&Ie&&t.texStorage3D(r.TEXTURE_2D_ARRAY,de,ge,fe[0].width,fe[0].height,ee.depth);for(let te=0,_e=fe.length;te<_e;te++)if(me=fe[te],x.format!==bi)if(he!==null)if(Pe){if(U)if(x.layerUpdates.size>0){const xe=th(me.width,me.height,x.format,x.type);for(const ie of x.layerUpdates){const le=me.data.subarray(ie*xe/me.data.BYTES_PER_ELEMENT,(ie+1)*xe/me.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,ie,me.width,me.height,1,he,le)}x.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,me.width,me.height,ee.depth,he,me.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,te,ge,me.width,me.height,ee.depth,0,me.data,0,0);else $e("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Pe?U&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,me.width,me.height,ee.depth,he,Ae,me.data):t.texImage3D(r.TEXTURE_2D_ARRAY,te,ge,me.width,me.height,ee.depth,0,he,Ae,me.data)}else{Pe&&Ie&&t.texStorage2D(r.TEXTURE_2D,de,ge,fe[0].width,fe[0].height);for(let te=0,_e=fe.length;te<_e;te++)me=fe[te],x.format!==bi?he!==null?Pe?U&&t.compressedTexSubImage2D(r.TEXTURE_2D,te,0,0,me.width,me.height,he,me.data):t.compressedTexImage2D(r.TEXTURE_2D,te,ge,me.width,me.height,0,me.data):$e("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Pe?U&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,me.width,me.height,he,Ae,me.data):t.texImage2D(r.TEXTURE_2D,te,ge,me.width,me.height,0,he,Ae,me.data)}else if(x.isDataArrayTexture)if(Pe){if(Ie&&t.texStorage3D(r.TEXTURE_2D_ARRAY,de,ge,ee.width,ee.height,ee.depth),U)if(x.layerUpdates.size>0){const te=th(ee.width,ee.height,x.format,x.type);for(const _e of x.layerUpdates){const xe=ee.data.subarray(_e*te/ee.data.BYTES_PER_ELEMENT,(_e+1)*te/ee.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,_e,ee.width,ee.height,1,he,Ae,xe)}x.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,ee.width,ee.height,ee.depth,he,Ae,ee.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,ge,ee.width,ee.height,ee.depth,0,he,Ae,ee.data);else if(x.isData3DTexture)Pe?(Ie&&t.texStorage3D(r.TEXTURE_3D,de,ge,ee.width,ee.height,ee.depth),U&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,ee.width,ee.height,ee.depth,he,Ae,ee.data)):t.texImage3D(r.TEXTURE_3D,0,ge,ee.width,ee.height,ee.depth,0,he,Ae,ee.data);else if(x.isFramebufferTexture){if(Ie)if(Pe)t.texStorage2D(r.TEXTURE_2D,de,ge,ee.width,ee.height);else{let te=ee.width,_e=ee.height;for(let xe=0;xe<de;xe++)t.texImage2D(r.TEXTURE_2D,xe,ge,te,_e,0,he,Ae,null),te>>=1,_e>>=1}}else if(x.isHTMLTexture){if("texElementImage2D"in r){const te=r.canvas;if(te.hasAttribute("layoutsubtree")||te.setAttribute("layoutsubtree","true"),ee.parentNode!==te){te.appendChild(ee),h.add(x),te.onpaint=_e=>{const xe=_e.changedElements;for(const ie of h)xe.includes(ie.image)&&(ie.needsUpdate=!0)},te.requestPaint();return}if(r.texElementImage2D.length===3)r.texElementImage2D(r.TEXTURE_2D,r.RGBA8,ee);else{const xe=r.RGBA,ie=r.RGBA,le=r.UNSIGNED_BYTE;r.texElementImage2D(r.TEXTURE_2D,0,xe,ie,le,ee)}r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)}}else if(fe.length>0){if(Pe&&Ie){const te=Xe(fe[0]);t.texStorage2D(r.TEXTURE_2D,de,ge,te.width,te.height)}for(let te=0,_e=fe.length;te<_e;te++)me=fe[te],Pe?U&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,he,Ae,me):t.texImage2D(r.TEXTURE_2D,te,ge,he,Ae,me);x.generateMipmaps=!1}else if(Pe){if(Ie){const te=Xe(ee);t.texStorage2D(r.TEXTURE_2D,de,ge,te.width,te.height)}U&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,he,Ae,ee)}else t.texImage2D(r.TEXTURE_2D,0,ge,he,Ae,ee);m(x)&&b(V),ae.__version=ce.version,x.onUpdate&&x.onUpdate(x)}R.__version=x.version}function Oe(R,x,k){if(x.image.length!==6)return;const V=Q(R,x),Z=x.source;t.bindTexture(r.TEXTURE_CUBE_MAP,R.__webglTexture,r.TEXTURE0+k);const ce=n.get(Z);if(Z.version!==ce.__version||V===!0){t.activeTexture(r.TEXTURE0+k);const ae=ft.getPrimaries(ft.workingColorSpace),J=x.colorSpace===xr?null:ft.getPrimaries(x.colorSpace),ee=x.colorSpace===xr||ae===J?r.NONE:r.BROWSER_DEFAULT_WEBGL;t.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),t.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),t.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),t.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,ee);const he=x.isCompressedTexture||x.image[0].isCompressedTexture,Ae=x.image[0]&&x.image[0].isDataTexture,ge=[];for(let ie=0;ie<6;ie++)!he&&!Ae?ge[ie]=p(x.image[ie],!0,i.maxCubemapSize):ge[ie]=Ae?x.image[ie].image:x.image[ie],ge[ie]=Ct(x,ge[ie]);const me=ge[0],fe=s.convert(x.format,x.colorSpace),Pe=s.convert(x.type),Ie=M(x.internalFormat,fe,Pe,x.normalized,x.colorSpace),U=x.isVideoTexture!==!0,de=ce.__version===void 0||V===!0,te=Z.dataReady;let _e=T(x,me);Le(r.TEXTURE_CUBE_MAP,x);let xe;if(he){U&&de&&t.texStorage2D(r.TEXTURE_CUBE_MAP,_e,Ie,me.width,me.height);for(let ie=0;ie<6;ie++){xe=ge[ie].mipmaps;for(let le=0;le<xe.length;le++){const re=xe[le];x.format!==bi?fe!==null?U?te&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,0,0,re.width,re.height,fe,re.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,Ie,re.width,re.height,0,re.data):$e("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,0,0,re.width,re.height,fe,Pe,re.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le,Ie,re.width,re.height,0,fe,Pe,re.data)}}}else{if(xe=x.mipmaps,U&&de){xe.length>0&&_e++;const ie=Xe(ge[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,_e,Ie,ie.width,ie.height)}for(let ie=0;ie<6;ie++)if(Ae){U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,ge[ie].width,ge[ie].height,fe,Pe,ge[ie].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ie,ge[ie].width,ge[ie].height,0,fe,Pe,ge[ie].data);for(let le=0;le<xe.length;le++){const Be=xe[le].image[ie].image;U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,0,0,Be.width,Be.height,fe,Pe,Be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,Ie,Be.width,Be.height,0,fe,Pe,Be.data)}}else{U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,fe,Pe,ge[ie]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ie,fe,Pe,ge[ie]);for(let le=0;le<xe.length;le++){const re=xe[le];U?te&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,0,0,fe,Pe,re.image[ie]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le+1,Ie,fe,Pe,re.image[ie])}}}m(x)&&b(r.TEXTURE_CUBE_MAP),ce.__version=Z.version,x.onUpdate&&x.onUpdate(x)}R.__version=x.version}function Te(R,x,k,V,Z,ce){const ae=s.convert(k.format,k.colorSpace),J=s.convert(k.type),ee=M(k.internalFormat,ae,J,k.normalized,k.colorSpace),he=n.get(x),Ae=n.get(k);if(Ae.__renderTarget=x,!he.__hasExternalTextures){const ge=Math.max(1,x.width>>ce),me=Math.max(1,x.height>>ce);Z===r.TEXTURE_3D||Z===r.TEXTURE_2D_ARRAY?t.texImage3D(Z,ce,ee,ge,me,x.depth,0,ae,J,null):t.texImage2D(Z,ce,ee,ge,me,0,ae,J,null)}t.bindFramebuffer(r.FRAMEBUFFER,R),Ke(x)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,V,Z,Ae.__webglTexture,0,Ge(x)):(Z===r.TEXTURE_2D||Z>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Z<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,V,Z,Ae.__webglTexture,ce),t.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(R,x,k){if(r.bindRenderbuffer(r.RENDERBUFFER,R),x.depthBuffer){const V=x.depthTexture,Z=V&&V.isDepthTexture?V.type:null,ce=E(x.stencilBuffer,Z),ae=x.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;Ke(x)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ge(x),ce,x.width,x.height):k?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ge(x),ce,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,ce,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,ae,r.RENDERBUFFER,R)}else{const V=x.textures;for(let Z=0;Z<V.length;Z++){const ce=V[Z],ae=s.convert(ce.format,ce.colorSpace),J=s.convert(ce.type),ee=M(ce.internalFormat,ae,J,ce.normalized,ce.colorSpace);Ke(x)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ge(x),ee,x.width,x.height):k?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ge(x),ee,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,ee,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Me(R,x,k){const V=x.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(r.FRAMEBUFFER,R),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("THREE.WebGLTextures: renderTarget.depthTexture must be an instance of THREE.DepthTexture.");const Z=n.get(x.depthTexture);if(Z.__renderTarget=x,(!Z.__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),V){if(Z.__webglInit===void 0&&(Z.__webglInit=!0,x.depthTexture.addEventListener("dispose",A)),Z.__webglTexture===void 0){Z.__webglTexture=r.createTexture(),t.bindTexture(r.TEXTURE_CUBE_MAP,Z.__webglTexture),Le(r.TEXTURE_CUBE_MAP,x.depthTexture);const he=s.convert(x.depthTexture.format),Ae=s.convert(x.depthTexture.type);let ge;x.depthTexture.format===ar?ge=r.DEPTH_COMPONENT24:x.depthTexture.format===Zr&&(ge=r.DEPTH24_STENCIL8);for(let me=0;me<6;me++)r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+me,0,ge,x.width,x.height,0,he,Ae,null)}}else q(x.depthTexture,0);const ce=Z.__webglTexture,ae=Ge(x),J=V?r.TEXTURE_CUBE_MAP_POSITIVE_X+k:r.TEXTURE_2D,ee=x.depthTexture.format===Zr?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;if(x.depthTexture.format===ar)Ke(x)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ee,J,ce,0,ae):r.framebufferTexture2D(r.FRAMEBUFFER,ee,J,ce,0);else if(x.depthTexture.format===Zr)Ke(x)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ee,J,ce,0,ae):r.framebufferTexture2D(r.FRAMEBUFFER,ee,J,ce,0);else throw new Error("THREE.WebGLTextures: Unknown depthTexture format.")}function ze(R){const x=n.get(R),k=R.isWebGLCubeRenderTarget===!0;if(x.__boundDepthTexture!==R.depthTexture){const V=R.depthTexture;if(x.__depthDisposeCallback&&x.__depthDisposeCallback(),V){const Z=()=>{delete x.__boundDepthTexture,delete x.__depthDisposeCallback,V.removeEventListener("dispose",Z)};V.addEventListener("dispose",Z),x.__depthDisposeCallback=Z}x.__boundDepthTexture=V}if(R.depthTexture&&!x.__autoAllocateDepthBuffer)if(k)for(let V=0;V<6;V++)Me(x.__webglFramebuffer[V],R,V);else{const V=R.texture.mipmaps;V&&V.length>0?Me(x.__webglFramebuffer[0],R,0):Me(x.__webglFramebuffer,R,0)}else if(k){x.__webglDepthbuffer=[];for(let V=0;V<6;V++)if(t.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[V]),x.__webglDepthbuffer[V]===void 0)x.__webglDepthbuffer[V]=r.createRenderbuffer(),tt(x.__webglDepthbuffer[V],R,!1);else{const Z=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ce=x.__webglDepthbuffer[V];r.bindRenderbuffer(r.RENDERBUFFER,ce),r.framebufferRenderbuffer(r.FRAMEBUFFER,Z,r.RENDERBUFFER,ce)}}else{const V=R.texture.mipmaps;if(V&&V.length>0?t.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[0]):t.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer===void 0)x.__webglDepthbuffer=r.createRenderbuffer(),tt(x.__webglDepthbuffer,R,!1);else{const Z=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ce=x.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ce),r.framebufferRenderbuffer(r.FRAMEBUFFER,Z,r.RENDERBUFFER,ce)}}t.bindFramebuffer(r.FRAMEBUFFER,null)}function qe(R,x,k){const V=n.get(R);x!==void 0&&Te(V.__webglFramebuffer,R,R.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),k!==void 0&&ze(R)}function Ye(R){const x=R.texture,k=n.get(R),V=n.get(x);R.addEventListener("dispose",v);const Z=R.textures,ce=R.isWebGLCubeRenderTarget===!0,ae=Z.length>1;if(ae||(V.__webglTexture===void 0&&(V.__webglTexture=r.createTexture()),V.__version=x.version,a.memory.textures++),ce){k.__webglFramebuffer=[];for(let J=0;J<6;J++)if(x.mipmaps&&x.mipmaps.length>0){k.__webglFramebuffer[J]=[];for(let ee=0;ee<x.mipmaps.length;ee++)k.__webglFramebuffer[J][ee]=r.createFramebuffer()}else k.__webglFramebuffer[J]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){k.__webglFramebuffer=[];for(let J=0;J<x.mipmaps.length;J++)k.__webglFramebuffer[J]=r.createFramebuffer()}else k.__webglFramebuffer=r.createFramebuffer();if(ae)for(let J=0,ee=Z.length;J<ee;J++){const he=n.get(Z[J]);he.__webglTexture===void 0&&(he.__webglTexture=r.createTexture(),a.memory.textures++)}if(R.samples>0&&Ke(R)===!1){k.__webglMultisampledFramebuffer=r.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let J=0;J<Z.length;J++){const ee=Z[J];k.__webglColorRenderbuffer[J]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,k.__webglColorRenderbuffer[J]);const he=s.convert(ee.format,ee.colorSpace),Ae=s.convert(ee.type),ge=M(ee.internalFormat,he,Ae,ee.normalized,ee.colorSpace,R.isXRRenderTarget===!0),me=Ge(R);r.renderbufferStorageMultisample(r.RENDERBUFFER,me,ge,R.width,R.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+J,r.RENDERBUFFER,k.__webglColorRenderbuffer[J])}r.bindRenderbuffer(r.RENDERBUFFER,null),R.depthBuffer&&(k.__webglDepthRenderbuffer=r.createRenderbuffer(),tt(k.__webglDepthRenderbuffer,R,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ce){t.bindTexture(r.TEXTURE_CUBE_MAP,V.__webglTexture),Le(r.TEXTURE_CUBE_MAP,x);for(let J=0;J<6;J++)if(x.mipmaps&&x.mipmaps.length>0)for(let ee=0;ee<x.mipmaps.length;ee++)Te(k.__webglFramebuffer[J][ee],R,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+J,ee);else Te(k.__webglFramebuffer[J],R,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+J,0);m(x)&&b(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ae){for(let J=0,ee=Z.length;J<ee;J++){const he=Z[J],Ae=n.get(he);let ge=r.TEXTURE_2D;(R.isWebGL3DRenderTarget||R.isWebGLArrayRenderTarget)&&(ge=R.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(ge,Ae.__webglTexture),Le(ge,he),Te(k.__webglFramebuffer,R,he,r.COLOR_ATTACHMENT0+J,ge,0),m(he)&&b(ge)}t.unbindTexture()}else{let J=r.TEXTURE_2D;if((R.isWebGL3DRenderTarget||R.isWebGLArrayRenderTarget)&&(J=R.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(J,V.__webglTexture),Le(J,x),x.mipmaps&&x.mipmaps.length>0)for(let ee=0;ee<x.mipmaps.length;ee++)Te(k.__webglFramebuffer[ee],R,x,r.COLOR_ATTACHMENT0,J,ee);else Te(k.__webglFramebuffer,R,x,r.COLOR_ATTACHMENT0,J,0);m(x)&&b(J),t.unbindTexture()}R.depthBuffer&&ze(R)}function $(R){const x=R.textures;for(let k=0,V=x.length;k<V;k++){const Z=x[k];if(m(Z)){const ce=y(R),ae=n.get(Z).__webglTexture;t.bindTexture(ce,ae),b(ce),t.unbindTexture()}}}const lt=[],We=[];function Qe(R){if(R.samples>0){if(Ke(R)===!1){const x=R.textures,k=R.width,V=R.height;let Z=r.COLOR_BUFFER_BIT;const ce=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ae=n.get(R),J=x.length>1;if(J)for(let he=0;he<x.length;he++)t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,ae.__webglMultisampledFramebuffer);const ee=R.texture.mipmaps;ee&&ee.length>0?t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ae.__webglFramebuffer[0]):t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ae.__webglFramebuffer);for(let he=0;he<x.length;he++){if(R.resolveDepthBuffer&&(R.depthBuffer&&(Z|=r.DEPTH_BUFFER_BIT),R.stencilBuffer&&R.resolveStencilBuffer&&(Z|=r.STENCIL_BUFFER_BIT)),J){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,ae.__webglColorRenderbuffer[he]);const Ae=n.get(x[he]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Ae,0)}r.blitFramebuffer(0,0,k,V,0,0,k,V,Z,r.NEAREST),l===!0&&(lt.length=0,We.length=0,lt.push(r.COLOR_ATTACHMENT0+he),R.depthBuffer&&R.resolveDepthBuffer===!1&&(lt.push(ce),We.push(ce),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,We)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,lt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),J)for(let he=0;he<x.length;he++){t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.RENDERBUFFER,ae.__webglColorRenderbuffer[he]);const Ae=n.get(x[he]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,ae.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+he,r.TEXTURE_2D,Ae,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,ae.__webglMultisampledFramebuffer)}else if(R.depthBuffer&&R.resolveDepthBuffer===!1&&l){const x=R.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function Ge(R){return Math.min(i.maxSamples,R.samples)}function Ke(R){const x=n.get(R);return R.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function F(R){const x=a.render.frame;u.get(R)!==x&&(u.set(R,x),R.update())}function Ct(R,x){const k=R.colorSpace,V=R.format,Z=R.type;return R.isCompressedTexture===!0||R.isVideoTexture===!0||k!==Ml&&k!==xr&&(ft.getTransfer(k)===vt?(V!==bi||Z!==hi)&&$e("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):mt("WebGLTextures: Unsupported texture color space:",k)),x}function Xe(R){return typeof HTMLImageElement<"u"&&R instanceof HTMLImageElement?(c.width=R.naturalWidth||R.width,c.height=R.naturalHeight||R.height):typeof VideoFrame<"u"&&R instanceof VideoFrame?(c.width=R.displayWidth,c.height=R.displayHeight):(c.width=R.width,c.height=R.height),c}this.allocateTextureUnit=z,this.resetTextureUnits=Y,this.getTextureUnits=H,this.setTextureUnits=O,this.setTexture2D=q,this.setTexture2DArray=j,this.setTexture3D=D,this.setTextureCube=se,this.rebindTextures=qe,this.setupRenderTarget=Ye,this.updateRenderTargetMipmap=$,this.updateMultisampleRenderTarget=Qe,this.setupDepthRenderbuffer=ze,this.setupFrameBufferTexture=Te,this.useMultisampledRTT=Ke,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function dy(r,e){function t(n,i=xr){let s;const a=ft.getTransfer(i);if(n===hi)return r.UNSIGNED_BYTE;if(n===vf)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Mf)return r.UNSIGNED_SHORT_5_5_5_1;if(n===hm)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===pm)return r.UNSIGNED_INT_10F_11F_11F_REV;if(n===fm)return r.BYTE;if(n===dm)return r.SHORT;if(n===Ja)return r.UNSIGNED_SHORT;if(n===xf)return r.INT;if(n===Gi)return r.UNSIGNED_INT;if(n===Ui)return r.FLOAT;if(n===sr)return r.HALF_FLOAT;if(n===mm)return r.ALPHA;if(n===gm)return r.RGB;if(n===bi)return r.RGBA;if(n===ar)return r.DEPTH_COMPONENT;if(n===Zr)return r.DEPTH_STENCIL;if(n===_m)return r.RED;if(n===Sf)return r.RED_INTEGER;if(n===ls)return r.RG;if(n===bf)return r.RG_INTEGER;if(n===yf)return r.RGBA_INTEGER;if(n===nl||n===il||n===rl||n===sl)if(a===vt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===nl)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===il)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===rl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===sl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===nl)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===il)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===rl)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===sl)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===uu||n===fu||n===du||n===hu)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===uu)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===fu)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===du)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===hu)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===pu||n===mu||n===gu||n===_u||n===xu||n===xl||n===vu)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===pu||n===mu)return a===vt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===gu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(n===_u)return s.COMPRESSED_R11_EAC;if(n===xu)return s.COMPRESSED_SIGNED_R11_EAC;if(n===xl)return s.COMPRESSED_RG11_EAC;if(n===vu)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===Mu||n===Su||n===bu||n===yu||n===Eu||n===Tu||n===wu||n===Au||n===Ru||n===Cu||n===Pu||n===Du||n===Lu||n===Nu)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Mu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Su)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===bu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===yu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Eu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Tu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===wu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Au)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ru)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Cu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Pu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Du)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Lu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Nu)return a===vt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Iu||n===Uu||n===Fu)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Iu)return a===vt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Uu)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Fu)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Ou||n===Bu||n===vl||n===ku)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===Ou)return s.COMPRESSED_RED_RGTC1_EXT;if(n===Bu)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===vl)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===ku)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Qa?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const hy=`
4085
4085
  void main() {
4086
4086
 
4087
4087
  gl_Position = vec4( position, 1.0 );
4088
4088
 
4089
- }`,hy=`
4089
+ }`,py=`
4090
4090
  uniform sampler2DArray depthColor;
4091
4091
  uniform float depthWidth;
4092
4092
  uniform float depthHeight;
@@ -4105,7 +4105,7 @@ void main() {
4105
4105
 
4106
4106
  }
4107
4107
 
4108
- }`;class py{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Rm(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new yi({vertexShader:dy,fragmentShader:hy,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new or(new Dl(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class my extends fs{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,u=null,h=null,f=null,d=null,g=null;const _=typeof XRWebGLBinding<"u",p=new py,m={},b=t.getContextAttributes();let y=null,M=null;const E=[],T=[],A=new gt;let v=null;const w=new di;w.viewport=new kt;const C=new di;C.viewport=new kt;const L=[w,C],N=new Ex;let Y=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let oe=E[Q];return oe===void 0&&(oe=new ic,E[Q]=oe),oe.getTargetRaySpace()},this.getControllerGrip=function(Q){let oe=E[Q];return oe===void 0&&(oe=new ic,E[Q]=oe),oe.getGripSpace()},this.getHand=function(Q){let oe=E[Q];return oe===void 0&&(oe=new ic,E[Q]=oe),oe.getHandSpace()};function O(Q){const oe=T.indexOf(Q.inputSource);if(oe===-1)return;const ne=E[oe];ne!==void 0&&(ne.update(Q.inputSource,Q.frame,c||a),ne.dispatchEvent({type:Q.type,data:Q.inputSource}))}function z(){i.removeEventListener("select",O),i.removeEventListener("selectstart",O),i.removeEventListener("selectend",O),i.removeEventListener("squeeze",O),i.removeEventListener("squeezestart",O),i.removeEventListener("squeezeend",O),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",I);for(let Q=0;Q<E.length;Q++){const oe=T[Q];oe!==null&&(T[Q]=null,E[Q].disconnect(oe))}Y=null,H=null,p.reset();for(const Q in m)delete m[Q];e.setRenderTarget(y),d=null,f=null,h=null,i=null,M=null,Le.stop(),n.isPresenting=!1,e.setPixelRatio(v),e.setSize(A.width,A.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Q){s=Q,n.isPresenting===!0&&$e("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Q){o=Q,n.isPresenting===!0&&$e("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Q){c=Q},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return h===null&&_&&(h=new XRWebGLBinding(i,t)),h},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(Q){if(i=Q,i!==null){if(y=e.getRenderTarget(),i.addEventListener("select",O),i.addEventListener("selectstart",O),i.addEventListener("selectend",O),i.addEventListener("squeeze",O),i.addEventListener("squeezestart",O),i.addEventListener("squeezeend",O),i.addEventListener("end",z),i.addEventListener("inputsourceschange",I),b.xrCompatible!==!0&&await t.makeXRCompatible(),v=e.getPixelRatio(),e.getSize(A),_&&"createProjectionLayer"in XRWebGLBinding.prototype){let ne=null,Ee=null,Oe=null;b.depth&&(Oe=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ne=b.stencil?Kr:ar,Ee=b.stencil?Qa:Gi);const Te={colorFormat:t.RGBA8,depthFormat:Oe,scaleFactor:s};h=this.getBinding(),f=h.createProjectionLayer(Te),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),M=new ki(f.textureWidth,f.textureHeight,{format:bi,type:hi,depthTexture:new ra(f.textureWidth,f.textureHeight,Ee,void 0,void 0,void 0,void 0,void 0,void 0,ne),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{const ne={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,ne),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),M=new ki(d.framebufferWidth,d.framebufferHeight,{format:bi,type:hi,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}M.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Le.setContext(i),Le.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function I(Q){for(let oe=0;oe<Q.removed.length;oe++){const ne=Q.removed[oe],Ee=T.indexOf(ne);Ee>=0&&(T[Ee]=null,E[Ee].disconnect(ne))}for(let oe=0;oe<Q.added.length;oe++){const ne=Q.added[oe];let Ee=T.indexOf(ne);if(Ee===-1){for(let Te=0;Te<E.length;Te++)if(Te>=T.length){T.push(ne),Ee=Te;break}else if(T[Te]===null){T[Te]=ne,Ee=Te;break}if(Ee===-1)break}const Oe=E[Ee];Oe&&Oe.connect(ne)}}const q=new X,j=new X;function D(Q,oe,ne){q.setFromMatrixPosition(oe.matrixWorld),j.setFromMatrixPosition(ne.matrixWorld);const Ee=q.distanceTo(j),Oe=oe.projectionMatrix.elements,Te=ne.projectionMatrix.elements,tt=Oe[14]/(Oe[10]-1),Me=Oe[14]/(Oe[10]+1),ze=(Oe[9]+1)/Oe[5],qe=(Oe[9]-1)/Oe[5],Ye=(Oe[8]-1)/Oe[0],$=(Te[8]+1)/Te[0],lt=tt*Ye,We=tt*$,Qe=Ee/(-Ye+$),Ge=Qe*-Ye;if(oe.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(Ge),Q.translateZ(Qe),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert(),Oe[10]===-1)Q.projectionMatrix.copy(oe.projectionMatrix),Q.projectionMatrixInverse.copy(oe.projectionMatrixInverse);else{const Ze=tt+Qe,F=Me+Qe,Ct=lt-Ge,Xe=We+(Ee-Ge),R=ze*Me/F*Ze,x=qe*Me/F*Ze;Q.projectionMatrix.makePerspective(Ct,Xe,R,x,Ze,F),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}}function se(Q,oe){oe===null?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(oe.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(i===null)return;let oe=Q.near,ne=Q.far;p.texture!==null&&(p.depthNear>0&&(oe=p.depthNear),p.depthFar>0&&(ne=p.depthFar)),N.near=C.near=w.near=oe,N.far=C.far=w.far=ne,(Y!==N.near||H!==N.far)&&(i.updateRenderState({depthNear:N.near,depthFar:N.far}),Y=N.near,H=N.far),N.layers.mask=Q.layers.mask|6,w.layers.mask=N.layers.mask&-5,C.layers.mask=N.layers.mask&-3;const Ee=Q.parent,Oe=N.cameras;se(N,Ee);for(let Te=0;Te<Oe.length;Te++)se(Oe[Te],Ee);Oe.length===2?D(N,w,C):N.projectionMatrix.copy(w.projectionMatrix),pe(Q,N,Ee)};function pe(Q,oe,ne){ne===null?Q.matrix.copy(oe.matrixWorld):(Q.matrix.copy(ne.matrixWorld),Q.matrix.invert(),Q.matrix.multiply(oe.matrixWorld)),Q.matrix.decompose(Q.position,Q.quaternion,Q.scale),Q.updateMatrixWorld(!0),Q.projectionMatrix.copy(oe.projectionMatrix),Q.projectionMatrixInverse.copy(oe.projectionMatrixInverse),Q.isPerspectiveCamera&&(Q.fov=eo*2*Math.atan(1/Q.projectionMatrix.elements[5]),Q.zoom=1)}this.getCamera=function(){return N},this.getFoveation=function(){if(!(f===null&&d===null))return l},this.setFoveation=function(Q){l=Q,f!==null&&(f.fixedFoveation=Q),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=Q)},this.hasDepthSensing=function(){return p.texture!==null},this.getDepthSensingMesh=function(){return p.getMesh(N)},this.getCameraTexture=function(Q){return m[Q]};let Ve=null;function He(Q,oe){if(u=oe.getViewerPose(c||a),g=oe,u!==null){const ne=u.views;d!==null&&(e.setRenderTargetFramebuffer(M,d.framebuffer),e.setRenderTarget(M));let Ee=!1;ne.length!==N.cameras.length&&(N.cameras.length=0,Ee=!0);for(let Me=0;Me<ne.length;Me++){const ze=ne[Me];let qe=null;if(d!==null)qe=d.getViewport(ze);else{const $=h.getViewSubImage(f,ze);qe=$.viewport,Me===0&&(e.setRenderTargetTextures(M,$.colorTexture,$.depthStencilTexture),e.setRenderTarget(M))}let Ye=L[Me];Ye===void 0&&(Ye=new di,Ye.layers.enable(Me),Ye.viewport=new kt,L[Me]=Ye),Ye.matrix.fromArray(ze.transform.matrix),Ye.matrix.decompose(Ye.position,Ye.quaternion,Ye.scale),Ye.projectionMatrix.fromArray(ze.projectionMatrix),Ye.projectionMatrixInverse.copy(Ye.projectionMatrix).invert(),Ye.viewport.set(qe.x,qe.y,qe.width,qe.height),Me===0&&(N.matrix.copy(Ye.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale)),Ee===!0&&N.cameras.push(Ye)}const Oe=i.enabledFeatures;if(Oe&&Oe.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&_){h=n.getBinding();const Me=h.getDepthInformation(ne[0]);Me&&Me.isValid&&Me.texture&&p.init(Me,i.renderState)}if(Oe&&Oe.includes("camera-access")&&_){e.state.unbindTexture(),h=n.getBinding();for(let Me=0;Me<ne.length;Me++){const ze=ne[Me].camera;if(ze){let qe=m[ze];qe||(qe=new Rm,m[ze]=qe);const Ye=h.getCameraImage(ze);qe.sourceTexture=Ye}}}}for(let ne=0;ne<E.length;ne++){const Ee=T[ne],Oe=E[ne];Ee!==null&&Oe!==void 0&&Oe.update(Ee,oe,c||a)}Ve&&Ve(Q,oe),oe.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:oe}),g=null}const Le=new Lm;Le.setAnimationLoop(He),this.setAnimationLoop=function(Q){Ve=Q},this.dispose=function(){}}}const gy=new Yt,km=new je;km.set(-1,0,0,0,1,0,0,0,1);function _y(r,e){function t(p,m){p.matrixAutoUpdate===!0&&p.updateMatrix(),m.value.copy(p.matrix)}function n(p,m){m.color.getRGB(p.fogColor.value,Cm(r)),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function i(p,m,b,y,M){m.isNodeMaterial?m.uniformsNeedUpdate=!1:m.isMeshBasicMaterial?s(p,m):m.isMeshLambertMaterial?(s(p,m),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)):m.isMeshToonMaterial?(s(p,m),h(p,m)):m.isMeshPhongMaterial?(s(p,m),u(p,m),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)):m.isMeshStandardMaterial?(s(p,m),f(p,m),m.isMeshPhysicalMaterial&&d(p,m,M)):m.isMeshMatcapMaterial?(s(p,m),g(p,m)):m.isMeshDepthMaterial?s(p,m):m.isMeshDistanceMaterial?(s(p,m),_(p,m)):m.isMeshNormalMaterial?s(p,m):m.isLineBasicMaterial?(a(p,m),m.isLineDashedMaterial&&o(p,m)):m.isPointsMaterial?l(p,m,b,y):m.isSpriteMaterial?c(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map,t(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,t(m.alphaMap,p.alphaMapTransform)),m.bumpMap&&(p.bumpMap.value=m.bumpMap,t(m.bumpMap,p.bumpMapTransform),p.bumpScale.value=m.bumpScale,m.side===Vn&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,t(m.normalMap,p.normalMapTransform),p.normalScale.value.copy(m.normalScale),m.side===Vn&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,t(m.displacementMap,p.displacementMapTransform),p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,p.emissiveMapTransform)),m.specularMap&&(p.specularMap.value=m.specularMap,t(m.specularMap,p.specularMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);const b=e.get(m),y=b.envMap,M=b.envMapRotation;y&&(p.envMap.value=y,p.envMapRotation.value.setFromMatrix4(gy.makeRotationFromEuler(M)).transpose(),y.isCubeTexture&&y.isRenderTargetTexture===!1&&p.envMapRotation.value.premultiply(km),p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap&&(p.lightMap.value=m.lightMap,p.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,p.lightMapTransform)),m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,p.aoMapTransform))}function a(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,m.map&&(p.map.value=m.map,t(m.map,p.mapTransform))}function o(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function l(p,m,b,y){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*b,p.scale.value=y*.5,m.map&&(p.map.value=m.map,t(m.map,p.uvTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,t(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function c(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map,t(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,t(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function u(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function f(p,m){p.metalness.value=m.metalness,m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,p.metalnessMapTransform)),p.roughness.value=m.roughness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,p.roughnessMapTransform)),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,b){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Vn&&p.clearcoatNormalScale.value.negate())),m.dispersion>0&&(p.dispersion.value=m.dispersion),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=b.texture,p.transmissionSamplerSize.value.set(b.width,b.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(p.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(p.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,p.specularIntensityMapTransform))}function g(p,m){m.matcap&&(p.matcap.value=m.matcap)}function _(p,m){const b=e.get(m).light;p.referencePosition.value.setFromMatrixPosition(b.matrixWorld),p.nearDistance.value=b.shadow.camera.near,p.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function xy(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(M,E){const T=E.program;n.uniformBlockBinding(M,T)}function c(M,E){let T=i[M.id];T===void 0&&(p(M),T=u(M),i[M.id]=T,M.addEventListener("dispose",b));const A=E.program;n.updateUBOMapping(M,A);const v=e.render.frame;s[M.id]!==v&&(f(M),s[M.id]=v)}function u(M){const E=h();M.__bindingPointIndex=E;const T=r.createBuffer(),A=M.__size,v=M.usage;return r.bindBuffer(r.UNIFORM_BUFFER,T),r.bufferData(r.UNIFORM_BUFFER,A,v),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,T),T}function h(){for(let M=0;M<o;M++)if(a.indexOf(M)===-1)return a.push(M),M;return mt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(M){const E=i[M.id],T=M.uniforms,A=M.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let v=0,w=T.length;v<w;v++){const C=T[v];if(Array.isArray(C))for(let L=0,N=C.length;L<N;L++)d(C[L],v,L,A);else d(C,v,0,A)}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(M,E,T,A){if(_(M,E,T,A)===!0){const v=M.__offset,w=M.value;if(Array.isArray(w)){let C=0;for(let L=0;L<w.length;L++){const N=w[L],Y=m(N);g(N,M.__data,C),typeof N!="number"&&typeof N!="boolean"&&!N.isMatrix3&&!ArrayBuffer.isView(N)&&(C+=Y.storage/Float32Array.BYTES_PER_ELEMENT)}}else g(w,M.__data,0);r.bufferSubData(r.UNIFORM_BUFFER,v,M.__data)}}function g(M,E,T){typeof M=="number"||typeof M=="boolean"?E[0]=M:M.isMatrix3?(E[0]=M.elements[0],E[1]=M.elements[1],E[2]=M.elements[2],E[3]=0,E[4]=M.elements[3],E[5]=M.elements[4],E[6]=M.elements[5],E[7]=0,E[8]=M.elements[6],E[9]=M.elements[7],E[10]=M.elements[8],E[11]=0):ArrayBuffer.isView(M)?E.set(new M.constructor(M.buffer,M.byteOffset,E.length)):M.toArray(E,T)}function _(M,E,T,A){const v=M.value,w=E+"_"+T;if(A[w]===void 0)return typeof v=="number"||typeof v=="boolean"?A[w]=v:ArrayBuffer.isView(v)?A[w]=v.slice():A[w]=v.clone(),!0;{const C=A[w];if(typeof v=="number"||typeof v=="boolean"){if(C!==v)return A[w]=v,!0}else{if(ArrayBuffer.isView(v))return!0;if(C.equals(v)===!1)return C.copy(v),!0}}return!1}function p(M){const E=M.uniforms;let T=0;const A=16;for(let w=0,C=E.length;w<C;w++){const L=Array.isArray(E[w])?E[w]:[E[w]];for(let N=0,Y=L.length;N<Y;N++){const H=L[N],O=Array.isArray(H.value)?H.value:[H.value];for(let z=0,I=O.length;z<I;z++){const q=O[z],j=m(q),D=T%A,se=D%j.boundary,pe=D+se;T+=se,pe!==0&&A-pe<j.storage&&(T+=A-pe),H.__data=new Float32Array(j.storage/Float32Array.BYTES_PER_ELEMENT),H.__offset=T,T+=j.storage}}}const v=T%A;return v>0&&(T+=A-v),M.__size=T,M.__cache={},this}function m(M){const E={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(E.boundary=4,E.storage=4):M.isVector2?(E.boundary=8,E.storage=8):M.isVector3||M.isColor?(E.boundary=16,E.storage=12):M.isVector4?(E.boundary=16,E.storage=16):M.isMatrix3?(E.boundary=48,E.storage=48):M.isMatrix4?(E.boundary=64,E.storage=64):M.isTexture?$e("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(M)?(E.boundary=16,E.storage=M.byteLength):$e("WebGLRenderer: Unsupported uniform value type.",M),E}function b(M){const E=M.target;E.removeEventListener("dispose",b);const T=a.indexOf(E.__bindingPointIndex);a.splice(T,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function y(){for(const M in i)r.deleteBuffer(i[M]);a=[],i={},s={}}return{bind:l,update:c,dispose:y}}const vy=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Ri=null;function My(){return Ri===null&&(Ri=new cx(vy,16,16,ls,sr),Ri.name="DFG_LUT",Ri.minFilter=yn,Ri.magFilter=yn,Ri.wrapS=Ji,Ri.wrapT=Ji,Ri.generateMipmaps=!1,Ri.needsUpdate=!0),Ri}class Sy{constructor(e={}){const{canvas:t=T_(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:f=!1,outputBufferType:d=hi}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=a;const _=d,p=new Set([yf,bf,Sf]),m=new Set([hi,Gi,Ja,Qa,vf,Mf]),b=new Uint32Array(4),y=new Int32Array(4),M=new X;let E=null,T=null;const A=[],v=[];let w=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Bi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const C=this;let L=!1,N=null,Y=null,H=null,O=null;this._outputColorSpace=ci;let z=0,I=0,q=null,j=-1,D=null;const se=new kt,pe=new kt;let Ve=null;const He=new ht(0);let Le=0,Q=t.width,oe=t.height,ne=1,Ee=null,Oe=null;const Te=new kt(0,0,Q,oe),tt=new kt(0,0,Q,oe);let Me=!1;const ze=new wm;let qe=!1,Ye=!1;const $=new Yt,lt=new X,We=new kt,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ge=!1;function Ze(){return q===null?ne:1}let F=n;function Ct(S,B){return t.getContext(S,B)}try{const S={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${_f}`),t.addEventListener("webglcontextlost",Be,!1),t.addEventListener("webglcontextrestored",ue,!1),t.addEventListener("webglcontextcreationerror",ke,!1),F===null){const B="webgl2";if(F=Ct(B,S),F===null)throw Ct(B)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(S){throw mt("WebGLRenderer: "+S.message),S}let Xe,R,x,k,V,K,ce,ae,J,ee,he,Ae,ge,me,fe,Pe,Ie,U,de,te,_e,xe,ie;function le(){Xe=new MS(F),Xe.init(),_e=new fy(F,Xe),R=new dS(F,Xe,e,_e),x=new cy(F,Xe),R.reversedDepthBuffer&&f&&x.buffers.depth.setReversed(!0),Y=F.createFramebuffer(),H=F.createFramebuffer(),O=F.createFramebuffer(),k=new yS(F),V=new Zb,K=new uy(F,Xe,x,V,R,_e,k),ce=new vS(C),ae=new Ax(F),xe=new uS(F,ae),J=new SS(F,ae,k,xe),ee=new TS(F,J,ae,xe,k),U=new ES(F,R,K),fe=new hS(V),he=new $b(C,ce,Xe,R,xe,fe),Ae=new _y(C,V),ge=new jb,me=new iy(Xe),Ie=new cS(C,ce,x,ee,g,l),Pe=new ly(C,ee,R),ie=new xy(F,k,R,x),de=new fS(F,Xe,k),te=new bS(F,Xe,k),k.programs=he.programs,C.capabilities=R,C.extensions=Xe,C.properties=V,C.renderLists=ge,C.shadowMap=Pe,C.state=x,C.info=k}le(),_!==hi&&(w=new AS(_,t.width,t.height,o,i,s));const re=new my(C,F);this.xr=re,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){const S=Xe.get("WEBGL_lose_context");S&&S.loseContext()},this.forceContextRestore=function(){const S=Xe.get("WEBGL_lose_context");S&&S.restoreContext()},this.getPixelRatio=function(){return ne},this.setPixelRatio=function(S){S!==void 0&&(ne=S,this.setSize(Q,oe,!1))},this.getSize=function(S){return S.set(Q,oe)},this.setSize=function(S,B,Z=!0){if(re.isPresenting){$e("WebGLRenderer: Can't change size while VR device is presenting.");return}Q=S,oe=B,t.width=Math.floor(S*ne),t.height=Math.floor(B*ne),Z===!0&&(t.style.width=S+"px",t.style.height=B+"px"),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,S,B)},this.getDrawingBufferSize=function(S){return S.set(Q*ne,oe*ne).floor()},this.setDrawingBufferSize=function(S,B,Z){Q=S,oe=B,ne=Z,t.width=Math.floor(S*Z),t.height=Math.floor(B*Z),this.setViewport(0,0,S,B)},this.setEffects=function(S){if(_===hi){mt("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(S){for(let B=0;B<S.length;B++)if(S[B].isOutputPass===!0){$e("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}w.setEffects(S||[])},this.getCurrentViewport=function(S){return S.copy(se)},this.getViewport=function(S){return S.copy(Te)},this.setViewport=function(S,B,Z,G){S.isVector4?Te.set(S.x,S.y,S.z,S.w):Te.set(S,B,Z,G),x.viewport(se.copy(Te).multiplyScalar(ne).round())},this.getScissor=function(S){return S.copy(tt)},this.setScissor=function(S,B,Z,G){S.isVector4?tt.set(S.x,S.y,S.z,S.w):tt.set(S,B,Z,G),x.scissor(pe.copy(tt).multiplyScalar(ne).round())},this.getScissorTest=function(){return Me},this.setScissorTest=function(S){x.setScissorTest(Me=S)},this.setOpaqueSort=function(S){Ee=S},this.setTransparentSort=function(S){Oe=S},this.getClearColor=function(S){return S.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor(...arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha(...arguments)},this.clear=function(S=!0,B=!0,Z=!0){let G=0;if(S){let W=!1;if(q!==null){const ve=q.texture.format;W=p.has(ve)}if(W){const ve=q.texture.type,Se=m.has(ve),ye=Ie.getClearColor(),De=Ie.getClearAlpha(),Ne=ye.r,Je=ye.g,nt=ye.b;Se?(b[0]=Ne,b[1]=Je,b[2]=nt,b[3]=De,F.clearBufferuiv(F.COLOR,0,b)):(y[0]=Ne,y[1]=Je,y[2]=nt,y[3]=De,F.clearBufferiv(F.COLOR,0,y))}else G|=F.COLOR_BUFFER_BIT}B&&(G|=F.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),Z&&(G|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G!==0&&F.clear(G)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(S){S.setRenderer(this),N=S},this.dispose=function(){t.removeEventListener("webglcontextlost",Be,!1),t.removeEventListener("webglcontextrestored",ue,!1),t.removeEventListener("webglcontextcreationerror",ke,!1),Ie.dispose(),ge.dispose(),me.dispose(),V.dispose(),ce.dispose(),ee.dispose(),xe.dispose(),ie.dispose(),he.dispose(),re.dispose(),re.removeEventListener("sessionstart",Dt),re.removeEventListener("sessionend",St),ut.stop()};function Be(S){S.preventDefault(),Dd("WebGLRenderer: Context Lost."),L=!0}function ue(){Dd("WebGLRenderer: Context Restored."),L=!1;const S=k.autoReset,B=Pe.enabled,Z=Pe.autoUpdate,G=Pe.needsUpdate,W=Pe.type;le(),k.autoReset=S,Pe.enabled=B,Pe.autoUpdate=Z,Pe.needsUpdate=G,Pe.type=W}function ke(S){mt("WebGLRenderer: A WebGL context could not be created. Reason: ",S.statusMessage)}function Ce(S){const B=S.target;B.removeEventListener("dispose",Ce),Ke(B)}function Ke(S){qt(S),V.remove(S)}function qt(S){const B=V.get(S).programs;B!==void 0&&(B.forEach(function(Z){he.releaseProgram(Z)}),S.isShaderMaterial&&he.releaseShaderCache(S))}this.renderBufferDirect=function(S,B,Z,G,W,ve){B===null&&(B=Qe);const Se=W.isMesh&&W.matrixWorld.determinantAffine()<0,ye=sn(S,B,Z,G,W);x.setMaterial(G,Se);let De=Z.index,Ne=1;if(G.wireframe===!0){if(De=J.getWireframeAttribute(Z),De===void 0)return;Ne=2}const Je=Z.drawRange,nt=Z.attributes.position;let Ue=Je.start*Ne,Mt=(Je.start+Je.count)*Ne;ve!==null&&(Ue=Math.max(Ue,ve.start*Ne),Mt=Math.min(Mt,(ve.start+ve.count)*Ne)),De!==null?(Ue=Math.max(Ue,0),Mt=Math.min(Mt,De.count)):nt!=null&&(Ue=Math.max(Ue,0),Mt=Math.min(Mt,nt.count));const Vt=Mt-Ue;if(Vt<0||Vt===1/0)return;xe.setup(W,G,ye,Z,De);let Bt,bt=de;if(De!==null&&(Bt=ae.get(De),bt=te,bt.setIndex(Bt)),W.isMesh)G.wireframe===!0?(x.setLineWidth(G.wireframeLinewidth*Ze()),bt.setMode(F.LINES)):bt.setMode(F.TRIANGLES);else if(W.isLine){let mn=G.linewidth;mn===void 0&&(mn=1),x.setLineWidth(mn*Ze()),W.isLineSegments?bt.setMode(F.LINES):W.isLineLoop?bt.setMode(F.LINE_LOOP):bt.setMode(F.LINE_STRIP)}else W.isPoints?bt.setMode(F.POINTS):W.isSprite&&bt.setMode(F.TRIANGLES);if(W.isBatchedMesh)if(Xe.get("WEBGL_multi_draw"))bt.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const mn=W._multiDrawStarts,we=W._multiDrawCounts,Xn=W._multiDrawCount,pt=De?ae.get(De).bytesPerElement:1,ai=V.get(G).currentProgram.getUniforms();for(let wi=0;wi<Xn;wi++)ai.setValue(F,"_gl_DrawID",wi),bt.render(mn[wi]/pt,we[wi])}else if(W.isInstancedMesh)bt.renderInstances(Ue,Vt,W.count);else if(Z.isInstancedBufferGeometry){const mn=Z._maxInstanceCount!==void 0?Z._maxInstanceCount:1/0,we=Math.min(Z.instanceCount,mn);bt.renderInstances(Ue,Vt,we)}else bt.render(Ue,Vt)};function rt(S,B,Z){S.transparent===!0&&S.side===Ki&&S.forceSinglePass===!1?(S.side=Vn,S.needsUpdate=!0,Ot(S,B,Z),S.side=Lr,S.needsUpdate=!0,Ot(S,B,Z),S.side=Ki):Ot(S,B,Z)}this.compile=function(S,B,Z=null){Z===null&&(Z=S),T=me.get(Z),T.init(B),v.push(T),Z.traverseVisible(function(W){W.isLight&&W.layers.test(B.layers)&&(T.pushLight(W),W.castShadow&&T.pushShadow(W))}),S!==Z&&S.traverseVisible(function(W){W.isLight&&W.layers.test(B.layers)&&(T.pushLight(W),W.castShadow&&T.pushShadow(W))}),T.setupLights();const G=new Set;return S.traverse(function(W){if(!(W.isMesh||W.isPoints||W.isLine||W.isSprite))return;const ve=W.material;if(ve)if(Array.isArray(ve))for(let Se=0;Se<ve.length;Se++){const ye=ve[Se];rt(ye,Z,W),G.add(ye)}else rt(ve,Z,W),G.add(ve)}),T=v.pop(),G},this.compileAsync=function(S,B,Z=null){const G=this.compile(S,B,Z);return new Promise(W=>{function ve(){if(G.forEach(function(Se){V.get(Se).currentProgram.isReady()&&G.delete(Se)}),G.size===0){W(S);return}setTimeout(ve,10)}Xe.get("KHR_parallel_shader_compile")!==null?ve():setTimeout(ve,10)})};let Pt=null;function rn(S){Pt&&Pt(S)}function Dt(){ut.stop()}function St(){ut.start()}const ut=new Lm;ut.setAnimationLoop(rn),typeof self<"u"&&ut.setContext(self),this.setAnimationLoop=function(S){Pt=S,re.setAnimationLoop(S),S===null?ut.stop():ut.start()},re.addEventListener("sessionstart",Dt),re.addEventListener("sessionend",St),this.render=function(S,B){if(B!==void 0&&B.isCamera!==!0){mt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;N!==null&&N.renderStart(S,B);const Z=re.enabled===!0&&re.isPresenting===!0,G=w!==null&&(q===null||Z)&&w.begin(C,q);if(S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),re.enabled===!0&&re.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(re.cameraAutoUpdate===!0&&re.updateCamera(B),B=re.getCamera()),S.isScene===!0&&S.onBeforeRender(C,S,B,q),T=me.get(S,v.length),T.init(B),T.state.textureUnits=K.getTextureUnits(),v.push(T),$.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),ze.setFromProjectionMatrix($,Fi,B.reversedDepth),Ye=this.localClippingEnabled,qe=fe.init(this.clippingPlanes,Ye),E=ge.get(S,A.length),E.init(),A.push(E),re.enabled===!0&&re.isPresenting===!0){const Se=C.xr.getDepthSensingMesh();Se!==null&&Tn(Se,B,-1/0,C.sortObjects)}Tn(S,B,0,C.sortObjects),E.finish(),C.sortObjects===!0&&E.sort(Ee,Oe,B.reversedDepth),Ge=re.enabled===!1||re.isPresenting===!1||re.hasDepthSensing()===!1,Ge&&Ie.addToRenderList(E,S),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),qe===!0&&fe.beginShadows();const W=T.state.shadowsArray;if(Pe.render(W,S,B),qe===!0&&fe.endShadows(),(G&&w.hasRenderPass())===!1){const Se=E.opaque,ye=E.transmissive;if(T.setupLights(),B.isArrayCamera){const De=B.cameras;if(ye.length>0)for(let Ne=0,Je=De.length;Ne<Je;Ne++){const nt=De[Ne];pn(Se,ye,S,nt)}Ge&&Ie.render(S);for(let Ne=0,Je=De.length;Ne<Je;Ne++){const nt=De[Ne];wt(E,S,nt,nt.viewport)}}else ye.length>0&&pn(Se,ye,S,B),Ge&&Ie.render(S),wt(E,S,B)}q!==null&&I===0&&(K.updateMultisampleRenderTarget(q),K.updateRenderTargetMipmap(q)),G&&w.end(C),S.isScene===!0&&S.onAfterRender(C,S,B),xe.resetDefaultState(),j=-1,D=null,v.pop(),v.length>0?(T=v[v.length-1],K.setTextureUnits(T.state.textureUnits),qe===!0&&fe.setGlobalState(C.clippingPlanes,T.state.camera)):T=null,A.pop(),A.length>0?E=A[A.length-1]:E=null,N!==null&&N.renderEnd()};function Tn(S,B,Z,G){if(S.visible===!1)return;if(S.layers.test(B.layers)){if(S.isGroup)Z=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(B);else if(S.isLightProbeGrid)T.pushLightProbeGrid(S);else if(S.isLight)T.pushLight(S),S.castShadow&&T.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||ze.intersectsSprite(S)){G&&We.setFromMatrixPosition(S.matrixWorld).applyMatrix4($);const Se=ee.update(S),ye=S.material;ye.visible&&E.push(S,Se,ye,Z,We.z,null)}}else if((S.isMesh||S.isLine||S.isPoints)&&(!S.frustumCulled||ze.intersectsObject(S))){const Se=ee.update(S),ye=S.material;if(G&&(S.boundingSphere!==void 0?(S.boundingSphere===null&&S.computeBoundingSphere(),We.copy(S.boundingSphere.center)):(Se.boundingSphere===null&&Se.computeBoundingSphere(),We.copy(Se.boundingSphere.center)),We.applyMatrix4(S.matrixWorld).applyMatrix4($)),Array.isArray(ye)){const De=Se.groups;for(let Ne=0,Je=De.length;Ne<Je;Ne++){const nt=De[Ne],Ue=ye[nt.materialIndex];Ue&&Ue.visible&&E.push(S,Se,Ue,Z,We.z,nt)}}else ye.visible&&E.push(S,Se,ye,Z,We.z,null)}}const ve=S.children;for(let Se=0,ye=ve.length;Se<ye;Se++)Tn(ve[Se],B,Z,G)}function wt(S,B,Z,G){const{opaque:W,transmissive:ve,transparent:Se}=S;T.setupLightsView(Z),qe===!0&&fe.setGlobalState(C.clippingPlanes,Z),G&&x.viewport(se.copy(G)),W.length>0&&wn(W,B,Z),ve.length>0&&wn(ve,B,Z),Se.length>0&&wn(Se,B,Z),x.buffers.depth.setTest(!0),x.buffers.depth.setMask(!0),x.buffers.color.setMask(!0),x.setPolygonOffset(!1)}function pn(S,B,Z,G){if((Z.isScene===!0?Z.overrideMaterial:null)!==null)return;if(T.state.transmissionRenderTarget[G.id]===void 0){const Ue=Xe.has("EXT_color_buffer_half_float")||Xe.has("EXT_color_buffer_float");T.state.transmissionRenderTarget[G.id]=new ki(1,1,{generateMipmaps:!0,type:Ue?sr:hi,minFilter:Zr,samples:Math.max(4,R.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ft.workingColorSpace})}const ve=T.state.transmissionRenderTarget[G.id],Se=G.viewport||se;ve.setSize(Se.z*C.transmissionResolutionScale,Se.w*C.transmissionResolutionScale);const ye=C.getRenderTarget(),De=C.getActiveCubeFace(),Ne=C.getActiveMipmapLevel();C.setRenderTarget(ve),C.getClearColor(He),Le=C.getClearAlpha(),Le<1&&C.setClearColor(16777215,.5),C.clear(),Ge&&Ie.render(Z);const Je=C.toneMapping;C.toneMapping=Bi;const nt=G.viewport;if(G.viewport!==void 0&&(G.viewport=void 0),T.setupLightsView(G),qe===!0&&fe.setGlobalState(C.clippingPlanes,G),wn(S,Z,G),K.updateMultisampleRenderTarget(ve),K.updateRenderTargetMipmap(ve),Xe.has("WEBGL_multisampled_render_to_texture")===!1){let Ue=!1;for(let Mt=0,Vt=B.length;Mt<Vt;Mt++){const Bt=B[Mt],{object:bt,geometry:mn,material:we,group:Xn}=Bt;if(we.side===Ki&&bt.layers.test(G.layers)){const pt=we.side;we.side=Vn,we.needsUpdate=!0,$t(bt,Z,G,mn,we,Xn),we.side=pt,we.needsUpdate=!0,Ue=!0}}Ue===!0&&(K.updateMultisampleRenderTarget(ve),K.updateRenderTargetMipmap(ve))}C.setRenderTarget(ye,De,Ne),C.setClearColor(He,Le),nt!==void 0&&(G.viewport=nt),C.toneMapping=Je}function wn(S,B,Z){const G=B.isScene===!0?B.overrideMaterial:null;for(let W=0,ve=S.length;W<ve;W++){const Se=S[W],{object:ye,geometry:De,group:Ne}=Se;let Je=Se.material;Je.allowOverride===!0&&G!==null&&(Je=G),ye.layers.test(Z.layers)&&$t(ye,B,Z,De,Je,Ne)}}function $t(S,B,Z,G,W,ve){S.onBeforeRender(C,B,Z,G,W,ve),S.modelViewMatrix.multiplyMatrices(Z.matrixWorldInverse,S.matrixWorld),S.normalMatrix.getNormalMatrix(S.modelViewMatrix),W.onBeforeRender(C,B,Z,G,S,ve),W.transparent===!0&&W.side===Ki&&W.forceSinglePass===!1?(W.side=Vn,W.needsUpdate=!0,C.renderBufferDirect(Z,B,G,W,S,ve),W.side=Lr,W.needsUpdate=!0,C.renderBufferDirect(Z,B,G,W,S,ve),W.side=Ki):C.renderBufferDirect(Z,B,G,W,S,ve),S.onAfterRender(C,B,Z,G,W,ve)}function Ot(S,B,Z){B.isScene!==!0&&(B=Qe);const G=V.get(S),W=T.state.lights,ve=T.state.shadowsArray,Se=W.state.version,ye=he.getParameters(S,W.state,ve,B,Z,T.state.lightProbeGridArray),De=he.getProgramCacheKey(ye);let Ne=G.programs;G.environment=S.isMeshStandardMaterial||S.isMeshLambertMaterial||S.isMeshPhongMaterial?B.environment:null,G.fog=B.fog;const Je=S.isMeshStandardMaterial||S.isMeshLambertMaterial&&!S.envMap||S.isMeshPhongMaterial&&!S.envMap;G.envMap=ce.get(S.envMap||G.environment,Je),G.envMapRotation=G.environment!==null&&S.envMap===null?B.environmentRotation:S.envMapRotation,Ne===void 0&&(S.addEventListener("dispose",Ce),Ne=new Map,G.programs=Ne);let nt=Ne.get(De);if(nt!==void 0){if(G.currentProgram===nt&&G.lightsStateVersion===Se)return Ti(S,ye),nt}else ye.uniforms=he.getUniforms(S),N!==null&&S.isNodeMaterial&&N.build(S,Z,ye),S.onBeforeCompile(ye,C),nt=he.acquireProgram(ye,De),Ne.set(De,nt),G.uniforms=ye.uniforms;const Ue=G.uniforms;return(!S.isShaderMaterial&&!S.isRawShaderMaterial||S.clipping===!0)&&(Ue.clippingPlanes=fe.uniform),Ti(S,ye),G.needsLights=si(S),G.lightsStateVersion=Se,G.needsLights&&(Ue.ambientLightColor.value=W.state.ambient,Ue.lightProbe.value=W.state.probe,Ue.directionalLights.value=W.state.directional,Ue.directionalLightShadows.value=W.state.directionalShadow,Ue.spotLights.value=W.state.spot,Ue.spotLightShadows.value=W.state.spotShadow,Ue.rectAreaLights.value=W.state.rectArea,Ue.ltc_1.value=W.state.rectAreaLTC1,Ue.ltc_2.value=W.state.rectAreaLTC2,Ue.pointLights.value=W.state.point,Ue.pointLightShadows.value=W.state.pointShadow,Ue.hemisphereLights.value=W.state.hemi,Ue.directionalShadowMatrix.value=W.state.directionalShadowMatrix,Ue.spotLightMatrix.value=W.state.spotLightMatrix,Ue.spotLightMap.value=W.state.spotLightMap,Ue.pointShadowMatrix.value=W.state.pointShadowMatrix),G.lightProbeGrid=T.state.lightProbeGridArray.length>0,G.currentProgram=nt,G.uniformsList=null,nt}function Jt(S){if(S.uniformsList===null){const B=S.currentProgram.getUniforms();S.uniformsList=al.seqWithValue(B.seq,S.uniforms)}return S.uniformsList}function Ti(S,B){const Z=V.get(S);Z.outputColorSpace=B.outputColorSpace,Z.batching=B.batching,Z.batchingColor=B.batchingColor,Z.instancing=B.instancing,Z.instancingColor=B.instancingColor,Z.instancingMorph=B.instancingMorph,Z.skinning=B.skinning,Z.morphTargets=B.morphTargets,Z.morphNormals=B.morphNormals,Z.morphColors=B.morphColors,Z.morphTargetsCount=B.morphTargetsCount,Z.numClippingPlanes=B.numClippingPlanes,Z.numIntersection=B.numClipIntersection,Z.vertexAlphas=B.vertexAlphas,Z.vertexTangents=B.vertexTangents,Z.toneMapping=B.toneMapping}function ds(S,B){if(S.length===0)return null;if(S.length===1)return S[0].texture!==null?S[0]:null;M.setFromMatrixPosition(B.matrixWorld);for(let Z=0,G=S.length;Z<G;Z++){const W=S[Z];if(W.texture!==null&&W.boundingBox.containsPoint(M))return W}return null}function sn(S,B,Z,G,W){B.isScene!==!0&&(B=Qe),K.resetTextureUnits();const ve=B.fog,Se=G.isMeshStandardMaterial||G.isMeshLambertMaterial||G.isMeshPhongMaterial?B.environment:null,ye=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:ft.workingColorSpace,De=G.isMeshStandardMaterial||G.isMeshLambertMaterial&&!G.envMap||G.isMeshPhongMaterial&&!G.envMap,Ne=ce.get(G.envMap||Se,De),Je=G.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,nt=!!Z.attributes.tangent&&(!!G.normalMap||G.anisotropy>0),Ue=!!Z.morphAttributes.position,Mt=!!Z.morphAttributes.normal,Vt=!!Z.morphAttributes.color;let Bt=Bi;G.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(Bt=C.toneMapping);const bt=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,mn=bt!==void 0?bt.length:0,we=V.get(G),Xn=T.state.lights;if(qe===!0&&(Ye===!0||S!==D)){const At=S===D&&G.id===j;fe.setState(G,S,At)}let pt=!1;G.version===we.__version?(we.needsLights&&we.lightsStateVersion!==Xn.state.version||we.outputColorSpace!==ye||W.isBatchedMesh&&we.batching===!1||!W.isBatchedMesh&&we.batching===!0||W.isBatchedMesh&&we.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&we.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&we.instancing===!1||!W.isInstancedMesh&&we.instancing===!0||W.isSkinnedMesh&&we.skinning===!1||!W.isSkinnedMesh&&we.skinning===!0||W.isInstancedMesh&&we.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&we.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&we.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&we.instancingMorph===!1&&W.morphTexture!==null||we.envMap!==Ne||G.fog===!0&&we.fog!==ve||we.numClippingPlanes!==void 0&&(we.numClippingPlanes!==fe.numPlanes||we.numIntersection!==fe.numIntersection)||we.vertexAlphas!==Je||we.vertexTangents!==nt||we.morphTargets!==Ue||we.morphNormals!==Mt||we.morphColors!==Vt||we.toneMapping!==Bt||we.morphTargetsCount!==mn||!!we.lightProbeGrid!=T.state.lightProbeGridArray.length>0)&&(pt=!0):(pt=!0,we.__version=G.version);let ai=we.currentProgram;pt===!0&&(ai=Ot(G,B,W),N&&G.isNodeMaterial&&N.onUpdateProgram(G,ai,we));let wi=!1,lr=!1,hs=!1;const yt=ai.getUniforms(),Ht=we.uniforms;if(x.useProgram(ai.program)&&(wi=!0,lr=!0,hs=!0),G.id!==j&&(j=G.id,lr=!0),we.needsLights){const At=ds(T.state.lightProbeGridArray,W);we.lightProbeGrid!==At&&(we.lightProbeGrid=At,lr=!0)}if(wi||D!==S){x.buffers.depth.getReversed()&&S.reversedDepth!==!0&&(S._reversedDepth=!0,S.updateProjectionMatrix()),yt.setValue(F,"projectionMatrix",S.projectionMatrix),yt.setValue(F,"viewMatrix",S.matrixWorldInverse);const ur=yt.map.cameraPosition;ur!==void 0&&ur.setValue(F,lt.setFromMatrixPosition(S.matrixWorld)),R.logarithmicDepthBuffer&&yt.setValue(F,"logDepthBufFC",2/(Math.log(S.far+1)/Math.LN2)),(G.isMeshPhongMaterial||G.isMeshToonMaterial||G.isMeshLambertMaterial||G.isMeshBasicMaterial||G.isMeshStandardMaterial||G.isShaderMaterial)&&yt.setValue(F,"isOrthographic",S.isOrthographicCamera===!0),D!==S&&(D=S,lr=!0,hs=!0)}if(we.needsLights&&(Xn.state.directionalShadowMap.length>0&&yt.setValue(F,"directionalShadowMap",Xn.state.directionalShadowMap,K),Xn.state.spotShadowMap.length>0&&yt.setValue(F,"spotShadowMap",Xn.state.spotShadowMap,K),Xn.state.pointShadowMap.length>0&&yt.setValue(F,"pointShadowMap",Xn.state.pointShadowMap,K)),W.isSkinnedMesh){yt.setOptional(F,W,"bindMatrix"),yt.setOptional(F,W,"bindMatrixInverse");const At=W.skeleton;At&&(At.boneTexture===null&&At.computeBoneTexture(),yt.setValue(F,"boneTexture",At.boneTexture,K))}W.isBatchedMesh&&(yt.setOptional(F,W,"batchingTexture"),yt.setValue(F,"batchingTexture",W._matricesTexture,K),yt.setOptional(F,W,"batchingIdTexture"),yt.setValue(F,"batchingIdTexture",W._indirectTexture,K),yt.setOptional(F,W,"batchingColorTexture"),W._colorsTexture!==null&&yt.setValue(F,"batchingColorTexture",W._colorsTexture,K));const cr=Z.morphAttributes;if((cr.position!==void 0||cr.normal!==void 0||cr.color!==void 0)&&U.update(W,Z,ai),(lr||we.receiveShadow!==W.receiveShadow)&&(we.receiveShadow=W.receiveShadow,yt.setValue(F,"receiveShadow",W.receiveShadow)),(G.isMeshStandardMaterial||G.isMeshLambertMaterial||G.isMeshPhongMaterial)&&G.envMap===null&&B.environment!==null&&(Ht.envMapIntensity.value=B.environmentIntensity),Ht.dfgLUT!==void 0&&(Ht.dfgLUT.value=My()),lr){if(yt.setValue(F,"toneMappingExposure",C.toneMappingExposure),we.needsLights&&Gt(Ht,hs),ve&&G.fog===!0&&Ae.refreshFogUniforms(Ht,ve),Ae.refreshMaterialUniforms(Ht,G,ne,oe,T.state.transmissionRenderTarget[S.id]),we.needsLights&&we.lightProbeGrid){const At=we.lightProbeGrid;Ht.probesSH.value=At.texture,Ht.probesMin.value.copy(At.boundingBox.min),Ht.probesMax.value.copy(At.boundingBox.max),Ht.probesResolution.value.copy(At.resolution)}al.upload(F,Jt(we),Ht,K)}if(G.isShaderMaterial&&G.uniformsNeedUpdate===!0&&(al.upload(F,Jt(we),Ht,K),G.uniformsNeedUpdate=!1),G.isSpriteMaterial&&yt.setValue(F,"center",W.center),yt.setValue(F,"modelViewMatrix",W.modelViewMatrix),yt.setValue(F,"normalMatrix",W.normalMatrix),yt.setValue(F,"modelMatrix",W.matrixWorld),G.uniformsGroups!==void 0){const At=G.uniformsGroups;for(let ur=0,ps=At.length;ur<ps;ur++){const Uf=At[ur];ie.update(Uf,ai),ie.bind(Uf,ai)}}return ai}function Gt(S,B){S.ambientLightColor.needsUpdate=B,S.lightProbe.needsUpdate=B,S.directionalLights.needsUpdate=B,S.directionalLightShadows.needsUpdate=B,S.pointLights.needsUpdate=B,S.pointLightShadows.needsUpdate=B,S.spotLights.needsUpdate=B,S.spotLightShadows.needsUpdate=B,S.rectAreaLights.needsUpdate=B,S.hemisphereLights.needsUpdate=B}function si(S){return S.isMeshLambertMaterial||S.isMeshToonMaterial||S.isMeshPhongMaterial||S.isMeshStandardMaterial||S.isShadowMaterial||S.isShaderMaterial&&S.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return I},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(S,B,Z){const G=V.get(S);G.__autoAllocateDepthBuffer=S.resolveDepthBuffer===!1,G.__autoAllocateDepthBuffer===!1&&(G.__useRenderToTexture=!1),V.get(S.texture).__webglTexture=B,V.get(S.depthTexture).__webglTexture=G.__autoAllocateDepthBuffer?void 0:Z,G.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(S,B){const Z=V.get(S);Z.__webglFramebuffer=B,Z.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(S,B=0,Z=0){q=S,z=B,I=Z;let G=null,W=!1,ve=!1;if(S){const ye=V.get(S);if(ye.__useDefaultFramebuffer!==void 0){x.bindFramebuffer(F.FRAMEBUFFER,ye.__webglFramebuffer),se.copy(S.viewport),pe.copy(S.scissor),Ve=S.scissorTest,x.viewport(se),x.scissor(pe),x.setScissorTest(Ve),j=-1;return}else if(ye.__webglFramebuffer===void 0)K.setupRenderTarget(S);else if(ye.__hasExternalTextures)K.rebindTextures(S,V.get(S.texture).__webglTexture,V.get(S.depthTexture).__webglTexture);else if(S.depthBuffer){const Je=S.depthTexture;if(ye.__boundDepthTexture!==Je){if(Je!==null&&V.has(Je)&&(S.width!==Je.image.width||S.height!==Je.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");K.setupDepthRenderbuffer(S)}}const De=S.texture;(De.isData3DTexture||De.isDataArrayTexture||De.isCompressedArrayTexture)&&(ve=!0);const Ne=V.get(S).__webglFramebuffer;S.isWebGLCubeRenderTarget?(Array.isArray(Ne[B])?G=Ne[B][Z]:G=Ne[B],W=!0):S.samples>0&&K.useMultisampledRTT(S)===!1?G=V.get(S).__webglMultisampledFramebuffer:Array.isArray(Ne)?G=Ne[Z]:G=Ne,se.copy(S.viewport),pe.copy(S.scissor),Ve=S.scissorTest}else se.copy(Te).multiplyScalar(ne).floor(),pe.copy(tt).multiplyScalar(ne).floor(),Ve=Me;if(Z!==0&&(G=Y),x.bindFramebuffer(F.FRAMEBUFFER,G)&&x.drawBuffers(S,G),x.viewport(se),x.scissor(pe),x.setScissorTest(Ve),W){const ye=V.get(S.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+B,ye.__webglTexture,Z)}else if(ve){const ye=B;for(let De=0;De<S.textures.length;De++){const Ne=V.get(S.textures[De]);F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+De,Ne.__webglTexture,Z,ye)}}else if(S!==null&&Z!==0){const ye=V.get(S.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,ye.__webglTexture,Z)}j=-1},this.readRenderTargetPixels=function(S,B,Z,G,W,ve,Se,ye=0){if(!(S&&S.isWebGLRenderTarget)){mt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let De=V.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&Se!==void 0&&(De=De[Se]),De){x.bindFramebuffer(F.FRAMEBUFFER,De);try{const Ne=S.textures[ye],Je=Ne.format,nt=Ne.type;if(S.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+ye),!R.textureFormatReadable(Je)){mt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!R.textureTypeReadable(nt)){mt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=S.width-G&&Z>=0&&Z<=S.height-W&&F.readPixels(B,Z,G,W,_e.convert(Je),_e.convert(nt),ve)}finally{const Ne=q!==null?V.get(q).__webglFramebuffer:null;x.bindFramebuffer(F.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(S,B,Z,G,W,ve,Se,ye=0){if(!(S&&S.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let De=V.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&Se!==void 0&&(De=De[Se]),De)if(B>=0&&B<=S.width-G&&Z>=0&&Z<=S.height-W){x.bindFramebuffer(F.FRAMEBUFFER,De);const Ne=S.textures[ye],Je=Ne.format,nt=Ne.type;if(S.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+ye),!R.textureFormatReadable(Je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!R.textureTypeReadable(nt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ue=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,Ue),F.bufferData(F.PIXEL_PACK_BUFFER,ve.byteLength,F.STREAM_READ),F.readPixels(B,Z,G,W,_e.convert(Je),_e.convert(nt),0);const Mt=q!==null?V.get(q).__webglFramebuffer:null;x.bindFramebuffer(F.FRAMEBUFFER,Mt);const Vt=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await w_(F,Vt,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,Ue),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,ve),F.deleteBuffer(Ue),F.deleteSync(Vt),ve}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(S,B=null,Z=0){const G=Math.pow(2,-Z),W=Math.floor(S.image.width*G),ve=Math.floor(S.image.height*G),Se=B!==null?B.x:0,ye=B!==null?B.y:0;K.setTexture2D(S,0),F.copyTexSubImage2D(F.TEXTURE_2D,Z,0,0,Se,ye,W,ve),x.unbindTexture()},this.copyTextureToTexture=function(S,B,Z=null,G=null,W=0,ve=0){let Se,ye,De,Ne,Je,nt,Ue,Mt,Vt;const Bt=S.isCompressedTexture?S.mipmaps[ve]:S.image;if(Z!==null)Se=Z.max.x-Z.min.x,ye=Z.max.y-Z.min.y,De=Z.isBox3?Z.max.z-Z.min.z:1,Ne=Z.min.x,Je=Z.min.y,nt=Z.isBox3?Z.min.z:0;else{const Ht=Math.pow(2,-W);Se=Math.floor(Bt.width*Ht),ye=Math.floor(Bt.height*Ht),S.isDataArrayTexture?De=Bt.depth:S.isData3DTexture?De=Math.floor(Bt.depth*Ht):De=1,Ne=0,Je=0,nt=0}G!==null?(Ue=G.x,Mt=G.y,Vt=G.z):(Ue=0,Mt=0,Vt=0);const bt=_e.convert(B.format),mn=_e.convert(B.type);let we;B.isData3DTexture?(K.setTexture3D(B,0),we=F.TEXTURE_3D):B.isDataArrayTexture||B.isCompressedArrayTexture?(K.setTexture2DArray(B,0),we=F.TEXTURE_2D_ARRAY):(K.setTexture2D(B,0),we=F.TEXTURE_2D),x.activeTexture(F.TEXTURE0),x.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,B.flipY),x.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),x.pixelStorei(F.UNPACK_ALIGNMENT,B.unpackAlignment);const Xn=x.getParameter(F.UNPACK_ROW_LENGTH),pt=x.getParameter(F.UNPACK_IMAGE_HEIGHT),ai=x.getParameter(F.UNPACK_SKIP_PIXELS),wi=x.getParameter(F.UNPACK_SKIP_ROWS),lr=x.getParameter(F.UNPACK_SKIP_IMAGES);x.pixelStorei(F.UNPACK_ROW_LENGTH,Bt.width),x.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Bt.height),x.pixelStorei(F.UNPACK_SKIP_PIXELS,Ne),x.pixelStorei(F.UNPACK_SKIP_ROWS,Je),x.pixelStorei(F.UNPACK_SKIP_IMAGES,nt);const hs=S.isDataArrayTexture||S.isData3DTexture,yt=B.isDataArrayTexture||B.isData3DTexture;if(S.isDepthTexture){const Ht=V.get(S),cr=V.get(B),At=V.get(Ht.__renderTarget),ur=V.get(cr.__renderTarget);x.bindFramebuffer(F.READ_FRAMEBUFFER,At.__webglFramebuffer),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,ur.__webglFramebuffer);for(let ps=0;ps<De;ps++)hs&&(F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,V.get(S).__webglTexture,W,nt+ps),F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,V.get(B).__webglTexture,ve,Vt+ps)),F.blitFramebuffer(Ne,Je,Se,ye,Ue,Mt,Se,ye,F.DEPTH_BUFFER_BIT,F.NEAREST);x.bindFramebuffer(F.READ_FRAMEBUFFER,null),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else if(W!==0||S.isRenderTargetTexture||V.has(S)){const Ht=V.get(S),cr=V.get(B);x.bindFramebuffer(F.READ_FRAMEBUFFER,H),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,O);for(let At=0;At<De;At++)hs?F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,Ht.__webglTexture,W,nt+At):F.framebufferTexture2D(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,Ht.__webglTexture,W),yt?F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,cr.__webglTexture,ve,Vt+At):F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,cr.__webglTexture,ve),W!==0?F.blitFramebuffer(Ne,Je,Se,ye,Ue,Mt,Se,ye,F.COLOR_BUFFER_BIT,F.NEAREST):yt?F.copyTexSubImage3D(we,ve,Ue,Mt,Vt+At,Ne,Je,Se,ye):F.copyTexSubImage2D(we,ve,Ue,Mt,Ne,Je,Se,ye);x.bindFramebuffer(F.READ_FRAMEBUFFER,null),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else yt?S.isDataTexture||S.isData3DTexture?F.texSubImage3D(we,ve,Ue,Mt,Vt,Se,ye,De,bt,mn,Bt.data):B.isCompressedArrayTexture?F.compressedTexSubImage3D(we,ve,Ue,Mt,Vt,Se,ye,De,bt,Bt.data):F.texSubImage3D(we,ve,Ue,Mt,Vt,Se,ye,De,bt,mn,Bt):S.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,ve,Ue,Mt,Se,ye,bt,mn,Bt.data):S.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,ve,Ue,Mt,Bt.width,Bt.height,bt,Bt.data):F.texSubImage2D(F.TEXTURE_2D,ve,Ue,Mt,Se,ye,bt,mn,Bt);x.pixelStorei(F.UNPACK_ROW_LENGTH,Xn),x.pixelStorei(F.UNPACK_IMAGE_HEIGHT,pt),x.pixelStorei(F.UNPACK_SKIP_PIXELS,ai),x.pixelStorei(F.UNPACK_SKIP_ROWS,wi),x.pixelStorei(F.UNPACK_SKIP_IMAGES,lr),ve===0&&B.generateMipmaps&&F.generateMipmap(we),x.unbindTexture()},this.initRenderTarget=function(S){V.get(S).__webglFramebuffer===void 0&&K.setupRenderTarget(S)},this.initTexture=function(S){S.isCubeTexture?K.setTextureCube(S,0):S.isData3DTexture?K.setTexture3D(S,0):S.isDataArrayTexture||S.isCompressedArrayTexture?K.setTexture2DArray(S,0):K.setTexture2D(S,0),x.unbindTexture()},this.resetState=function(){z=0,I=0,q=null,x.reset(),xe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=ft._getDrawingBufferColorSpace(e),t.unpackColorSpace=ft._getUnpackColorSpace()}}const by=["claude","opencode","gemini","copilot","codex","antigravity","cursor","kimi"],yy=[{left:88,top:29},{left:73,top:9},{left:27,top:9},{left:12,top:29},{left:9,top:57},{left:24,top:79},{left:76,top:79},{left:91,top:57}],Rt={tilt:-.58,flatten:.72,swirl:2.6,cameraZ:17,cameraY:7,cameraFov:62,cameraDollyIn:7,cameraPushIn:11,introSeconds:2.4,orbitSpeed:.012,mobileOrbitSpeed:.14,mobileCameraZ:20,mobileCameraY:6,mobileCameraFov:82,mobilePointScale:1.45,mobileLensScale:1.45,yOffset:-3.9};function Ey({compactViewport:r}){return r?Rt.mobileOrbitSpeed:Rt.orbitSpeed}function Ty({compactViewport:r}){return r?{cameraFov:Rt.mobileCameraFov,cameraY:Rt.mobileCameraY,cameraZ:Rt.mobileCameraZ,lensScale:Rt.mobileLensScale,lookAtY:Rt.yOffset,pointScale:Rt.mobilePointScale}:{cameraFov:Rt.cameraFov,cameraY:Rt.cameraY,cameraZ:Rt.cameraZ,lensScale:1,lookAtY:0,pointScale:1}}const yh=10.56,wy=1.78,Aa={cx:50,cy:43,rx:40,ry:34},Eh={cx:50,cy:68,rx:43,ry:19};function Rf(){return yy.map(r=>Math.atan2((Aa.cy-r.top)/Aa.ry,(r.left-Aa.cx)/Aa.rx))}function Cf(r,e=1,t=!1,n=Eh.cy){const i=t?Eh:Aa,s=t?n:i.cy;return{left:i.cx+Math.cos(r)*i.rx*e,top:s-Math.sin(r)*i.ry*e}}function Ay(r,e){const t=Math.cos(Rt.tilt),n=(50-e)/50*yh;return{x:(r-50)/50*yh*wy,y:(n-Rt.yOffset)/(Rt.flatten*t),z:0}}function Ry(){return Rf().map(r=>{const e=Cf(r);return Ay(e.left,e.top)})}function Cy({lowPower:r}){return r?{flow:1400,disc:4600,stars:400}:{flow:4200,disc:14e3,stars:1e3}}function Py(){return Rf().map(Cf)}function Th(r){return .35+(Math.min(79,Math.max(9,r))-9)/70*1.15}const Dy=`
4108
+ }`;class my{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Rm(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new yi({vertexShader:hy,fragmentShader:py,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new or(new Dl(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class gy extends fs{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,u=null,h=null,f=null,d=null,g=null;const _=typeof XRWebGLBinding<"u",p=new my,m={},b=t.getContextAttributes();let y=null,M=null;const E=[],T=[],A=new gt;let v=null;const w=new di;w.viewport=new kt;const C=new di;C.viewport=new kt;const L=[w,C],N=new Tx;let Y=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let oe=E[Q];return oe===void 0&&(oe=new ic,E[Q]=oe),oe.getTargetRaySpace()},this.getControllerGrip=function(Q){let oe=E[Q];return oe===void 0&&(oe=new ic,E[Q]=oe),oe.getGripSpace()},this.getHand=function(Q){let oe=E[Q];return oe===void 0&&(oe=new ic,E[Q]=oe),oe.getHandSpace()};function O(Q){const oe=T.indexOf(Q.inputSource);if(oe===-1)return;const ne=E[oe];ne!==void 0&&(ne.update(Q.inputSource,Q.frame,c||a),ne.dispatchEvent({type:Q.type,data:Q.inputSource}))}function z(){i.removeEventListener("select",O),i.removeEventListener("selectstart",O),i.removeEventListener("selectend",O),i.removeEventListener("squeeze",O),i.removeEventListener("squeezestart",O),i.removeEventListener("squeezeend",O),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",I);for(let Q=0;Q<E.length;Q++){const oe=T[Q];oe!==null&&(T[Q]=null,E[Q].disconnect(oe))}Y=null,H=null,p.reset();for(const Q in m)delete m[Q];e.setRenderTarget(y),d=null,f=null,h=null,i=null,M=null,Le.stop(),n.isPresenting=!1,e.setPixelRatio(v),e.setSize(A.width,A.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Q){s=Q,n.isPresenting===!0&&$e("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Q){o=Q,n.isPresenting===!0&&$e("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Q){c=Q},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return h===null&&_&&(h=new XRWebGLBinding(i,t)),h},this.getFrame=function(){return g},this.getSession=function(){return i},this.setSession=async function(Q){if(i=Q,i!==null){if(y=e.getRenderTarget(),i.addEventListener("select",O),i.addEventListener("selectstart",O),i.addEventListener("selectend",O),i.addEventListener("squeeze",O),i.addEventListener("squeezestart",O),i.addEventListener("squeezeend",O),i.addEventListener("end",z),i.addEventListener("inputsourceschange",I),b.xrCompatible!==!0&&await t.makeXRCompatible(),v=e.getPixelRatio(),e.getSize(A),_&&"createProjectionLayer"in XRWebGLBinding.prototype){let ne=null,Ee=null,Oe=null;b.depth&&(Oe=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ne=b.stencil?Zr:ar,Ee=b.stencil?Qa:Gi);const Te={colorFormat:t.RGBA8,depthFormat:Oe,scaleFactor:s};h=this.getBinding(),f=h.createProjectionLayer(Te),i.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),M=new ki(f.textureWidth,f.textureHeight,{format:bi,type:hi,depthTexture:new ra(f.textureWidth,f.textureHeight,Ee,void 0,void 0,void 0,void 0,void 0,void 0,ne),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{const ne={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,ne),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),M=new ki(d.framebufferWidth,d.framebufferHeight,{format:bi,type:hi,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}M.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Le.setContext(i),Le.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};function I(Q){for(let oe=0;oe<Q.removed.length;oe++){const ne=Q.removed[oe],Ee=T.indexOf(ne);Ee>=0&&(T[Ee]=null,E[Ee].disconnect(ne))}for(let oe=0;oe<Q.added.length;oe++){const ne=Q.added[oe];let Ee=T.indexOf(ne);if(Ee===-1){for(let Te=0;Te<E.length;Te++)if(Te>=T.length){T.push(ne),Ee=Te;break}else if(T[Te]===null){T[Te]=ne,Ee=Te;break}if(Ee===-1)break}const Oe=E[Ee];Oe&&Oe.connect(ne)}}const q=new X,j=new X;function D(Q,oe,ne){q.setFromMatrixPosition(oe.matrixWorld),j.setFromMatrixPosition(ne.matrixWorld);const Ee=q.distanceTo(j),Oe=oe.projectionMatrix.elements,Te=ne.projectionMatrix.elements,tt=Oe[14]/(Oe[10]-1),Me=Oe[14]/(Oe[10]+1),ze=(Oe[9]+1)/Oe[5],qe=(Oe[9]-1)/Oe[5],Ye=(Oe[8]-1)/Oe[0],$=(Te[8]+1)/Te[0],lt=tt*Ye,We=tt*$,Qe=Ee/(-Ye+$),Ge=Qe*-Ye;if(oe.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(Ge),Q.translateZ(Qe),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert(),Oe[10]===-1)Q.projectionMatrix.copy(oe.projectionMatrix),Q.projectionMatrixInverse.copy(oe.projectionMatrixInverse);else{const Ke=tt+Qe,F=Me+Qe,Ct=lt-Ge,Xe=We+(Ee-Ge),R=ze*Me/F*Ke,x=qe*Me/F*Ke;Q.projectionMatrix.makePerspective(Ct,Xe,R,x,Ke,F),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}}function se(Q,oe){oe===null?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(oe.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(i===null)return;let oe=Q.near,ne=Q.far;p.texture!==null&&(p.depthNear>0&&(oe=p.depthNear),p.depthFar>0&&(ne=p.depthFar)),N.near=C.near=w.near=oe,N.far=C.far=w.far=ne,(Y!==N.near||H!==N.far)&&(i.updateRenderState({depthNear:N.near,depthFar:N.far}),Y=N.near,H=N.far),N.layers.mask=Q.layers.mask|6,w.layers.mask=N.layers.mask&-5,C.layers.mask=N.layers.mask&-3;const Ee=Q.parent,Oe=N.cameras;se(N,Ee);for(let Te=0;Te<Oe.length;Te++)se(Oe[Te],Ee);Oe.length===2?D(N,w,C):N.projectionMatrix.copy(w.projectionMatrix),pe(Q,N,Ee)};function pe(Q,oe,ne){ne===null?Q.matrix.copy(oe.matrixWorld):(Q.matrix.copy(ne.matrixWorld),Q.matrix.invert(),Q.matrix.multiply(oe.matrixWorld)),Q.matrix.decompose(Q.position,Q.quaternion,Q.scale),Q.updateMatrixWorld(!0),Q.projectionMatrix.copy(oe.projectionMatrix),Q.projectionMatrixInverse.copy(oe.projectionMatrixInverse),Q.isPerspectiveCamera&&(Q.fov=eo*2*Math.atan(1/Q.projectionMatrix.elements[5]),Q.zoom=1)}this.getCamera=function(){return N},this.getFoveation=function(){if(!(f===null&&d===null))return l},this.setFoveation=function(Q){l=Q,f!==null&&(f.fixedFoveation=Q),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=Q)},this.hasDepthSensing=function(){return p.texture!==null},this.getDepthSensingMesh=function(){return p.getMesh(N)},this.getCameraTexture=function(Q){return m[Q]};let Ve=null;function He(Q,oe){if(u=oe.getViewerPose(c||a),g=oe,u!==null){const ne=u.views;d!==null&&(e.setRenderTargetFramebuffer(M,d.framebuffer),e.setRenderTarget(M));let Ee=!1;ne.length!==N.cameras.length&&(N.cameras.length=0,Ee=!0);for(let Me=0;Me<ne.length;Me++){const ze=ne[Me];let qe=null;if(d!==null)qe=d.getViewport(ze);else{const $=h.getViewSubImage(f,ze);qe=$.viewport,Me===0&&(e.setRenderTargetTextures(M,$.colorTexture,$.depthStencilTexture),e.setRenderTarget(M))}let Ye=L[Me];Ye===void 0&&(Ye=new di,Ye.layers.enable(Me),Ye.viewport=new kt,L[Me]=Ye),Ye.matrix.fromArray(ze.transform.matrix),Ye.matrix.decompose(Ye.position,Ye.quaternion,Ye.scale),Ye.projectionMatrix.fromArray(ze.projectionMatrix),Ye.projectionMatrixInverse.copy(Ye.projectionMatrix).invert(),Ye.viewport.set(qe.x,qe.y,qe.width,qe.height),Me===0&&(N.matrix.copy(Ye.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale)),Ee===!0&&N.cameras.push(Ye)}const Oe=i.enabledFeatures;if(Oe&&Oe.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&_){h=n.getBinding();const Me=h.getDepthInformation(ne[0]);Me&&Me.isValid&&Me.texture&&p.init(Me,i.renderState)}if(Oe&&Oe.includes("camera-access")&&_){e.state.unbindTexture(),h=n.getBinding();for(let Me=0;Me<ne.length;Me++){const ze=ne[Me].camera;if(ze){let qe=m[ze];qe||(qe=new Rm,m[ze]=qe);const Ye=h.getCameraImage(ze);qe.sourceTexture=Ye}}}}for(let ne=0;ne<E.length;ne++){const Ee=T[ne],Oe=E[ne];Ee!==null&&Oe!==void 0&&Oe.update(Ee,oe,c||a)}Ve&&Ve(Q,oe),oe.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:oe}),g=null}const Le=new Lm;Le.setAnimationLoop(He),this.setAnimationLoop=function(Q){Ve=Q},this.dispose=function(){}}}const _y=new Yt,km=new je;km.set(-1,0,0,0,1,0,0,0,1);function xy(r,e){function t(p,m){p.matrixAutoUpdate===!0&&p.updateMatrix(),m.value.copy(p.matrix)}function n(p,m){m.color.getRGB(p.fogColor.value,Cm(r)),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function i(p,m,b,y,M){m.isNodeMaterial?m.uniformsNeedUpdate=!1:m.isMeshBasicMaterial?s(p,m):m.isMeshLambertMaterial?(s(p,m),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)):m.isMeshToonMaterial?(s(p,m),h(p,m)):m.isMeshPhongMaterial?(s(p,m),u(p,m),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)):m.isMeshStandardMaterial?(s(p,m),f(p,m),m.isMeshPhysicalMaterial&&d(p,m,M)):m.isMeshMatcapMaterial?(s(p,m),g(p,m)):m.isMeshDepthMaterial?s(p,m):m.isMeshDistanceMaterial?(s(p,m),_(p,m)):m.isMeshNormalMaterial?s(p,m):m.isLineBasicMaterial?(a(p,m),m.isLineDashedMaterial&&o(p,m)):m.isPointsMaterial?l(p,m,b,y):m.isSpriteMaterial?c(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map,t(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,t(m.alphaMap,p.alphaMapTransform)),m.bumpMap&&(p.bumpMap.value=m.bumpMap,t(m.bumpMap,p.bumpMapTransform),p.bumpScale.value=m.bumpScale,m.side===Vn&&(p.bumpScale.value*=-1)),m.normalMap&&(p.normalMap.value=m.normalMap,t(m.normalMap,p.normalMapTransform),p.normalScale.value.copy(m.normalScale),m.side===Vn&&p.normalScale.value.negate()),m.displacementMap&&(p.displacementMap.value=m.displacementMap,t(m.displacementMap,p.displacementMapTransform),p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,p.emissiveMapTransform)),m.specularMap&&(p.specularMap.value=m.specularMap,t(m.specularMap,p.specularMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);const b=e.get(m),y=b.envMap,M=b.envMapRotation;y&&(p.envMap.value=y,p.envMapRotation.value.setFromMatrix4(_y.makeRotationFromEuler(M)).transpose(),y.isCubeTexture&&y.isRenderTargetTexture===!1&&p.envMapRotation.value.premultiply(km),p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap&&(p.lightMap.value=m.lightMap,p.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,p.lightMapTransform)),m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,p.aoMapTransform))}function a(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,m.map&&(p.map.value=m.map,t(m.map,p.mapTransform))}function o(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function l(p,m,b,y){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*b,p.scale.value=y*.5,m.map&&(p.map.value=m.map,t(m.map,p.uvTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,t(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function c(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map,t(m.map,p.mapTransform)),m.alphaMap&&(p.alphaMap.value=m.alphaMap,t(m.alphaMap,p.alphaMapTransform)),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest)}function u(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function f(p,m){p.metalness.value=m.metalness,m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,p.metalnessMapTransform)),p.roughness.value=m.roughness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,p.roughnessMapTransform)),m.envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,b){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Vn&&p.clearcoatNormalScale.value.negate())),m.dispersion>0&&(p.dispersion.value=m.dispersion),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=b.texture,p.transmissionSamplerSize.value.set(b.width,b.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(p.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(p.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,p.specularIntensityMapTransform))}function g(p,m){m.matcap&&(p.matcap.value=m.matcap)}function _(p,m){const b=e.get(m).light;p.referencePosition.value.setFromMatrixPosition(b.matrixWorld),p.nearDistance.value=b.shadow.camera.near,p.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function vy(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(M,E){const T=E.program;n.uniformBlockBinding(M,T)}function c(M,E){let T=i[M.id];T===void 0&&(p(M),T=u(M),i[M.id]=T,M.addEventListener("dispose",b));const A=E.program;n.updateUBOMapping(M,A);const v=e.render.frame;s[M.id]!==v&&(f(M),s[M.id]=v)}function u(M){const E=h();M.__bindingPointIndex=E;const T=r.createBuffer(),A=M.__size,v=M.usage;return r.bindBuffer(r.UNIFORM_BUFFER,T),r.bufferData(r.UNIFORM_BUFFER,A,v),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,T),T}function h(){for(let M=0;M<o;M++)if(a.indexOf(M)===-1)return a.push(M),M;return mt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(M){const E=i[M.id],T=M.uniforms,A=M.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let v=0,w=T.length;v<w;v++){const C=T[v];if(Array.isArray(C))for(let L=0,N=C.length;L<N;L++)d(C[L],v,L,A);else d(C,v,0,A)}r.bindBuffer(r.UNIFORM_BUFFER,null)}function d(M,E,T,A){if(_(M,E,T,A)===!0){const v=M.__offset,w=M.value;if(Array.isArray(w)){let C=0;for(let L=0;L<w.length;L++){const N=w[L],Y=m(N);g(N,M.__data,C),typeof N!="number"&&typeof N!="boolean"&&!N.isMatrix3&&!ArrayBuffer.isView(N)&&(C+=Y.storage/Float32Array.BYTES_PER_ELEMENT)}}else g(w,M.__data,0);r.bufferSubData(r.UNIFORM_BUFFER,v,M.__data)}}function g(M,E,T){typeof M=="number"||typeof M=="boolean"?E[0]=M:M.isMatrix3?(E[0]=M.elements[0],E[1]=M.elements[1],E[2]=M.elements[2],E[3]=0,E[4]=M.elements[3],E[5]=M.elements[4],E[6]=M.elements[5],E[7]=0,E[8]=M.elements[6],E[9]=M.elements[7],E[10]=M.elements[8],E[11]=0):ArrayBuffer.isView(M)?E.set(new M.constructor(M.buffer,M.byteOffset,E.length)):M.toArray(E,T)}function _(M,E,T,A){const v=M.value,w=E+"_"+T;if(A[w]===void 0)return typeof v=="number"||typeof v=="boolean"?A[w]=v:ArrayBuffer.isView(v)?A[w]=v.slice():A[w]=v.clone(),!0;{const C=A[w];if(typeof v=="number"||typeof v=="boolean"){if(C!==v)return A[w]=v,!0}else{if(ArrayBuffer.isView(v))return!0;if(C.equals(v)===!1)return C.copy(v),!0}}return!1}function p(M){const E=M.uniforms;let T=0;const A=16;for(let w=0,C=E.length;w<C;w++){const L=Array.isArray(E[w])?E[w]:[E[w]];for(let N=0,Y=L.length;N<Y;N++){const H=L[N],O=Array.isArray(H.value)?H.value:[H.value];for(let z=0,I=O.length;z<I;z++){const q=O[z],j=m(q),D=T%A,se=D%j.boundary,pe=D+se;T+=se,pe!==0&&A-pe<j.storage&&(T+=A-pe),H.__data=new Float32Array(j.storage/Float32Array.BYTES_PER_ELEMENT),H.__offset=T,T+=j.storage}}}const v=T%A;return v>0&&(T+=A-v),M.__size=T,M.__cache={},this}function m(M){const E={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(E.boundary=4,E.storage=4):M.isVector2?(E.boundary=8,E.storage=8):M.isVector3||M.isColor?(E.boundary=16,E.storage=12):M.isVector4?(E.boundary=16,E.storage=16):M.isMatrix3?(E.boundary=48,E.storage=48):M.isMatrix4?(E.boundary=64,E.storage=64):M.isTexture?$e("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(M)?(E.boundary=16,E.storage=M.byteLength):$e("WebGLRenderer: Unsupported uniform value type.",M),E}function b(M){const E=M.target;E.removeEventListener("dispose",b);const T=a.indexOf(E.__bindingPointIndex);a.splice(T,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function y(){for(const M in i)r.deleteBuffer(i[M]);a=[],i={},s={}}return{bind:l,update:c,dispose:y}}const My=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Ri=null;function Sy(){return Ri===null&&(Ri=new ux(My,16,16,ls,sr),Ri.name="DFG_LUT",Ri.minFilter=yn,Ri.magFilter=yn,Ri.wrapS=Ji,Ri.wrapT=Ji,Ri.generateMipmaps=!1,Ri.needsUpdate=!0),Ri}class by{constructor(e={}){const{canvas:t=w0(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:f=!1,outputBufferType:d=hi}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=a;const _=d,p=new Set([yf,bf,Sf]),m=new Set([hi,Gi,Ja,Qa,vf,Mf]),b=new Uint32Array(4),y=new Int32Array(4),M=new X;let E=null,T=null;const A=[],v=[];let w=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Bi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const C=this;let L=!1,N=null,Y=null,H=null,O=null;this._outputColorSpace=ci;let z=0,I=0,q=null,j=-1,D=null;const se=new kt,pe=new kt;let Ve=null;const He=new ht(0);let Le=0,Q=t.width,oe=t.height,ne=1,Ee=null,Oe=null;const Te=new kt(0,0,Q,oe),tt=new kt(0,0,Q,oe);let Me=!1;const ze=new wm;let qe=!1,Ye=!1;const $=new Yt,lt=new X,We=new kt,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ge=!1;function Ke(){return q===null?ne:1}let F=n;function Ct(S,B){return t.getContext(S,B)}try{const S={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${_f}`),t.addEventListener("webglcontextlost",Be,!1),t.addEventListener("webglcontextrestored",ue,!1),t.addEventListener("webglcontextcreationerror",ke,!1),F===null){const B="webgl2";if(F=Ct(B,S),F===null)throw Ct(B)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(S){throw mt("WebGLRenderer: "+S.message),S}let Xe,R,x,k,V,Z,ce,ae,J,ee,he,Ae,ge,me,fe,Pe,Ie,U,de,te,_e,xe,ie;function le(){Xe=new SS(F),Xe.init(),_e=new dy(F,Xe),R=new hS(F,Xe,e,_e),x=new uy(F,Xe),R.reversedDepthBuffer&&f&&x.buffers.depth.setReversed(!0),Y=F.createFramebuffer(),H=F.createFramebuffer(),O=F.createFramebuffer(),k=new ES(F),V=new Zb,Z=new fy(F,Xe,x,V,R,_e,k),ce=new MS(C),ae=new Rx(F),xe=new fS(F,ae),J=new bS(F,ae,k,xe),ee=new wS(F,J,ae,xe,k),U=new TS(F,R,Z),fe=new pS(V),he=new Kb(C,ce,Xe,R,xe,fe),Ae=new xy(C,V),ge=new Jb,me=new ry(Xe),Ie=new uS(C,ce,x,ee,g,l),Pe=new cy(C,ee,R),ie=new vy(F,k,R,x),de=new dS(F,Xe,k),te=new yS(F,Xe,k),k.programs=he.programs,C.capabilities=R,C.extensions=Xe,C.properties=V,C.renderLists=ge,C.shadowMap=Pe,C.state=x,C.info=k}le(),_!==hi&&(w=new RS(_,t.width,t.height,o,i,s));const re=new gy(C,F);this.xr=re,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){const S=Xe.get("WEBGL_lose_context");S&&S.loseContext()},this.forceContextRestore=function(){const S=Xe.get("WEBGL_lose_context");S&&S.restoreContext()},this.getPixelRatio=function(){return ne},this.setPixelRatio=function(S){S!==void 0&&(ne=S,this.setSize(Q,oe,!1))},this.getSize=function(S){return S.set(Q,oe)},this.setSize=function(S,B,K=!0){if(re.isPresenting){$e("WebGLRenderer: Can't change size while VR device is presenting.");return}Q=S,oe=B,t.width=Math.floor(S*ne),t.height=Math.floor(B*ne),K===!0&&(t.style.width=S+"px",t.style.height=B+"px"),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,S,B)},this.getDrawingBufferSize=function(S){return S.set(Q*ne,oe*ne).floor()},this.setDrawingBufferSize=function(S,B,K){Q=S,oe=B,ne=K,t.width=Math.floor(S*K),t.height=Math.floor(B*K),this.setViewport(0,0,S,B)},this.setEffects=function(S){if(_===hi){mt("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(S){for(let B=0;B<S.length;B++)if(S[B].isOutputPass===!0){$e("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}w.setEffects(S||[])},this.getCurrentViewport=function(S){return S.copy(se)},this.getViewport=function(S){return S.copy(Te)},this.setViewport=function(S,B,K,G){S.isVector4?Te.set(S.x,S.y,S.z,S.w):Te.set(S,B,K,G),x.viewport(se.copy(Te).multiplyScalar(ne).round())},this.getScissor=function(S){return S.copy(tt)},this.setScissor=function(S,B,K,G){S.isVector4?tt.set(S.x,S.y,S.z,S.w):tt.set(S,B,K,G),x.scissor(pe.copy(tt).multiplyScalar(ne).round())},this.getScissorTest=function(){return Me},this.setScissorTest=function(S){x.setScissorTest(Me=S)},this.setOpaqueSort=function(S){Ee=S},this.setTransparentSort=function(S){Oe=S},this.getClearColor=function(S){return S.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor(...arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha(...arguments)},this.clear=function(S=!0,B=!0,K=!0){let G=0;if(S){let W=!1;if(q!==null){const ve=q.texture.format;W=p.has(ve)}if(W){const ve=q.texture.type,Se=m.has(ve),ye=Ie.getClearColor(),De=Ie.getClearAlpha(),Ne=ye.r,Je=ye.g,nt=ye.b;Se?(b[0]=Ne,b[1]=Je,b[2]=nt,b[3]=De,F.clearBufferuiv(F.COLOR,0,b)):(y[0]=Ne,y[1]=Je,y[2]=nt,y[3]=De,F.clearBufferiv(F.COLOR,0,y))}else G|=F.COLOR_BUFFER_BIT}B&&(G|=F.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),K&&(G|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G!==0&&F.clear(G)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(S){S.setRenderer(this),N=S},this.dispose=function(){t.removeEventListener("webglcontextlost",Be,!1),t.removeEventListener("webglcontextrestored",ue,!1),t.removeEventListener("webglcontextcreationerror",ke,!1),Ie.dispose(),ge.dispose(),me.dispose(),V.dispose(),ce.dispose(),ee.dispose(),xe.dispose(),ie.dispose(),he.dispose(),re.dispose(),re.removeEventListener("sessionstart",Dt),re.removeEventListener("sessionend",St),ut.stop()};function Be(S){S.preventDefault(),Nd("WebGLRenderer: Context Lost."),L=!0}function ue(){Nd("WebGLRenderer: Context Restored."),L=!1;const S=k.autoReset,B=Pe.enabled,K=Pe.autoUpdate,G=Pe.needsUpdate,W=Pe.type;le(),k.autoReset=S,Pe.enabled=B,Pe.autoUpdate=K,Pe.needsUpdate=G,Pe.type=W}function ke(S){mt("WebGLRenderer: A WebGL context could not be created. Reason: ",S.statusMessage)}function Ce(S){const B=S.target;B.removeEventListener("dispose",Ce),Ze(B)}function Ze(S){qt(S),V.remove(S)}function qt(S){const B=V.get(S).programs;B!==void 0&&(B.forEach(function(K){he.releaseProgram(K)}),S.isShaderMaterial&&he.releaseShaderCache(S))}this.renderBufferDirect=function(S,B,K,G,W,ve){B===null&&(B=Qe);const Se=W.isMesh&&W.matrixWorld.determinantAffine()<0,ye=sn(S,B,K,G,W);x.setMaterial(G,Se);let De=K.index,Ne=1;if(G.wireframe===!0){if(De=J.getWireframeAttribute(K),De===void 0)return;Ne=2}const Je=K.drawRange,nt=K.attributes.position;let Ue=Je.start*Ne,Mt=(Je.start+Je.count)*Ne;ve!==null&&(Ue=Math.max(Ue,ve.start*Ne),Mt=Math.min(Mt,(ve.start+ve.count)*Ne)),De!==null?(Ue=Math.max(Ue,0),Mt=Math.min(Mt,De.count)):nt!=null&&(Ue=Math.max(Ue,0),Mt=Math.min(Mt,nt.count));const Vt=Mt-Ue;if(Vt<0||Vt===1/0)return;xe.setup(W,G,ye,K,De);let Bt,bt=de;if(De!==null&&(Bt=ae.get(De),bt=te,bt.setIndex(Bt)),W.isMesh)G.wireframe===!0?(x.setLineWidth(G.wireframeLinewidth*Ke()),bt.setMode(F.LINES)):bt.setMode(F.TRIANGLES);else if(W.isLine){let mn=G.linewidth;mn===void 0&&(mn=1),x.setLineWidth(mn*Ke()),W.isLineSegments?bt.setMode(F.LINES):W.isLineLoop?bt.setMode(F.LINE_LOOP):bt.setMode(F.LINE_STRIP)}else W.isPoints?bt.setMode(F.POINTS):W.isSprite&&bt.setMode(F.TRIANGLES);if(W.isBatchedMesh)if(Xe.get("WEBGL_multi_draw"))bt.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const mn=W._multiDrawStarts,we=W._multiDrawCounts,Xn=W._multiDrawCount,pt=De?ae.get(De).bytesPerElement:1,ai=V.get(G).currentProgram.getUniforms();for(let wi=0;wi<Xn;wi++)ai.setValue(F,"_gl_DrawID",wi),bt.render(mn[wi]/pt,we[wi])}else if(W.isInstancedMesh)bt.renderInstances(Ue,Vt,W.count);else if(K.isInstancedBufferGeometry){const mn=K._maxInstanceCount!==void 0?K._maxInstanceCount:1/0,we=Math.min(K.instanceCount,mn);bt.renderInstances(Ue,Vt,we)}else bt.render(Ue,Vt)};function rt(S,B,K){S.transparent===!0&&S.side===Zi&&S.forceSinglePass===!1?(S.side=Vn,S.needsUpdate=!0,Ot(S,B,K),S.side=Lr,S.needsUpdate=!0,Ot(S,B,K),S.side=Zi):Ot(S,B,K)}this.compile=function(S,B,K=null){K===null&&(K=S),T=me.get(K),T.init(B),v.push(T),K.traverseVisible(function(W){W.isLight&&W.layers.test(B.layers)&&(T.pushLight(W),W.castShadow&&T.pushShadow(W))}),S!==K&&S.traverseVisible(function(W){W.isLight&&W.layers.test(B.layers)&&(T.pushLight(W),W.castShadow&&T.pushShadow(W))}),T.setupLights();const G=new Set;return S.traverse(function(W){if(!(W.isMesh||W.isPoints||W.isLine||W.isSprite))return;const ve=W.material;if(ve)if(Array.isArray(ve))for(let Se=0;Se<ve.length;Se++){const ye=ve[Se];rt(ye,K,W),G.add(ye)}else rt(ve,K,W),G.add(ve)}),T=v.pop(),G},this.compileAsync=function(S,B,K=null){const G=this.compile(S,B,K);return new Promise(W=>{function ve(){if(G.forEach(function(Se){V.get(Se).currentProgram.isReady()&&G.delete(Se)}),G.size===0){W(S);return}setTimeout(ve,10)}Xe.get("KHR_parallel_shader_compile")!==null?ve():setTimeout(ve,10)})};let Pt=null;function rn(S){Pt&&Pt(S)}function Dt(){ut.stop()}function St(){ut.start()}const ut=new Lm;ut.setAnimationLoop(rn),typeof self<"u"&&ut.setContext(self),this.setAnimationLoop=function(S){Pt=S,re.setAnimationLoop(S),S===null?ut.stop():ut.start()},re.addEventListener("sessionstart",Dt),re.addEventListener("sessionend",St),this.render=function(S,B){if(B!==void 0&&B.isCamera!==!0){mt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;N!==null&&N.renderStart(S,B);const K=re.enabled===!0&&re.isPresenting===!0,G=w!==null&&(q===null||K)&&w.begin(C,q);if(S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),re.enabled===!0&&re.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(re.cameraAutoUpdate===!0&&re.updateCamera(B),B=re.getCamera()),S.isScene===!0&&S.onBeforeRender(C,S,B,q),T=me.get(S,v.length),T.init(B),T.state.textureUnits=Z.getTextureUnits(),v.push(T),$.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),ze.setFromProjectionMatrix($,Fi,B.reversedDepth),Ye=this.localClippingEnabled,qe=fe.init(this.clippingPlanes,Ye),E=ge.get(S,A.length),E.init(),A.push(E),re.enabled===!0&&re.isPresenting===!0){const Se=C.xr.getDepthSensingMesh();Se!==null&&Tn(Se,B,-1/0,C.sortObjects)}Tn(S,B,0,C.sortObjects),E.finish(),C.sortObjects===!0&&E.sort(Ee,Oe,B.reversedDepth),Ge=re.enabled===!1||re.isPresenting===!1||re.hasDepthSensing()===!1,Ge&&Ie.addToRenderList(E,S),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),qe===!0&&fe.beginShadows();const W=T.state.shadowsArray;if(Pe.render(W,S,B),qe===!0&&fe.endShadows(),(G&&w.hasRenderPass())===!1){const Se=E.opaque,ye=E.transmissive;if(T.setupLights(),B.isArrayCamera){const De=B.cameras;if(ye.length>0)for(let Ne=0,Je=De.length;Ne<Je;Ne++){const nt=De[Ne];pn(Se,ye,S,nt)}Ge&&Ie.render(S);for(let Ne=0,Je=De.length;Ne<Je;Ne++){const nt=De[Ne];wt(E,S,nt,nt.viewport)}}else ye.length>0&&pn(Se,ye,S,B),Ge&&Ie.render(S),wt(E,S,B)}q!==null&&I===0&&(Z.updateMultisampleRenderTarget(q),Z.updateRenderTargetMipmap(q)),G&&w.end(C),S.isScene===!0&&S.onAfterRender(C,S,B),xe.resetDefaultState(),j=-1,D=null,v.pop(),v.length>0?(T=v[v.length-1],Z.setTextureUnits(T.state.textureUnits),qe===!0&&fe.setGlobalState(C.clippingPlanes,T.state.camera)):T=null,A.pop(),A.length>0?E=A[A.length-1]:E=null,N!==null&&N.renderEnd()};function Tn(S,B,K,G){if(S.visible===!1)return;if(S.layers.test(B.layers)){if(S.isGroup)K=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(B);else if(S.isLightProbeGrid)T.pushLightProbeGrid(S);else if(S.isLight)T.pushLight(S),S.castShadow&&T.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||ze.intersectsSprite(S)){G&&We.setFromMatrixPosition(S.matrixWorld).applyMatrix4($);const Se=ee.update(S),ye=S.material;ye.visible&&E.push(S,Se,ye,K,We.z,null)}}else if((S.isMesh||S.isLine||S.isPoints)&&(!S.frustumCulled||ze.intersectsObject(S))){const Se=ee.update(S),ye=S.material;if(G&&(S.boundingSphere!==void 0?(S.boundingSphere===null&&S.computeBoundingSphere(),We.copy(S.boundingSphere.center)):(Se.boundingSphere===null&&Se.computeBoundingSphere(),We.copy(Se.boundingSphere.center)),We.applyMatrix4(S.matrixWorld).applyMatrix4($)),Array.isArray(ye)){const De=Se.groups;for(let Ne=0,Je=De.length;Ne<Je;Ne++){const nt=De[Ne],Ue=ye[nt.materialIndex];Ue&&Ue.visible&&E.push(S,Se,Ue,K,We.z,nt)}}else ye.visible&&E.push(S,Se,ye,K,We.z,null)}}const ve=S.children;for(let Se=0,ye=ve.length;Se<ye;Se++)Tn(ve[Se],B,K,G)}function wt(S,B,K,G){const{opaque:W,transmissive:ve,transparent:Se}=S;T.setupLightsView(K),qe===!0&&fe.setGlobalState(C.clippingPlanes,K),G&&x.viewport(se.copy(G)),W.length>0&&wn(W,B,K),ve.length>0&&wn(ve,B,K),Se.length>0&&wn(Se,B,K),x.buffers.depth.setTest(!0),x.buffers.depth.setMask(!0),x.buffers.color.setMask(!0),x.setPolygonOffset(!1)}function pn(S,B,K,G){if((K.isScene===!0?K.overrideMaterial:null)!==null)return;if(T.state.transmissionRenderTarget[G.id]===void 0){const Ue=Xe.has("EXT_color_buffer_half_float")||Xe.has("EXT_color_buffer_float");T.state.transmissionRenderTarget[G.id]=new ki(1,1,{generateMipmaps:!0,type:Ue?sr:hi,minFilter:Kr,samples:Math.max(4,R.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ft.workingColorSpace})}const ve=T.state.transmissionRenderTarget[G.id],Se=G.viewport||se;ve.setSize(Se.z*C.transmissionResolutionScale,Se.w*C.transmissionResolutionScale);const ye=C.getRenderTarget(),De=C.getActiveCubeFace(),Ne=C.getActiveMipmapLevel();C.setRenderTarget(ve),C.getClearColor(He),Le=C.getClearAlpha(),Le<1&&C.setClearColor(16777215,.5),C.clear(),Ge&&Ie.render(K);const Je=C.toneMapping;C.toneMapping=Bi;const nt=G.viewport;if(G.viewport!==void 0&&(G.viewport=void 0),T.setupLightsView(G),qe===!0&&fe.setGlobalState(C.clippingPlanes,G),wn(S,K,G),Z.updateMultisampleRenderTarget(ve),Z.updateRenderTargetMipmap(ve),Xe.has("WEBGL_multisampled_render_to_texture")===!1){let Ue=!1;for(let Mt=0,Vt=B.length;Mt<Vt;Mt++){const Bt=B[Mt],{object:bt,geometry:mn,material:we,group:Xn}=Bt;if(we.side===Zi&&bt.layers.test(G.layers)){const pt=we.side;we.side=Vn,we.needsUpdate=!0,$t(bt,K,G,mn,we,Xn),we.side=pt,we.needsUpdate=!0,Ue=!0}}Ue===!0&&(Z.updateMultisampleRenderTarget(ve),Z.updateRenderTargetMipmap(ve))}C.setRenderTarget(ye,De,Ne),C.setClearColor(He,Le),nt!==void 0&&(G.viewport=nt),C.toneMapping=Je}function wn(S,B,K){const G=B.isScene===!0?B.overrideMaterial:null;for(let W=0,ve=S.length;W<ve;W++){const Se=S[W],{object:ye,geometry:De,group:Ne}=Se;let Je=Se.material;Je.allowOverride===!0&&G!==null&&(Je=G),ye.layers.test(K.layers)&&$t(ye,B,K,De,Je,Ne)}}function $t(S,B,K,G,W,ve){S.onBeforeRender(C,B,K,G,W,ve),S.modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,S.matrixWorld),S.normalMatrix.getNormalMatrix(S.modelViewMatrix),W.onBeforeRender(C,B,K,G,S,ve),W.transparent===!0&&W.side===Zi&&W.forceSinglePass===!1?(W.side=Vn,W.needsUpdate=!0,C.renderBufferDirect(K,B,G,W,S,ve),W.side=Lr,W.needsUpdate=!0,C.renderBufferDirect(K,B,G,W,S,ve),W.side=Zi):C.renderBufferDirect(K,B,G,W,S,ve),S.onAfterRender(C,B,K,G,W,ve)}function Ot(S,B,K){B.isScene!==!0&&(B=Qe);const G=V.get(S),W=T.state.lights,ve=T.state.shadowsArray,Se=W.state.version,ye=he.getParameters(S,W.state,ve,B,K,T.state.lightProbeGridArray),De=he.getProgramCacheKey(ye);let Ne=G.programs;G.environment=S.isMeshStandardMaterial||S.isMeshLambertMaterial||S.isMeshPhongMaterial?B.environment:null,G.fog=B.fog;const Je=S.isMeshStandardMaterial||S.isMeshLambertMaterial&&!S.envMap||S.isMeshPhongMaterial&&!S.envMap;G.envMap=ce.get(S.envMap||G.environment,Je),G.envMapRotation=G.environment!==null&&S.envMap===null?B.environmentRotation:S.envMapRotation,Ne===void 0&&(S.addEventListener("dispose",Ce),Ne=new Map,G.programs=Ne);let nt=Ne.get(De);if(nt!==void 0){if(G.currentProgram===nt&&G.lightsStateVersion===Se)return Ti(S,ye),nt}else ye.uniforms=he.getUniforms(S),N!==null&&S.isNodeMaterial&&N.build(S,K,ye),S.onBeforeCompile(ye,C),nt=he.acquireProgram(ye,De),Ne.set(De,nt),G.uniforms=ye.uniforms;const Ue=G.uniforms;return(!S.isShaderMaterial&&!S.isRawShaderMaterial||S.clipping===!0)&&(Ue.clippingPlanes=fe.uniform),Ti(S,ye),G.needsLights=si(S),G.lightsStateVersion=Se,G.needsLights&&(Ue.ambientLightColor.value=W.state.ambient,Ue.lightProbe.value=W.state.probe,Ue.directionalLights.value=W.state.directional,Ue.directionalLightShadows.value=W.state.directionalShadow,Ue.spotLights.value=W.state.spot,Ue.spotLightShadows.value=W.state.spotShadow,Ue.rectAreaLights.value=W.state.rectArea,Ue.ltc_1.value=W.state.rectAreaLTC1,Ue.ltc_2.value=W.state.rectAreaLTC2,Ue.pointLights.value=W.state.point,Ue.pointLightShadows.value=W.state.pointShadow,Ue.hemisphereLights.value=W.state.hemi,Ue.directionalShadowMatrix.value=W.state.directionalShadowMatrix,Ue.spotLightMatrix.value=W.state.spotLightMatrix,Ue.spotLightMap.value=W.state.spotLightMap,Ue.pointShadowMatrix.value=W.state.pointShadowMatrix),G.lightProbeGrid=T.state.lightProbeGridArray.length>0,G.currentProgram=nt,G.uniformsList=null,nt}function Jt(S){if(S.uniformsList===null){const B=S.currentProgram.getUniforms();S.uniformsList=al.seqWithValue(B.seq,S.uniforms)}return S.uniformsList}function Ti(S,B){const K=V.get(S);K.outputColorSpace=B.outputColorSpace,K.batching=B.batching,K.batchingColor=B.batchingColor,K.instancing=B.instancing,K.instancingColor=B.instancingColor,K.instancingMorph=B.instancingMorph,K.skinning=B.skinning,K.morphTargets=B.morphTargets,K.morphNormals=B.morphNormals,K.morphColors=B.morphColors,K.morphTargetsCount=B.morphTargetsCount,K.numClippingPlanes=B.numClippingPlanes,K.numIntersection=B.numClipIntersection,K.vertexAlphas=B.vertexAlphas,K.vertexTangents=B.vertexTangents,K.toneMapping=B.toneMapping}function ds(S,B){if(S.length===0)return null;if(S.length===1)return S[0].texture!==null?S[0]:null;M.setFromMatrixPosition(B.matrixWorld);for(let K=0,G=S.length;K<G;K++){const W=S[K];if(W.texture!==null&&W.boundingBox.containsPoint(M))return W}return null}function sn(S,B,K,G,W){B.isScene!==!0&&(B=Qe),Z.resetTextureUnits();const ve=B.fog,Se=G.isMeshStandardMaterial||G.isMeshLambertMaterial||G.isMeshPhongMaterial?B.environment:null,ye=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:ft.workingColorSpace,De=G.isMeshStandardMaterial||G.isMeshLambertMaterial&&!G.envMap||G.isMeshPhongMaterial&&!G.envMap,Ne=ce.get(G.envMap||Se,De),Je=G.vertexColors===!0&&!!K.attributes.color&&K.attributes.color.itemSize===4,nt=!!K.attributes.tangent&&(!!G.normalMap||G.anisotropy>0),Ue=!!K.morphAttributes.position,Mt=!!K.morphAttributes.normal,Vt=!!K.morphAttributes.color;let Bt=Bi;G.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(Bt=C.toneMapping);const bt=K.morphAttributes.position||K.morphAttributes.normal||K.morphAttributes.color,mn=bt!==void 0?bt.length:0,we=V.get(G),Xn=T.state.lights;if(qe===!0&&(Ye===!0||S!==D)){const At=S===D&&G.id===j;fe.setState(G,S,At)}let pt=!1;G.version===we.__version?(we.needsLights&&we.lightsStateVersion!==Xn.state.version||we.outputColorSpace!==ye||W.isBatchedMesh&&we.batching===!1||!W.isBatchedMesh&&we.batching===!0||W.isBatchedMesh&&we.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&we.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&we.instancing===!1||!W.isInstancedMesh&&we.instancing===!0||W.isSkinnedMesh&&we.skinning===!1||!W.isSkinnedMesh&&we.skinning===!0||W.isInstancedMesh&&we.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&we.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&we.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&we.instancingMorph===!1&&W.morphTexture!==null||we.envMap!==Ne||G.fog===!0&&we.fog!==ve||we.numClippingPlanes!==void 0&&(we.numClippingPlanes!==fe.numPlanes||we.numIntersection!==fe.numIntersection)||we.vertexAlphas!==Je||we.vertexTangents!==nt||we.morphTargets!==Ue||we.morphNormals!==Mt||we.morphColors!==Vt||we.toneMapping!==Bt||we.morphTargetsCount!==mn||!!we.lightProbeGrid!=T.state.lightProbeGridArray.length>0)&&(pt=!0):(pt=!0,we.__version=G.version);let ai=we.currentProgram;pt===!0&&(ai=Ot(G,B,W),N&&G.isNodeMaterial&&N.onUpdateProgram(G,ai,we));let wi=!1,lr=!1,hs=!1;const yt=ai.getUniforms(),Ht=we.uniforms;if(x.useProgram(ai.program)&&(wi=!0,lr=!0,hs=!0),G.id!==j&&(j=G.id,lr=!0),we.needsLights){const At=ds(T.state.lightProbeGridArray,W);we.lightProbeGrid!==At&&(we.lightProbeGrid=At,lr=!0)}if(wi||D!==S){x.buffers.depth.getReversed()&&S.reversedDepth!==!0&&(S._reversedDepth=!0,S.updateProjectionMatrix()),yt.setValue(F,"projectionMatrix",S.projectionMatrix),yt.setValue(F,"viewMatrix",S.matrixWorldInverse);const ur=yt.map.cameraPosition;ur!==void 0&&ur.setValue(F,lt.setFromMatrixPosition(S.matrixWorld)),R.logarithmicDepthBuffer&&yt.setValue(F,"logDepthBufFC",2/(Math.log(S.far+1)/Math.LN2)),(G.isMeshPhongMaterial||G.isMeshToonMaterial||G.isMeshLambertMaterial||G.isMeshBasicMaterial||G.isMeshStandardMaterial||G.isShaderMaterial)&&yt.setValue(F,"isOrthographic",S.isOrthographicCamera===!0),D!==S&&(D=S,lr=!0,hs=!0)}if(we.needsLights&&(Xn.state.directionalShadowMap.length>0&&yt.setValue(F,"directionalShadowMap",Xn.state.directionalShadowMap,Z),Xn.state.spotShadowMap.length>0&&yt.setValue(F,"spotShadowMap",Xn.state.spotShadowMap,Z),Xn.state.pointShadowMap.length>0&&yt.setValue(F,"pointShadowMap",Xn.state.pointShadowMap,Z)),W.isSkinnedMesh){yt.setOptional(F,W,"bindMatrix"),yt.setOptional(F,W,"bindMatrixInverse");const At=W.skeleton;At&&(At.boneTexture===null&&At.computeBoneTexture(),yt.setValue(F,"boneTexture",At.boneTexture,Z))}W.isBatchedMesh&&(yt.setOptional(F,W,"batchingTexture"),yt.setValue(F,"batchingTexture",W._matricesTexture,Z),yt.setOptional(F,W,"batchingIdTexture"),yt.setValue(F,"batchingIdTexture",W._indirectTexture,Z),yt.setOptional(F,W,"batchingColorTexture"),W._colorsTexture!==null&&yt.setValue(F,"batchingColorTexture",W._colorsTexture,Z));const cr=K.morphAttributes;if((cr.position!==void 0||cr.normal!==void 0||cr.color!==void 0)&&U.update(W,K,ai),(lr||we.receiveShadow!==W.receiveShadow)&&(we.receiveShadow=W.receiveShadow,yt.setValue(F,"receiveShadow",W.receiveShadow)),(G.isMeshStandardMaterial||G.isMeshLambertMaterial||G.isMeshPhongMaterial)&&G.envMap===null&&B.environment!==null&&(Ht.envMapIntensity.value=B.environmentIntensity),Ht.dfgLUT!==void 0&&(Ht.dfgLUT.value=Sy()),lr){if(yt.setValue(F,"toneMappingExposure",C.toneMappingExposure),we.needsLights&&Gt(Ht,hs),ve&&G.fog===!0&&Ae.refreshFogUniforms(Ht,ve),Ae.refreshMaterialUniforms(Ht,G,ne,oe,T.state.transmissionRenderTarget[S.id]),we.needsLights&&we.lightProbeGrid){const At=we.lightProbeGrid;Ht.probesSH.value=At.texture,Ht.probesMin.value.copy(At.boundingBox.min),Ht.probesMax.value.copy(At.boundingBox.max),Ht.probesResolution.value.copy(At.resolution)}al.upload(F,Jt(we),Ht,Z)}if(G.isShaderMaterial&&G.uniformsNeedUpdate===!0&&(al.upload(F,Jt(we),Ht,Z),G.uniformsNeedUpdate=!1),G.isSpriteMaterial&&yt.setValue(F,"center",W.center),yt.setValue(F,"modelViewMatrix",W.modelViewMatrix),yt.setValue(F,"normalMatrix",W.normalMatrix),yt.setValue(F,"modelMatrix",W.matrixWorld),G.uniformsGroups!==void 0){const At=G.uniformsGroups;for(let ur=0,ps=At.length;ur<ps;ur++){const Uf=At[ur];ie.update(Uf,ai),ie.bind(Uf,ai)}}return ai}function Gt(S,B){S.ambientLightColor.needsUpdate=B,S.lightProbe.needsUpdate=B,S.directionalLights.needsUpdate=B,S.directionalLightShadows.needsUpdate=B,S.pointLights.needsUpdate=B,S.pointLightShadows.needsUpdate=B,S.spotLights.needsUpdate=B,S.spotLightShadows.needsUpdate=B,S.rectAreaLights.needsUpdate=B,S.hemisphereLights.needsUpdate=B}function si(S){return S.isMeshLambertMaterial||S.isMeshToonMaterial||S.isMeshPhongMaterial||S.isMeshStandardMaterial||S.isShadowMaterial||S.isShaderMaterial&&S.lights===!0}this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return I},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(S,B,K){const G=V.get(S);G.__autoAllocateDepthBuffer=S.resolveDepthBuffer===!1,G.__autoAllocateDepthBuffer===!1&&(G.__useRenderToTexture=!1),V.get(S.texture).__webglTexture=B,V.get(S.depthTexture).__webglTexture=G.__autoAllocateDepthBuffer?void 0:K,G.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(S,B){const K=V.get(S);K.__webglFramebuffer=B,K.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(S,B=0,K=0){q=S,z=B,I=K;let G=null,W=!1,ve=!1;if(S){const ye=V.get(S);if(ye.__useDefaultFramebuffer!==void 0){x.bindFramebuffer(F.FRAMEBUFFER,ye.__webglFramebuffer),se.copy(S.viewport),pe.copy(S.scissor),Ve=S.scissorTest,x.viewport(se),x.scissor(pe),x.setScissorTest(Ve),j=-1;return}else if(ye.__webglFramebuffer===void 0)Z.setupRenderTarget(S);else if(ye.__hasExternalTextures)Z.rebindTextures(S,V.get(S.texture).__webglTexture,V.get(S.depthTexture).__webglTexture);else if(S.depthBuffer){const Je=S.depthTexture;if(ye.__boundDepthTexture!==Je){if(Je!==null&&V.has(Je)&&(S.width!==Je.image.width||S.height!==Je.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");Z.setupDepthRenderbuffer(S)}}const De=S.texture;(De.isData3DTexture||De.isDataArrayTexture||De.isCompressedArrayTexture)&&(ve=!0);const Ne=V.get(S).__webglFramebuffer;S.isWebGLCubeRenderTarget?(Array.isArray(Ne[B])?G=Ne[B][K]:G=Ne[B],W=!0):S.samples>0&&Z.useMultisampledRTT(S)===!1?G=V.get(S).__webglMultisampledFramebuffer:Array.isArray(Ne)?G=Ne[K]:G=Ne,se.copy(S.viewport),pe.copy(S.scissor),Ve=S.scissorTest}else se.copy(Te).multiplyScalar(ne).floor(),pe.copy(tt).multiplyScalar(ne).floor(),Ve=Me;if(K!==0&&(G=Y),x.bindFramebuffer(F.FRAMEBUFFER,G)&&x.drawBuffers(S,G),x.viewport(se),x.scissor(pe),x.setScissorTest(Ve),W){const ye=V.get(S.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+B,ye.__webglTexture,K)}else if(ve){const ye=B;for(let De=0;De<S.textures.length;De++){const Ne=V.get(S.textures[De]);F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+De,Ne.__webglTexture,K,ye)}}else if(S!==null&&K!==0){const ye=V.get(S.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,ye.__webglTexture,K)}j=-1},this.readRenderTargetPixels=function(S,B,K,G,W,ve,Se,ye=0){if(!(S&&S.isWebGLRenderTarget)){mt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let De=V.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&Se!==void 0&&(De=De[Se]),De){x.bindFramebuffer(F.FRAMEBUFFER,De);try{const Ne=S.textures[ye],Je=Ne.format,nt=Ne.type;if(S.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+ye),!R.textureFormatReadable(Je)){mt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!R.textureTypeReadable(nt)){mt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=S.width-G&&K>=0&&K<=S.height-W&&F.readPixels(B,K,G,W,_e.convert(Je),_e.convert(nt),ve)}finally{const Ne=q!==null?V.get(q).__webglFramebuffer:null;x.bindFramebuffer(F.FRAMEBUFFER,Ne)}}},this.readRenderTargetPixelsAsync=async function(S,B,K,G,W,ve,Se,ye=0){if(!(S&&S.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let De=V.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&Se!==void 0&&(De=De[Se]),De)if(B>=0&&B<=S.width-G&&K>=0&&K<=S.height-W){x.bindFramebuffer(F.FRAMEBUFFER,De);const Ne=S.textures[ye],Je=Ne.format,nt=Ne.type;if(S.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+ye),!R.textureFormatReadable(Je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!R.textureTypeReadable(nt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ue=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,Ue),F.bufferData(F.PIXEL_PACK_BUFFER,ve.byteLength,F.STREAM_READ),F.readPixels(B,K,G,W,_e.convert(Je),_e.convert(nt),0);const Mt=q!==null?V.get(q).__webglFramebuffer:null;x.bindFramebuffer(F.FRAMEBUFFER,Mt);const Vt=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await A0(F,Vt,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,Ue),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,ve),F.deleteBuffer(Ue),F.deleteSync(Vt),ve}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(S,B=null,K=0){const G=Math.pow(2,-K),W=Math.floor(S.image.width*G),ve=Math.floor(S.image.height*G),Se=B!==null?B.x:0,ye=B!==null?B.y:0;Z.setTexture2D(S,0),F.copyTexSubImage2D(F.TEXTURE_2D,K,0,0,Se,ye,W,ve),x.unbindTexture()},this.copyTextureToTexture=function(S,B,K=null,G=null,W=0,ve=0){let Se,ye,De,Ne,Je,nt,Ue,Mt,Vt;const Bt=S.isCompressedTexture?S.mipmaps[ve]:S.image;if(K!==null)Se=K.max.x-K.min.x,ye=K.max.y-K.min.y,De=K.isBox3?K.max.z-K.min.z:1,Ne=K.min.x,Je=K.min.y,nt=K.isBox3?K.min.z:0;else{const Ht=Math.pow(2,-W);Se=Math.floor(Bt.width*Ht),ye=Math.floor(Bt.height*Ht),S.isDataArrayTexture?De=Bt.depth:S.isData3DTexture?De=Math.floor(Bt.depth*Ht):De=1,Ne=0,Je=0,nt=0}G!==null?(Ue=G.x,Mt=G.y,Vt=G.z):(Ue=0,Mt=0,Vt=0);const bt=_e.convert(B.format),mn=_e.convert(B.type);let we;B.isData3DTexture?(Z.setTexture3D(B,0),we=F.TEXTURE_3D):B.isDataArrayTexture||B.isCompressedArrayTexture?(Z.setTexture2DArray(B,0),we=F.TEXTURE_2D_ARRAY):(Z.setTexture2D(B,0),we=F.TEXTURE_2D),x.activeTexture(F.TEXTURE0),x.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,B.flipY),x.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),x.pixelStorei(F.UNPACK_ALIGNMENT,B.unpackAlignment);const Xn=x.getParameter(F.UNPACK_ROW_LENGTH),pt=x.getParameter(F.UNPACK_IMAGE_HEIGHT),ai=x.getParameter(F.UNPACK_SKIP_PIXELS),wi=x.getParameter(F.UNPACK_SKIP_ROWS),lr=x.getParameter(F.UNPACK_SKIP_IMAGES);x.pixelStorei(F.UNPACK_ROW_LENGTH,Bt.width),x.pixelStorei(F.UNPACK_IMAGE_HEIGHT,Bt.height),x.pixelStorei(F.UNPACK_SKIP_PIXELS,Ne),x.pixelStorei(F.UNPACK_SKIP_ROWS,Je),x.pixelStorei(F.UNPACK_SKIP_IMAGES,nt);const hs=S.isDataArrayTexture||S.isData3DTexture,yt=B.isDataArrayTexture||B.isData3DTexture;if(S.isDepthTexture){const Ht=V.get(S),cr=V.get(B),At=V.get(Ht.__renderTarget),ur=V.get(cr.__renderTarget);x.bindFramebuffer(F.READ_FRAMEBUFFER,At.__webglFramebuffer),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,ur.__webglFramebuffer);for(let ps=0;ps<De;ps++)hs&&(F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,V.get(S).__webglTexture,W,nt+ps),F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,V.get(B).__webglTexture,ve,Vt+ps)),F.blitFramebuffer(Ne,Je,Se,ye,Ue,Mt,Se,ye,F.DEPTH_BUFFER_BIT,F.NEAREST);x.bindFramebuffer(F.READ_FRAMEBUFFER,null),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else if(W!==0||S.isRenderTargetTexture||V.has(S)){const Ht=V.get(S),cr=V.get(B);x.bindFramebuffer(F.READ_FRAMEBUFFER,H),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,O);for(let At=0;At<De;At++)hs?F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,Ht.__webglTexture,W,nt+At):F.framebufferTexture2D(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,Ht.__webglTexture,W),yt?F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,cr.__webglTexture,ve,Vt+At):F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,cr.__webglTexture,ve),W!==0?F.blitFramebuffer(Ne,Je,Se,ye,Ue,Mt,Se,ye,F.COLOR_BUFFER_BIT,F.NEAREST):yt?F.copyTexSubImage3D(we,ve,Ue,Mt,Vt+At,Ne,Je,Se,ye):F.copyTexSubImage2D(we,ve,Ue,Mt,Ne,Je,Se,ye);x.bindFramebuffer(F.READ_FRAMEBUFFER,null),x.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else yt?S.isDataTexture||S.isData3DTexture?F.texSubImage3D(we,ve,Ue,Mt,Vt,Se,ye,De,bt,mn,Bt.data):B.isCompressedArrayTexture?F.compressedTexSubImage3D(we,ve,Ue,Mt,Vt,Se,ye,De,bt,Bt.data):F.texSubImage3D(we,ve,Ue,Mt,Vt,Se,ye,De,bt,mn,Bt):S.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,ve,Ue,Mt,Se,ye,bt,mn,Bt.data):S.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,ve,Ue,Mt,Bt.width,Bt.height,bt,Bt.data):F.texSubImage2D(F.TEXTURE_2D,ve,Ue,Mt,Se,ye,bt,mn,Bt);x.pixelStorei(F.UNPACK_ROW_LENGTH,Xn),x.pixelStorei(F.UNPACK_IMAGE_HEIGHT,pt),x.pixelStorei(F.UNPACK_SKIP_PIXELS,ai),x.pixelStorei(F.UNPACK_SKIP_ROWS,wi),x.pixelStorei(F.UNPACK_SKIP_IMAGES,lr),ve===0&&B.generateMipmaps&&F.generateMipmap(we),x.unbindTexture()},this.initRenderTarget=function(S){V.get(S).__webglFramebuffer===void 0&&Z.setupRenderTarget(S)},this.initTexture=function(S){S.isCubeTexture?Z.setTextureCube(S,0):S.isData3DTexture?Z.setTexture3D(S,0):S.isDataArrayTexture||S.isCompressedArrayTexture?Z.setTexture2DArray(S,0):Z.setTexture2D(S,0),x.unbindTexture()},this.resetState=function(){z=0,I=0,q=null,x.reset(),xe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=ft._getDrawingBufferColorSpace(e),t.unpackColorSpace=ft._getUnpackColorSpace()}}const yy=["claude","opencode","gemini","copilot","codex","antigravity","cursor","kimi"],Ey=[{left:88,top:29},{left:73,top:9},{left:27,top:9},{left:12,top:29},{left:9,top:57},{left:24,top:79},{left:76,top:79},{left:91,top:57}],Rt={tilt:-.58,flatten:.72,swirl:2.6,cameraZ:17,cameraY:7,cameraFov:62,cameraDollyIn:7,cameraPushIn:11,introSeconds:2.4,orbitSpeed:.012,mobileOrbitSpeed:.14,mobileCameraZ:20,mobileCameraY:6,mobileCameraFov:82,mobilePointScale:1.45,mobileLensScale:1.45,yOffset:-3.9};function Ty({compactViewport:r}){return r?Rt.mobileOrbitSpeed:Rt.orbitSpeed}function wy({compactViewport:r}){return r?{cameraFov:Rt.mobileCameraFov,cameraY:Rt.mobileCameraY,cameraZ:Rt.mobileCameraZ,lensScale:Rt.mobileLensScale,lookAtY:Rt.yOffset,pointScale:Rt.mobilePointScale}:{cameraFov:Rt.cameraFov,cameraY:Rt.cameraY,cameraZ:Rt.cameraZ,lensScale:1,lookAtY:0,pointScale:1}}const Th=10.56,Ay=1.78,Aa={cx:50,cy:43,rx:40,ry:34},wh={cx:50,cy:68,rx:43,ry:19};function Rf(){return Ey.map(r=>Math.atan2((Aa.cy-r.top)/Aa.ry,(r.left-Aa.cx)/Aa.rx))}function Cf(r,e=1,t=!1,n=wh.cy){const i=t?wh:Aa,s=t?n:i.cy;return{left:i.cx+Math.cos(r)*i.rx*e,top:s-Math.sin(r)*i.ry*e}}function Ry(r,e){const t=Math.cos(Rt.tilt),n=(50-e)/50*Th;return{x:(r-50)/50*Th*Ay,y:(n-Rt.yOffset)/(Rt.flatten*t),z:0}}function Cy(){return Rf().map(r=>{const e=Cf(r);return Ry(e.left,e.top)})}function Py({lowPower:r}){return r?{flow:1400,disc:4600,stars:400}:{flow:4200,disc:14e3,stars:1e3}}function Dy(){return Rf().map(Cf)}function Ah(r){return .35+(Math.min(79,Math.max(9,r))-9)/70*1.15}const Ly=`
4109
4109
  uniform float uTime;
4110
4110
  uniform float uPixelRatio;
4111
4111
  uniform float uSwirl;
@@ -4295,7 +4295,7 @@ void main() {
4295
4295
  vAlpha = alpha;
4296
4296
  vGlow = glow;
4297
4297
  }
4298
- `,Ly=`
4298
+ `,Ny=`
4299
4299
  precision mediump float;
4300
4300
  uniform float uGlobalAlpha;
4301
4301
  varying float vAlpha;
@@ -4311,4 +4311,4 @@ void main() {
4311
4311
  if (a < 0.003) discard;
4312
4312
  gl_FragColor = vec4(vColor, a);
4313
4313
  }
4314
- `,zm="(max-width: 1023px)";function wh(r=typeof window>"u"?void 0:window,e=typeof document>"u"?void 0:document){return r?.visualViewport?.height||e?.documentElement?.clientHeight||r?.innerHeight||1}function Ny(){if(typeof window>"u")return!0;const r=window.matchMedia?.(zm)?.matches,e=(navigator.hardwareConcurrency||8)<=4;return!!(r||e)}function Iy(r,e){const t=e.flow+e.disc+e.stars,n=new Float32Array(t*3),i=new Float32Array(t),s=new Float32Array(t),a=new Float32Array(t),o=new Float32Array(t),l=new Float32Array(t);for(let u=0;u<e.flow;u+=1){const h=u%r.length,f=r[h];n[u*3]=f.x,n[u*3+1]=f.y,n[u*3+2]=f.z,i[u]=Math.random(),s[u]=Math.random(),a[u]=1+Math.random()*1.9,o[u]=1,l[u]=h}for(let u=e.flow;u<e.flow+e.disc;u+=1){const h=Math.random(),f=h<.55?11*(.05+.95*Math.pow(Math.random(),.8)):h<.85?9+Math.random()*3.4:11+Math.random()*3,d=Math.random()*Math.PI*2;n[u*3]=Math.cos(d)*f,n[u*3+1]=Math.sin(d)*f,n[u*3+2]=0,i[u]=Math.random(),s[u]=Math.random(),a[u]=1.1+Math.random()*1.6,o[u]=2,l[u]=0}for(let u=e.flow+e.disc;u<t;u+=1){const h=14+Math.random()*22,f=Math.random()*Math.PI*2;n[u*3]=Math.cos(f)*h,n[u*3+1]=(Math.random()-.5)*16,n[u*3+2]=-8-Math.random()*22,i[u]=Math.random(),s[u]=Math.random(),a[u]=.5+Math.random()*1,o[u]=0,l[u]=0}const c=new Ei;return c.setAttribute("position",new Mn(n,3)),c.setAttribute("aSeed",new Mn(i,1)),c.setAttribute("aPhase",new Mn(s,1)),c.setAttribute("aSize",new Mn(a,1)),c.setAttribute("aFlow",new Mn(o,1)),c.setAttribute("aStream",new Mn(l,1)),c}function Uy({mode:r="full",progressRef:e,className:t=""}){const n=Fe.useRef(null),i=Fe.useRef([]),s=Fe.useRef(null),[a,o]=Fe.useState(!1);Fe.useEffect(()=>{if(r!=="full")return;const u=n.current;if(!u)return;let h;try{h=new Sy({antialias:!1,alpha:!0,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch(We){console.warn("TokenGalaxy: WebGL unavailable, using static fallback.",We),o(!0);return}const f=Ny(),d=window.matchMedia?.(zm)?.matches??!1,g=Ey({compactViewport:d}),_=Ty({compactViewport:d}),p=Math.min(window.devicePixelRatio||1,f?1.5:2);h.setPixelRatio(p),h.setClearColor(0,0);const m=h.domElement;m.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;",u.appendChild(m);const b=new ix,y=new di(_.cameraFov,1,.1,120);y.position.set(0,0,_.cameraZ);const M=Ry(),E=Iy(M,Cy({lowPower:f})),T={uTime:{value:0},uPixelRatio:{value:p},uSwirl:{value:Rt.swirl},uFlatten:{value:Rt.flatten},uTilt:{value:Rt.tilt},uYOffset:{value:Rt.yOffset},uIntro:{value:0},uOrbit:{value:0},uAnchors:{value:M.map(We=>new X(We.x,We.y,We.z))},uGlobalAlpha:{value:0},uProgress:{value:0},uLensScale:{value:_.lensScale},uPointScale:{value:_.pointScale},uColorA:{value:new ht(Il.accent)},uColorB:{value:new ht(Il.accentSoft)},uColorC:{value:new ht(Il.glint)}},A=new yi({vertexShader:Dy,fragmentShader:Ly,uniforms:T,transparent:!0,depthTest:!1,depthWrite:!1,blending:Jc}),v=new px(E,A);v.frustumCulled=!1,b.add(v);const w=Rf(),C=Math.cos(Rt.tilt),L=Math.sin(Rt.tilt),N=new X(0,-L,C),Y=new X(0,Rt.yOffset,0),H=new X(0,C,L),O=new X,z=new X,I=new X,q=(We,Qe,Ge)=>{O.set(We/50-1,1-Qe/50,.5).unproject(y),z.copy(O).sub(y.position).normalize();const Ze=N.dot(z);if(Math.abs(Ze)<1e-6)return Ge.set(0,0,0);const F=N.dot(I.copy(Y).sub(y.position))/Ze;return O.copy(y.position).addScaledVector(z,F),I.copy(O).sub(Y),Ge.set(O.x,I.dot(H)/Rt.flatten,0)};let j=0,D=0;function se(){const We=u.clientWidth||1,Qe=u.clientHeight||1;if(Math.abs(We-j)<1&&Math.abs(Qe-D)<1)return;j=We,D=Qe,h.setSize(We,Qe,!1),y.aspect=We/Qe,y.updateProjectionMatrix();const Ge=wh();Qe>Ge&&(y.projectionMatrix.elements[9]=-(Qe-Ge)/Qe,y.projectionMatrixInverse.copy(y.projectionMatrix).invert())}let pe=0;const Ve=new ResizeObserver(()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(se)});Ve.observe(u),se();const He={current:!0},Le={current:!1},Q=new IntersectionObserver(We=>{He.current=We[0]?.isIntersecting??!0},{threshold:0});Q.observe(u);const oe=()=>{Le.current=document.hidden};document.addEventListener("visibilitychange",oe,{passive:!0});const ne={x:0,y:0},Ee={x:0,y:0},Oe=We=>{ne.x=We.clientX/window.innerWidth*2-1,ne.y=We.clientY/window.innerHeight*2-1},Te=window.matchMedia?.("(hover: hover)")?.matches;Te&&window.addEventListener("pointermove",Oe,{passive:!0});const tt=new Tx;let Me=0,ze=0,qe=0,Ye=0,$=0;function lt(){if(Ye=requestAnimationFrame(lt),Le.current||!He.current)return;const We=tt.getElapsedTime(),Qe=Math.min(Math.max(We-qe,.001),.033);qe=We;const Ge=Math.min(Math.max(e?.current??0,0),1);$+=(Ge-$)*(1-Math.exp(-Qe/.14));const Ze=$;T.uTime.value=We,T.uOrbit.value=We*g,T.uProgress.value=Ze,Me=Math.min(1,Me+Qe/.9),ze=Math.min(1,ze+Qe/Rt.introSeconds);const F=1-Math.pow(1-ze,3);T.uIntro.value=F,T.uGlobalAlpha.value=Me*(1-Fr.smoothstep(Ze,.55,.8));const Ct=1-Math.exp(-Qe/.22);Ee.x+=(ne.x-Ee.x)*Ct,Ee.y+=(ne.y-Ee.y)*Ct,y.position.x=Ee.x*1.8,y.position.y=_.cameraY-Ee.y*1.2-Ze*4.5,y.position.z=_.cameraZ+(1-F)*Rt.cameraDollyIn-Ze*Rt.cameraPushIn,d&&(y.lookAt(0,_.lookAtY,0),y.updateMatrixWorld());const Xe=wh(),R=new X(0,Rt.yOffset,0);R.applyMatrix4(y.matrixWorldInverse);const x=1-2*(.68*Xe/D);if(y.projectionMatrix.elements[9]=y.projectionMatrix.elements[5]*R.y/-R.z-x,y.projectionMatrixInverse.copy(y.projectionMatrix).invert(),d||y.lookAt(0,_.lookAtY,0),h.render(b,y),s.current){const ce=Fr.smoothstep(Ze,0,.25)*(1-Fr.smoothstep(Ze,.25,.65)),ae=1-Fr.smoothstep(Ze,.35,.75),J=1+Ze*1.2,ee=.4*Me*ae*(1+ce*1.5);s.current.style.transform=`translate3d(-50%, -50%, 0) scale(${J.toFixed(3)})`,s.current.style.opacity=String(ee.toFixed(3))}const k=1+Math.pow(Ze,1.8)*1.5,V=Me*(1-Fr.smoothstep(Ze,.25,.7)),K=Fr.smoothstep(Ze,0,.2)*(1-Fr.smoothstep(Ze,.2,.6));for(let ce=0;ce<w.length;ce+=1){const ae=i.current[ce];if(!ae)continue;const J=w[ce]+T.uOrbit.value,ee=68*Xe/D,he=Cf(J,k,d,ee);q(he.left,he.top,T.uAnchors.value[ce]);const Ae=he.left/100*j,ge=he.top/100*D,me=Th(he.top),fe=Math.min(1,Math.max(0,F*2.6-ce*.22)),Pe=me*(.6+.4*fe)*(1-Ze*.3);ae.style.transform=`translate3d(${Ae.toFixed(1)}px, ${ge.toFixed(1)}px, 0) translate(-50%, -50%) scale(${Pe.toFixed(3)})`,ae.style.opacity=String(Math.max(0,V*fe*(.75+.25*me)).toFixed(3));const Ie=1+K*1.4,U=1+K*.6;ae.style.filter=`brightness(${Ie.toFixed(2)}) saturate(${U.toFixed(2)})`;const de=(12+K*28).toFixed(0),te=(.3+K*.6).toFixed(2);ae.style.boxShadow=`0 0 ${de}px rgba(168, 85, 247, ${te})`}}return lt(),()=>{cancelAnimationFrame(Ye),cancelAnimationFrame(pe),Ve.disconnect(),Q.disconnect(),document.removeEventListener("visibilitychange",oe),Te&&window.removeEventListener("pointermove",Oe),b.clear(),E.dispose(),A.dispose(),h.dispose(),h.forceContextLoss(),u.contains(m)&&u.removeChild(m)}},[r]);const l=r!=="full"||a,c=Py();return P.jsxs("div",{ref:n,className:`pointer-events-none absolute inset-0 overflow-hidden ${t}`,"aria-hidden":"true","data-mode":l?"static":"webgl",children:[P.jsx("div",{ref:s,className:"absolute left-1/2 top-[68vh] h-72 w-72 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-45 lg:h-[28rem] lg:w-[28rem]",style:{background:"radial-gradient(circle, var(--lv3-bg) 6%, rgba(138, 122, 255, 0.28) 18%, rgba(138, 122, 255, 0.05) 45%, transparent 68%)"}}),l?P.jsx("div",{className:"absolute left-1/2 top-[68vh] h-[22rem] w-[52rem] max-w-[92vw] -translate-x-1/2 -translate-y-1/2 rounded-[50%] opacity-50",style:{background:"radial-gradient(ellipse at center, var(--lv3-accent-ghost) 0%, transparent 60%)",boxShadow:"inset 0 0 120px var(--lv3-accent-ghost)"}}):null,by.map((u,h)=>P.jsxs("div",{"data-provider-orb":u,ref:f=>{i.current[h]=f},className:"absolute left-0 top-0 flex h-10 w-10 items-center justify-center rounded-full border border-white/20 lg:h-12 lg:w-12",style:{background:"var(--lv3-orb-surface)",boxShadow:"var(--lv3-orb-shadow)",backdropFilter:"blur(10px) saturate(1.3)",WebkitBackdropFilter:"blur(10px) saturate(1.3)",...l?{left:`${c[h].left}%`,top:`${c[h].top}%`,transform:`translate(-50%, -50%) scale(${Th(c[h].top).toFixed(2)})`,opacity:.9}:{opacity:0}},children:[l?null:P.jsx("span",{className:"absolute inset-0 animate-ping rounded-full border border-[color:var(--lv3-accent)] opacity-40",style:{animationDuration:`${2.2+h*.35}s`},"aria-hidden":"true"}),P.jsx("span",{className:"absolute left-[16%] top-[8%] h-[32%] w-[52%] rounded-full opacity-80",style:{background:"var(--lv3-orb-highlight)",filter:"blur(1.5px)"},"aria-hidden":"true"}),P.jsx("span",{className:"absolute left-[24%] top-[13%] h-[16%] w-[22%] rounded-full",style:{background:"var(--lv3-orb-glint)"},"aria-hidden":"true"}),P.jsx(Xm,{provider:u,size:19})]},u))]})}function Gm({copy:r,installCommand:e,installCopied:t,onCopyInstallCommand:n,reduceMotion:i}){return P.jsxs("div",{className:"w-full max-w-lg mx-auto",children:[P.jsxs(Nh.div,{whileHover:i?void 0:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[P.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, var(--lv3-glint), transparent 10%)",animationDuration:"6s"}}),P.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, var(--lv3-glint), transparent 10%)",animationDuration:"6s"}}),P.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-oai-black border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[P.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[P.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),P.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:e?e.split(" ").map((s,a)=>P.jsxs("span",{className:s==="npx"||s==="tokentracker-cli"?"text-white font-medium":s==="--yes"?"text-oai-gray-500":"text-[color:var(--lv3-accent-soft)]",children:[s," "]},a)):null})]}),P.jsx("button",{type:"button",onClick:n,"aria-label":r(t?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:t?P.jsx(ng,{className:"h-4 w-4 text-[color:var(--lv3-accent-soft)]","aria-hidden":!0}):P.jsx(ig,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),P.jsx("span",{className:"sr-only","aria-live":"polite",children:t?r("landing.install.action.copied"):""})]})}function Fy(){if(typeof navigator>"u")return"other";const e=`${navigator.userAgentData?.platform??""} ${navigator.userAgent??""} ${navigator.platform??""}`.toLowerCase();return e.includes("win")?"windows":e.includes("mac")&&!e.includes("iphone")&&!e.includes("ipad")?"mac":"other"}function Ah({className:r}){return P.jsx("svg",{viewBox:"0 0 384 512",className:r,fill:"currentColor","aria-hidden":"true",children:P.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function Oy({className:r}){return P.jsx("svg",{viewBox:"0 0 16 16",className:r,fill:"currentColor","aria-hidden":"true",children:P.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function Rh({className:r}){return P.jsx("svg",{viewBox:"0 0 24 24",className:r,fill:"currentColor","aria-hidden":"true",children:P.jsx("path",{d:"M3 5.46 10.2 4.5v6.92H3V5.46Zm0 13.08 7.2.96v-6.84H3v5.88Zm8.04 1.08L21 21V12.46h-9.96v7.16ZM11.04 4.38 21 3v8.46h-9.96V4.38Z"})})}function Vm({copy:r,githubLabel:e}){const t=Fe.useMemo(()=>Fy(),[]),n={href:Ff,label:r("landing.v2.install.os_macos"),Icon:Ah},i={href:Of,label:r("landing.v2.install.os_windows"),Icon:Rh},s=t==="windows"?{href:Of,label:r("landing.v2.install.win_cta"),Icon:Rh}:t==="mac"?{href:Ff,label:r("landing.v2.install.mac_cta"),Icon:Ah}:{href:Ym,label:r("landing.v2.install.desktop_cta"),Icon:rg},o=[...(t==="windows"?[n]:t==="mac"?[i]:[n,i]).map(l=>({key:l.href,href:l.href,Icon:l.Icon,label:l.label})),{key:Ac,href:Ac,Icon:Oy,label:e}];return P.jsx("div",{className:"flex justify-center",children:P.jsxs("div",{className:"flex min-w-[16rem] flex-col items-stretch",children:[P.jsxs("a",{href:s.href,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex h-11 items-center justify-center gap-2 rounded-full bg-white px-7 text-sm font-semibold text-oai-gray-950 shadow-lg shadow-black/30 transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98]",children:[P.jsx(s.Icon,{className:"h-4 w-4"}),s.label]}),P.jsx("div",{className:"mt-3 flex gap-3",children:o.map(l=>P.jsxs("a",{href:l.href,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex h-9 flex-1 items-center justify-center gap-2 rounded-full border border-white/10 bg-oai-black/60 px-3 text-sm font-medium text-oai-gray-200 backdrop-blur-sm transition-colors hover:border-white/25 hover:text-white",children:[P.jsx(l.Icon,{className:"h-4 w-4 shrink-0 text-oai-gray-400 group-hover:text-white"}),P.jsx("span",{className:"truncate",children:l.label})]},l.key))})]})})}const By=1800,ky=250;function zy(r){return Math.round(r).toLocaleString("en-US")}function Hm({value:r,animate:e=!0,durationMs:t=By,format:n=zy,ratePerSec:i=0,className:s}){const a=Number(r)||0,[o,l]=Fe.useState(e?0:a),c=Fe.useRef(null),u=Fe.useRef(e?0:a),[h,f]=Fe.useState(!1);return Fe.useEffect(()=>{u.current=o},[o]),Fe.useEffect(()=>{if(!e)return;const d=c.current;if(!d||typeof IntersectionObserver>"u"){f(!0);return}const g=new IntersectionObserver(_=>f(!!_[0]?.isIntersecting),{threshold:.4});return g.observe(d),()=>g.disconnect()},[e]),Fe.useEffect(()=>{if(!e){l(a);return}if(!h)return;const d=u.current;if(d===a&&!(i>0))return;let g=0;const _=performance.now();let p=_,m=0;const b=i>0&&d>=a;let y=Math.max(d,a);const M=E=>{const T=b?1:Math.min(1,(E-_)/t);if(T<1){const v=1-Math.pow(1-T,4);l(d+(a-d)*v),p=E,g=requestAnimationFrame(M);return}if(!(i>0)){l(a);return}const A=Math.min(E-p,100)/1e3;p=E,y=Math.max(y,a)+i*A,E-m>=ky&&(m=E,l(y)),g=requestAnimationFrame(M)};return g=requestAnimationFrame(M),()=>cancelAnimationFrame(g)},[e,h,a,t,i]),P.jsx("span",{ref:c,className:s,children:n(o)})}function Gy(r){return r?"absolute inset-x-0 bottom-0 top-0 z-0 lg:bottom-[-40vh]":"absolute inset-0 z-0"}function Vy({copy:r,animate:e,effectsReady:t,stats:n,tokenFallback:i,devsFallback:s,installCommand:a,installCopied:o,onCopyInstallCommand:l,githubLabel:c}){const u=Fe.useRef(null),h=Fe.useRef(null),f=Fe.useRef(null),d=Fe.useRef(0);Fe.useLayoutEffect(()=>{if(!e)return;const b=Lt.context(()=>{ot.create({trigger:u.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:M=>{d.current=M.progress}});const y=Lt.timeline({defaults:{ease:"none"},scrollTrigger:{trigger:u.current,start:"top top",end:"bottom top",scrub:.5}});y.to(h.current,{yPercent:-16,autoAlpha:0,duration:.3},.08),y.to(f.current,{y:-28,scale:.94,autoAlpha:0,duration:.22},.45),y.to({},{duration:.1})},u);return()=>b.revert()},[e]);const g=n.status==="ready"?n.tokenFloor:i,_=n.status==="ready"?n.totalEntries:s,p=g*.004/86400,m=e&&t?"full":"static";return P.jsx("section",{ref:u,className:"relative",children:P.jsxs("div",{className:"relative min-h-[max(100svh,52rem)]",children:[P.jsx("div",{ref:h,className:"relative z-20 mx-auto flex max-w-3xl flex-col items-center px-4 pt-28 text-center tall:pt-48 xtall:pt-56 sm:px-6 sm:pt-36 sm:xtall:pt-60",children:P.jsxs(Nh.div,{initial:e?{opacity:0,y:24}:!1,animate:{opacity:1,y:0},transition:{duration:.6},className:"flex flex-col items-center",children:[P.jsxs("p",{className:"mb-3 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.03] px-4 py-1.5 text-[10px] font-bold uppercase tracking-[0.2em] text-oai-gray-400 tall:mb-5",children:[P.jsxs("span",{className:"relative flex h-1.5 w-1.5","aria-hidden":"true",children:[P.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-[color:var(--lv3-accent)] opacity-75"}),P.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-[color:var(--lv3-accent)]"})]}),r("landing.v3.hero.kicker")]}),P.jsxs("h1",{className:"text-balance text-4xl font-semibold leading-[1.08] tracking-tight text-white sm:text-[2.75rem] sm:tall:text-[3.25rem] sm:xtall:text-6xl lg:xtall:text-[4rem]",children:[r("landing.v2.hero.title_line1"),P.jsx("br",{}),P.jsx("span",{className:"bg-gradient-to-b from-white via-[color:var(--lv3-accent-soft)] to-[color:var(--lv3-accent)] bg-clip-text font-bold tracking-tight text-transparent",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.12)"},children:r("landing.v2.hero.title_line2")})]}),P.jsx("div",{className:"mt-8 sm:mt-10 w-full xtall:mt-12",children:P.jsx(Gm,{copy:r,installCommand:a,installCopied:o,onCopyInstallCommand:l,reduceMotion:!e})}),P.jsx("div",{className:"mt-4 w-full xtall:mt-5",children:P.jsx(Vm,{copy:r,githubLabel:c})})]})}),P.jsxs("div",{className:Gy(e),children:[P.jsx(Uy,{mode:m,progressRef:d}),P.jsx("div",{className:"pointer-events-none absolute left-1/2 top-[68vh] z-10 -translate-x-1/2 -translate-y-1/2",children:P.jsxs("div",{ref:f,className:"flex flex-col items-center gap-2",children:[P.jsx("div",{className:"absolute -inset-x-28 -inset-y-12 -z-10",style:{backdropFilter:"blur(9px)",WebkitBackdropFilter:"blur(9px)",background:"radial-gradient(closest-side, var(--lv3-scrim), transparent 76%)",maskImage:"radial-gradient(closest-side, black 55%, transparent 100%)",WebkitMaskImage:"radial-gradient(closest-side, black 55%, transparent 100%)"},"aria-hidden":"true"}),P.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.3em] text-oai-gray-300",children:r("landing.v3.hero.stat_label")}),P.jsx("p",{className:"whitespace-nowrap font-mono text-4xl font-bold tabular-nums leading-none text-white sm:tall:text-5xl",style:{textShadow:"0 2px 24px rgba(0, 0, 0, 0.9), 0 0 90px var(--lv3-accent-faint), 0 0 30px var(--lv3-accent-ghost)"},children:P.jsx(Hm,{value:g,animate:e,ratePerSec:p,format:b=>Math.round(b).toLocaleString("en-US").split(",").map((y,M)=>P.jsxs(qm.Fragment,{children:[M!==0?P.jsx("span",{className:"-mx-[0.14em] inline-block sm:mx-0",children:","}):null,y]},`${M}-${y}`))})}),P.jsx("p",{className:"font-mono text-sm text-oai-gray-300",children:r("landing.v3.stats.devs_syncing",{count:(Number(_)||0).toLocaleString("en-US")})})]})}),P.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-24",style:{background:"linear-gradient(to bottom, transparent, var(--lv3-bg) 85%)"},"aria-hidden":"true"})]})]})})}function Hy({copy:r,animate:e}){const t=Fe.useRef(null),n=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const i=Lt.context(()=>{Lt.fromTo(n.current,{autoAlpha:0,y:28},{autoAlpha:1,y:0,duration:.8,ease:"power3.out",scrollTrigger:{trigger:t.current,start:"top 85%"}})},t);return()=>i.revert()},[e]),P.jsx("section",{ref:t,className:"relative border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:P.jsx("div",{ref:n,className:"mx-auto max-w-6xl px-4 sm:px-6",children:P.jsxs("div",{className:"flex flex-col justify-between gap-10 md:flex-row md:items-center",children:[P.jsxs("div",{className:"shrink-0 md:max-w-[16rem]",children:[P.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400",children:r("landing.v2.models.title")}),P.jsx("p",{className:"mt-2 text-xs leading-relaxed text-oai-gray-500",children:r("landing.v3.tools.count",{count:kf.length})})]}),P.jsx("div",{className:"flex justify-center md:justify-end",children:P.jsx(sg,{logos:kf,columnCount:6})})]})})})}const wc=["step1","step2","step3","step4"],Wy=[34,58,42,88,66,100,74];function Wo({title:r,children:e,accent:t=!1}){return P.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-xl border border-oai-gray-800 bg-[color:var(--lv3-panel)] shadow-2xl shadow-black/40",style:t?{borderColor:"var(--lv3-line)",boxShadow:"0 24px 80px -32px var(--lv3-accent-faint)"}:void 0,children:[P.jsxs("div",{className:"flex items-center gap-2 border-b border-oai-gray-800/80 px-4 py-2.5",children:[P.jsxs("span",{className:"flex gap-1.5","aria-hidden":"true",children:[P.jsx("span",{className:"h-2 w-2 rounded-full bg-oai-gray-700"}),P.jsx("span",{className:"h-2 w-2 rounded-full bg-oai-gray-700"}),P.jsx("span",{className:"h-2 w-2 rounded-full bg-oai-gray-700"})]}),P.jsx("span",{className:"ml-1 font-mono text-[10px] uppercase tracking-widest text-oai-gray-500",children:r})]}),P.jsx("div",{className:"flex flex-1 flex-col justify-center px-5 py-5 font-mono text-xs leading-loose sm:px-6",children:e})]})}function Ch({index:r}){return r===0?P.jsxs(Wo,{title:"terminal",children:[P.jsxs("p",{className:"text-oai-gray-200",children:[P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"$"})," claude ",P.jsx("span",{className:"text-oai-gray-500",children:'"refactor the parser"'})]}),P.jsx("p",{className:"mt-2 text-oai-gray-500",children:"⏺ thinking…"}),P.jsx("p",{className:"text-oai-gray-500",children:"⏺ editing src/lib/rollout.js"}),P.jsx("p",{className:"mt-2 text-oai-gray-300",children:"✓ 3 files changed"})]}):r===1?P.jsxs(Wo,{title:"session log · last turn",children:[P.jsx("p",{className:"text-oai-gray-500",children:'"usage": {'}),P.jsxs("p",{className:"pl-4 text-oai-gray-300",children:['"input_tokens": ',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"12,482"}),","]}),P.jsxs("p",{className:"pl-4 text-oai-gray-300",children:['"output_tokens": ',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"3,067"}),","]}),P.jsxs("p",{className:"pl-4 text-oai-gray-300",children:['"cache_read": ',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"88,214"})]}),P.jsx("p",{className:"text-oai-gray-500",children:"}"})]}):r===2?P.jsxs(Wo,{title:"~/.tokentracker/queue.jsonl",children:[P.jsx("p",{className:"truncate text-oai-gray-500",children:'{"source":"codex","total_tokens":91406…'}),P.jsx("p",{className:"truncate text-oai-gray-500",children:'{"source":"cursor","total_tokens":18220…'}),P.jsxs("p",{className:"truncate text-oai-gray-300",children:['{"source":"claude","total_tokens":',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"103,763"}),"…"]}),P.jsx("p",{className:"mt-3 text-[10px] uppercase tracking-widest text-[color:var(--lv3-accent-soft)]",children:"▌ appended locally"})]}):P.jsxs(Wo,{title:"localhost:7680",accent:!0,children:[P.jsx("div",{className:"flex h-24 items-end gap-2","aria-hidden":"true",children:Wy.map((e,t)=>P.jsx("span",{className:"lv3-how-bar w-full origin-bottom rounded-sm",style:{height:`${e}%`,background:t===5?"var(--lv3-accent)":"var(--lv3-accent-faint)"}},t))}),P.jsx("p",{className:"mt-4 text-[10px] uppercase tracking-widest text-oai-gray-500",children:"total tokens"}),P.jsx("p",{className:"text-lg font-bold tabular-nums text-white",children:"6,830,736,916"})]})}function Ph({copy:r,stepKey:e,index:t}){return P.jsxs("div",{className:"lv3-how-step flex gap-4",children:[P.jsx("span",{className:"relative mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-oai-gray-700 bg-oai-gray-950 font-mono text-[10px] font-bold text-oai-gray-300","aria-hidden":"true",children:String(t+1).padStart(2,"0")}),P.jsxs("div",{children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:r(`landing.v3.how.${e}.title`)}),P.jsx("p",{className:"mt-1 text-sm leading-relaxed text-oai-gray-400",children:r(`landing.v3.how.${e}.body`)})]})]})}function Xy({copy:r,animate:e}){const t=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const n=Lt.context(()=>{Lt.matchMedia().add("(min-width: 1024px)",()=>{const s=Lt.utils.toArray(".lv3-how-scene"),a=Lt.utils.toArray(".lv3-how-desktop .lv3-how-step");Lt.set(s.slice(1),{autoAlpha:0,y:28}),Lt.set(a.slice(1),{opacity:.35});const o=Lt.timeline({defaults:{ease:"none"},scrollTrigger:{trigger:t.current,pin:!0,scrub:.8,start:"top top",end:"+=240%",anticipatePin:1}});for(let l=1;l<s.length;l+=1)o.to(s[l-1],{autoAlpha:0,y:-24,duration:.62},l),o.fromTo(s[l],{autoAlpha:0,y:24},{autoAlpha:1,y:0,duration:.62},l+.12),o.to(a[l-1],{opacity:.35,duration:.45},l),o.to(a[l],{opacity:1,duration:.45},l+.12);o.fromTo(".lv3-how-bar",{scaleY:.1},{scaleY:1,duration:.5,stagger:.05},s.length-1+.35),o.to(".lv3-how-progress",{scaleY:1,duration:s.length},0),o.to({},{duration:.35})})},t);return()=>n.revert()},[e]),P.jsx("section",{ref:t,className:"relative overflow-hidden bg-oai-gray-950",children:P.jsxs("div",{className:"mx-auto flex min-h-[100vh] max-w-6xl flex-col justify-center px-4 py-20 sm:px-6 lg:py-0",children:[P.jsxs("div",{className:"mb-12 max-w-2xl lg:mb-16",children:[P.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-[color:var(--lv3-accent-soft)]",children:r("landing.v3.how.kicker")}),P.jsx("h2",{className:"mt-4 text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-4xl",children:r("landing.v3.how.title")}),P.jsx("p",{className:"mt-4 text-base leading-relaxed text-oai-gray-400",children:r("landing.v3.how.subtitle")})]}),P.jsxs("div",{className:"lv3-how-desktop hidden grid-cols-12 items-center gap-12 lg:grid",children:[P.jsxs("div",{className:"relative col-span-5 space-y-9 pl-1",children:[P.jsx("span",{className:"absolute bottom-3 left-[17px] top-3 w-px origin-top bg-oai-gray-800","aria-hidden":"true",children:P.jsx("span",{className:"lv3-how-progress block h-full w-full origin-top scale-y-0",style:{background:"linear-gradient(to bottom, var(--lv3-accent), var(--lv3-accent-soft))"}})}),wc.map((n,i)=>P.jsx(Ph,{copy:r,stepKey:n,index:i},n))]}),P.jsx("div",{className:"relative col-span-7 h-[420px]",children:wc.map((n,i)=>P.jsx("div",{className:"lv3-how-scene absolute inset-0",children:P.jsx(Ch,{index:i})},n))})]}),P.jsx("div",{className:"space-y-10 lg:hidden",children:wc.map((n,i)=>P.jsxs("div",{className:"space-y-4",children:[P.jsx(Ph,{copy:r,stepKey:n,index:i}),P.jsx("div",{className:"h-64",children:P.jsx(Ch,{index:i})})]},n))})]})})}function Yy({children:r,className:e="",spotlightColor:t="rgba(138, 122, 255, 0.12)",...n}){const i=Fe.useRef(null),[s,a]=Fe.useState({x:0,y:0}),[o,l]=Fe.useState(!1),c=u=>{if(!i.current)return;const h=i.current.getBoundingClientRect();a({x:u.clientX-h.left,y:u.clientY-h.top})};return P.jsxs("div",{ref:i,onPointerMove:c,onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),className:Hu("relative overflow-hidden rounded-xl border border-oai-gray-800 bg-[#080808] p-5 shadow-2xl transition-all duration-300",e),...n,children:[P.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 z-0",style:{opacity:o?1:0,background:`radial-gradient(350px circle at ${s.x}px ${s.y}px, ${t}, transparent 80%)`}}),P.jsx("div",{className:"relative z-10 w-full h-full",children:r})]})}const qy=["limits","heatmap","devices"];function $y(){return P.jsxs("svg",{viewBox:"0 0 48 24",className:"h-6 w-12",fill:"none","aria-hidden":"true",children:[P.jsx("path",{d:"M2 22 A 22 22 0 0 1 46 22",stroke:"var(--lv3-line)",strokeWidth:"3",strokeLinecap:"round"}),P.jsx("path",{d:"M2 22 A 22 22 0 0 1 32 4.5",stroke:"var(--lv3-accent)",strokeWidth:"3",strokeLinecap:"round"}),P.jsx("circle",{cx:"32",cy:"4.5",r:"2.6",fill:"var(--lv3-accent-soft)"})]})}function Zy(){const r=[.15,.5,.9,.3,.7,.2,1,.45,.6,.25,.8,.35];return P.jsx("div",{className:"grid w-12 grid-cols-6 gap-[3px]","aria-hidden":"true",children:r.map((e,t)=>P.jsx("span",{className:"h-[7px] w-[7px] rounded-[2px]",style:{background:"var(--lv3-accent)",opacity:.15+e*.85}},t))})}function Ky(){return P.jsxs("svg",{viewBox:"0 0 48 24",className:"h-6 w-12",fill:"none",stroke:"var(--lv3-accent-soft)",strokeWidth:"2","aria-hidden":"true",children:[P.jsx("rect",{x:"2",y:"3",width:"24",height:"15",rx:"2"}),P.jsx("path",{d:"M10 21h8",strokeLinecap:"round"}),P.jsx("rect",{x:"33",y:"6",width:"12",height:"16",rx:"2.5",stroke:"var(--lv3-accent)"})]})}const jy={limits:$y,heatmap:Zy,devices:Ky};function Jy({copy:r,animate:e,screenshotSrc:t,screenshotAlt:n}){const i=Fe.useRef(null),s=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const a=Lt.context(()=>{Lt.fromTo(".lv3-cap-header",{y:160,autoAlpha:0},{y:0,autoAlpha:1,ease:"power1.out",scrollTrigger:{trigger:i.current,start:"top bottom",end:"top 25%",scrub:.5}}),Lt.fromTo(".lv3-cap-card",{autoAlpha:0,y:110},{autoAlpha:1,y:0,ease:"power1.out",stagger:.1,scrollTrigger:{trigger:i.current,start:"top 85%",end:"top 15%",scrub:.5}}),Lt.fromTo(s.current,{rotateX:16,y:90,autoAlpha:.35},{rotateX:0,y:0,autoAlpha:1,ease:"none",scrollTrigger:{trigger:s.current,start:"top 95%",end:"top 40%",scrub:.5}})},i);return()=>a.revert()},[e]),P.jsxs("section",{ref:i,className:"relative bg-transparent py-20 sm:py-28 lg:py-36",children:[P.jsx("div",{className:"pointer-events-none absolute -top-40 left-1/2 h-80 w-[60rem] -translate-x-1/2 rounded-[50%] opacity-20",style:{background:"radial-gradient(ellipse at center, var(--lv3-accent), transparent 65%)",filter:"blur(120px)"},"aria-hidden":"true"}),P.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[P.jsxs("div",{className:"max-w-2xl lv3-cap-header",children:[P.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-[color:var(--lv3-accent-soft)]",children:r("landing.v3.cap.kicker")}),P.jsx("h2",{className:"mt-4 text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-4xl",children:r("landing.v3.cap.title")}),P.jsx("p",{className:"mt-4 text-base leading-relaxed text-oai-gray-400",children:r("landing.v3.cap.subtitle")})]}),P.jsx("div",{className:"mt-12 grid grid-cols-1 gap-5 sm:grid-cols-3",children:qy.map(a=>{const o=jy[a];return P.jsxs(Yy,{className:"lv3-cap-card p-6",children:[P.jsx(o,{}),P.jsx("h3",{className:"mt-5 text-sm font-semibold text-white",children:r(`landing.v3.cap.${a}.title`)}),P.jsx("p",{className:"mt-2 text-sm leading-relaxed text-oai-gray-400",children:r(`landing.v3.cap.${a}.body`)})]},a)})}),P.jsx("div",{className:"mt-16 sm:mt-20",style:{perspective:"1400px"},children:P.jsx("div",{ref:s,className:"relative rounded-xl p-[1px] shadow-2xl",style:{transformStyle:"preserve-3d",background:"linear-gradient(to bottom, var(--lv3-line), var(--lv3-accent-ghost) 40%, transparent)",boxShadow:"0 24px 90px -20px var(--lv3-accent-faint), 0 4px 20px rgba(0,0,0,0.4)"},children:P.jsxs("div",{className:"relative overflow-hidden rounded-[11px] bg-oai-gray-950",children:[P.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-20 h-40",style:{background:"linear-gradient(to bottom, var(--lv3-accent-faint) 0%, transparent 100%)",mixBlendMode:"screen"}}),P.jsx("img",{src:t,alt:n,className:"relative z-10 block h-auto w-full object-cover",loading:"lazy",decoding:"async",width:2496,height:1730})]})})})]})]})}const Qy=["p1","p2","p3"];function eE(r){if(typeof Intl<"u"&&Intl.Segmenter){const e=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(e.segment(r),({segment:t,isWordLike:n})=>({text:t,isWordLike:!!(n??t.trim())}))}return r.includes(" ")?r.split(/(\s+)/).map(e=>({text:e,isWordLike:!!e.trim()})):Array.from(r).map(e=>({text:e,isWordLike:/[\p{L}\p{N}]/u.test(e)}))}function tE({copy:r,animate:e}){const t=Fe.useRef(null),n=r("landing.v3.privacy.title"),i=eE(n),s=Math.max(0,i.filter(o=>o.isWordLike).length-2);let a=0;return Fe.useLayoutEffect(()=>{if(!e)return;const o=Lt.context(()=>{Lt.fromTo(".lv3-privacy-word",{autoAlpha:0,y:26,rotateX:-35},{autoAlpha:1,y:0,rotateX:0,duration:.7,stagger:.07,ease:"power3.out",scrollTrigger:{trigger:t.current,start:"top 68%"}}),Lt.fromTo(".lv3-privacy-chip",{autoAlpha:0,y:14},{autoAlpha:1,y:0,duration:.5,stagger:.1,delay:.4,ease:"power2.out",scrollTrigger:{trigger:t.current,start:"top 68%"}})},t);return()=>o.revert()},[e,n]),P.jsx("section",{ref:t,className:"relative overflow-hidden border-t border-oai-gray-900 py-24 sm:py-32 lg:py-44",style:{background:"radial-gradient(60rem 30rem at 50% 120%, var(--lv3-accent-ghost), transparent 70%)"},children:P.jsxs("div",{className:"mx-auto max-w-4xl px-4 text-center sm:px-6",style:{perspective:"900px"},children:[P.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.3em] text-[color:var(--lv3-accent-soft)]",children:r("landing.v3.privacy.kicker")}),P.jsx("h2",{className:"mt-6 text-balance text-4xl font-semibold leading-[1.12] tracking-tight text-white sm:text-5xl lg:text-6xl",children:i.map((o,l)=>{const c=o.isWordLike?a++:-1;return P.jsx("span",{className:"lv3-privacy-word inline-block whitespace-pre",children:P.jsx("span",{className:o.isWordLike&&c>=s?"bg-gradient-to-b from-[color:var(--lv3-accent-soft)] to-[color:var(--lv3-accent)] bg-clip-text text-transparent":void 0,children:o.text})},l)})}),P.jsx("p",{className:"mx-auto mt-6 max-w-xl text-base leading-relaxed text-oai-gray-400",children:r("landing.v2.distill.body")}),P.jsx("div",{className:"mt-10 flex flex-wrap items-center justify-center gap-3",children:Qy.map(o=>P.jsxs("span",{className:"lv3-privacy-chip inline-flex items-center gap-2 rounded-full border border-oai-gray-800 bg-oai-black px-4 py-2 font-mono text-[11px] uppercase tracking-widest text-oai-gray-300",children:[P.jsx("span",{className:"h-1 w-1 rounded-full bg-[color:var(--lv3-accent)]","aria-hidden":"true"}),r(`landing.v3.privacy.${o}`)]},o))})]})})}function nE(r){const e=r.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return e?{h:parseFloat(e[1]),s:parseFloat(e[2]),l:parseFloat(e[3])}:{h:247,s:100,l:74}}function iE(r,e){const{h:t,s:n,l:i}=nE(r),s=`${t}deg ${n}% ${i}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([o,l,c,u,h,f])=>{const d=Math.min(h*e,100);return`${f?"inset ":""}${o}px ${l}px ${c}px ${u}px hsl(${s} / ${d}%)`}).join(", ")}function Wm(r){return 1-Math.pow(1-r,3)}function Dh(r){return r*r*r}function Xo({start:r=0,end:e=100,duration:t=1e3,delay:n=0,ease:i=Wm,onUpdate:s,onEnd:a}){const o=performance.now()+n;function l(){const c=performance.now()-o,u=Math.min(c/t,1);s(r+(e-r)*i(u)),u<1?requestAnimationFrame(l):a&&a()}setTimeout(()=>requestAnimationFrame(l),n)}const rE=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],sE=[0,1,2,0,1,2,1];function aE(r){const e=[];for(let t=0;t<7;t++){const n=r[Math.min(sE[t],r.length-1)];e.push(`radial-gradient(at ${rE[t]}, ${n} 0px, transparent 50%)`)}return e.push(`linear-gradient(${r[0]} 0 100%)`),e}const oE=({children:r,className:e="",edgeSensitivity:t=30,glowColor:n="247 100 74",backgroundColor:i="#09090b",borderRadius:s=16,glowRadius:a=35,glowIntensity:o=1,coneSpread:l=25,animated:c=!1,colors:u=["#8a7aff","#f472b6","#38bdf8"],fillOpacity:h=.45})=>{const f=Fe.useRef(null),[d,g]=Fe.useState(!1),[_,p]=Fe.useState(45),[m,b]=Fe.useState(0),[y,M]=Fe.useState(!1),E=Fe.useCallback(I=>{const{width:q,height:j}=I.getBoundingClientRect();return[q/2,j/2]},[]),T=Fe.useCallback((I,q,j)=>{const[D,se]=E(I),pe=q-D,Ve=j-se;let He=1/0,Le=1/0;return pe!==0&&(He=D/Math.abs(pe)),Ve!==0&&(Le=se/Math.abs(Ve)),Math.min(Math.max(1/Math.min(He,Le),0),1)},[E]),A=Fe.useCallback((I,q,j)=>{const[D,se]=E(I),pe=q-D,Ve=j-se;if(pe===0&&Ve===0)return 0;let Le=Math.atan2(Ve,pe)*(180/Math.PI)+90;return Le<0&&(Le+=360),Le},[E]),v=Fe.useCallback(I=>{const q=f.current;if(!q)return;const j=q.getBoundingClientRect(),D=I.clientX-j.left,se=I.clientY-j.top;b(T(q,D,se)),p(A(q,D,se))},[T,A]);Fe.useEffect(()=>{if(!c)return;const I=110,q=465;M(!0),p(I),Xo({duration:500,onUpdate:j=>b(j/100)}),Xo({ease:Dh,duration:1500,end:50,onUpdate:j=>{p((q-I)*(j/100)+I)}}),Xo({ease:Wm,delay:1500,duration:2250,start:50,end:100,onUpdate:j=>{p((q-I)*(j/100)+I)}}),Xo({ease:Dh,delay:2500,duration:1500,start:100,end:0,onUpdate:j=>b(j/100),onEnd:()=>M(!1)})},[c]);const w=t+20,C=d||y,L=C?Math.max(0,(m*100-w)/(100-w)):0,N=C?Math.max(0,(m*100-t)/(100-t)):0,Y=aE(u),H=Y.map(I=>`${I} border-box`),O=Y.map(I=>`${I} padding-box`),z=`${_.toFixed(3)}deg`;return P.jsxs("div",{ref:f,onPointerMove:v,onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),className:Hu("relative grid isolate border border-white/10",e),style:{background:i,borderRadius:`${s}px`,transform:"translate3d(0, 0, 0.01px)",boxShadow:"rgba(0,0,0,0.2) 0 4px 12px, rgba(0,0,0,0.3) 0 16px 48px"},children:[P.jsx("div",{className:"absolute inset-0 rounded-[inherit] -z-[1]",style:{border:"1px solid transparent",background:[`linear-gradient(${i} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...H].join(", "),opacity:L,maskImage:`conic-gradient(from ${z} at center, black ${l}%, transparent ${l+15}%, transparent ${100-l-15}%, black ${100-l}%)`,WebkitMaskImage:`conic-gradient(from ${z} at center, black ${l}%, transparent ${l+15}%, transparent ${100-l-15}%, black ${100-l}%)`,transition:C?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),P.jsx("div",{className:"absolute inset-0 rounded-[inherit] -z-[1]",style:{border:"1px solid transparent",background:O.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${z} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${z} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),maskComposite:"subtract, add, add, add, add, add",WebkitMaskComposite:"source-out, source-over, source-over, source-over, source-over, source-over",opacity:L*h,mixBlendMode:"soft-light",transition:C?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),P.jsx("span",{className:"absolute pointer-events-none z-[1] rounded-[inherit]",style:{inset:`${-a}px`,maskImage:`conic-gradient(from ${z} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${z} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:N,mixBlendMode:"plus-lighter",transition:C?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"},children:P.jsx("span",{className:"absolute rounded-[inherit]",style:{inset:`${a}px`,boxShadow:iE(n,o)}})}),P.jsx("div",{className:"flex flex-col relative overflow-hidden z-[1] w-full h-full",style:{borderRadius:`${Math.max(0,s-1)}px`},children:r})]})};function Lh(r,e){return(r?.display_name||"").trim()||e("landing.v3.leaderboard.anonymous")}function lE({entry:r,rank:e,maxTokens:t,copy:n,animate:i}){const s=e===1,a=Number(r?.total_tokens)||0,o=t>0?Math.max(6,Math.round(a/t*100)):0;return P.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 transition-colors hover:bg-white/[0.02] sm:px-5",children:[P.jsxs("div",{className:"flex min-w-0 items-center gap-3.5",children:[P.jsx("span",{className:`w-5 font-mono text-xs font-bold ${s?"text-[color:var(--lv3-accent-soft)]":"text-oai-gray-500"}`,children:String(e).padStart(2,"0")}),r?.avatar_url?P.jsx("img",{src:r.avatar_url,alt:"",width:24,height:24,loading:"lazy",className:"h-6 w-6 shrink-0 rounded-full border border-oai-gray-800 object-cover"}):P.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-oai-gray-800 bg-oai-gray-900 font-mono text-[10px] font-bold text-oai-gray-400","aria-hidden":"true",children:Lh(r,n).charAt(0).toUpperCase()}),P.jsx("span",{className:`truncate text-sm tracking-wide ${s?"font-bold text-white":"font-semibold text-oai-gray-200"}`,children:Lh(r,n)})]}),P.jsxs("div",{className:"flex shrink-0 items-center gap-5",children:[P.jsx("span",{className:"hidden h-[2px] w-16 overflow-hidden rounded-full bg-oai-gray-900 sm:block","aria-hidden":"true",children:P.jsx("span",{className:"block h-full rounded-full",style:{width:`${o}%`,background:s?"var(--lv3-accent)":ln.line}})}),P.jsx("span",{className:`font-mono text-sm leading-none tabular-nums ${s?"font-semibold text-white":"font-medium text-oai-gray-300"}`,children:P.jsx(Hm,{value:a,animate:i,format:l=>Ih(Math.round(l))})})]})]})}function cE(){return P.jsxs("div",{className:"flex items-center justify-between px-4 py-4 sm:px-5",children:[P.jsxs("div",{className:"flex items-center gap-3.5",children:[P.jsx("span",{className:"h-3 w-5 animate-pulse rounded bg-white/10"}),P.jsx("span",{className:"h-6 w-6 animate-pulse rounded-full bg-white/10"}),P.jsx("span",{className:"h-3 w-28 animate-pulse rounded bg-white/10"})]}),P.jsx("span",{className:"h-3 w-16 animate-pulse rounded bg-white/10"})]})}function uE({copy:r,animate:e,stats:t,tokenFallback:n,devsFallback:i}){const s=Fe.useRef(null);Fe.useLayoutEffect(()=>{if(!e)return;const h=Lt.context(()=>{Lt.fromTo(".lv3-lb-col",{autoAlpha:0,y:30},{autoAlpha:1,y:0,duration:.75,stagger:.14,ease:"power3.out",scrollTrigger:{trigger:s.current,start:"top 75%"}})},s);return()=>h.revert()},[e]);const a=t.status==="ready",o=a?t.top:[],l=o.length&&Number(o[0]?.total_tokens)||0,c=a?t.totalEntries:i,u=a?t.tokenFloor:n;return P.jsx("section",{ref:s,className:"relative border-t border-oai-gray-900 bg-oai-gray-950 py-16 sm:py-24 lg:py-32",children:P.jsx("div",{className:"relative z-10 mx-auto max-w-6xl px-4 sm:px-6",children:P.jsxs("div",{className:"grid grid-cols-1 items-center gap-10 sm:gap-12 lg:grid-cols-12 lg:gap-8",children:[P.jsxs("div",{className:"lv3-lb-col space-y-6 text-left lg:col-span-5",children:[P.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-oai-gray-800 bg-oai-black px-3 py-1 text-[10px] font-bold uppercase tracking-widest text-oai-gray-400",children:[P.jsxs("span",{className:"relative flex h-2 w-2","aria-hidden":"true",children:[P.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-[color:var(--lv3-accent)] opacity-75"}),P.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-[color:var(--lv3-accent)]"})]}),r("landing.v2.leaderboard.kicker")]}),P.jsx("h2",{className:"text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-4xl",children:r("landing.v2.leaderboard.title")}),P.jsx("p",{className:"text-base leading-relaxed text-oai-gray-400",children:r("landing.v2.leaderboard.subtitle")}),P.jsx("div",{className:"pt-4",children:P.jsx(Ns,{to:"/leaderboard",className:"inline-flex h-9 items-center justify-center whitespace-nowrap rounded-[8px] bg-white px-6 text-xs font-bold text-oai-gray-950 shadow-sm transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98] select-none",children:r("landing.v2.leaderboard.view_more")})})]}),P.jsx("div",{className:"lv3-lb-col w-full lg:col-span-7",children:P.jsxs(oE,{edgeSensitivity:30,glowColor:"138 122 255",backgroundColor:ln.panel,borderRadius:16,glowRadius:35,glowIntensity:1,coneSpread:25,animated:!1,colors:[ln.accent,ln.accentSoft,ln.glint],className:"w-full",children:[P.jsxs("div",{className:"flex select-none items-center justify-between border-b border-oai-gray-800/80 bg-white/[0.025] px-4 py-3 text-[10px] font-bold uppercase tracking-widest text-oai-gray-500 sm:px-5",children:[P.jsx("span",{children:r("landing.v3.leaderboard.panel_title")}),P.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[color:var(--lv3-accent-soft)]",children:[P.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-[color:var(--lv3-accent)]","aria-hidden":"true"}),r("landing.v3.leaderboard.live")]})]}),P.jsx("div",{className:"divide-y divide-oai-gray-800/60",children:a?o.map((h,f)=>P.jsx(lE,{entry:h,rank:f+1,maxTokens:l,copy:r,animate:e},h?.user_id||f)):[0,1,2].map(h=>P.jsx(cE,{},h))}),P.jsxs("div",{className:"flex select-none items-center justify-between border-t border-oai-gray-800/80 bg-black/[0.15] px-4 py-2.5 font-mono text-[9px] uppercase tracking-widest text-oai-gray-500 sm:px-5",children:[P.jsx("span",{children:r("landing.v3.stats.devs_syncing",{count:(Number(c)||0).toLocaleString("en-US")})}),P.jsx("span",{children:r("landing.v3.leaderboard.tokens_synced",{count:`${Ih(Number(u)||0)}+`})})]})]})})]})})})}const fE=Array.from({length:46},(r,e)=>({left:(e*37.7+11)%100,top:(e*53.9+7)%86,size:1+e%3,delay:e%7*.7,duration:2.6+e%5*.8,dim:e%3===0}));function dE({copy:r,animate:e,installCommand:t,installCopied:n,onCopyInstallCommand:i,githubLabel:s}){const a=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const o=Lt.context(()=>{Lt.fromTo(".lv3-dl-inner",{autoAlpha:0,y:36},{autoAlpha:1,y:0,duration:.8,ease:"power3.out",scrollTrigger:{trigger:a.current,start:"top 72%"}}),Lt.fromTo(".lv3-dl-horizon",{opacity:.2,scaleX:.7},{opacity:1,scaleX:1,ease:"none",scrollTrigger:{trigger:a.current,start:"top 90%",end:"bottom bottom",scrub:.5}})},a);return()=>o.revert()},[e]),P.jsxs("section",{ref:a,className:"relative overflow-hidden border-t border-oai-gray-900 bg-oai-gray-950 py-24 sm:py-32",children:[P.jsx("style",{children:"@keyframes lv3-twinkle { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.9; } }"}),P.jsx("div",{className:"pointer-events-none absolute inset-0","aria-hidden":"true",children:fE.map((o,l)=>P.jsx("span",{className:`absolute rounded-full ${o.dim?"bg-[color:var(--lv3-accent-soft)]":"bg-white"}`,style:{left:`${o.left}%`,top:`${o.top}%`,width:o.size,height:o.size,opacity:o.dim?.35:.5,...e?{animation:`lv3-twinkle ${o.duration}s ease-in-out ${o.delay}s infinite`}:{}}},l))}),P.jsx("div",{className:"pointer-events-none absolute -left-32 top-4 h-[26rem] w-[26rem] rounded-full opacity-30",style:{background:"radial-gradient(closest-side, var(--lv3-accent-ghost), transparent 70%)"},"aria-hidden":"true"}),P.jsx("div",{className:"pointer-events-none absolute -right-40 bottom-10 h-[30rem] w-[30rem] rounded-full opacity-30",style:{background:"radial-gradient(closest-side, var(--lv3-accent-ghost), transparent 70%)"},"aria-hidden":"true"}),P.jsx("svg",{className:"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 opacity-[0.14]",width:"920",height:"440",viewBox:"0 0 920 440",fill:"none","aria-hidden":"true",children:P.jsx("ellipse",{cx:"460",cy:"220",rx:"450",ry:"205",stroke:"var(--lv3-accent-soft)",strokeWidth:"1",strokeDasharray:"2 7"})}),P.jsx("div",{className:"lv3-dl-horizon pointer-events-none absolute inset-x-0 bottom-[-14rem] h-[24rem]",style:{background:"radial-gradient(50% 100% at 50% 100%, var(--lv3-accent-faint), transparent 70%)"},"aria-hidden":"true"}),P.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-px",style:{background:"linear-gradient(90deg, transparent, var(--lv3-accent) 35%, var(--lv3-accent-soft) 50%, var(--lv3-accent) 65%, transparent)",opacity:.5},"aria-hidden":"true"}),P.jsxs("div",{className:"lv3-dl-inner relative z-10 mx-auto flex max-w-3xl flex-col items-center px-4 text-center sm:px-6",children:[P.jsx("h2",{className:"text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-5xl",children:r("landing.v3.download.title")}),P.jsx("p",{className:"mt-4 max-w-xl text-base leading-relaxed text-oai-gray-400",children:r("landing.v3.download.subtitle")}),P.jsx("div",{className:"mt-9 w-full",children:P.jsx(Gm,{copy:r,installCommand:t,installCopied:n,onCopyInstallCommand:i,reduceMotion:!e})}),P.jsx("div",{className:"mt-6 w-full",children:P.jsx(Vm,{copy:r,githubLabel:s})})]})]})}function hE({copy:r,reduceMotion:e,screenshotMode:t,effectsReady:n,signInUrl:i,signUpUrl:s,installCommand:a,installCopied:o,onCopyInstallCommand:l}){const c=!e&&!t,[u,h]=Fe.useState(!1);Fe.useEffect(()=>{const M=()=>h(window.scrollY>10);return window.addEventListener("scroll",M,{passive:!0}),()=>window.removeEventListener("scroll",M)},[]);const f=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:d,loading:g}=$m(),{openLoginModal:_}=Zm(),p=tg(),m=Number(r("landing.v3.stats.fallback_tokens"))||0,b=Number(r("landing.v3.stats.fallback_devs"))||0,y=r("landing.cta.secondary");return P.jsxs("div",{className:"relative min-h-screen overflow-x-hidden bg-[color:var(--lv3-bg)] text-oai-white font-oai antialiased dark",style:og,children:[P.jsx("header",{className:Hu("sticky top-0 z-50 transition-all duration-300",u?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:P.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6",children:[P.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[P.jsxs(Ns,{to:s||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[P.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),P.jsx("span",{className:"whitespace-nowrap text-sm font-semibold uppercase tracking-wide text-white",children:"Token Tracker"})]}),P.jsx("div",{className:"hidden sm:block",children:P.jsx(eg,{})})]}),P.jsxs("div",{className:"flex items-center justify-end gap-3 sm:gap-5 md:gap-6",children:[P.jsx(Ns,{to:"/leaderboard",className:"hidden select-none text-sm font-medium text-oai-gray-400 outline-none transition-colors duration-200 hover:text-white focus-visible:underline sm:inline",children:r("nav.leaderboard")}),!d&&!g&&P.jsx(Ns,{to:zf(),className:"hidden select-none text-sm font-medium text-oai-gray-400 outline-none transition-colors duration-200 hover:text-white focus-visible:underline sm:inline",children:r("landing.v2.cta.primary")}),P.jsx("div",{className:"flex items-center gap-2.5 sm:gap-3.5",children:g?P.jsx("div",{className:"h-8 w-16 animate-pulse rounded-[8px] bg-white/10","aria-hidden":!0}):d?P.jsxs(P.Fragment,{children:[P.jsx(Ns,{to:zf(),className:"inline-flex h-8 select-none items-center justify-center rounded-[8px] bg-white px-3.5 text-xs font-bold text-oai-gray-950 shadow-sm transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98]",children:r("landing.v2.cta.primary")}),P.jsx(Km,{})]}):P.jsx("button",{type:"button",onClick:_,className:"inline-flex h-8 min-w-[80px] select-none items-center justify-center rounded-[8px] bg-white px-3.5 text-xs font-bold text-oai-gray-950 shadow-sm transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98]",children:r("header.auth.sign_in_aria")})})]})]})}),P.jsxs("main",{className:"-mt-14",children:[P.jsx(Vy,{copy:r,animate:c,effectsReady:n,stats:p,tokenFallback:m,devsFallback:b,installCommand:a,installCopied:o,onCopyInstallCommand:l,githubLabel:y}),P.jsx(Jy,{copy:r,animate:c,screenshotSrc:"/dashboard-dark.png",screenshotAlt:r("landing.screenshot.alt")}),P.jsx(Hy,{copy:r,animate:c}),P.jsx(Xy,{copy:r,animate:c}),P.jsx(tE,{copy:r,animate:c}),P.jsx(uE,{copy:r,animate:c,stats:p,tokenFallback:m,devsFallback:b}),P.jsx(dE,{copy:r,animate:c,installCommand:a,installCopied:o,onCopyInstallCommand:l,githubLabel:y})]}),P.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:P.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 text-sm text-oai-gray-400 sm:flex-row sm:px-6",children:[P.jsx("p",{children:r("landing.v2.footer.line")}),P.jsxs("div",{className:"flex items-center gap-6",children:[P.jsx("a",{href:jm,className:"font-medium text-oai-gray-400 transition-colors hover:text-white",target:"_blank",rel:"noopener noreferrer",children:r("landing.v2.nav.status")}),P.jsx("a",{href:Ac,className:"font-medium text-oai-gray-400 transition-colors hover:text-white",target:"_blank",rel:"noopener noreferrer",children:r("landing.v2.nav.github")}),f&&P.jsxs(Ns,{to:i,className:"font-medium text-[color:var(--lv3-accent-soft)] transition-colors hover:text-white",children:[r("landing.cta.primary")," →"]})]})]})})]})}function pE({prefersReducedMotion:r,screenshotMode:e}){return!(e||r)}function mE(){return Fe.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function gE(r=0,e=!0){const[t,n]=Fe.useState(()=>!e);return Fe.useEffect(()=>{if(!e){n(!0);return}let i=null,s=null;const a=()=>n(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(a,{timeout:r||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(i=window.setTimeout(a,r),()=>{i!=null&&window.clearTimeout(i)})},[r,e]),t}function TE({signInUrl:r,signUpUrl:e}){const t=mE(),n=Fe.useMemo(()=>typeof window>"u"?!1:Jm(window.location.search),[]),i=pE({prefersReducedMotion:t,screenshotMode:n}),s=gE(250,i),a="tokentracker.dashboard.from_landing.v1";Fe.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(a,"1")}catch{}},[a]);const o=Bf("landing.install.command"),[l,c]=Fe.useState(!1),u=Fe.useRef(null);Fe.useEffect(()=>()=>{u.current!=null&&window.clearTimeout(u.current)},[]);const h=async()=>{await Qm(o)&&(u.current!=null&&window.clearTimeout(u.current),c(!0),u.current=window.setTimeout(()=>{c(!1),u.current=null},2e3))};return P.jsx(hE,{copy:Bf,reduceMotion:t,screenshotMode:n,effectsReady:s,signInUrl:r,signUpUrl:e,installCommand:o,installCopied:l,onCopyInstallCommand:h})}export{TE as LandingPage};
4314
+ `,zm="(max-width: 1023px)";function Rh(r=typeof window>"u"?void 0:window,e=typeof document>"u"?void 0:document){return r?.visualViewport?.height||e?.documentElement?.clientHeight||r?.innerHeight||1}function Iy(){if(typeof window>"u")return!0;const r=window.matchMedia?.(zm)?.matches,e=(navigator.hardwareConcurrency||8)<=4;return!!(r||e)}function Uy(r,e){const t=e.flow+e.disc+e.stars,n=new Float32Array(t*3),i=new Float32Array(t),s=new Float32Array(t),a=new Float32Array(t),o=new Float32Array(t),l=new Float32Array(t);for(let u=0;u<e.flow;u+=1){const h=u%r.length,f=r[h];n[u*3]=f.x,n[u*3+1]=f.y,n[u*3+2]=f.z,i[u]=Math.random(),s[u]=Math.random(),a[u]=1+Math.random()*1.9,o[u]=1,l[u]=h}for(let u=e.flow;u<e.flow+e.disc;u+=1){const h=Math.random(),f=h<.55?11*(.05+.95*Math.pow(Math.random(),.8)):h<.85?9+Math.random()*3.4:11+Math.random()*3,d=Math.random()*Math.PI*2;n[u*3]=Math.cos(d)*f,n[u*3+1]=Math.sin(d)*f,n[u*3+2]=0,i[u]=Math.random(),s[u]=Math.random(),a[u]=1.1+Math.random()*1.6,o[u]=2,l[u]=0}for(let u=e.flow+e.disc;u<t;u+=1){const h=14+Math.random()*22,f=Math.random()*Math.PI*2;n[u*3]=Math.cos(f)*h,n[u*3+1]=(Math.random()-.5)*16,n[u*3+2]=-8-Math.random()*22,i[u]=Math.random(),s[u]=Math.random(),a[u]=.5+Math.random()*1,o[u]=0,l[u]=0}const c=new Ei;return c.setAttribute("position",new Mn(n,3)),c.setAttribute("aSeed",new Mn(i,1)),c.setAttribute("aPhase",new Mn(s,1)),c.setAttribute("aSize",new Mn(a,1)),c.setAttribute("aFlow",new Mn(o,1)),c.setAttribute("aStream",new Mn(l,1)),c}function Fy({mode:r="full",progressRef:e,className:t=""}){const n=Fe.useRef(null),i=Fe.useRef([]),s=Fe.useRef(null),[a,o]=Fe.useState(!1);Fe.useEffect(()=>{if(r!=="full")return;const u=n.current;if(!u)return;let h;try{h=new by({antialias:!1,alpha:!0,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch(We){console.warn("TokenGalaxy: WebGL unavailable, using static fallback.",We),o(!0);return}const f=Iy(),d=window.matchMedia?.(zm)?.matches??!1,g=Ty({compactViewport:d}),_=wy({compactViewport:d}),p=Math.min(window.devicePixelRatio||1,f?1.5:2);h.setPixelRatio(p),h.setClearColor(0,0);const m=h.domElement;m.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;",u.appendChild(m);const b=new rx,y=new di(_.cameraFov,1,.1,120);y.position.set(0,0,_.cameraZ);const M=Cy(),E=Uy(M,Py({lowPower:f})),T={uTime:{value:0},uPixelRatio:{value:p},uSwirl:{value:Rt.swirl},uFlatten:{value:Rt.flatten},uTilt:{value:Rt.tilt},uYOffset:{value:Rt.yOffset},uIntro:{value:0},uOrbit:{value:0},uAnchors:{value:M.map(We=>new X(We.x,We.y,We.z))},uGlobalAlpha:{value:0},uProgress:{value:0},uLensScale:{value:_.lensScale},uPointScale:{value:_.pointScale},uColorA:{value:new ht(Il.accent)},uColorB:{value:new ht(Il.accentSoft)},uColorC:{value:new ht(Il.glint)}},A=new yi({vertexShader:Ly,fragmentShader:Ny,uniforms:T,transparent:!0,depthTest:!1,depthWrite:!1,blending:Jc}),v=new mx(E,A);v.frustumCulled=!1,b.add(v);const w=Rf(),C=Math.cos(Rt.tilt),L=Math.sin(Rt.tilt),N=new X(0,-L,C),Y=new X(0,Rt.yOffset,0),H=new X(0,C,L),O=new X,z=new X,I=new X,q=(We,Qe,Ge)=>{O.set(We/50-1,1-Qe/50,.5).unproject(y),z.copy(O).sub(y.position).normalize();const Ke=N.dot(z);if(Math.abs(Ke)<1e-6)return Ge.set(0,0,0);const F=N.dot(I.copy(Y).sub(y.position))/Ke;return O.copy(y.position).addScaledVector(z,F),I.copy(O).sub(Y),Ge.set(O.x,I.dot(H)/Rt.flatten,0)};let j=0,D=0;function se(){const We=u.clientWidth||1,Qe=u.clientHeight||1;if(Math.abs(We-j)<1&&Math.abs(Qe-D)<1)return;j=We,D=Qe,h.setSize(We,Qe,!1),y.aspect=We/Qe,y.updateProjectionMatrix();const Ge=Rh();Qe>Ge&&(y.projectionMatrix.elements[9]=-(Qe-Ge)/Qe,y.projectionMatrixInverse.copy(y.projectionMatrix).invert())}let pe=0;const Ve=new ResizeObserver(()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(se)});Ve.observe(u),se();const He={current:!0},Le={current:!1},Q=new IntersectionObserver(We=>{He.current=We[0]?.isIntersecting??!0},{threshold:0});Q.observe(u);const oe=()=>{Le.current=document.hidden};document.addEventListener("visibilitychange",oe,{passive:!0});const ne={x:0,y:0},Ee={x:0,y:0},Oe=We=>{ne.x=We.clientX/window.innerWidth*2-1,ne.y=We.clientY/window.innerHeight*2-1},Te=window.matchMedia?.("(hover: hover)")?.matches;Te&&window.addEventListener("pointermove",Oe,{passive:!0});const tt=new wx;let Me=0,ze=0,qe=0,Ye=0,$=0;function lt(){if(Ye=requestAnimationFrame(lt),Le.current||!He.current)return;const We=tt.getElapsedTime(),Qe=Math.min(Math.max(We-qe,.001),.033);qe=We;const Ge=Math.min(Math.max(e?.current??0,0),1);$+=(Ge-$)*(1-Math.exp(-Qe/.14));const Ke=$;T.uTime.value=We,T.uOrbit.value=We*g,T.uProgress.value=Ke,Me=Math.min(1,Me+Qe/.9),ze=Math.min(1,ze+Qe/Rt.introSeconds);const F=1-Math.pow(1-ze,3);T.uIntro.value=F,T.uGlobalAlpha.value=Me*(1-Fr.smoothstep(Ke,.55,.8));const Ct=1-Math.exp(-Qe/.22);Ee.x+=(ne.x-Ee.x)*Ct,Ee.y+=(ne.y-Ee.y)*Ct,y.position.x=Ee.x*1.8,y.position.y=_.cameraY-Ee.y*1.2-Ke*4.5,y.position.z=_.cameraZ+(1-F)*Rt.cameraDollyIn-Ke*Rt.cameraPushIn,d&&(y.lookAt(0,_.lookAtY,0),y.updateMatrixWorld());const Xe=Rh(),R=new X(0,Rt.yOffset,0);R.applyMatrix4(y.matrixWorldInverse);const x=1-2*(.68*Xe/D);if(y.projectionMatrix.elements[9]=y.projectionMatrix.elements[5]*R.y/-R.z-x,y.projectionMatrixInverse.copy(y.projectionMatrix).invert(),d||y.lookAt(0,_.lookAtY,0),h.render(b,y),s.current){const ce=Fr.smoothstep(Ke,0,.25)*(1-Fr.smoothstep(Ke,.25,.65)),ae=1-Fr.smoothstep(Ke,.35,.75),J=1+Ke*1.2,ee=.4*Me*ae*(1+ce*1.5);s.current.style.transform=`translate3d(-50%, -50%, 0) scale(${J.toFixed(3)})`,s.current.style.opacity=String(ee.toFixed(3))}const k=1+Math.pow(Ke,1.8)*1.5,V=Me*(1-Fr.smoothstep(Ke,.25,.7)),Z=Fr.smoothstep(Ke,0,.2)*(1-Fr.smoothstep(Ke,.2,.6));for(let ce=0;ce<w.length;ce+=1){const ae=i.current[ce];if(!ae)continue;const J=w[ce]+T.uOrbit.value,ee=68*Xe/D,he=Cf(J,k,d,ee);q(he.left,he.top,T.uAnchors.value[ce]);const Ae=he.left/100*j,ge=he.top/100*D,me=Ah(he.top),fe=Math.min(1,Math.max(0,F*2.6-ce*.22)),Pe=me*(.6+.4*fe)*(1-Ke*.3);ae.style.transform=`translate3d(${Ae.toFixed(1)}px, ${ge.toFixed(1)}px, 0) translate(-50%, -50%) scale(${Pe.toFixed(3)})`,ae.style.opacity=String(Math.max(0,V*fe*(.75+.25*me)).toFixed(3));const Ie=1+Z*1.4,U=1+Z*.6;ae.style.filter=`brightness(${Ie.toFixed(2)}) saturate(${U.toFixed(2)})`;const de=(12+Z*28).toFixed(0),te=(.3+Z*.6).toFixed(2);ae.style.boxShadow=`0 0 ${de}px rgba(168, 85, 247, ${te})`}}return lt(),()=>{cancelAnimationFrame(Ye),cancelAnimationFrame(pe),Ve.disconnect(),Q.disconnect(),document.removeEventListener("visibilitychange",oe),Te&&window.removeEventListener("pointermove",Oe),b.clear(),E.dispose(),A.dispose(),h.dispose(),h.forceContextLoss(),u.contains(m)&&u.removeChild(m)}},[r]);const l=r!=="full"||a,c=Dy();return P.jsxs("div",{ref:n,className:`pointer-events-none absolute inset-0 overflow-hidden ${t}`,"aria-hidden":"true","data-mode":l?"static":"webgl",children:[P.jsx("div",{ref:s,className:"absolute left-1/2 top-[68vh] h-72 w-72 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-45 lg:h-[28rem] lg:w-[28rem]",style:{background:"radial-gradient(circle, var(--lv3-bg) 6%, rgba(138, 122, 255, 0.28) 18%, rgba(138, 122, 255, 0.05) 45%, transparent 68%)"}}),l?P.jsx("div",{className:"absolute left-1/2 top-[68vh] h-[22rem] w-[52rem] max-w-[92vw] -translate-x-1/2 -translate-y-1/2 rounded-[50%] opacity-50",style:{background:"radial-gradient(ellipse at center, var(--lv3-accent-ghost) 0%, transparent 60%)",boxShadow:"inset 0 0 120px var(--lv3-accent-ghost)"}}):null,yy.map((u,h)=>P.jsxs("div",{"data-provider-orb":u,ref:f=>{i.current[h]=f},className:"absolute left-0 top-0 flex h-10 w-10 items-center justify-center rounded-full border border-white/20 lg:h-12 lg:w-12",style:{background:"var(--lv3-orb-surface)",boxShadow:"var(--lv3-orb-shadow)",backdropFilter:"blur(10px) saturate(1.3)",WebkitBackdropFilter:"blur(10px) saturate(1.3)",...l?{left:`${c[h].left}%`,top:`${c[h].top}%`,transform:`translate(-50%, -50%) scale(${Ah(c[h].top).toFixed(2)})`,opacity:.9}:{opacity:0}},children:[l?null:P.jsx("span",{className:"absolute inset-0 animate-ping rounded-full border border-[color:var(--lv3-accent)] opacity-40",style:{animationDuration:`${2.2+h*.35}s`},"aria-hidden":"true"}),P.jsx("span",{className:"absolute left-[16%] top-[8%] h-[32%] w-[52%] rounded-full opacity-80",style:{background:"var(--lv3-orb-highlight)",filter:"blur(1.5px)"},"aria-hidden":"true"}),P.jsx("span",{className:"absolute left-[24%] top-[13%] h-[16%] w-[22%] rounded-full",style:{background:"var(--lv3-orb-glint)"},"aria-hidden":"true"}),P.jsx(Xm,{provider:u,size:19})]},u))]})}function Gm({copy:r,installCommand:e,installCopied:t,onCopyInstallCommand:n,reduceMotion:i}){return P.jsxs("div",{className:"w-full max-w-lg mx-auto",children:[P.jsxs(Nh.div,{whileHover:i?void 0:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[P.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, var(--lv3-glint), transparent 10%)",animationDuration:"6s"}}),P.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, var(--lv3-glint), transparent 10%)",animationDuration:"6s"}}),P.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-oai-black border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[P.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[P.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),P.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:e?e.split(" ").map((s,a)=>P.jsxs("span",{className:s==="npx"||s==="tokentracker-cli"?"text-white font-medium":s==="--yes"?"text-oai-gray-500":"text-[color:var(--lv3-accent-soft)]",children:[s," "]},a)):null})]}),P.jsx("button",{type:"button",onClick:n,"aria-label":r(t?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:t?P.jsx(ng,{className:"h-4 w-4 text-[color:var(--lv3-accent-soft)]","aria-hidden":!0}):P.jsx(ig,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),P.jsx("span",{className:"sr-only","aria-live":"polite",children:t?r("landing.install.action.copied"):""})]})}function Oy(){if(typeof navigator>"u")return"other";const e=`${navigator.userAgentData?.platform??""} ${navigator.userAgent??""} ${navigator.platform??""}`.toLowerCase();return e.includes("win")?"windows":e.includes("mac")&&!e.includes("iphone")&&!e.includes("ipad")?"mac":"other"}function Vm({copy:r,githubLabel:e}){const t=Fe.useMemo(()=>Oy(),[]),n={href:Ff,label:r("landing.v2.install.os_macos"),Icon:kf},i={href:Of,label:r("landing.v2.install.os_windows"),Icon:zf},s=t==="windows"?{href:Of,label:r("landing.v2.install.win_cta"),Icon:zf}:t==="mac"?{href:Ff,label:r("landing.v2.install.mac_cta"),Icon:kf}:{href:Ym,label:r("landing.v2.install.desktop_cta"),Icon:sg},o=[...(t==="windows"?[n]:t==="mac"?[i]:[n,i]).map(l=>({key:l.href,href:l.href,Icon:l.Icon,label:l.label})),{key:Ac,href:Ac,Icon:rg,label:e}];return P.jsx("div",{className:"flex justify-center",children:P.jsxs("div",{className:"flex min-w-[16rem] flex-col items-stretch",children:[P.jsxs("a",{href:s.href,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex h-11 items-center justify-center gap-2 rounded-full bg-white px-7 text-sm font-semibold text-oai-gray-950 shadow-lg shadow-black/30 transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98]",children:[P.jsx(s.Icon,{className:"h-4 w-4"}),s.label]}),P.jsx("div",{className:"mt-3 flex gap-3",children:o.map(l=>P.jsxs("a",{href:l.href,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex h-9 flex-1 items-center justify-center gap-2 rounded-full border border-white/10 bg-oai-black/60 px-3 text-sm font-medium text-oai-gray-200 backdrop-blur-sm transition-colors hover:border-white/25 hover:text-white",children:[P.jsx(l.Icon,{className:"h-4 w-4 shrink-0 text-oai-gray-400 group-hover:text-white"}),P.jsx("span",{className:"truncate",children:l.label})]},l.key))})]})})}const By=1800,ky=250;function zy(r){return Math.round(r).toLocaleString("en-US")}function Hm({value:r,animate:e=!0,durationMs:t=By,format:n=zy,ratePerSec:i=0,className:s}){const a=Number(r)||0,[o,l]=Fe.useState(e?0:a),c=Fe.useRef(null),u=Fe.useRef(e?0:a),[h,f]=Fe.useState(!1);return Fe.useEffect(()=>{u.current=o},[o]),Fe.useEffect(()=>{if(!e)return;const d=c.current;if(!d||typeof IntersectionObserver>"u"){f(!0);return}const g=new IntersectionObserver(_=>f(!!_[0]?.isIntersecting),{threshold:.4});return g.observe(d),()=>g.disconnect()},[e]),Fe.useEffect(()=>{if(!e){l(a);return}if(!h)return;const d=u.current;if(d===a&&!(i>0))return;let g=0;const _=performance.now();let p=_,m=0;const b=i>0&&d>=a;let y=Math.max(d,a);const M=E=>{const T=b?1:Math.min(1,(E-_)/t);if(T<1){const v=1-Math.pow(1-T,4);l(d+(a-d)*v),p=E,g=requestAnimationFrame(M);return}if(!(i>0)){l(a);return}const A=Math.min(E-p,100)/1e3;p=E,y=Math.max(y,a)+i*A,E-m>=ky&&(m=E,l(y)),g=requestAnimationFrame(M)};return g=requestAnimationFrame(M),()=>cancelAnimationFrame(g)},[e,h,a,t,i]),P.jsx("span",{ref:c,className:s,children:n(o)})}function Gy(r){return r?"absolute inset-x-0 bottom-0 top-0 z-0 lg:bottom-[-40vh]":"absolute inset-0 z-0"}function Vy({copy:r,animate:e,effectsReady:t,stats:n,tokenFallback:i,devsFallback:s,installCommand:a,installCopied:o,onCopyInstallCommand:l,githubLabel:c}){const u=Fe.useRef(null),h=Fe.useRef(null),f=Fe.useRef(null),d=Fe.useRef(0);Fe.useLayoutEffect(()=>{if(!e)return;const b=Lt.context(()=>{ot.create({trigger:u.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:M=>{d.current=M.progress}});const y=Lt.timeline({defaults:{ease:"none"},scrollTrigger:{trigger:u.current,start:"top top",end:"bottom top",scrub:.5}});y.to(h.current,{yPercent:-16,autoAlpha:0,duration:.3},.08),y.to(f.current,{y:-28,scale:.94,autoAlpha:0,duration:.22},.45),y.to({},{duration:.1})},u);return()=>b.revert()},[e]);const g=n.status==="ready"?n.tokenFloor:i,_=n.status==="ready"?n.totalEntries:s,p=g*.004/86400,m=e&&t?"full":"static";return P.jsx("section",{ref:u,className:"relative",children:P.jsxs("div",{className:"relative min-h-[max(100svh,52rem)]",children:[P.jsx("div",{ref:h,className:"relative z-20 mx-auto flex max-w-3xl flex-col items-center px-4 pt-28 text-center tall:pt-48 xtall:pt-56 sm:px-6 sm:pt-36 sm:xtall:pt-60",children:P.jsxs(Nh.div,{initial:e?{opacity:0,y:24}:!1,animate:{opacity:1,y:0},transition:{duration:.6},className:"flex flex-col items-center",children:[P.jsxs("p",{className:"mb-3 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.03] px-4 py-1.5 text-[10px] font-bold uppercase tracking-[0.2em] text-oai-gray-400 tall:mb-5",children:[P.jsxs("span",{className:"relative flex h-1.5 w-1.5","aria-hidden":"true",children:[P.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-[color:var(--lv3-accent)] opacity-75"}),P.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-[color:var(--lv3-accent)]"})]}),r("landing.v3.hero.kicker")]}),P.jsxs("h1",{className:"text-balance text-4xl font-semibold leading-[1.08] tracking-tight text-white sm:text-[2.75rem] sm:tall:text-[3.25rem] sm:xtall:text-6xl lg:xtall:text-[4rem]",children:[r("landing.v2.hero.title_line1"),P.jsx("br",{}),P.jsx("span",{className:"bg-gradient-to-b from-white via-[color:var(--lv3-accent-soft)] to-[color:var(--lv3-accent)] bg-clip-text font-bold tracking-tight text-transparent",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.12)"},children:r("landing.v2.hero.title_line2")})]}),P.jsx("div",{className:"mt-8 sm:mt-10 w-full xtall:mt-12",children:P.jsx(Gm,{copy:r,installCommand:a,installCopied:o,onCopyInstallCommand:l,reduceMotion:!e})}),P.jsx("div",{className:"mt-4 w-full xtall:mt-5",children:P.jsx(Vm,{copy:r,githubLabel:c})})]})}),P.jsxs("div",{className:Gy(e),children:[P.jsx(Fy,{mode:m,progressRef:d}),P.jsx("div",{className:"pointer-events-none absolute left-1/2 top-[68vh] z-10 -translate-x-1/2 -translate-y-1/2",children:P.jsxs("div",{ref:f,className:"flex flex-col items-center gap-2",children:[P.jsx("div",{className:"absolute -inset-x-28 -inset-y-12 -z-10",style:{backdropFilter:"blur(9px)",WebkitBackdropFilter:"blur(9px)",background:"radial-gradient(closest-side, var(--lv3-scrim), transparent 76%)",maskImage:"radial-gradient(closest-side, black 55%, transparent 100%)",WebkitMaskImage:"radial-gradient(closest-side, black 55%, transparent 100%)"},"aria-hidden":"true"}),P.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.3em] text-oai-gray-300",children:r("landing.v3.hero.stat_label")}),P.jsx("p",{className:"whitespace-nowrap font-mono text-4xl font-bold tabular-nums leading-none text-white sm:tall:text-5xl",style:{textShadow:"0 2px 24px rgba(0, 0, 0, 0.9), 0 0 90px var(--lv3-accent-faint), 0 0 30px var(--lv3-accent-ghost)"},children:P.jsx(Hm,{value:g,animate:e,ratePerSec:p,format:b=>Math.round(b).toLocaleString("en-US").split(",").map((y,M)=>P.jsxs(qm.Fragment,{children:[M!==0?P.jsx("span",{className:"-mx-[0.14em] inline-block sm:mx-0",children:","}):null,y]},`${M}-${y}`))})}),P.jsx("p",{className:"font-mono text-sm text-oai-gray-300",children:r("landing.v3.stats.devs_syncing",{count:(Number(_)||0).toLocaleString("en-US")})})]})}),P.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-24",style:{background:"linear-gradient(to bottom, transparent, var(--lv3-bg) 85%)"},"aria-hidden":"true"})]})]})})}function Hy({copy:r,animate:e}){const t=Fe.useRef(null),n=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const i=Lt.context(()=>{Lt.fromTo(n.current,{autoAlpha:0,y:28},{autoAlpha:1,y:0,duration:.8,ease:"power3.out",scrollTrigger:{trigger:t.current,start:"top 85%"}})},t);return()=>i.revert()},[e]),P.jsx("section",{ref:t,className:"relative border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:P.jsx("div",{ref:n,className:"mx-auto max-w-6xl px-4 sm:px-6",children:P.jsxs("div",{className:"flex flex-col justify-between gap-10 md:flex-row md:items-center",children:[P.jsxs("div",{className:"shrink-0 md:max-w-[16rem]",children:[P.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400",children:r("landing.v2.models.title")}),P.jsx("p",{className:"mt-2 text-xs leading-relaxed text-oai-gray-500",children:r("landing.v3.tools.count",{count:Gf.length})})]}),P.jsx("div",{className:"flex justify-center md:justify-end",children:P.jsx(ag,{logos:Gf,columnCount:6})})]})})})}const wc=["step1","step2","step3","step4"],Wy=[34,58,42,88,66,100,74];function Wo({title:r,children:e,accent:t=!1}){return P.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-xl border border-oai-gray-800 bg-[color:var(--lv3-panel)] shadow-2xl shadow-black/40",style:t?{borderColor:"var(--lv3-line)",boxShadow:"0 24px 80px -32px var(--lv3-accent-faint)"}:void 0,children:[P.jsxs("div",{className:"flex items-center gap-2 border-b border-oai-gray-800/80 px-4 py-2.5",children:[P.jsxs("span",{className:"flex gap-1.5","aria-hidden":"true",children:[P.jsx("span",{className:"h-2 w-2 rounded-full bg-oai-gray-700"}),P.jsx("span",{className:"h-2 w-2 rounded-full bg-oai-gray-700"}),P.jsx("span",{className:"h-2 w-2 rounded-full bg-oai-gray-700"})]}),P.jsx("span",{className:"ml-1 font-mono text-[10px] uppercase tracking-widest text-oai-gray-500",children:r})]}),P.jsx("div",{className:"flex flex-1 flex-col justify-center px-5 py-5 font-mono text-xs leading-loose sm:px-6",children:e})]})}function Ch({index:r}){return r===0?P.jsxs(Wo,{title:"terminal",children:[P.jsxs("p",{className:"text-oai-gray-200",children:[P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"$"})," claude ",P.jsx("span",{className:"text-oai-gray-500",children:'"refactor the parser"'})]}),P.jsx("p",{className:"mt-2 text-oai-gray-500",children:"⏺ thinking…"}),P.jsx("p",{className:"text-oai-gray-500",children:"⏺ editing src/lib/rollout.js"}),P.jsx("p",{className:"mt-2 text-oai-gray-300",children:"✓ 3 files changed"})]}):r===1?P.jsxs(Wo,{title:"session log · last turn",children:[P.jsx("p",{className:"text-oai-gray-500",children:'"usage": {'}),P.jsxs("p",{className:"pl-4 text-oai-gray-300",children:['"input_tokens": ',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"12,482"}),","]}),P.jsxs("p",{className:"pl-4 text-oai-gray-300",children:['"output_tokens": ',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"3,067"}),","]}),P.jsxs("p",{className:"pl-4 text-oai-gray-300",children:['"cache_read": ',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"88,214"})]}),P.jsx("p",{className:"text-oai-gray-500",children:"}"})]}):r===2?P.jsxs(Wo,{title:"~/.tokentracker/queue.jsonl",children:[P.jsx("p",{className:"truncate text-oai-gray-500",children:'{"source":"codex","total_tokens":91406…'}),P.jsx("p",{className:"truncate text-oai-gray-500",children:'{"source":"cursor","total_tokens":18220…'}),P.jsxs("p",{className:"truncate text-oai-gray-300",children:['{"source":"claude","total_tokens":',P.jsx("span",{className:"text-[color:var(--lv3-accent-soft)]",children:"103,763"}),"…"]}),P.jsx("p",{className:"mt-3 text-[10px] uppercase tracking-widest text-[color:var(--lv3-accent-soft)]",children:"▌ appended locally"})]}):P.jsxs(Wo,{title:"localhost:7680",accent:!0,children:[P.jsx("div",{className:"flex h-24 items-end gap-2","aria-hidden":"true",children:Wy.map((e,t)=>P.jsx("span",{className:"lv3-how-bar w-full origin-bottom rounded-sm",style:{height:`${e}%`,background:t===5?"var(--lv3-accent)":"var(--lv3-accent-faint)"}},t))}),P.jsx("p",{className:"mt-4 text-[10px] uppercase tracking-widest text-oai-gray-500",children:"total tokens"}),P.jsx("p",{className:"text-lg font-bold tabular-nums text-white",children:"6,830,736,916"})]})}function Ph({copy:r,stepKey:e,index:t}){return P.jsxs("div",{className:"lv3-how-step flex gap-4",children:[P.jsx("span",{className:"relative mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-oai-gray-700 bg-oai-gray-950 font-mono text-[10px] font-bold text-oai-gray-300","aria-hidden":"true",children:String(t+1).padStart(2,"0")}),P.jsxs("div",{children:[P.jsx("h3",{className:"text-sm font-semibold text-white",children:r(`landing.v3.how.${e}.title`)}),P.jsx("p",{className:"mt-1 text-sm leading-relaxed text-oai-gray-400",children:r(`landing.v3.how.${e}.body`)})]})]})}function Xy({copy:r,animate:e}){const t=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const n=Lt.context(()=>{Lt.matchMedia().add("(min-width: 1024px)",()=>{const s=Lt.utils.toArray(".lv3-how-scene"),a=Lt.utils.toArray(".lv3-how-desktop .lv3-how-step");Lt.set(s.slice(1),{autoAlpha:0,y:28}),Lt.set(a.slice(1),{opacity:.35});const o=Lt.timeline({defaults:{ease:"none"},scrollTrigger:{trigger:t.current,pin:!0,scrub:.8,start:"top top",end:"+=240%",anticipatePin:1}});for(let l=1;l<s.length;l+=1)o.to(s[l-1],{autoAlpha:0,y:-24,duration:.62},l),o.fromTo(s[l],{autoAlpha:0,y:24},{autoAlpha:1,y:0,duration:.62},l+.12),o.to(a[l-1],{opacity:.35,duration:.45},l),o.to(a[l],{opacity:1,duration:.45},l+.12);o.fromTo(".lv3-how-bar",{scaleY:.1},{scaleY:1,duration:.5,stagger:.05},s.length-1+.35),o.to(".lv3-how-progress",{scaleY:1,duration:s.length},0),o.to({},{duration:.35})})},t);return()=>n.revert()},[e]),P.jsx("section",{ref:t,className:"relative overflow-hidden bg-oai-gray-950",children:P.jsxs("div",{className:"mx-auto flex min-h-[100vh] max-w-6xl flex-col justify-center px-4 py-20 sm:px-6 lg:py-0",children:[P.jsxs("div",{className:"mb-12 max-w-2xl lg:mb-16",children:[P.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-[color:var(--lv3-accent-soft)]",children:r("landing.v3.how.kicker")}),P.jsx("h2",{className:"mt-4 text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-4xl",children:r("landing.v3.how.title")}),P.jsx("p",{className:"mt-4 text-base leading-relaxed text-oai-gray-400",children:r("landing.v3.how.subtitle")})]}),P.jsxs("div",{className:"lv3-how-desktop hidden grid-cols-12 items-center gap-12 lg:grid",children:[P.jsxs("div",{className:"relative col-span-5 space-y-9 pl-1",children:[P.jsx("span",{className:"absolute bottom-3 left-[17px] top-3 w-px origin-top bg-oai-gray-800","aria-hidden":"true",children:P.jsx("span",{className:"lv3-how-progress block h-full w-full origin-top scale-y-0",style:{background:"linear-gradient(to bottom, var(--lv3-accent), var(--lv3-accent-soft))"}})}),wc.map((n,i)=>P.jsx(Ph,{copy:r,stepKey:n,index:i},n))]}),P.jsx("div",{className:"relative col-span-7 h-[420px]",children:wc.map((n,i)=>P.jsx("div",{className:"lv3-how-scene absolute inset-0",children:P.jsx(Ch,{index:i})},n))})]}),P.jsx("div",{className:"space-y-10 lg:hidden",children:wc.map((n,i)=>P.jsxs("div",{className:"space-y-4",children:[P.jsx(Ph,{copy:r,stepKey:n,index:i}),P.jsx("div",{className:"h-64",children:P.jsx(Ch,{index:i})})]},n))})]})})}function Yy({children:r,className:e="",spotlightColor:t="rgba(138, 122, 255, 0.12)",...n}){const i=Fe.useRef(null),[s,a]=Fe.useState({x:0,y:0}),[o,l]=Fe.useState(!1),c=u=>{if(!i.current)return;const h=i.current.getBoundingClientRect();a({x:u.clientX-h.left,y:u.clientY-h.top})};return P.jsxs("div",{ref:i,onPointerMove:c,onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),className:Hu("relative overflow-hidden rounded-xl border border-oai-gray-800 bg-[#080808] p-5 shadow-2xl transition-all duration-300",e),...n,children:[P.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 z-0",style:{opacity:o?1:0,background:`radial-gradient(350px circle at ${s.x}px ${s.y}px, ${t}, transparent 80%)`}}),P.jsx("div",{className:"relative z-10 w-full h-full",children:r})]})}const qy=["limits","heatmap","devices"];function $y(){return P.jsxs("svg",{viewBox:"0 0 48 24",className:"h-6 w-12",fill:"none","aria-hidden":"true",children:[P.jsx("path",{d:"M2 22 A 22 22 0 0 1 46 22",stroke:"var(--lv3-line)",strokeWidth:"3",strokeLinecap:"round"}),P.jsx("path",{d:"M2 22 A 22 22 0 0 1 32 4.5",stroke:"var(--lv3-accent)",strokeWidth:"3",strokeLinecap:"round"}),P.jsx("circle",{cx:"32",cy:"4.5",r:"2.6",fill:"var(--lv3-accent-soft)"})]})}function Ky(){const r=[.15,.5,.9,.3,.7,.2,1,.45,.6,.25,.8,.35];return P.jsx("div",{className:"grid w-12 grid-cols-6 gap-[3px]","aria-hidden":"true",children:r.map((e,t)=>P.jsx("span",{className:"h-[7px] w-[7px] rounded-[2px]",style:{background:"var(--lv3-accent)",opacity:.15+e*.85}},t))})}function Zy(){return P.jsxs("svg",{viewBox:"0 0 48 24",className:"h-6 w-12",fill:"none",stroke:"var(--lv3-accent-soft)",strokeWidth:"2","aria-hidden":"true",children:[P.jsx("rect",{x:"2",y:"3",width:"24",height:"15",rx:"2"}),P.jsx("path",{d:"M10 21h8",strokeLinecap:"round"}),P.jsx("rect",{x:"33",y:"6",width:"12",height:"16",rx:"2.5",stroke:"var(--lv3-accent)"})]})}const jy={limits:$y,heatmap:Ky,devices:Zy};function Jy({copy:r,animate:e,screenshotSrc:t,screenshotAlt:n}){const i=Fe.useRef(null),s=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const a=Lt.context(()=>{Lt.fromTo(".lv3-cap-header",{y:160,autoAlpha:0},{y:0,autoAlpha:1,ease:"power1.out",scrollTrigger:{trigger:i.current,start:"top bottom",end:"top 25%",scrub:.5}}),Lt.fromTo(".lv3-cap-card",{autoAlpha:0,y:110},{autoAlpha:1,y:0,ease:"power1.out",stagger:.1,scrollTrigger:{trigger:i.current,start:"top 85%",end:"top 15%",scrub:.5}}),Lt.fromTo(s.current,{rotateX:16,y:90,autoAlpha:.35},{rotateX:0,y:0,autoAlpha:1,ease:"none",scrollTrigger:{trigger:s.current,start:"top 95%",end:"top 40%",scrub:.5}})},i);return()=>a.revert()},[e]),P.jsxs("section",{ref:i,className:"relative bg-transparent py-20 sm:py-28 lg:py-36",children:[P.jsx("div",{className:"pointer-events-none absolute -top-40 left-1/2 h-80 w-[60rem] -translate-x-1/2 rounded-[50%] opacity-20",style:{background:"radial-gradient(ellipse at center, var(--lv3-accent), transparent 65%)",filter:"blur(120px)"},"aria-hidden":"true"}),P.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[P.jsxs("div",{className:"max-w-2xl lv3-cap-header",children:[P.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-[color:var(--lv3-accent-soft)]",children:r("landing.v3.cap.kicker")}),P.jsx("h2",{className:"mt-4 text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-4xl",children:r("landing.v3.cap.title")}),P.jsx("p",{className:"mt-4 text-base leading-relaxed text-oai-gray-400",children:r("landing.v3.cap.subtitle")})]}),P.jsx("div",{className:"mt-12 grid grid-cols-1 gap-5 sm:grid-cols-3",children:qy.map(a=>{const o=jy[a];return P.jsxs(Yy,{className:"lv3-cap-card p-6",children:[P.jsx(o,{}),P.jsx("h3",{className:"mt-5 text-sm font-semibold text-white",children:r(`landing.v3.cap.${a}.title`)}),P.jsx("p",{className:"mt-2 text-sm leading-relaxed text-oai-gray-400",children:r(`landing.v3.cap.${a}.body`)})]},a)})}),P.jsx("div",{className:"mt-16 sm:mt-20",style:{perspective:"1400px"},children:P.jsx("div",{ref:s,className:"relative rounded-xl p-[1px] shadow-2xl",style:{transformStyle:"preserve-3d",background:"linear-gradient(to bottom, var(--lv3-line), var(--lv3-accent-ghost) 40%, transparent)",boxShadow:"0 24px 90px -20px var(--lv3-accent-faint), 0 4px 20px rgba(0,0,0,0.4)"},children:P.jsxs("div",{className:"relative overflow-hidden rounded-[11px] bg-oai-gray-950",children:[P.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-20 h-40",style:{background:"linear-gradient(to bottom, var(--lv3-accent-faint) 0%, transparent 100%)",mixBlendMode:"screen"}}),P.jsx("img",{src:t,alt:n,className:"relative z-10 block h-auto w-full object-cover",loading:"lazy",decoding:"async",width:2496,height:1730})]})})})]})]})}const Qy=["p1","p2","p3"];function eE(r){if(typeof Intl<"u"&&Intl.Segmenter){const e=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(e.segment(r),({segment:t,isWordLike:n})=>({text:t,isWordLike:!!(n??t.trim())}))}return r.includes(" ")?r.split(/(\s+)/).map(e=>({text:e,isWordLike:!!e.trim()})):Array.from(r).map(e=>({text:e,isWordLike:/[\p{L}\p{N}]/u.test(e)}))}function tE({copy:r,animate:e}){const t=Fe.useRef(null),n=r("landing.v3.privacy.title"),i=eE(n),s=Math.max(0,i.filter(o=>o.isWordLike).length-2);let a=0;return Fe.useLayoutEffect(()=>{if(!e)return;const o=Lt.context(()=>{Lt.fromTo(".lv3-privacy-word",{autoAlpha:0,y:26,rotateX:-35},{autoAlpha:1,y:0,rotateX:0,duration:.7,stagger:.07,ease:"power3.out",scrollTrigger:{trigger:t.current,start:"top 68%"}}),Lt.fromTo(".lv3-privacy-chip",{autoAlpha:0,y:14},{autoAlpha:1,y:0,duration:.5,stagger:.1,delay:.4,ease:"power2.out",scrollTrigger:{trigger:t.current,start:"top 68%"}})},t);return()=>o.revert()},[e,n]),P.jsx("section",{ref:t,className:"relative overflow-hidden border-t border-oai-gray-900 py-24 sm:py-32 lg:py-44",style:{background:"radial-gradient(60rem 30rem at 50% 120%, var(--lv3-accent-ghost), transparent 70%)"},children:P.jsxs("div",{className:"mx-auto max-w-4xl px-4 text-center sm:px-6",style:{perspective:"900px"},children:[P.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.3em] text-[color:var(--lv3-accent-soft)]",children:r("landing.v3.privacy.kicker")}),P.jsx("h2",{className:"mt-6 text-balance text-4xl font-semibold leading-[1.12] tracking-tight text-white sm:text-5xl lg:text-6xl",children:i.map((o,l)=>{const c=o.isWordLike?a++:-1;return P.jsx("span",{className:"lv3-privacy-word inline-block whitespace-pre",children:P.jsx("span",{className:o.isWordLike&&c>=s?"bg-gradient-to-b from-[color:var(--lv3-accent-soft)] to-[color:var(--lv3-accent)] bg-clip-text text-transparent":void 0,children:o.text})},l)})}),P.jsx("p",{className:"mx-auto mt-6 max-w-xl text-base leading-relaxed text-oai-gray-400",children:r("landing.v2.distill.body")}),P.jsx("div",{className:"mt-10 flex flex-wrap items-center justify-center gap-3",children:Qy.map(o=>P.jsxs("span",{className:"lv3-privacy-chip inline-flex items-center gap-2 rounded-full border border-oai-gray-800 bg-oai-black px-4 py-2 font-mono text-[11px] uppercase tracking-widest text-oai-gray-300",children:[P.jsx("span",{className:"h-1 w-1 rounded-full bg-[color:var(--lv3-accent)]","aria-hidden":"true"}),r(`landing.v3.privacy.${o}`)]},o))})]})})}function nE(r){const e=r.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return e?{h:parseFloat(e[1]),s:parseFloat(e[2]),l:parseFloat(e[3])}:{h:247,s:100,l:74}}function iE(r,e){const{h:t,s:n,l:i}=nE(r),s=`${t}deg ${n}% ${i}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([o,l,c,u,h,f])=>{const d=Math.min(h*e,100);return`${f?"inset ":""}${o}px ${l}px ${c}px ${u}px hsl(${s} / ${d}%)`}).join(", ")}function Wm(r){return 1-Math.pow(1-r,3)}function Dh(r){return r*r*r}function Xo({start:r=0,end:e=100,duration:t=1e3,delay:n=0,ease:i=Wm,onUpdate:s,onEnd:a}){const o=performance.now()+n;function l(){const c=performance.now()-o,u=Math.min(c/t,1);s(r+(e-r)*i(u)),u<1?requestAnimationFrame(l):a&&a()}setTimeout(()=>requestAnimationFrame(l),n)}const rE=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],sE=[0,1,2,0,1,2,1];function aE(r){const e=[];for(let t=0;t<7;t++){const n=r[Math.min(sE[t],r.length-1)];e.push(`radial-gradient(at ${rE[t]}, ${n} 0px, transparent 50%)`)}return e.push(`linear-gradient(${r[0]} 0 100%)`),e}const oE=({children:r,className:e="",edgeSensitivity:t=30,glowColor:n="247 100 74",backgroundColor:i="#09090b",borderRadius:s=16,glowRadius:a=35,glowIntensity:o=1,coneSpread:l=25,animated:c=!1,colors:u=["#8a7aff","#f472b6","#38bdf8"],fillOpacity:h=.45})=>{const f=Fe.useRef(null),[d,g]=Fe.useState(!1),[_,p]=Fe.useState(45),[m,b]=Fe.useState(0),[y,M]=Fe.useState(!1),E=Fe.useCallback(I=>{const{width:q,height:j}=I.getBoundingClientRect();return[q/2,j/2]},[]),T=Fe.useCallback((I,q,j)=>{const[D,se]=E(I),pe=q-D,Ve=j-se;let He=1/0,Le=1/0;return pe!==0&&(He=D/Math.abs(pe)),Ve!==0&&(Le=se/Math.abs(Ve)),Math.min(Math.max(1/Math.min(He,Le),0),1)},[E]),A=Fe.useCallback((I,q,j)=>{const[D,se]=E(I),pe=q-D,Ve=j-se;if(pe===0&&Ve===0)return 0;let Le=Math.atan2(Ve,pe)*(180/Math.PI)+90;return Le<0&&(Le+=360),Le},[E]),v=Fe.useCallback(I=>{const q=f.current;if(!q)return;const j=q.getBoundingClientRect(),D=I.clientX-j.left,se=I.clientY-j.top;b(T(q,D,se)),p(A(q,D,se))},[T,A]);Fe.useEffect(()=>{if(!c)return;const I=110,q=465;M(!0),p(I),Xo({duration:500,onUpdate:j=>b(j/100)}),Xo({ease:Dh,duration:1500,end:50,onUpdate:j=>{p((q-I)*(j/100)+I)}}),Xo({ease:Wm,delay:1500,duration:2250,start:50,end:100,onUpdate:j=>{p((q-I)*(j/100)+I)}}),Xo({ease:Dh,delay:2500,duration:1500,start:100,end:0,onUpdate:j=>b(j/100),onEnd:()=>M(!1)})},[c]);const w=t+20,C=d||y,L=C?Math.max(0,(m*100-w)/(100-w)):0,N=C?Math.max(0,(m*100-t)/(100-t)):0,Y=aE(u),H=Y.map(I=>`${I} border-box`),O=Y.map(I=>`${I} padding-box`),z=`${_.toFixed(3)}deg`;return P.jsxs("div",{ref:f,onPointerMove:v,onPointerEnter:()=>g(!0),onPointerLeave:()=>g(!1),className:Hu("relative grid isolate border border-white/10",e),style:{background:i,borderRadius:`${s}px`,transform:"translate3d(0, 0, 0.01px)",boxShadow:"rgba(0,0,0,0.2) 0 4px 12px, rgba(0,0,0,0.3) 0 16px 48px"},children:[P.jsx("div",{className:"absolute inset-0 rounded-[inherit] -z-[1]",style:{border:"1px solid transparent",background:[`linear-gradient(${i} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...H].join(", "),opacity:L,maskImage:`conic-gradient(from ${z} at center, black ${l}%, transparent ${l+15}%, transparent ${100-l-15}%, black ${100-l}%)`,WebkitMaskImage:`conic-gradient(from ${z} at center, black ${l}%, transparent ${l+15}%, transparent ${100-l-15}%, black ${100-l}%)`,transition:C?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),P.jsx("div",{className:"absolute inset-0 rounded-[inherit] -z-[1]",style:{border:"1px solid transparent",background:O.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${z} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${z} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),maskComposite:"subtract, add, add, add, add, add",WebkitMaskComposite:"source-out, source-over, source-over, source-over, source-over, source-over",opacity:L*h,mixBlendMode:"soft-light",transition:C?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"}}),P.jsx("span",{className:"absolute pointer-events-none z-[1] rounded-[inherit]",style:{inset:`${-a}px`,maskImage:`conic-gradient(from ${z} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${z} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:N,mixBlendMode:"plus-lighter",transition:C?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"},children:P.jsx("span",{className:"absolute rounded-[inherit]",style:{inset:`${a}px`,boxShadow:iE(n,o)}})}),P.jsx("div",{className:"flex flex-col relative overflow-hidden z-[1] w-full h-full",style:{borderRadius:`${Math.max(0,s-1)}px`},children:r})]})};function Lh(r,e){return(r?.display_name||"").trim()||e("landing.v3.leaderboard.anonymous")}function lE({entry:r,rank:e,maxTokens:t,copy:n,animate:i}){const s=e===1,a=Number(r?.total_tokens)||0,o=t>0?Math.max(6,Math.round(a/t*100)):0;return P.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 transition-colors hover:bg-white/[0.02] sm:px-5",children:[P.jsxs("div",{className:"flex min-w-0 items-center gap-3.5",children:[P.jsx("span",{className:`w-5 font-mono text-xs font-bold ${s?"text-[color:var(--lv3-accent-soft)]":"text-oai-gray-500"}`,children:String(e).padStart(2,"0")}),r?.avatar_url?P.jsx("img",{src:r.avatar_url,alt:"",width:24,height:24,loading:"lazy",className:"h-6 w-6 shrink-0 rounded-full border border-oai-gray-800 object-cover"}):P.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-oai-gray-800 bg-oai-gray-900 font-mono text-[10px] font-bold text-oai-gray-400","aria-hidden":"true",children:Lh(r,n).charAt(0).toUpperCase()}),P.jsx("span",{className:`truncate text-sm tracking-wide ${s?"font-bold text-white":"font-semibold text-oai-gray-200"}`,children:Lh(r,n)})]}),P.jsxs("div",{className:"flex shrink-0 items-center gap-5",children:[P.jsx("span",{className:"hidden h-[2px] w-16 overflow-hidden rounded-full bg-oai-gray-900 sm:block","aria-hidden":"true",children:P.jsx("span",{className:"block h-full rounded-full",style:{width:`${o}%`,background:s?"var(--lv3-accent)":ln.line}})}),P.jsx("span",{className:`font-mono text-sm leading-none tabular-nums ${s?"font-semibold text-white":"font-medium text-oai-gray-300"}`,children:P.jsx(Hm,{value:a,animate:i,format:l=>Ih(Math.round(l))})})]})]})}function cE(){return P.jsxs("div",{className:"flex items-center justify-between px-4 py-4 sm:px-5",children:[P.jsxs("div",{className:"flex items-center gap-3.5",children:[P.jsx("span",{className:"h-3 w-5 animate-pulse rounded bg-white/10"}),P.jsx("span",{className:"h-6 w-6 animate-pulse rounded-full bg-white/10"}),P.jsx("span",{className:"h-3 w-28 animate-pulse rounded bg-white/10"})]}),P.jsx("span",{className:"h-3 w-16 animate-pulse rounded bg-white/10"})]})}function uE({copy:r,animate:e,stats:t,tokenFallback:n,devsFallback:i}){const s=Fe.useRef(null);Fe.useLayoutEffect(()=>{if(!e)return;const h=Lt.context(()=>{Lt.fromTo(".lv3-lb-col",{autoAlpha:0,y:30},{autoAlpha:1,y:0,duration:.75,stagger:.14,ease:"power3.out",scrollTrigger:{trigger:s.current,start:"top 75%"}})},s);return()=>h.revert()},[e]);const a=t.status==="ready",o=a?t.top:[],l=o.length&&Number(o[0]?.total_tokens)||0,c=a?t.totalEntries:i,u=a?t.tokenFloor:n;return P.jsx("section",{ref:s,className:"relative border-t border-oai-gray-900 bg-oai-gray-950 py-16 sm:py-24 lg:py-32",children:P.jsx("div",{className:"relative z-10 mx-auto max-w-6xl px-4 sm:px-6",children:P.jsxs("div",{className:"grid grid-cols-1 items-center gap-10 sm:gap-12 lg:grid-cols-12 lg:gap-8",children:[P.jsxs("div",{className:"lv3-lb-col space-y-6 text-left lg:col-span-5",children:[P.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-oai-gray-800 bg-oai-black px-3 py-1 text-[10px] font-bold uppercase tracking-widest text-oai-gray-400",children:[P.jsxs("span",{className:"relative flex h-2 w-2","aria-hidden":"true",children:[P.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-[color:var(--lv3-accent)] opacity-75"}),P.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-[color:var(--lv3-accent)]"})]}),r("landing.v2.leaderboard.kicker")]}),P.jsx("h2",{className:"text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-4xl",children:r("landing.v2.leaderboard.title")}),P.jsx("p",{className:"text-base leading-relaxed text-oai-gray-400",children:r("landing.v2.leaderboard.subtitle")}),P.jsx("div",{className:"pt-4",children:P.jsx(Ns,{to:"/leaderboard",className:"inline-flex h-9 items-center justify-center whitespace-nowrap rounded-[8px] bg-white px-6 text-xs font-bold text-oai-gray-950 shadow-sm transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98] select-none",children:r("landing.v2.leaderboard.view_more")})})]}),P.jsx("div",{className:"lv3-lb-col w-full lg:col-span-7",children:P.jsxs(oE,{edgeSensitivity:30,glowColor:"138 122 255",backgroundColor:ln.panel,borderRadius:16,glowRadius:35,glowIntensity:1,coneSpread:25,animated:!1,colors:[ln.accent,ln.accentSoft,ln.glint],className:"w-full",children:[P.jsxs("div",{className:"flex select-none items-center justify-between border-b border-oai-gray-800/80 bg-white/[0.025] px-4 py-3 text-[10px] font-bold uppercase tracking-widest text-oai-gray-500 sm:px-5",children:[P.jsx("span",{children:r("landing.v3.leaderboard.panel_title")}),P.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[color:var(--lv3-accent-soft)]",children:[P.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-[color:var(--lv3-accent)]","aria-hidden":"true"}),r("landing.v3.leaderboard.live")]})]}),P.jsx("div",{className:"divide-y divide-oai-gray-800/60",children:a?o.map((h,f)=>P.jsx(lE,{entry:h,rank:f+1,maxTokens:l,copy:r,animate:e},h?.user_id||f)):[0,1,2].map(h=>P.jsx(cE,{},h))}),P.jsxs("div",{className:"flex select-none items-center justify-between border-t border-oai-gray-800/80 bg-black/[0.15] px-4 py-2.5 font-mono text-[9px] uppercase tracking-widest text-oai-gray-500 sm:px-5",children:[P.jsx("span",{children:r("landing.v3.stats.devs_syncing",{count:(Number(c)||0).toLocaleString("en-US")})}),P.jsx("span",{children:r("landing.v3.leaderboard.tokens_synced",{count:`${Ih(Number(u)||0)}+`})})]})]})})]})})})}const fE=Array.from({length:46},(r,e)=>({left:(e*37.7+11)%100,top:(e*53.9+7)%86,size:1+e%3,delay:e%7*.7,duration:2.6+e%5*.8,dim:e%3===0}));function dE({copy:r,animate:e,installCommand:t,installCopied:n,onCopyInstallCommand:i,githubLabel:s}){const a=Fe.useRef(null);return Fe.useLayoutEffect(()=>{if(!e)return;const o=Lt.context(()=>{Lt.fromTo(".lv3-dl-inner",{autoAlpha:0,y:36},{autoAlpha:1,y:0,duration:.8,ease:"power3.out",scrollTrigger:{trigger:a.current,start:"top 72%"}}),Lt.fromTo(".lv3-dl-horizon",{opacity:.2,scaleX:.7},{opacity:1,scaleX:1,ease:"none",scrollTrigger:{trigger:a.current,start:"top 90%",end:"bottom bottom",scrub:.5}})},a);return()=>o.revert()},[e]),P.jsxs("section",{ref:a,className:"relative overflow-hidden border-t border-oai-gray-900 bg-oai-gray-950 py-24 sm:py-32",children:[P.jsx("style",{children:"@keyframes lv3-twinkle { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.9; } }"}),P.jsx("div",{className:"pointer-events-none absolute inset-0","aria-hidden":"true",children:fE.map((o,l)=>P.jsx("span",{className:`absolute rounded-full ${o.dim?"bg-[color:var(--lv3-accent-soft)]":"bg-white"}`,style:{left:`${o.left}%`,top:`${o.top}%`,width:o.size,height:o.size,opacity:o.dim?.35:.5,...e?{animation:`lv3-twinkle ${o.duration}s ease-in-out ${o.delay}s infinite`}:{}}},l))}),P.jsx("div",{className:"pointer-events-none absolute -left-32 top-4 h-[26rem] w-[26rem] rounded-full opacity-30",style:{background:"radial-gradient(closest-side, var(--lv3-accent-ghost), transparent 70%)"},"aria-hidden":"true"}),P.jsx("div",{className:"pointer-events-none absolute -right-40 bottom-10 h-[30rem] w-[30rem] rounded-full opacity-30",style:{background:"radial-gradient(closest-side, var(--lv3-accent-ghost), transparent 70%)"},"aria-hidden":"true"}),P.jsx("svg",{className:"pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 opacity-[0.14]",width:"920",height:"440",viewBox:"0 0 920 440",fill:"none","aria-hidden":"true",children:P.jsx("ellipse",{cx:"460",cy:"220",rx:"450",ry:"205",stroke:"var(--lv3-accent-soft)",strokeWidth:"1",strokeDasharray:"2 7"})}),P.jsx("div",{className:"lv3-dl-horizon pointer-events-none absolute inset-x-0 bottom-[-14rem] h-[24rem]",style:{background:"radial-gradient(50% 100% at 50% 100%, var(--lv3-accent-faint), transparent 70%)"},"aria-hidden":"true"}),P.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-px",style:{background:"linear-gradient(90deg, transparent, var(--lv3-accent) 35%, var(--lv3-accent-soft) 50%, var(--lv3-accent) 65%, transparent)",opacity:.5},"aria-hidden":"true"}),P.jsxs("div",{className:"lv3-dl-inner relative z-10 mx-auto flex max-w-3xl flex-col items-center px-4 text-center sm:px-6",children:[P.jsx("h2",{className:"text-balance text-3xl font-semibold leading-tight tracking-tight text-white sm:text-5xl",children:r("landing.v3.download.title")}),P.jsx("p",{className:"mt-4 max-w-xl text-base leading-relaxed text-oai-gray-400",children:r("landing.v3.download.subtitle")}),P.jsx("div",{className:"mt-9 w-full",children:P.jsx(Gm,{copy:r,installCommand:t,installCopied:n,onCopyInstallCommand:i,reduceMotion:!e})}),P.jsx("div",{className:"mt-6 w-full",children:P.jsx(Vm,{copy:r,githubLabel:s})})]})]})}function hE({copy:r,reduceMotion:e,screenshotMode:t,effectsReady:n,signInUrl:i,signUpUrl:s,installCommand:a,installCopied:o,onCopyInstallCommand:l}){const c=!e&&!t,[u,h]=Fe.useState(!1);Fe.useEffect(()=>{const M=()=>h(window.scrollY>10);return window.addEventListener("scroll",M,{passive:!0}),()=>window.removeEventListener("scroll",M)},[]);const f=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:d,loading:g}=$m(),{openLoginModal:_}=Km(),p=tg(),m=Number(r("landing.v3.stats.fallback_tokens"))||0,b=Number(r("landing.v3.stats.fallback_devs"))||0,y=r("landing.cta.secondary");return P.jsxs("div",{className:"relative min-h-screen overflow-x-hidden bg-[color:var(--lv3-bg)] text-oai-white font-oai antialiased dark",style:lg,children:[P.jsx("header",{className:Hu("sticky top-0 z-50 transition-all duration-300",u?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:P.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6",children:[P.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[P.jsxs(Ns,{to:s||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[P.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),P.jsx("span",{className:"whitespace-nowrap text-sm font-semibold uppercase tracking-wide text-white",children:"Token Tracker"})]}),P.jsx("div",{className:"hidden sm:block",children:P.jsx(eg,{})})]}),P.jsxs("div",{className:"flex items-center justify-end gap-3 sm:gap-5 md:gap-6",children:[P.jsx(Ns,{to:"/leaderboard",className:"hidden select-none text-sm font-medium text-oai-gray-400 outline-none transition-colors duration-200 hover:text-white focus-visible:underline sm:inline",children:r("nav.leaderboard")}),!d&&!g&&P.jsx(Ns,{to:Vf(),className:"hidden select-none text-sm font-medium text-oai-gray-400 outline-none transition-colors duration-200 hover:text-white focus-visible:underline sm:inline",children:r("landing.v2.cta.primary")}),P.jsx("div",{className:"flex items-center gap-2.5 sm:gap-3.5",children:g?P.jsx("div",{className:"h-8 w-16 animate-pulse rounded-[8px] bg-white/10","aria-hidden":!0}):d?P.jsxs(P.Fragment,{children:[P.jsx(Ns,{to:Vf(),className:"inline-flex h-8 select-none items-center justify-center rounded-[8px] bg-white px-3.5 text-xs font-bold text-oai-gray-950 shadow-sm transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98]",children:r("landing.v2.cta.primary")}),P.jsx(Zm,{})]}):P.jsx("button",{type:"button",onClick:_,className:"inline-flex h-8 min-w-[80px] select-none items-center justify-center rounded-[8px] bg-white px-3.5 text-xs font-bold text-oai-gray-950 shadow-sm transition-all duration-200 hover:bg-oai-gray-100 active:scale-[0.98]",children:r("header.auth.sign_in_aria")})})]})]})}),P.jsxs("main",{className:"-mt-14",children:[P.jsx(Vy,{copy:r,animate:c,effectsReady:n,stats:p,tokenFallback:m,devsFallback:b,installCommand:a,installCopied:o,onCopyInstallCommand:l,githubLabel:y}),P.jsx(Jy,{copy:r,animate:c,screenshotSrc:"/dashboard-dark.png",screenshotAlt:r("landing.screenshot.alt")}),P.jsx(Hy,{copy:r,animate:c}),P.jsx(Xy,{copy:r,animate:c}),P.jsx(tE,{copy:r,animate:c}),P.jsx(uE,{copy:r,animate:c,stats:p,tokenFallback:m,devsFallback:b}),P.jsx(dE,{copy:r,animate:c,installCommand:a,installCopied:o,onCopyInstallCommand:l,githubLabel:y})]}),P.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:P.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 text-sm text-oai-gray-400 sm:flex-row sm:px-6",children:[P.jsx("p",{children:r("landing.v2.footer.line")}),P.jsxs("div",{className:"flex items-center gap-6",children:[P.jsx("a",{href:jm,className:"font-medium text-oai-gray-400 transition-colors hover:text-white",target:"_blank",rel:"noopener noreferrer",children:r("landing.v2.nav.status")}),P.jsx("a",{href:Ac,className:"font-medium text-oai-gray-400 transition-colors hover:text-white",target:"_blank",rel:"noopener noreferrer",children:r("landing.v2.nav.github")}),f&&P.jsxs(Ns,{to:i,className:"font-medium text-[color:var(--lv3-accent-soft)] transition-colors hover:text-white",children:[r("landing.cta.primary")," →"]})]})]})})]})}function pE({prefersReducedMotion:r,screenshotMode:e}){return!(e||r)}function mE(){return Fe.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function gE(r=0,e=!0){const[t,n]=Fe.useState(()=>!e);return Fe.useEffect(()=>{if(!e){n(!0);return}let i=null,s=null;const a=()=>n(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(a,{timeout:r||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(i=window.setTimeout(a,r),()=>{i!=null&&window.clearTimeout(i)})},[r,e]),t}function wE({signInUrl:r,signUpUrl:e}){const t=mE(),n=Fe.useMemo(()=>typeof window>"u"?!1:Jm(window.location.search),[]),i=pE({prefersReducedMotion:t,screenshotMode:n}),s=gE(250,i),a="tokentracker.dashboard.from_landing.v1";Fe.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(a,"1")}catch{}},[a]);const o=Bf("landing.install.command"),[l,c]=Fe.useState(!1),u=Fe.useRef(null);Fe.useEffect(()=>()=>{u.current!=null&&window.clearTimeout(u.current)},[]);const h=async()=>{await Qm(o)&&(u.current!=null&&window.clearTimeout(u.current),c(!0),u.current=window.setTimeout(()=>{c(!1),u.current=null},2e3))};return P.jsx(hE,{copy:Bf,reduceMotion:t,screenshotMode:n,effectsReady:s,signInUrl:r,signUpUrl:e,installCommand:o,installCopied:l,onCopyInstallCommand:h})}export{wE as LandingPage};