@selvajs/selva 4.8.0-beta.13 → 4.8.0-beta.14

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 (311) hide show
  1. package/build/client/_app/immutable/chunks/B0jTScCy2.js +1 -0
  2. package/build/client/_app/immutable/chunks/B0jTScCy2.js.br +2 -0
  3. package/build/client/_app/immutable/chunks/B0jTScCy2.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/{BYD9ojkv.js → BYGCjWOb.js} +2 -2
  5. package/build/client/_app/immutable/chunks/BYGCjWOb.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/BYGCjWOb.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/{Be3WC0-8.js → BfekBVrn.js} +1 -1
  8. package/build/client/_app/immutable/chunks/BfekBVrn.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/BfekBVrn.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/{Np3qQttx.js → BlXcsLVf.js} +1 -1
  11. package/build/client/_app/immutable/chunks/BlXcsLVf.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/BlXcsLVf.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/{DNtgc4DF2.js → CLvDQlah2.js} +1 -1
  14. package/build/client/_app/immutable/chunks/CLvDQlah2.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/CLvDQlah2.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/{KazlGG-f.js → DpQ84QEi.js} +1 -1
  17. package/build/client/_app/immutable/chunks/DpQ84QEi.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/DpQ84QEi.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{DiKrHerm2.js → DumM7_1v2.js} +1 -1
  20. package/build/client/_app/immutable/chunks/DumM7_1v2.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/DumM7_1v2.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/{D1hCb6FF.js → HEqndEFV.js} +1 -1
  23. package/build/client/_app/immutable/chunks/HEqndEFV.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/HEqndEFV.js.gz +0 -0
  25. package/build/client/_app/immutable/entry/{app.BN7RslZp.js → app.Dx0fykq2.js} +2 -2
  26. package/build/client/_app/immutable/entry/app.Dx0fykq2.js.br +0 -0
  27. package/build/client/_app/immutable/entry/app.Dx0fykq2.js.gz +0 -0
  28. package/build/client/_app/immutable/entry/start.Bz0I6Xj-.js +1 -0
  29. package/build/client/_app/immutable/entry/start.Bz0I6Xj-.js.br +0 -0
  30. package/build/client/_app/immutable/entry/start.Bz0I6Xj-.js.gz +0 -0
  31. package/build/client/_app/immutable/nodes/{1.D-zguijV.js → 1.BO3fLnKA.js} +1 -1
  32. package/build/client/_app/immutable/nodes/1.BO3fLnKA.js.br +0 -0
  33. package/build/client/_app/immutable/nodes/1.BO3fLnKA.js.gz +0 -0
  34. package/build/client/_app/immutable/nodes/{11.Bkdh-AiT.js → 11.DYdmBhDy.js} +1 -1
  35. package/build/client/_app/immutable/nodes/11.DYdmBhDy.js.br +0 -0
  36. package/build/client/_app/immutable/nodes/11.DYdmBhDy.js.gz +0 -0
  37. package/build/client/_app/immutable/nodes/{13.DrKe42QO.js → 13.CtvzjgsH.js} +1 -1
  38. package/build/client/_app/immutable/nodes/13.CtvzjgsH.js.br +0 -0
  39. package/build/client/_app/immutable/nodes/13.CtvzjgsH.js.gz +0 -0
  40. package/build/client/_app/immutable/nodes/{14.B_ujHGn8.js → 14.CUYp62li.js} +1 -1
  41. package/build/client/_app/immutable/nodes/14.CUYp62li.js.br +0 -0
  42. package/build/client/_app/immutable/nodes/14.CUYp62li.js.gz +0 -0
  43. package/build/client/_app/immutable/nodes/{15.tFzVGAUV.js → 15.CduH4fZW.js} +1 -1
  44. package/build/client/_app/immutable/nodes/15.CduH4fZW.js.br +0 -0
  45. package/build/client/_app/immutable/nodes/15.CduH4fZW.js.gz +0 -0
  46. package/build/client/_app/immutable/nodes/{16.D8c5EwIv.js → 16.Dot6k5D6.js} +1 -1
  47. package/build/client/_app/immutable/nodes/16.Dot6k5D6.js.br +0 -0
  48. package/build/client/_app/immutable/nodes/16.Dot6k5D6.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/{17.BRlwoiq3.js → 17.B3AimMJI.js} +1 -1
  50. package/build/client/_app/immutable/nodes/17.B3AimMJI.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/17.B3AimMJI.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/{19.DRxbK7Dn.js → 19.ZqzF8JBu.js} +1 -1
  53. package/build/client/_app/immutable/nodes/19.ZqzF8JBu.js.br +0 -0
  54. package/build/client/_app/immutable/nodes/19.ZqzF8JBu.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/{2.CEFhQHYU.js → 2.D_rZvST-.js} +1 -1
  56. package/build/client/_app/immutable/nodes/2.D_rZvST-.js.br +1 -0
  57. package/build/client/_app/immutable/nodes/2.D_rZvST-.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/{20.BwkZ69JF.js → 20.BdI-VOvV.js} +1 -1
  59. package/build/client/_app/immutable/nodes/20.BdI-VOvV.js.br +0 -0
  60. package/build/client/_app/immutable/nodes/20.BdI-VOvV.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{21.CJ2mTjrC.js → 21.ZibevvXm.js} +1 -1
  62. package/build/client/_app/immutable/nodes/21.ZibevvXm.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/21.ZibevvXm.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/{22.DgCZAA13.js → 22.C-VNj-2o.js} +1 -1
  65. package/build/client/_app/immutable/nodes/22.C-VNj-2o.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/22.C-VNj-2o.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{24.DdvwAU-3.js → 24.CzsEH6Sp.js} +1 -1
  68. package/build/client/_app/immutable/nodes/24.CzsEH6Sp.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/24.CzsEH6Sp.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/{25.Dl43tU9v.js → 25.BSMt3Z7q.js} +1 -1
  71. package/build/client/_app/immutable/nodes/25.BSMt3Z7q.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/25.BSMt3Z7q.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/{28.CViwnTnZ.js → 28.fas2NfVz.js} +1 -1
  74. package/build/client/_app/immutable/nodes/28.fas2NfVz.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/28.fas2NfVz.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{29.CTuIOorG.js → 29.CMthJV6o.js} +1 -1
  77. package/build/client/_app/immutable/nodes/29.CMthJV6o.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/29.CMthJV6o.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{3.C2KRyg4Q.js → 3.EKzmnuqF.js} +1 -1
  80. package/build/client/_app/immutable/nodes/3.EKzmnuqF.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/3.EKzmnuqF.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/{30.joGx-70R.js → 30.DTVVDQS5.js} +1 -1
  83. package/build/client/_app/immutable/nodes/30.DTVVDQS5.js.br +0 -0
  84. package/build/client/_app/immutable/nodes/30.DTVVDQS5.js.gz +0 -0
  85. package/build/client/_app/immutable/nodes/{31.B6HiWuZb.js → 31.EPPK-UJw.js} +1 -1
  86. package/build/client/_app/immutable/nodes/31.EPPK-UJw.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/31.EPPK-UJw.js.gz +0 -0
  88. package/build/client/_app/immutable/nodes/{5.CpT-aMen.js → 5.1Ed44Zc2.js} +1 -1
  89. package/build/client/_app/immutable/nodes/5.1Ed44Zc2.js.br +2 -0
  90. package/build/client/_app/immutable/nodes/5.1Ed44Zc2.js.gz +0 -0
  91. package/build/client/_app/immutable/nodes/{6.DN1CD9ie.js → 6.e3r9ssu2.js} +1 -1
  92. package/build/client/_app/immutable/nodes/6.e3r9ssu2.js.br +0 -0
  93. package/build/client/_app/immutable/nodes/6.e3r9ssu2.js.gz +0 -0
  94. package/build/client/_app/immutable/nodes/{7.jUM_z2nw.js → 7.tx3sClKh.js} +1 -1
  95. package/build/client/_app/immutable/nodes/7.tx3sClKh.js.br +0 -0
  96. package/build/client/_app/immutable/nodes/7.tx3sClKh.js.gz +0 -0
  97. package/build/client/_app/immutable/nodes/{8.D2sryp3t.js → 8.BFWWiB3_.js} +1 -1
  98. package/build/client/_app/immutable/nodes/8.BFWWiB3_.js.br +0 -0
  99. package/build/client/_app/immutable/nodes/8.BFWWiB3_.js.gz +0 -0
  100. package/build/client/_app/immutable/nodes/{9.F1vgVSRk.js → 9.BOMYv3ZE.js} +1 -1
  101. package/build/client/_app/immutable/nodes/9.BOMYv3ZE.js.br +0 -0
  102. package/build/client/_app/immutable/nodes/9.BOMYv3ZE.js.gz +0 -0
  103. package/build/client/_app/version.json +1 -1
  104. package/build/client/_app/version.json.br +0 -0
  105. package/build/client/_app/version.json.gz +0 -0
  106. package/build/handler.js +4 -4
  107. package/build/index.js +4 -4
  108. package/build/server/chunks/chunks/{AppHeader.js-BLsoVvJl.js → AppHeader.js-BiYpqMz4.js} +3 -3
  109. package/build/server/chunks/chunks/{AppHeader.js-BLsoVvJl.js.map → AppHeader.js-BiYpqMz4.js.map} +1 -1
  110. package/build/server/chunks/chunks/{SideNav.js-CGizZYTe.js → SideNav.js-DNwgk2vX.js} +2 -2
  111. package/build/server/chunks/chunks/{SideNav.js-CGizZYTe.js.map → SideNav.js-DNwgk2vX.js.map} +1 -1
  112. package/build/server/chunks/chunks/{UserChip.js-BbJIny8X.js → UserChip.js-DSt47nKM.js} +3 -3
  113. package/build/server/chunks/chunks/{UserChip.js-BbJIny8X.js.map → UserChip.js-DSt47nKM.js.map} +1 -1
  114. package/build/server/chunks/chunks/{client.js-C2uRl56X.js → client.js-WPhme-Hv.js} +2 -2
  115. package/build/server/chunks/chunks/{client.js-C2uRl56X.js.map → client.js-WPhme-Hv.js.map} +1 -1
  116. package/build/server/chunks/chunks/forms.js-dEoCKFXm.js +2 -0
  117. package/build/server/chunks/chunks/forms.js-dEoCKFXm.js.map +1 -0
  118. package/build/server/chunks/chunks/internal.js-Du115o1_.js.map +1 -1
  119. package/build/server/chunks/chunks/{internal2.js-Bsdxd76H.js → internal2.js-QAStwQ2u.js} +2 -2
  120. package/build/server/chunks/chunks/{internal2.js-Bsdxd76H.js.map → internal2.js-QAStwQ2u.js.map} +1 -1
  121. package/build/server/chunks/chunks/navigation.js-dEoCKFXm.js +2 -0
  122. package/build/server/chunks/chunks/navigation.js-dEoCKFXm.js.map +1 -0
  123. package/build/server/chunks/chunks/{package.js-08yOy4we.js → package.js-BnfKHP4H.js} +2 -2
  124. package/build/server/chunks/chunks/{package.js-08yOy4we.js.map → package.js-BnfKHP4H.js.map} +1 -1
  125. package/build/server/chunks/chunks/{paths.js-CrHgBXzp.js → paths.js-CfWf63wq.js} +2 -2
  126. package/build/server/chunks/chunks/{paths.js-CrHgBXzp.js.map → paths.js-CfWf63wq.js.map} +1 -1
  127. package/build/server/chunks/chunks/{state.js-C5l5D1uF.js → state.js-CcNuYmm-.js} +2 -2
  128. package/build/server/chunks/chunks/{state.js-C5l5D1uF.js.map → state.js-CcNuYmm-.js.map} +1 -1
  129. package/build/server/chunks/chunks/{stores.js-BQkhkurO.js → stores.js-D6RT-8OU.js} +2 -2
  130. package/build/server/chunks/chunks/{stores.js-BQkhkurO.js.map → stores.js-D6RT-8OU.js.map} +1 -1
  131. package/build/server/chunks/entries/pages/{_error.svelte.js-DuPb8sdo.js → _error.svelte.js-BIjyguG0.js} +4 -4
  132. package/build/server/chunks/entries/pages/{_error.svelte.js-DuPb8sdo.js.map → _error.svelte.js-BIjyguG0.js.map} +1 -1
  133. package/build/server/chunks/entries/pages/{_page.svelte.js-BdPmnGmW.js → _page.svelte.js-DHmuw2BG.js} +6 -6
  134. package/build/server/chunks/entries/pages/{_page.svelte.js-BdPmnGmW.js.map → _page.svelte.js-DHmuw2BG.js.map} +1 -1
  135. package/build/server/chunks/entries/pages/accept-invite/{_page.svelte.js-urTkNgjk.js → _page.svelte.js-ute5SzmW.js} +4 -4
  136. package/build/server/chunks/entries/pages/accept-invite/{_page.svelte.js-urTkNgjk.js.map → _page.svelte.js-ute5SzmW.js.map} +1 -1
  137. package/build/server/chunks/entries/pages/admin/{_error.svelte.js-Dd-JdChw.js → _error.svelte.js-D8xVfeml.js} +4 -4
  138. package/build/server/chunks/entries/pages/admin/{_error.svelte.js-Dd-JdChw.js.map → _error.svelte.js-D8xVfeml.js.map} +1 -1
  139. package/build/server/chunks/entries/pages/admin/{_layout.svelte.js-CQ6U6EGQ.js → _layout.svelte.js-BeE4mhN7.js} +7 -7
  140. package/build/server/chunks/entries/pages/admin/{_layout.svelte.js-CQ6U6EGQ.js.map → _layout.svelte.js-BeE4mhN7.js.map} +1 -1
  141. package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-Dnkzy7wM.js → _page.server.ts.js-COVvUDPQ.js} +2 -2
  142. package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-Dnkzy7wM.js.map → _page.server.ts.js-COVvUDPQ.js.map} +1 -1
  143. package/build/server/chunks/entries/pages/admin/{_page.svelte.js-O32hr90O.js → _page.svelte.js-Cjyh3Ofz.js} +4 -4
  144. package/build/server/chunks/entries/pages/admin/{_page.svelte.js-O32hr90O.js.map → _page.svelte.js-Cjyh3Ofz.js.map} +1 -1
  145. package/build/server/chunks/entries/pages/admin/compute/{_page.svelte.js-DZD6irdf.js → _page.svelte.js-BmsbKrBX.js} +3 -3
  146. package/build/server/chunks/entries/pages/admin/compute/{_page.svelte.js-DZD6irdf.js.map → _page.svelte.js-BmsbKrBX.js.map} +1 -1
  147. package/build/server/chunks/entries/pages/admin/projects/_id_/{_page.svelte.js-DQJmvJma.js → _page.svelte.js-ArYGa2iv.js} +3 -3
  148. package/build/server/chunks/entries/pages/admin/projects/_id_/{_page.svelte.js-DQJmvJma.js.map → _page.svelte.js-ArYGa2iv.js.map} +1 -1
  149. package/build/server/chunks/entries/pages/admin/projects/{_page.svelte.js-CxKD_0EH.js → _page.svelte.js-Do9jDoJh.js} +3 -3
  150. package/build/server/chunks/entries/pages/admin/projects/{_page.svelte.js-CxKD_0EH.js.map → _page.svelte.js-Do9jDoJh.js.map} +1 -1
  151. package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-OtdWKH_W.js → _page.server.ts.js-hOdJmmYZ.js} +2 -2
  152. package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-OtdWKH_W.js.map → _page.server.ts.js-hOdJmmYZ.js.map} +1 -1
  153. package/build/server/chunks/entries/pages/admin/system/{_page.svelte.js-De_jKUjZ.js → _page.svelte.js-BvrWIfcu.js} +3 -3
  154. package/build/server/chunks/entries/pages/admin/system/{_page.svelte.js-De_jKUjZ.js.map → _page.svelte.js-BvrWIfcu.js.map} +1 -1
  155. package/build/server/chunks/entries/pages/admin/users/{_page.svelte.js-jn7h_MeW.js → _page.svelte.js-B8mEKNbV.js} +4 -4
  156. package/build/server/chunks/entries/pages/admin/users/{_page.svelte.js-jn7h_MeW.js.map → _page.svelte.js-B8mEKNbV.js.map} +1 -1
  157. package/build/server/chunks/entries/pages/auth/email/sent/{_page.svelte.js-DLytff0n.js → _page.svelte.js-Djs9_FGQ.js} +4 -4
  158. package/build/server/chunks/entries/pages/auth/email/sent/{_page.svelte.js-DLytff0n.js.map → _page.svelte.js-Djs9_FGQ.js.map} +1 -1
  159. package/build/server/chunks/entries/pages/docs/api/{_page.svelte.js-TfTp2TQ7.js → _page.svelte.js-ZU7lULL1.js} +3 -3
  160. package/build/server/chunks/entries/pages/docs/api/{_page.svelte.js-TfTp2TQ7.js.map → _page.svelte.js-ZU7lULL1.js.map} +1 -1
  161. package/build/server/chunks/entries/pages/library/_guid_/{_page.svelte.js-CIZ3SqAb.js → _page.svelte.js-BA93OB-5.js} +5 -5
  162. package/build/server/chunks/entries/pages/library/_guid_/{_page.svelte.js-CIZ3SqAb.js.map → _page.svelte.js-BA93OB-5.js.map} +1 -1
  163. package/build/server/chunks/entries/pages/library/{_page.svelte.js-xJqsYQ3l.js → _page.svelte.js-SssdJ0oZ.js} +6 -6
  164. package/build/server/chunks/entries/pages/library/{_page.svelte.js-xJqsYQ3l.js.map → _page.svelte.js-SssdJ0oZ.js.map} +1 -1
  165. package/build/server/chunks/entries/pages/login/{_page.svelte.js-COLquOwh.js → _page.svelte.js-CnGd-RFs.js} +4 -4
  166. package/build/server/chunks/entries/pages/login/{_page.svelte.js-COLquOwh.js.map → _page.svelte.js-CnGd-RFs.js.map} +1 -1
  167. package/build/server/chunks/entries/pages/projects/{_layout.svelte.js-5d-QRqmI.js → _layout.svelte.js-DI5I2kcx.js} +6 -6
  168. package/build/server/chunks/entries/pages/projects/{_layout.svelte.js-5d-QRqmI.js.map → _layout.svelte.js-DI5I2kcx.js.map} +1 -1
  169. package/build/server/chunks/entries/pages/projects/{_page.svelte.js-CQ2Oidtr.js → _page.svelte.js-CN1FRrSj.js} +4 -4
  170. package/build/server/chunks/entries/pages/projects/{_page.svelte.js-CQ2Oidtr.js.map → _page.svelte.js-CN1FRrSj.js.map} +1 -1
  171. package/build/server/chunks/entries/pages/setup/{_page.svelte.js-CLY2-fLV.js → _page.svelte.js-DfS87SvM.js} +4 -4
  172. package/build/server/chunks/entries/pages/setup/{_page.svelte.js-CLY2-fLV.js.map → _page.svelte.js-DfS87SvM.js.map} +1 -1
  173. package/build/server/chunks/entries/pages/team/{_layout.svelte.js-Bb-wNxrt.js → _layout.svelte.js-Bg1v8LvC.js} +8 -8
  174. package/build/server/chunks/entries/pages/team/{_layout.svelte.js-Bb-wNxrt.js.map → _layout.svelte.js-Bg1v8LvC.js.map} +1 -1
  175. package/build/server/chunks/entries/pages/team/compute/{_page.svelte.js-C56kjjMI.js → _page.svelte.js-DQXvanlA.js} +4 -4
  176. package/build/server/chunks/entries/pages/team/compute/{_page.svelte.js-C56kjjMI.js.map → _page.svelte.js-DQXvanlA.js.map} +1 -1
  177. package/build/server/chunks/entries/pages/team/members/{_page.svelte.js-BNdam10o.js → _page.svelte.js-CvluTnc3.js} +3 -3
  178. package/build/server/chunks/entries/pages/team/members/{_page.svelte.js-BNdam10o.js.map → _page.svelte.js-CvluTnc3.js.map} +1 -1
  179. package/build/server/chunks/entries/pages/team/projects/{_page.svelte.js-CvAudtf9.js → _page.svelte.js-DyEZVCe8.js} +3 -3
  180. package/build/server/chunks/entries/pages/team/projects/{_page.svelte.js-CvAudtf9.js.map → _page.svelte.js-DyEZVCe8.js.map} +1 -1
  181. package/build/server/chunks/entries/pages/team/reclaim/{_page.svelte.js-BGh7pbyR.js → _page.svelte.js-BKPrtKFm.js} +3 -3
  182. package/build/server/chunks/entries/pages/team/reclaim/{_page.svelte.js-BGh7pbyR.js.map → _page.svelte.js-BKPrtKFm.js.map} +1 -1
  183. package/build/server/chunks/{handler-D7uyDPX_.js → handler-Cy2TELJx.js} +3 -3
  184. package/build/server/chunks/{handler-D7uyDPX_.js.map → handler-Cy2TELJx.js.map} +1 -1
  185. package/build/server/chunks/{index.js-D_FWifaI.js → index.js-zmQjWJJE.js} +2 -2
  186. package/build/server/chunks/{index.js-D_FWifaI.js.map → index.js-zmQjWJJE.js.map} +1 -1
  187. package/build/server/chunks/{manifest.js-C3EYsF6o.js → manifest.js-0J8gX1tS.js} +26 -26
  188. package/build/server/chunks/{manifest.js-C3EYsF6o.js.map → manifest.js-0J8gX1tS.js.map} +1 -1
  189. package/build/server/chunks/nodes/{1.js-BmUbPLIr.js → 1.js-DhHvnb6X.js} +3 -3
  190. package/build/server/chunks/nodes/{1.js-BmUbPLIr.js.map → 1.js-DhHvnb6X.js.map} +1 -1
  191. package/build/server/chunks/nodes/{11.js-CpqEc56h.js → 11.js-SWvtluFy.js} +3 -3
  192. package/build/server/chunks/nodes/{11.js-CpqEc56h.js.map → 11.js-SWvtluFy.js.map} +1 -1
  193. package/build/server/chunks/nodes/{13.js-_S5r_D14.js → 13.js-Kjtlg6yq.js} +3 -3
  194. package/build/server/chunks/nodes/{13.js-_S5r_D14.js.map → 13.js-Kjtlg6yq.js.map} +1 -1
  195. package/build/server/chunks/nodes/{14.js-B_mOWEA7.js → 14.js-CcEIXjoI.js} +3 -3
  196. package/build/server/chunks/nodes/{14.js-B_mOWEA7.js.map → 14.js-CcEIXjoI.js.map} +1 -1
  197. package/build/server/chunks/nodes/{15.js-D0AinrdH.js → 15.js-DXrBPdjU.js} +5 -5
  198. package/build/server/chunks/nodes/{15.js-D0AinrdH.js.map → 15.js-DXrBPdjU.js.map} +1 -1
  199. package/build/server/chunks/nodes/{16.js-zb5vz7m7.js → 16.js-BHCy0HEI.js} +3 -3
  200. package/build/server/chunks/nodes/{16.js-zb5vz7m7.js.map → 16.js-BHCy0HEI.js.map} +1 -1
  201. package/build/server/chunks/nodes/{17.js-D90B4tke.js → 17.js-DV7Na3zX.js} +3 -3
  202. package/build/server/chunks/nodes/{17.js-D90B4tke.js.map → 17.js-DV7Na3zX.js.map} +1 -1
  203. package/build/server/chunks/nodes/{19.js-unlJbnMM.js → 19.js-D65Z-mad.js} +3 -3
  204. package/build/server/chunks/nodes/{19.js-unlJbnMM.js.map → 19.js-D65Z-mad.js.map} +1 -1
  205. package/build/server/chunks/nodes/{2.js-Ci6oR-mI.js → 2.js-Cg2nIMxo.js} +3 -3
  206. package/build/server/chunks/nodes/{2.js-Ci6oR-mI.js.map → 2.js-Cg2nIMxo.js.map} +1 -1
  207. package/build/server/chunks/nodes/{20.js-Be6Kp7pn.js → 20.js-Droo8W_k.js} +3 -3
  208. package/build/server/chunks/nodes/{20.js-Be6Kp7pn.js.map → 20.js-Droo8W_k.js.map} +1 -1
  209. package/build/server/chunks/nodes/{21.js-DN-Ks4rG.js → 21.js-B5v9FMFT.js} +3 -3
  210. package/build/server/chunks/nodes/{21.js-DN-Ks4rG.js.map → 21.js-B5v9FMFT.js.map} +1 -1
  211. package/build/server/chunks/nodes/{22.js-D5Mrg2un.js → 22.js-BArf2NO0.js} +3 -3
  212. package/build/server/chunks/nodes/{22.js-D5Mrg2un.js.map → 22.js-BArf2NO0.js.map} +1 -1
  213. package/build/server/chunks/nodes/{24.js-BwU32qWC.js → 24.js-D5wNz-jk.js} +3 -3
  214. package/build/server/chunks/nodes/{24.js-BwU32qWC.js.map → 24.js-D5wNz-jk.js.map} +1 -1
  215. package/build/server/chunks/nodes/{25.js-CqPZNOiA.js → 25.js-uW7Fu7ou.js} +3 -3
  216. package/build/server/chunks/nodes/{25.js-CqPZNOiA.js.map → 25.js-uW7Fu7ou.js.map} +1 -1
  217. package/build/server/chunks/nodes/{28.js-DIKDjI6a.js → 28.js-CJ8iN5Zf.js} +3 -3
  218. package/build/server/chunks/nodes/{28.js-DIKDjI6a.js.map → 28.js-CJ8iN5Zf.js.map} +1 -1
  219. package/build/server/chunks/nodes/{29.js-BAEP2rk4.js → 29.js-BL5lNRHx.js} +3 -3
  220. package/build/server/chunks/nodes/{29.js-BAEP2rk4.js.map → 29.js-BL5lNRHx.js.map} +1 -1
  221. package/build/server/chunks/nodes/{3.js-Cy3-V4q-.js → 3.js-D-fJfhsf.js} +3 -3
  222. package/build/server/chunks/nodes/{3.js-Cy3-V4q-.js.map → 3.js-D-fJfhsf.js.map} +1 -1
  223. package/build/server/chunks/nodes/{30.js-Iges0z_Z.js → 30.js-B9Fw7ttr.js} +3 -3
  224. package/build/server/chunks/nodes/{30.js-Iges0z_Z.js.map → 30.js-B9Fw7ttr.js.map} +1 -1
  225. package/build/server/chunks/nodes/{31.js-BH8_1FZs.js → 31.js-D44JFiKn.js} +3 -3
  226. package/build/server/chunks/nodes/{31.js-BH8_1FZs.js.map → 31.js-D44JFiKn.js.map} +1 -1
  227. package/build/server/chunks/nodes/{5.js-OyqTNYI5.js → 5.js-CrT1Yru3.js} +3 -3
  228. package/build/server/chunks/nodes/{5.js-OyqTNYI5.js.map → 5.js-CrT1Yru3.js.map} +1 -1
  229. package/build/server/chunks/nodes/{6.js-OPLqTyAT.js → 6.js-BqLxIx6s.js} +3 -3
  230. package/build/server/chunks/nodes/{6.js-OPLqTyAT.js.map → 6.js-BqLxIx6s.js.map} +1 -1
  231. package/build/server/chunks/nodes/{7.js-BDHBTbsB.js → 7.js-CTJtl9w2.js} +3 -3
  232. package/build/server/chunks/nodes/{7.js-BDHBTbsB.js.map → 7.js-CTJtl9w2.js.map} +1 -1
  233. package/build/server/chunks/nodes/{8.js-CuDjgHfO.js → 8.js-CPoKkvl-.js} +3 -3
  234. package/build/server/chunks/nodes/{8.js-CuDjgHfO.js.map → 8.js-CPoKkvl-.js.map} +1 -1
  235. package/build/server/chunks/nodes/{9.js-Om1TXkBX.js → 9.js-BmbkoUWF.js} +5 -5
  236. package/build/server/chunks/nodes/{9.js-Om1TXkBX.js.map → 9.js-BmbkoUWF.js.map} +1 -1
  237. package/package.json +5 -5
  238. package/build/client/_app/immutable/chunks/BYD9ojkv.js.br +0 -0
  239. package/build/client/_app/immutable/chunks/BYD9ojkv.js.gz +0 -0
  240. package/build/client/_app/immutable/chunks/Be3WC0-8.js.br +0 -0
  241. package/build/client/_app/immutable/chunks/Be3WC0-8.js.gz +0 -0
  242. package/build/client/_app/immutable/chunks/CRivHbsS2.js +0 -1
  243. package/build/client/_app/immutable/chunks/CRivHbsS2.js.br +0 -2
  244. package/build/client/_app/immutable/chunks/CRivHbsS2.js.gz +0 -0
  245. package/build/client/_app/immutable/chunks/D1hCb6FF.js.br +0 -0
  246. package/build/client/_app/immutable/chunks/D1hCb6FF.js.gz +0 -0
  247. package/build/client/_app/immutable/chunks/DNtgc4DF2.js.br +0 -0
  248. package/build/client/_app/immutable/chunks/DNtgc4DF2.js.gz +0 -0
  249. package/build/client/_app/immutable/chunks/DiKrHerm2.js.br +0 -0
  250. package/build/client/_app/immutable/chunks/DiKrHerm2.js.gz +0 -0
  251. package/build/client/_app/immutable/chunks/KazlGG-f.js.br +0 -2
  252. package/build/client/_app/immutable/chunks/KazlGG-f.js.gz +0 -0
  253. package/build/client/_app/immutable/chunks/Np3qQttx.js.br +0 -0
  254. package/build/client/_app/immutable/chunks/Np3qQttx.js.gz +0 -0
  255. package/build/client/_app/immutable/entry/app.BN7RslZp.js.br +0 -0
  256. package/build/client/_app/immutable/entry/app.BN7RslZp.js.gz +0 -0
  257. package/build/client/_app/immutable/entry/start.DTc5753t.js +0 -1
  258. package/build/client/_app/immutable/entry/start.DTc5753t.js.br +0 -1
  259. package/build/client/_app/immutable/entry/start.DTc5753t.js.gz +0 -0
  260. package/build/client/_app/immutable/nodes/1.D-zguijV.js.br +0 -0
  261. package/build/client/_app/immutable/nodes/1.D-zguijV.js.gz +0 -0
  262. package/build/client/_app/immutable/nodes/11.Bkdh-AiT.js.br +0 -0
  263. package/build/client/_app/immutable/nodes/11.Bkdh-AiT.js.gz +0 -0
  264. package/build/client/_app/immutable/nodes/13.DrKe42QO.js.br +0 -0
  265. package/build/client/_app/immutable/nodes/13.DrKe42QO.js.gz +0 -0
  266. package/build/client/_app/immutable/nodes/14.B_ujHGn8.js.br +0 -0
  267. package/build/client/_app/immutable/nodes/14.B_ujHGn8.js.gz +0 -0
  268. package/build/client/_app/immutable/nodes/15.tFzVGAUV.js.br +0 -0
  269. package/build/client/_app/immutable/nodes/15.tFzVGAUV.js.gz +0 -0
  270. package/build/client/_app/immutable/nodes/16.D8c5EwIv.js.br +0 -0
  271. package/build/client/_app/immutable/nodes/16.D8c5EwIv.js.gz +0 -0
  272. package/build/client/_app/immutable/nodes/17.BRlwoiq3.js.br +0 -0
  273. package/build/client/_app/immutable/nodes/17.BRlwoiq3.js.gz +0 -0
  274. package/build/client/_app/immutable/nodes/19.DRxbK7Dn.js.br +0 -0
  275. package/build/client/_app/immutable/nodes/19.DRxbK7Dn.js.gz +0 -0
  276. package/build/client/_app/immutable/nodes/2.CEFhQHYU.js.br +0 -0
  277. package/build/client/_app/immutable/nodes/2.CEFhQHYU.js.gz +0 -0
  278. package/build/client/_app/immutable/nodes/20.BwkZ69JF.js.br +0 -0
  279. package/build/client/_app/immutable/nodes/20.BwkZ69JF.js.gz +0 -0
  280. package/build/client/_app/immutable/nodes/21.CJ2mTjrC.js.br +0 -0
  281. package/build/client/_app/immutable/nodes/21.CJ2mTjrC.js.gz +0 -0
  282. package/build/client/_app/immutable/nodes/22.DgCZAA13.js.br +0 -0
  283. package/build/client/_app/immutable/nodes/22.DgCZAA13.js.gz +0 -0
  284. package/build/client/_app/immutable/nodes/24.DdvwAU-3.js.br +0 -0
  285. package/build/client/_app/immutable/nodes/24.DdvwAU-3.js.gz +0 -0
  286. package/build/client/_app/immutable/nodes/25.Dl43tU9v.js.br +0 -0
  287. package/build/client/_app/immutable/nodes/25.Dl43tU9v.js.gz +0 -0
  288. package/build/client/_app/immutable/nodes/28.CViwnTnZ.js.br +0 -0
  289. package/build/client/_app/immutable/nodes/28.CViwnTnZ.js.gz +0 -0
  290. package/build/client/_app/immutable/nodes/29.CTuIOorG.js.br +0 -0
  291. package/build/client/_app/immutable/nodes/29.CTuIOorG.js.gz +0 -0
  292. package/build/client/_app/immutable/nodes/3.C2KRyg4Q.js.br +0 -0
  293. package/build/client/_app/immutable/nodes/3.C2KRyg4Q.js.gz +0 -0
  294. package/build/client/_app/immutable/nodes/30.joGx-70R.js.br +0 -0
  295. package/build/client/_app/immutable/nodes/30.joGx-70R.js.gz +0 -0
  296. package/build/client/_app/immutable/nodes/31.B6HiWuZb.js.br +0 -0
  297. package/build/client/_app/immutable/nodes/31.B6HiWuZb.js.gz +0 -0
  298. package/build/client/_app/immutable/nodes/5.CpT-aMen.js.br +0 -1
  299. package/build/client/_app/immutable/nodes/5.CpT-aMen.js.gz +0 -0
  300. package/build/client/_app/immutable/nodes/6.DN1CD9ie.js.br +0 -0
  301. package/build/client/_app/immutable/nodes/6.DN1CD9ie.js.gz +0 -0
  302. package/build/client/_app/immutable/nodes/7.jUM_z2nw.js.br +0 -0
  303. package/build/client/_app/immutable/nodes/7.jUM_z2nw.js.gz +0 -0
  304. package/build/client/_app/immutable/nodes/8.D2sryp3t.js.br +0 -0
  305. package/build/client/_app/immutable/nodes/8.D2sryp3t.js.gz +0 -0
  306. package/build/client/_app/immutable/nodes/9.F1vgVSRk.js.br +0 -0
  307. package/build/client/_app/immutable/nodes/9.F1vgVSRk.js.gz +0 -0
  308. package/build/server/chunks/chunks/forms.js-DVOMMUAq.js +0 -2
  309. package/build/server/chunks/chunks/forms.js-DVOMMUAq.js.map +0 -1
  310. package/build/server/chunks/chunks/navigation.js-DVOMMUAq.js +0 -2
  311. package/build/server/chunks/chunks/navigation.js-DVOMMUAq.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,At as n,B as r,C as i,Dt as a,E as o,F as s,Ft as c,G as l,H as u,It as d,J as f,K as p,L as m,Lt as h,M as g,N as _,P as v,Pt as y,Q as b,Rt as x,S,T as C,U as w,V as T,W as E,X as D,Y as O,_t as k,a as A,at as j,bt as ee,c as M,dt as N,f as P,ft as te,g as ne,gt as F,h as re,it as I,j as ie,jt as ae,k as L,kt as R,lt as z,m as oe,mt as B,n as se,nt as ce,o as V,ot as le,q as ue,r as de,s as H,ut as U,v as fe,vt as pe,w as W,yt as G,z as K,zt as me}from"../chunks/Cke4knuE.js";import"../chunks/xihTtKlq.js";import{c as q,s as he,t as J}from"../chunks/CrKMaiko.js";import{i as ge,r as _e}from"../chunks/B2lr8IYb.js";import{C as ve,E as ye,d as be,n as xe,o as Se,p as Ce,r as we,s as Te,t as Ee,u as De,y as Y}from"../chunks/BWkyPB3e.js";import{n as Oe,t as ke}from"../chunks/DSGwkBAQ.js";import{a as Ae,c as je,d as Me,f as Ne,i as Pe,l as Fe,m as Ie,n as Le,o as Re,p as ze,r as Be,s as Ve,t as He,u as Ue}from"../chunks/Be3WC0-8.js";import{t as We}from"../chunks/BRMiG9hK.js";import{t as Ge}from"../chunks/D0RK8yNo.js";import{t as Ke}from"../chunks/VJTh542u.js";import{t as qe}from"../chunks/DX2MELJa.js";import{t as Je}from"../chunks/CNcd_3er.js";import{t as Ye}from"../chunks/f9BZlcKm.js";import{t as Xe}from"../chunks/_YFjRYrV.js";import{n as Ze,r as Qe,t as $e}from"../chunks/0lP-Rpma.js";import{i as et,n as tt,r as nt,t as rt}from"../chunks/BzEuycjW.js";import{t as it}from"../chunks/CAB-AK4E.js";import{t as at}from"../chunks/gu4X15yF.js";import{t as ot}from"../chunks/CjPXNCS7.js";import{t as st}from"../chunks/BOS-wpIV.js";import{t as ct}from"../chunks/Dz00jH5u.js";import{D as lt,E as ut,O as dt,a as ft,d as pt,f as mt,o as ht,p as gt,t as _t,u as vt,v as yt,w as bt}from"../chunks/B50OBSAG.js";import{a as xt,c as St,d as Ct,i as wt,l as Tt,n as Et,o as Dt,r as Ot,s as kt,t as At,u as jt}from"../chunks/CzAXFvH8.js";import{D as Mt,M as Nt,O as Pt,T as Ft,c as It,d as Lt,f as Rt,h as zt,k as Bt,l as Vt,m as Ht,n as Ut,p as Wt,s as Gt,u as Kt,w as qt,x as Jt}from"../chunks/B1oMYNg6.js";import{a as Yt,i as Xt,n as Zt,r as Qt,t as $t}from"../chunks/CWlCxbnY.js";import{t as en}from"../chunks/C2ulfLBp.js";import{a as tn,i as nn,n as rn,r as an,t as on}from"../chunks/E0FrUJ1t.js";import{t as sn}from"../chunks/KazlGG-f.js";import{n as cn,t as ln}from"../chunks/DJq7n-sf.js";import{t as un}from"../chunks/KXvDoa1V.js";import{n as dn,t as fn}from"../chunks/sPP9TUD-.js";import{t as pn}from"../chunks/D3p1tqid.js";import{t as mn}from"../chunks/DqR8kuM62.js";import{n as hn}from"../chunks/C57linrd2.js";var gn=new Set([`$$slots`,`$$events`,`$$legacy`]);function _n(e,t){let n=V(t,gn),r=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]];Oe(e,H({name:`box`},()=>n,{get iconNode(){return r}}))}var vn=new Set([`$$slots`,`$$events`,`$$legacy`]);function yn(e,t){let n=V(t,vn),r=[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`}],[`circle`,{cx:`12`,cy:`13`,r:`3`}]];Oe(e,H({name:`camera`},()=>n,{get iconNode(){return r}}))}var bn=new Set([`$$slots`,`$$events`,`$$legacy`]);function xn(e,t){let n=V(t,bn),r=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`}],[`path`,{d:`m9 11 3 3L22 4`}]];Oe(e,H({name:`circle-check-big`},()=>n,{get iconNode(){return r}}))}var Sn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cn(e,t){let n=V(t,Sn),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Oe(e,H({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var wn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tn(e,t){let n=V(t,wn),r=[[`path`,{d:`M12 15V3`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}],[`path`,{d:`m7 10 5 5 5-5`}]];Oe(e,H({name:`download`},()=>n,{get iconNode(){return r}}))}var En=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dn(e,t){let n=V(t,En),r=[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}],[`path`,{d:`m2 2 20 20`}]];Oe(e,H({name:`eye-off`},()=>n,{get iconNode(){return r}}))}var On=new Set([`$$slots`,`$$events`,`$$legacy`]);function kn(e,t){let n=V(t,On),r=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];Oe(e,H({name:`eye`},()=>n,{get iconNode(){return r}}))}var An=new Set([`$$slots`,`$$events`,`$$legacy`]);function jn(e,t){let n=V(t,An),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];Oe(e,H({name:`file`},()=>n,{get iconNode(){return r}}))}var Mn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Nn(e,t){let n=V(t,Mn),r=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];Oe(e,H({name:`folder`},()=>n,{get iconNode(){return r}}))}var Pn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fn(e,t){let n=V(t,Pn),r=[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`}]];Oe(e,H({name:`frame`},()=>n,{get iconNode(){return r}}))}var In=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ln(e,t){let n=V(t,In),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 9h18`}],[`path`,{d:`M3 15h18`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`M15 3v18`}]];Oe(e,H({name:`grid-3x3`},()=>n,{get iconNode(){return r}}))}var Rn=new Set([`$$slots`,`$$events`,`$$legacy`]);function zn(e,t){let n=V(t,Rn),r=[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`}]];Oe(e,H({name:`inbox`},()=>n,{get iconNode(){return r}}))}var Bn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vn(e,t){let n=V(t,Bn),r=[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`}]];Oe(e,H({name:`layers`},()=>n,{get iconNode(){return r}}))}var Hn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Un(e,t){let n=V(t,Hn),r=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}]];Oe(e,H({name:`link`},()=>n,{get iconNode(){return r}}))}var Wn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Gn(e,t){let n=V(t,Wn),r=[[`path`,{d:`M12 2v4`}],[`path`,{d:`m16.2 7.8 2.9-2.9`}],[`path`,{d:`M18 12h4`}],[`path`,{d:`m16.2 16.2 2.9 2.9`}],[`path`,{d:`M12 18v4`}],[`path`,{d:`m4.9 19.1 2.9-2.9`}],[`path`,{d:`M2 12h4`}],[`path`,{d:`m4.9 4.9 2.9 2.9`}]];Oe(e,H({name:`loader`},()=>n,{get iconNode(){return r}}))}var Kn=new Set([`$$slots`,`$$events`,`$$legacy`]);function qn(e,t){let n=V(t,Kn),r=[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`}]];Oe(e,H({name:`maximize`},()=>n,{get iconNode(){return r}}))}var Jn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Yn(e,t){let n=V(t,Jn),r=[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`}]];Oe(e,H({name:`minimize`},()=>n,{get iconNode(){return r}}))}var Xn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zn(e,t){let n=V(t,Xn),r=[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];Oe(e,H({name:`palette`},()=>n,{get iconNode(){return r}}))}var Qn=new Set([`$$slots`,`$$events`,`$$legacy`]);function $n(e,t){let n=V(t,Qn),r=[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`}],[`path`,{d:`m14.5 12.5 2-2`}],[`path`,{d:`m11.5 9.5 2-2`}],[`path`,{d:`m8.5 6.5 2-2`}],[`path`,{d:`m17.5 15.5 2-2`}]];Oe(e,H({name:`ruler`},()=>n,{get iconNode(){return r}}))}var er=new Set([`$$slots`,`$$events`,`$$legacy`]);function tr(e,t){let n=V(t,er),r=[[`path`,{d:`M14 17H5`}],[`path`,{d:`M19 7h-9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}],[`circle`,{cx:`7`,cy:`7`,r:`3`}]];Oe(e,H({name:`settings-2`},()=>n,{get iconNode(){return r}}))}var nr=new Set([`$$slots`,`$$events`,`$$legacy`]);function rr(e,t){let n=V(t,nr),r=[[`circle`,{cx:`19`,cy:`5`,r:`2`}],[`circle`,{cx:`5`,cy:`19`,r:`2`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`}]];Oe(e,H({name:`spline`},()=>n,{get iconNode(){return r}}))}var ir=new Set([`$$slots`,`$$events`,`$$legacy`]);function ar(e,t){let n=V(t,ir),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];Oe(e,H({name:`square`},()=>n,{get iconNode(){return r}}))}var or=new Set([`$$slots`,`$$events`,`$$legacy`]);function sr(e,t){let n=V(t,or),r=[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`}]];Oe(e,H({name:`zap`},()=>n,{get iconNode(){return r}}))}var cr=Se({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),lr=new dt(`Checkbox.Group`),ur=new dt(`Checkbox.Root`),dr=class e{static create(t,n=null){return ur.set(new e(t,n))}opts;group;#e=G(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return D(this.#e)}set trueName(e){B(this.#e,e)}#t=G(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return D(this.#t)}set trueRequired(e){B(this.#t,e)}#n=G(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return D(this.#n)}set trueDisabled(e){B(this.#n,e)}#r=G(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return D(this.#r)}set trueReadonly(e){B(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=De(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),ut.pre([()=>y(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{!e||!t||(this.opts.checked.current=e.includes(t))}),ut.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===`Enter`){e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),this.#i())}}#i(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current===`submit`){this.#i();return}e.preventDefault(),this.#i()}}#a=G(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return D(this.#a)}set snippetProps(e){B(this.#a,e)}#o=G(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Te(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":we(this.trueRequired),"aria-readonly":we(this.trueReadonly),"data-disabled":xe(this.trueDisabled),"data-readonly":xe(this.trueReadonly),"data-state":pr(this.opts.checked.current,this.opts.indeterminate.current),[cr.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},fr=class e{static create(){return new e(ur.get())}root;#e=G(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return D(this.#e)}set trueChecked(e){B(this.#e,e)}#t=G(()=>!!this.root.trueName);get shouldRender(){return D(this.#t)}set shouldRender(e){B(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){ht(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=G(()=>({type:`checkbox`,checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}};function pr(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}function mr(e,t){n(t,!0);let i=fr.create();var a=r(),o=U(a),c=e=>{jt(e,H(()=>i.props))};s(o,e=>{i.shouldRender&&e(c)}),K(e,a),R()}var hr=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),gr=T(`<button><!></button>`),_r=T(`<!> <!>`,1);function vr(e,i){let a=w();n(i,!0);let o=A(i,`checked`,15,!1),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`required`,3,!1),f=A(i,`name`,3,void 0),p=A(i,`value`,3,`on`),m=A(i,`id`,19,()=>Ee(a)),h=A(i,`indeterminate`,15,!1),g=A(i,`type`,3,`button`),_=V(i,hr),v=lr.getOr(null);v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1)),ut.pre(()=>p(),()=>{v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1))});let y=dr.create({checked:Y(()=>o(),e=>{o(e),i.onCheckedChange?.(e)}),disabled:Y(()=>l()??!1),required:Y(()=>u()),name:Y(()=>f()),value:Y(()=>p()),id:Y(()=>m()),ref:Y(()=>c(),e=>c(e)),indeterminate:Y(()=>h(),e=>{h(e),i.onIndeterminateChange?.(e)}),type:Y(()=>g()),readonly:Y(()=>!!i.readonly)},v),b=G(()=>be({..._},y.props));var S=_r(),C=U(S),T=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(b),...y.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},E=e=>{var n=gr();oe(n,()=>({...D(b)}));var r=z(n);t(r,()=>i.children??x,()=>y.snippetProps),d(n),K(e,n)};s(C,e=>{i.child?e(T):e(E,-1)}),mr(N(C,2),{}),K(e,S),R()}function yr(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`onOpenChange`,3,_t),s=A(i,`onOpenChangeComplete`,3,_t);zt.create({open:Y(()=>a(),e=>{a(e),o()?.(e)}),onOpenChangeComplete:Y(()=>s())}),St(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var br=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),xr=T(`<div><!></div>`);function Sr(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=A(i,`onSelect`,3,_t),f=A(i,`closeOnSelect`,3,!0),p=V(i,br),m=Vt.create({id:Y(()=>c()),disabled:Y(()=>l()),onSelect:Y(()=>u()),ref:Y(()=>o(),e=>o(e)),closeOnSelect:Y(()=>f())}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=xr();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var Cr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),wr=T(`<div><!></div>`);function Tr(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,Cr),u=Wt.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=wr();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var Er=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`loop`,`onInteractOutside`,`forceMount`,`onEscapeKeydown`,`interactOutsideBehavior`,`escapeKeydownBehavior`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onFocusOutside`,`side`,`trapFocus`,`style`]),Dr=T(`<div><div><!></div></div>`);function Or(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,_t),f=A(i,`forceMount`,3,!1),p=A(i,`onEscapeKeydown`,3,_t),m=A(i,`interactOutsideBehavior`,3,`defer-otherwise-close`),h=A(i,`escapeKeydownBehavior`,3,`defer-otherwise-close`),g=A(i,`onOpenAutoFocus`,3,_t),_=A(i,`onCloseAutoFocus`,3,_t),v=A(i,`onFocusOutside`,3,_t),y=A(i,`side`,3,`right`),b=A(i,`trapFocus`,3,!1),S=V(i,Er),C=It.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),isSub:!0,onCloseAutoFocus:Y(()=>j)});function T(e){let t=e.currentTarget.contains(e.target),n=qt[C.parentMenu.root.opts.dir.current].includes(e.key);t&&n&&(C.parentMenu.onClose(),C.parentMenu.triggerNode?.focus(),e.preventDefault())}let E=G(()=>C.parentMenu.root.getBitsAttr(`sub-content`)),O=G(()=>be(S,C.props,{side:y(),onkeydown:T,[D(E)]:``}));function k(e){g()(e),!e.defaultPrevented&&(e.preventDefault(),C.parentMenu.root.isUsingKeyboard&&C.parentMenu.contentNode&&Lt.dispatch(C.parentMenu.contentNode))}function j(e){_()(e),!e.defaultPrevented&&e.preventDefault()}function ee(e){u()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function M(e){p()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function N(e){if(v()(e),e.defaultPrevented||!ht(e.target)||e.target.id===C.parentMenu.triggerNode?.id)return;if((C.parentMenu.parentMenu?.contentNode)?.contains(e.target)){C.parentMenu.onClose(),e.preventDefault();return}let t=`[${C.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t)){e.preventDefault();return}C.parentMenu.onClose()}var P=r(),te=U(P),ne=e=>{xt(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onOpenAutoFocus:k,get enabled(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Tt(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Dr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},F=e=>{Dt(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onCloseAutoFocus:j,onOpenAutoFocus:k,get open(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Tt(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Dr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(te,e=>{f()?e(ne):f()||e(F,1)}),K(e,P),R()}var kr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`disabled`,`ref`,`children`,`child`,`onSelect`,`openDelay`]),Ar=T(`<div><!></div>`);function jr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`disabled`,3,!1),l=A(i,`ref`,15,null),u=A(i,`onSelect`,3,_t),f=A(i,`openDelay`,3,0),p=V(i,kr),m=Ht.create({disabled:Y(()=>c()),onSelect:Y(()=>u()),id:Y(()=>o()),ref:Y(()=>l(),e=>l(e)),openDelay:Y(()=>f())}),h=G(()=>be(p,m.props));kt(e,{get id(){return o()},get ref(){return m.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},l=e=>{var n=Ar();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}function Mr(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`dir`,3,`ltr`),s=A(i,`onOpenChange`,3,_t),c=A(i,`onOpenChangeComplete`,3,_t),l=A(i,`_internal_variant`,3,`dropdown-menu`),u=A(i,`_internal_should_skip_exit_animation`,3,void 0),d=Rt.create({variant:Y(()=>l()),dir:Y(()=>o()),onClose:()=>{a(!1),s()(!1)},shouldSkipExitAnimation:()=>u()?.()??!1});Kt.create({open:Y(()=>a(),e=>{a(e),s()(e)}),onOpenChangeComplete:Y(()=>c())},d),St(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var Nr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),Pr=T(`<div><div><!></div></div>`);function Fr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,_t),f=A(i,`onEscapeKeydown`,3,_t),p=A(i,`onCloseAutoFocus`,3,_t),m=A(i,`forceMount`,3,!1),h=A(i,`trapFocus`,3,!1),g=V(i,Nr),_=It.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),onCloseAutoFocus:Y(()=>p())}),v=G(()=>be(g,_.props));function y(e){if(_.handleInteractOutside(e),!e.defaultPrevented&&(u()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}_.parentMenu.onClose()}}function b(e){f()(e),!e.defaultPrevented&&_.parentMenu.onClose()}var S=r(),C=U(S),T=e=>{xt(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!0,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Tt(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Pr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},E=e=>{Dt(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get open(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!1,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Tt(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Pr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(C,e=>{m()?e(T):m()||e(E,1)}),K(e,S),R()}var Ir=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),Lr=T(`<button><!></button>`);function Rr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`type`,3,`button`),f=V(i,Ir),p=Gt.create({id:Y(()=>o()),disabled:Y(()=>l()??!1),ref:Y(()=>c(),e=>c(e))}),m=G(()=>be(f,p.props,{type:u()}));kt(e,{get id(){return o()},get ref(){return p.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(m)})),K(e,n)},l=e=>{var n=Lr();oe(n,()=>({...D(m)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}var zr=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),j(this.handler)}handler(){let e=0,t=this.#e();if(!t)return;let n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}},Br=class{opts;present;#e;#t=F(!1);#n=!1;#r=F(void 0);#i=null;constructor(e){this.opts=e,this.present=this.opts.open,B(this.#t,e.open.current,!0),this.#e=new Mt({ref:this.opts.ref,afterTick:this.opts.open}),Nt(()=>this.#o()),ut(()=>this.present.current,e=>{if(!this.#n){this.#n=!0;return}this.#o(),e&&B(this.#t,!0),B(this.#r,e?`starting`:`ending`,!0),e&&(this.#i=window.requestAnimationFrame(()=>{this.#i=null,this.present.current&&B(this.#r,void 0)})),this.#e.run(()=>{e===this.present.current&&(e||B(this.#t,!1),B(this.#r,void 0))})})}#a=G(()=>D(this.#t));get isPresent(){return D(this.#a)}set isPresent(e){B(this.#a,e)}get transitionStatus(){return D(this.#r)}#o(){this.#i!==null&&(window.cancelAnimationFrame(this.#i),this.#i=null)}};function Vr(e,i){n(i,!0);let a=new Br({open:Y(()=>i.open),ref:i.ref});var o=r(),c=U(o),l=e=>{var n=r(),o=U(n);t(o,()=>i.presence??x,()=>({present:a.isPresent,transitionStatus:a.transitionStatus})),K(e,n)};s(c,e=>{(i.forceMount||i.open||a.isPresent)&&e(l)}),K(e,o),R()}function Hr(e,t,n){return Math.min(n,Math.max(t,e))}var Ur=class{state;#e;constructor(e,t){this.state=ve(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}},Wr=Se({component:`scroll-area`,parts:[`root`,`viewport`,`corner`,`thumb`,`scrollbar`]}),Gr=new dt(`ScrollArea.Root`),Kr=new dt(`ScrollArea.Scrollbar`),qr=new dt(`ScrollArea.ScrollbarVisible`),Jr=new dt(`ScrollArea.ScrollbarAxis`),Yr=new dt(`ScrollArea.ScrollbarShared`),Xr=class e{static create(t){return Gr.set(new e(t))}opts;attachment;#e=F(null);get scrollAreaNode(){return D(this.#e)}set scrollAreaNode(e){B(this.#e,e,!0)}#t=F(null);get viewportNode(){return D(this.#t)}set viewportNode(e){B(this.#t,e,!0)}#n=F(null);get contentNode(){return D(this.#n)}set contentNode(e){B(this.#n,e,!0)}#r=F(null);get scrollbarXNode(){return D(this.#r)}set scrollbarXNode(e){B(this.#r,e,!0)}#i=F(null);get scrollbarYNode(){return D(this.#i)}set scrollbarYNode(e){B(this.#i,e,!0)}#a=F(0);get cornerWidth(){return D(this.#a)}set cornerWidth(e){B(this.#a,e,!0)}#o=F(0);get cornerHeight(){return D(this.#o)}set cornerHeight(e){B(this.#o,e,!0)}#s=F(!1);get scrollbarXEnabled(){return D(this.#s)}set scrollbarXEnabled(e){B(this.#s,e,!0)}#c=F(!1);get scrollbarYEnabled(){return D(this.#c)}set scrollbarYEnabled(e){B(this.#c,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref,e=>this.scrollAreaNode=e),this.domContext=new Pt(e.ref)}#l=G(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:`relative`,"--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[Wr.root]:``,...this.attachment}));get props(){return D(this.#l)}set props(e){B(this.#l,e)}},Zr=class e{static create(t){return new e(t,Gr.get())}opts;root;attachment;#e=ve(Ut());#t=ve(null);contentAttachment=De(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref,e=>this.root.viewportNode=e)}#n=G(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?`scroll`:`hidden`,overflowY:this.root.scrollbarYEnabled?`scroll`:`hidden`},[Wr.viewport]:``,...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}#r=G(()=>({id:this.#e.current,"data-scroll-area-content":``,style:{minWidth:this.root.scrollbarXEnabled?`fit-content`:void 0},...this.contentAttachment}));get contentProps(){return D(this.#r)}set contentProps(e){B(this.#r,e)}},Qr=class e{static create(t){return Kr.set(new e(t,Gr.get()))}opts;root;#e=G(()=>this.opts.orientation.current===`horizontal`);get isHorizontal(){return D(this.#e)}set isHorizontal(e){B(this.#e,e)}#t=F(!1);get hasThumb(){return D(this.#t)}set hasThumb(e){B(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,ut(()=>this.isHorizontal,e=>e?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}},$r=class t{static create(){return new t(Kr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(t){this.scrollbar=t,this.root=t.root,j(()=>{let t=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current,r=0;if(!t)return;let i=Ce(f(t,`pointerenter`,()=>{this.root.domContext.clearTimeout(r),e(()=>this.isVisible=!0)}),f(t,`pointerleave`,()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{e(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)}));return()=>{this.root.domContext.getWindow().clearTimeout(r),i()}})}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ei=class e{static create(){return new e(Kr.get())}scrollbar;root;machine=new Ur(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});#e=G(()=>this.machine.state.current===`hidden`);get isHidden(){return D(this.#e)}set isHidden(e){B(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;let t=lt(()=>this.machine.dispatch(`SCROLL_END`),100);j(()=>{let e=this.machine.state.current,t=this.root.opts.scrollHideDelay.current;if(e===`idle`){let e=this.root.domContext.setTimeout(()=>this.machine.dispatch(`HIDE`),t);return()=>this.root.domContext.clearTimeout(e)}}),j(()=>{let e=this.root.viewportNode;if(!e)return;let n=this.scrollbar.isHorizontal?`scrollLeft`:`scrollTop`,r=e[n];return f(e,`scroll`,()=>{let i=e[n];r!==i&&(this.machine.dispatch(`SCROLL`),t()),r=i})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch(`POINTER_ENTER`)}onpointerleave(e){this.machine.dispatch(`POINTER_LEAVE`)}#t=G(()=>({"data-state":this.machine.state.current===`hidden`?`hidden`:`visible`,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ti=class e{static create(){return new e(Kr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;let t=lt(()=>{let e=this.root.viewportNode;if(!e)return;let t=e.offsetWidth<e.scrollWidth,n=e.offsetHeight<e.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?t:n},10);new zr(()=>this.root.viewportNode,t),new zr(()=>this.root.contentNode,t)}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ni=class e{static create(){return qr.set(new e(Kr.get()))}scrollbar;root;#e=F(null);get thumbNode(){return D(this.#e)}set thumbNode(e){B(this.#e,e,!0)}#t=F(0);get pointerOffset(){return D(this.#t)}set pointerOffset(e){B(this.#t,e,!0)}#n=F({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return D(this.#n)}set sizes(e){B(this.#n,e)}#r=G(()=>li(this.sizes.viewport,this.sizes.content));get thumbRatio(){return D(this.#r)}set thumbRatio(e){B(this.#r,e)}#i=G(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return D(this.#i)}set hasThumb(e){B(this.#i,e)}#a=F(``);get prevTransformStyle(){return D(this.#a)}set prevTransformStyle(e){B(this.#a,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,j(()=>{this.scrollbar.hasThumb=this.hasThumb}),j(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return di({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollLeft,t=`translate3d(${fi({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollTop,t=`translate3d(0, ${fi({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}},ri=class e{static create(t){return Jr.set(new e(t,qr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarXNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),mi(n,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:ci(this.computedStyle.paddingLeft),paddingEnd:ci(this.computedStyle.paddingRight)}})};#t=G(()=>ui(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`horizontal`,style:{bottom:0,left:this.root.opts.dir.current===`rtl`?`var(--bits-scroll-area-corner-width)`:0,right:this.root.opts.dir.current===`ltr`?`var(--bits-scroll-area-corner-width)`:0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}},ii=class e{static create(t){return Jr.set(new e(t,qr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarYNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),mi(n,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:ci(this.computedStyle.paddingTop),paddingEnd:ci(this.computedStyle.paddingBottom)}})}#t=G(()=>ui(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`vertical`,style:{top:0,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:`var(--bits-scroll-area-corner-height)`,"--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}},ai=class t{static create(){return Yr.set(new t(Jr.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=F(null);get rect(){return D(this.#e)}set rect(e){B(this.#e,e)}#t=F(``);get prevWebkitUserSelect(){return D(this.#t)}set prevWebkitUserSelect(e){B(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=G(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return D(this.#n)}set maxScrollPos(e){B(this.#n,e)}constructor(t){this.scrollbarState=t,this.root=t.root,this.scrollbarVis=t.scrollbarVis,this.scrollbar=t.scrollbarVis.scrollbar,this.handleResize=lt(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,j(()=>{let e=this.maxScrollPos,t=this.scrollbar.opts.ref.current;return this.root.viewportNode,f(this.root.domContext.getDocument(),`wheel`,n=>{let r=n.target;t?.contains(r)&&this.handleWheelScroll(n,e)},{passive:!1})}),le(()=>{this.scrollbarVis.sizes,e(()=>this.handleThumbPositionChange())}),new zr(()=>this.scrollbar.opts.ref.current,this.handleResize),new zr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;let t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}#r(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=``),this.rect=null)}onpointerdown(e){e.button===0&&(e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect=`none`,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=`auto`),this.handleDragScroll(e))}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#r()}onlostpointercapture(e){this.#r()}#i=G(()=>be({...this.scrollbarState.props,style:{position:`absolute`,...this.scrollbarState.props.style},[Wr.scrollbar]:``,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return D(this.#i)}set props(e){B(this.#i,e)}},oi=class t{static create(e){return new t(e,Yr.get())}opts;scrollbarState;attachment;#e;#t=F();#n=lt(()=>{D(this.#t)&&(D(this.#t)(),B(this.#t,void 0))},100);constructor(t,n){this.opts=t,this.scrollbarState=n,this.#e=n.root,this.attachment=De(this.opts.ref,e=>this.scrollbarState.scrollbarVis.thumbNode=e),j(()=>{let t=this.#e.viewportNode;return t?(e(()=>this.scrollbarState.handleThumbPositionChange()),f(t,`scroll`,()=>{if(this.#n(),!D(this.#t)){let e=hi(t,this.scrollbarState.handleThumbPositionChange);B(this.#t,e,!0),this.scrollbarState.handleThumbPositionChange()}})):void 0}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){let t=e.target;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:r,y:i})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#r=G(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?`visible`:`hidden`,style:{width:`var(--bits-scroll-area-thumb-width)`,height:`var(--bits-scroll-area-thumb-height)`,transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[Wr.thumb]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}},si=class e{static create(t){return new e(t,Gr.get())}opts;root;attachment;#e=F(0);#t=F(0);#n=G(()=>!!(D(this.#e)&&D(this.#t)));get hasSize(){return D(this.#n)}set hasSize(e){B(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=De(this.opts.ref),new zr(()=>this.root.scrollbarXNode,()=>{let e=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=e,B(this.#t,e,!0)}),new zr(()=>this.root.scrollbarYNode,()=>{let e=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=e,B(this.#e,e,!0)})}#r=G(()=>({id:this.opts.id.current,style:{width:D(this.#e),height:D(this.#t),position:`absolute`,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:0},[Wr.corner]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}};function ci(e){return e?Number.parseInt(e,10):0}function li(e,t){let n=e/t;return Number.isNaN(n)?0:n}function ui(e){let t=li(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function di({pointerPos:e,pointerOffset:t,sizes:n,dir:r=`ltr`}){let i=ui(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return pi([c,l],d)(e)}function fi({scrollPos:e,sizes:t,dir:n=`ltr`}){let r=ui(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Hr(e,c[0],c[1]);return pi([0,o],[0,s])(l)}function pi(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function mi(e,t){return e>0&&e<t}function hi(e,t){let n={left:e.scrollLeft,top:e.scrollTop},r=0,i=Bt(e);return(function a(){let o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=i.requestAnimationFrame(a)})(),()=>i.cancelAnimationFrame(r)}var gi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`type`,`dir`,`scrollHideDelay`,`children`,`child`]),_i=T(`<div><!></div>`);function vi(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`type`,3,`hover`),u=A(i,`dir`,3,`ltr`),f=A(i,`scrollHideDelay`,3,600),p=V(i,gi),m=Xr.create({type:Y(()=>l()),dir:Y(()=>u()),scrollHideDelay:Y(()=>f()),id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=_i();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var yi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`]),bi=T(`<div><div><!></div></div>`);function xi(e,r){let i=w();n(r,!0);let a=A(r,`ref`,15,null),o=A(r,`id`,19,()=>Ee(i)),s=V(r,yi),c=Zr.create({id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(s,c.props)),u=G(()=>be({},c.contentProps));var f=bi();oe(f,()=>({...D(l)}));var p=z(f);oe(p,()=>({...D(u)}));var m=z(p);t(m,()=>r.children??x),d(p),d(f),K(e,f),R()}var Si=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`]),Ci=T(`<div><!></div>`);function wi(e,i){n(i,!0);let a=V(i,Si),o=ai.create(),c=G(()=>be(a,o.props));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(c)})),K(e,n)},p=e=>{var n=Ci();oe(n,()=>({...D(c)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l),R()}var Ti=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ei(e,t){n(t,!0);let r=V(t,Ti),i=new bt,a=ri.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));wi(e,H(()=>D(o))),R()}var Di=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oi(e,t){n(t,!0);let r=V(t,Di),i=new bt,a=ii.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));wi(e,H(()=>D(o))),R()}var ki=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ai(e,t){n(t,!0);let i=V(t,ki),a=ni.create();var o=r(),c=U(o),l=e=>{Ei(e,H(()=>i))},u=e=>{Oi(e,H(()=>i))};s(c,e=>{a.scrollbar.opts.orientation.current===`horizontal`?e(l):e(u,-1)}),K(e,o),R()}var ji=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Mi(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,ji),a=ti.create(),o=G(()=>be(i,a.props));{let t=e=>{Ai(e,H(()=>D(o)))},n=G(()=>r()||a.isVisible);Vr(e,{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Ni=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Pi(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Ni),a=ei.create(),o=G(()=>be(i,a.props));{let t=e=>{Ai(e,H(()=>D(o)))},n=G(()=>r()||!a.isHidden);Vr(e,H(()=>D(o),{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}}))}R()}var Fi=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Ii(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Fi),a=$r.create(),o=ti.create(),s=G(()=>be(i,a.props,o.props,{"data-state":a.isVisible?`visible`:`hidden`})),c=G(()=>r()||a.isVisible&&o.isVisible);Vr(e,{get open(){return D(c)},get ref(){return o.scrollbar.opts.ref},presence:e=>{Ai(e,H(()=>D(s)))},$$slots:{presence:!0}}),R()}var Li=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`]);function Ri(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,Li),l=Qr.create({orientation:Y(()=>t.orientation),id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),u=G(()=>l.root.opts.type.current);var d=r(),f=U(d),p=e=>{Ii(e,H(()=>c,{get id(){return o()}}))},m=e=>{Pi(e,H(()=>c,{get id(){return o()}}))},h=e=>{Mi(e,H(()=>c,{get id(){return o()}}))},g=e=>{Ai(e,H(()=>c,{get id(){return o()}}))};s(f,e=>{D(u)===`hover`?e(p):D(u)===`scroll`?e(m,1):D(u)===`auto`?e(h,2):D(u)===`always`&&e(g,3)}),K(e,d),R()}var zi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`,`present`]),Bi=T(`<div><!></div>`);function Vi(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,zi),c=new bt,l=oi.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e)),mounted:Y(()=>c.current)}),u=G(()=>be(o,l.props,{style:{hidden:!i.present}}));var f=r(),p=U(f),m=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(u)})),K(e,n)},h=e=>{var n=Bi();oe(n,()=>({...D(u)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(p,e=>{i.child?e(m):e(h,-1)}),K(e,f),R()}var Hi=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`]);function Ui(e,t){let r=w();n(t,!0);let i=A(t,`id`,19,()=>Ee(r)),a=A(t,`ref`,15,null),o=A(t,`forceMount`,3,!1),s=V(t,Hi),c=qr.get();{let t=(e,t)=>{let n=()=>(t?.()).present;Vi(e,H(()=>s,{get id(){return i()},get present(){return n()},get ref(){return a()},set ref(e){a(e)}}))},n=G(()=>o()||c.hasThumb);Vr(e,{get open(){return D(n)},get ref(){return c.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Wi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`,`child`]),Gi=T(`<div><!></div>`);function Ki(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,Wi),c=si.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(o,c.props));var u=r(),f=U(u),p=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(l)})),K(e,n)},m=e=>{var n=Gi();oe(n,()=>({...D(l)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(f,e=>{i.child?e(p):e(m,-1)}),K(e,u),R()}var qi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`]);function Ji(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,qi),l=Gr.get(),u=G(()=>!!(l.scrollbarXNode&&l.scrollbarYNode)),d=G(()=>l.opts.type.current!==`scroll`&&D(u));var f=r(),p=U(f),m=e=>{Ki(e,H(()=>c,{get id(){return o()},get ref(){return a()},set ref(e){a(e)}}))};s(p,e=>{D(d)&&e(m)}),K(e,f),R()}function Yi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.right=`${n}%`):e===`rl`?(r.right=`${t}%`,r.left=`${n}%`):e===`bt`?(r.bottom=`${t}%`,r.top=`${n}%`):(r.top=`${t}%`,r.bottom=`${n}%`),r}function Xi(e,t){let n={position:`absolute`};return e===`lr`?(n.left=`${t}%`,n.translate=`-50% 0`):e===`rl`?(n.right=`${t}%`,n.translate=`50% 0`):e===`bt`?(n.bottom=`${t}%`,n.translate=`0 50%`):(n.top=`${t}%`,n.translate=`0 -50%`),n}function Zi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.translate=`${n}% 0`):e===`rl`?(r.right=`${t}%`,r.translate=`${-n}% 0`):e===`bt`?(r.bottom=`${t}%`,r.translate=`0 ${-n}%`):(r.top=`${t}%`,r.translate=`0 ${n}%`),r}function Qi(e){if(Math.floor(e)===e)return 0;let t=e.toString();if(t.indexOf(`.`)!==-1&&t.indexOf(`e-`)===-1)return t.split(`.`)[1].length;if(t.indexOf(`e-`)!==-1){let e=t.split(`e-`);return parseInt(e[1],10)}return 0}function $i(e,t){let n=10**t;return Math.round(e*n)/n}function ea(e,t,n){if(typeof e==`number`){let r=n-t,i=Math.ceil(r/e),a=Qi(e),o=10**a;Math.round(r*o)%Math.round(e*o)===0&&i++;let s=[];for(let n=0;n<i;n++){let r=$i(t+n*e,a);s.push(r)}return s}return[...new Set(e)].filter(e=>e>=t&&e<=n).sort((e,t)=>e-t)}function ta(e,t){if(t.length===0)return e;let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}return n}function na(e,t,n){let r=t.indexOf(e);return r===-1?ta(e,t):n===`next`?r<t.length-1?t[r+1]:e:r>0?t[r-1]:e}function ra(e,t,n=!0){let[r,i]=e,[a,o]=t,s=(o-a)/(i-r);return e=>{let t=a+s*(e-r);return n?t>Math.max(a,o)?Math.max(a,o):t<Math.min(a,o)?Math.min(a,o):t:t}}var ia=Se({component:`slider`,parts:[`root`,`thumb`,`range`,`tick`,`tick-label`,`thumb-label`]}),aa=new dt(`Slider.Root`),oa=class{opts;attachment;#e=F(!1);get isActive(){return D(this.#e)}set isActive(e){B(this.#e,e,!0)}#t=F(0);#n=G(()=>this.opts.orientation.current===`horizontal`?this.opts.dir.current===`rtl`?`rl`:`lr`:this.opts.dir.current===`rtl`?`tb`:`bt`);get direction(){return D(this.#n)}set direction(e){B(this.#n,e)}#r=G(()=>ea(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return D(this.#r)}set normalizedSteps(e){B(this.#r,e)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref),this.domContext=new Pt(this.opts.ref),new zr(()=>this.opts.ref.current,this.#i)}#i=()=>{B(this.#t,D(this.#t)+1)};isThumbActive(e){return this.isActive}#a=G(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current===`horizontal`?`pan-y`:`pan-x`});getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(ia.selector(`thumb`))):[]};getThumbScale=()=>{D(this.#t);let e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current===`exact`)return[0,100];let t=this.opts.orientation.current===`vertical`,n=this.getAllThumbs()[0],r=t?n?.offsetHeight:n?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];let i=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(i===void 0||Number.isNaN(i)||i===0)return[0,100];let a=r/2/i*100;return[a,100-a]};getPositionFromValue=e=>{let t=this.getThumbScale();return ra([this.opts.min.current,this.opts.max.current],t)(e)};#o=G(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":xe(this.opts.disabled.current),style:{touchAction:D(this.#a)},[ia.root]:``,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},sa=class extends oa{opts;isMulti=!1;constructor(e){super(e),this.opts=e,Ct(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),ut([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ea(e,t,n),a=e=>i.includes(e),o=e=>ta(e,i);a(r)||(this.opts.value.current=o(r))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:n}){let r=this.opts.min.current,i=this.opts.max.current,a=(e-t)/(n-t)*(i-r)+r;if(a<r)this.updateValue(r);else if(a>i)this.updateValue(i);else{let e=this.normalizedSteps,t=ta(a,e);this.updateValue(t)}}updateValue=e=>{this.opts.value.current=ta(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!t||!n)return;n.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect();this.direction===`lr`?this.applyPosition({clientXY:e.clientX,start:r,end:i}):this.direction===`rl`?this.applyPosition({clientXY:e.clientX,start:i,end:r}):this.direction===`bt`?this.applyPosition({clientXY:e.clientY,start:o,end:a}):this.direction===`tb`&&this.applyPosition({clientXY:e.clientY,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!n||!t)return;let r=e.composedPath()[0]??e.target;!ft(r)||!t.contains(r)||(e.preventDefault(),n.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};#e=G(()=>{let e=this.opts.value.current;return Array.from({length:1},()=>{let t=e,n=this.getPositionFromValue(t),r=Xi(this.direction,n);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[ia.thumb]:``}})});get thumbsPropsArr(){return D(this.#e)}set thumbsPropsArr(e){B(this.#e,e)}#t=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#t)}set thumbsRenderArr(e){B(this.#t,e)}#n=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Zi(this.direction,i,s),l=n<=t;return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,"data-selected":this.isTickValueSelected(n)?``:void 0,style:c,[ia.tick]:``}})});get ticksPropsArr(){return D(this.#n)}set ticksPropsArr(e){B(this.#n,e)}#r=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#r)}set ticksRenderArr(e){B(this.#r,e)}#i=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#i)}set tickItemsArr(e){B(this.#i,e)}#a=G(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return D(this.#a)}set thumbItemsArr(e){B(this.#a,e)}#o=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#o)}set snippetProps(e){B(this.#o,e)}},ca=class extends oa{opts;isMulti=!0;#e=F(null);get activeThumb(){return D(this.#e)}set activeThumb(e){B(this.#e,e,!0)}#t=F(0);get currentThumbIdx(){return D(this.#t)}set currentThumbIdx(e){B(this.#t,e,!0)}constructor(e){super(e),this.opts=e,Ct(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),ut([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ea(e,t,n),a=e=>i.includes(e),o=e=>ta(e,i);r.some(e=>!a(e))&&(this.opts.value.current=r.map(o))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:n,end:r}){let i=this.opts.min.current,a=this.opts.max.current,o=(e-n)/(r-n)*(a-i)+i;if(o<i)this.updateValue(i,t);else if(o>a)this.updateValue(a,t);else{let e=this.normalizedSteps,n=ta(o,e);this.updateValue(n,t)}}#n=e=>{let t=this.getAllThumbs();if(!t.length)return;for(let e of t)e.blur();let n=t.map(t=>{if(this.opts.orientation.current===`horizontal`){let{left:n,right:r}=t.getBoundingClientRect();return Math.abs(e.clientX-(n+r)/2)}{let{top:n,bottom:r}=t.getBoundingClientRect();return Math.abs(e.clientY-(n+r)/2)}}),r=t[n.indexOf(Math.min(...n))];return{node:r,idx:t.indexOf(r)}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.activeThumb;if(!t||!n)return;n.node.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect(),s=this.direction;s===`lr`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:r,end:i}):s===`rl`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:i,end:r}):s===`bt`?this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:o,end:a}):s===`tb`&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;let t=this.opts.ref.current,n=this.#n(e);if(!n||!t)return;let r=e.composedPath()[0]??e.target;!ft(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=n,n.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(ia.selector(`thumb`))):[]};updateValue=(e,t)=>{let n=this.opts.value.current;if(!n.length){this.opts.value.current.push(e);return}if(n[t]===e)return;let r=[...n];if(!Jt(t,r))return;let i=r[t]>e?-1:1,a=()=>{let n=t+i;r[t]=r[n],r[n]=e;let a=this.getAllThumbs();a.length&&(a[n]?.focus(),this.activeThumb={node:a[n],idx:n})};if(this.opts.autoSort.current&&(i===-1&&e<r[t-1]||i===1&&e>r[t+1])){a(),this.opts.value.current=r;return}let o=this.normalizedSteps;r[t]=ta(e,o),this.opts.value.current=r};#r=G(()=>{let t=this.opts.value.current;return Array.from({length:t.length||1},(n,r)=>{let i=e(()=>this.currentThumbIdx);i<t.length&&e(()=>{this.currentThumbIdx=i+1});let a=t[r],o=this.getPositionFromValue(a??0),s=Xi(this.direction,o);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":a,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":a,"data-orientation":this.opts.orientation.current,style:s,[ia.thumb]:``}})});get thumbsPropsArr(){return D(this.#r)}set thumbsPropsArr(e){B(this.#r,e)}#i=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#i)}set thumbsRenderArr(e){B(this.#i,e)}#a=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Zi(this.direction,i,s),l=t.length===1?n<=t[0]:t[0]<=n&&n<=t[t.length-1];return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,style:c,[ia.tick]:``}})});get ticksPropsArr(){return D(this.#a)}set ticksPropsArr(e){B(this.#a,e)}#o=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#o)}set ticksRenderArr(e){B(this.#o,e)}#s=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#s)}set tickItemsArr(e){B(this.#s,e)}#c=G(()=>this.opts.value.current.map((e,t)=>({value:e,index:t})));get thumbItemsArr(){return D(this.#c)}set thumbItemsArr(e){B(this.#c,e)}#l=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#l)}set snippetProps(e){B(this.#l,e)}},la=class{static create(e){let{type:t,...n}=e,r=t===`single`?new sa(n):new ca(n);return aa.set(r)}},ua=[pt,mt,gt,vt,yt,`End`],da=class e{static create(t){return new e(t,aa.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref)}#e=G(()=>{if(Array.isArray(this.root.opts.value.current)){let e=this.root.opts.value.current.length>1?this.root.getPositionFromValue(Math.min(...this.root.opts.value.current)??0):0,t=100-this.root.getPositionFromValue(Math.max(...this.root.opts.value.current)??0);return{position:`absolute`,...Yi(this.root.direction,e,t)}}{let e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,n=this.root.opts.max.current,r=e!==void 0&&e>0&&t===n?0:100-this.root.getPositionFromValue(t);return{position:`absolute`,...Yi(this.root.direction,0,r)}}});get rangeStyles(){return D(this.#e)}set rangeStyles(e){B(this.#e,e)}#t=G(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":xe(this.root.opts.disabled.current),style:this.rangeStyles,[ia.range]:``,...this.attachment}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},fa=class e{static create(t){return new e(t,aa.get())}opts;root;attachment;#e=G(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref),this.onkeydown=this.onkeydown.bind(this)}#t(e){this.root.isMulti?this.root.updateValue(e,this.opts.index.current):this.root.updateValue(e)}onkeydown(e){if(D(this.#e))return;let t=this.opts.ref.current;if(!t)return;let n=this.root.getAllThumbs();if(!n.length)return;let r=n.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!ua.includes(e.key))return;e.preventDefault();let i=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,s=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,l=this.root.direction,u=this.root.normalizedSteps;switch(e.key){case yt:this.#t(i);break;case`End`:this.#t(a);break;case pt:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?a:i;this.#t(e)}else{let e=na(s,u,l===`rl`?`next`:`prev`);this.#t(e)}break;case mt:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?i:a;this.#t(e)}else{let e=na(s,u,l===`rl`?`prev`:`next`);this.#t(e)}break;case gt:if(e.metaKey){let e=l===`tb`?i:a;this.#t(e)}else{let e=na(s,u,l===`tb`?`prev`:`next`);this.#t(e)}break;case vt:if(e.metaKey){let e=l===`tb`?a:i;this.#t(e)}else{let e=na(s,u,l===`tb`?`next`:`prev`);this.#t(e)}}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=G(()=>({...this.root.thumbsPropsArr[this.opts.index.current],id:this.opts.id.current,onkeydown:this.onkeydown,"data-active":this.root.isThumbActive(this.opts.index.current)?``:void 0,"data-disabled":xe(this.opts.disabled.current||this.root.opts.disabled.current),tabindex:this.opts.disabled.current||this.root.opts.disabled.current?-1:0,...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}},pa=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`value`,`type`,`onValueChange`,`onValueCommit`,`disabled`,`min`,`max`,`step`,`dir`,`autoSort`,`orientation`,`thumbPositioning`,`trackPadding`]),ma=T(`<span><!></span>`);function ha(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`value`,15),u=A(i,`onValueChange`,3,_t),f=A(i,`onValueCommit`,3,_t),p=A(i,`disabled`,3,!1),m=A(i,`step`,3,1),h=A(i,`dir`,3,`ltr`),g=A(i,`autoSort`,3,!0),_=A(i,`orientation`,3,`horizontal`),v=A(i,`thumbPositioning`,3,`contain`),y=V(i,pa),b=G(()=>i.min===void 0?Array.isArray(m())?Math.min(...m()):0:i.min),S=G(()=>i.max===void 0?Array.isArray(m())?Math.max(...m()):100:i.max);function C(){if(l()===void 0)return i.type===`single`?D(b):[]}C(),ut.pre(()=>l(),()=>{C()});let T=la.create({id:Y(()=>o()),ref:Y(()=>c(),e=>c(e)),value:Y(()=>l(),e=>{l(e),u()(e)}),onValueCommit:Y(()=>f()),disabled:Y(()=>p()),min:Y(()=>D(b)),max:Y(()=>D(S)),step:Y(()=>m()),dir:Y(()=>h()),autoSort:Y(()=>g()),orientation:Y(()=>_()),thumbPositioning:Y(()=>v()),type:i.type,trackPadding:Y(()=>i.trackPadding)}),E=G(()=>be(y,T.props));var O=r(),k=U(O),j=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(E),...T.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},ee=e=>{var n=ma();oe(n,()=>({...D(E)}));var r=z(n);t(r,()=>i.children??x,()=>T.snippetProps),d(n),K(e,n)};s(k,e=>{i.child?e(j):e(ee,-1)}),K(e,O),R()}var ga=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_a=T(`<span><!></span>`);function va(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,ga),u=da.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=_a();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var ya=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`,`index`,`disabled`]),ba=T(`<span><!></span>`);function xa(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=V(i,ya),f=fa.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e)),index:Y(()=>i.index),disabled:Y(()=>l())}),p=G(()=>be(u,f.props));var m=r(),h=U(m),g=e=>{var n=r(),a=U(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current),props:D(p)}));t(a,()=>i.child,()=>D(e))}K(e,n)},_=e=>{var n=ba();oe(n,()=>({...D(p)}));var r=z(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current)}));t(r,()=>i.children??x,()=>D(e))}d(n),K(e,n)};s(h,e=>{i.child?e(g):e(_,-1)}),K(e,m),R()}var Sa={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ca={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},wa=1e3,Ta=1001,Ea=1002,Da=1003,Oa=1004,ka=1005,Aa=1006,ja=1007,Ma=1008,Na=1009,Pa=1010,Fa=1011,Ia=1012,La=1013,Ra=1014,za=1015,Ba=1016,Va=1017,Ha=1018,Ua=1020,Wa=35902,Ga=35899,Ka=1021,qa=1022,Ja=1023,Ya=1026,Xa=1027,Za=1028,Qa=1029,$a=1030,eo=1031,to=1033,no=33776,ro=33777,io=33778,ao=33779,oo=35840,so=35841,co=35842,lo=35843,uo=36196,fo=37492,po=37496,mo=37488,ho=37489,go=37490,_o=37491,vo=37808,yo=37809,bo=37810,xo=37811,So=37812,Co=37813,wo=37814,To=37815,Eo=37816,Do=37817,Oo=37818,ko=37819,Ao=37820,jo=37821,Mo=36492,No=36494,Po=36495,Fo=36283,Io=36284,Lo=36285,Ro=36286,zo=2300,Bo=2301,Vo=2302,Ho=2303,Uo=2400,Wo=2401,Go=2402,Ko=3200,qo=`srgb`,Jo=`srgb-linear`,Yo=`linear`,Xo=`srgb`,Zo=7680,Qo=35044,$o=2e3;function es(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function ts(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ns(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function rs(){let e=ns(`canvas`);return e.style.display=`block`,e}var is={};function as(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function os(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function ss(...e){e=os(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function cs(...e){e=os(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function ls(...e){let t=e.join(` `);t in is||(is[t]=!0,ss(...e))}function us(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var ds={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},fs=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},ps=`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`.split(`.`),ms=1234567,hs=Math.PI/180,gs=180/Math.PI;function _s(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ps[e&255]+ps[e>>8&255]+ps[e>>16&255]+ps[e>>24&255]+`-`+ps[t&255]+ps[t>>8&255]+`-`+ps[t>>16&15|64]+ps[t>>24&255]+`-`+ps[n&63|128]+ps[n>>8&255]+`-`+ps[n>>16&255]+ps[n>>24&255]+ps[r&255]+ps[r>>8&255]+ps[r>>16&255]+ps[r>>24&255]).toLowerCase()}function vs(e,t,n){return Math.max(t,Math.min(n,e))}function ys(e,t){return(e%t+t)%t}function bs(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function xs(e,t,n){return e===t?0:(n-e)/(t-e)}function Ss(e,t,n){return(1-n)*e+n*t}function Cs(e,t,n,r){return Ss(e,t,1-Math.exp(-n*r))}function ws(e,t=1){return t-Math.abs(ys(e,t*2)-t)}function Ts(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Es(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Ds(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Os(e,t){return e+Math.random()*(t-e)}function ks(e){return e*(.5-Math.random())}function As(e){e!==void 0&&(ms=e);let t=ms+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function js(e){return e*hs}function Ms(e){return e*gs}function Ns(e){return!(e&e-1)&&e!==0}function Ps(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Fs(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Is(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:ss(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Ls(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function Rs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}var zs={DEG2RAD:hs,RAD2DEG:gs,generateUUID:_s,clamp:vs,euclideanModulo:ys,mapLinear:bs,inverseLerp:xs,lerp:Ss,damp:Cs,pingpong:ws,smoothstep:Ts,smootherstep:Es,randInt:Ds,randFloat:Os,randFloatSpread:ks,seededRandom:As,degToRad:js,radToDeg:Ms,isPowerOfTwo:Ns,ceilPowerOfTwo:Ps,floorPowerOfTwo:Fs,setQuaternionFromProperEuler:Is,normalize:Rs,denormalize:Ls},X=class e{static{e.prototype.isVector2=!0}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 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 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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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=vs(this.x,e.x,t.x),this.y=vs(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=vs(this.x,e,t),this.y=vs(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(vs(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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(vs(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let 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){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Bs=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,r){return this._x=e,this._y=t,this._z=n,this._w=r,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){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:ss(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}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(vs(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*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}},Z=class e{static{e.prototype.isVector3=!0}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 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 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(Hs.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Hs.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-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){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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=vs(this.x,e.x,t.x),this.y=vs(this.y,e.y,t.y),this.z=vs(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=vs(this.x,e,t),this.y=vs(this.y,e,t),this.z=vs(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(vs(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){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Vs.copy(this).projectOnVector(e),this.sub(Vs)}reflect(e){return this.sub(Vs.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(vs(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*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){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,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(){let 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}},Vs=new Z,Hs=new Bs,Us=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let 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){let 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){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,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){let 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,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return ls(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Ws.makeScale(e,t)),this}rotate(e){return ls(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Ws.makeRotation(-e)),this}translate(e,t){return ls(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Ws.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){let 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){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])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){let 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)}},Ws=new Us,Gs=new Us().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ks=new Us().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function qs(){let e={enabled:!0,workingColorSpace:Jo,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=Ys(e.r),e.g=Ys(e.g),e.b=Ys(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Xs(e.r),e.g=Xs(e.g),e.b=Xs(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?Yo:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return ls(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return ls(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Jo]:{primaries:t,whitePoint:r,transfer:Yo,toXYZ:Gs,fromXYZ:Ks,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:qo},outputColorSpaceConfig:{drawingBufferColorSpace:qo}},[qo]:{primaries:t,whitePoint:r,transfer:Xo,toXYZ:Gs,fromXYZ:Ks,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:qo}}}),e}var Js=qs();function Ys(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Xs(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var Zs,Qs=class{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{Zs===void 0&&(Zs=ns(`canvas`)),Zs.width=e.width,Zs.height=e.height;let t=Zs.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Zs}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){let t=ns(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=Ys(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(Ys(t[e]/255)*255):t[e]=Ys(t[e]);return{data:t,width:e.width,height:e.height}}return ss(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},$s=0,ec=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:$s++}),this.uuid=_s(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let 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(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(tc(r[t].image)):e.push(tc(r[t]))}else e=tc(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function tc(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?Qs.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(ss(`Texture: Unable to serialize Texture.`),{})}var nc=0,rc=new Z,ic=class e extends fs{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=Ta,i=Ta,a=Aa,o=Ma,s=Ja,c=Na,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:nc++}),this.uuid=_s(),this.name=``,this.source=new ec(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new X(0,0),this.repeat=new X(1,1),this.center=new X(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Us,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=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(rc).x}get height(){return this.source.getSize(rc).y}get depth(){return this.source.getSize(rc).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(let t in e){let n=e[t];if(n===void 0){ss(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){ss(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let 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!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case wa:e.x-=Math.floor(e.x);break;case Ta:e.x=e.x<0?0:1;break;case Ea:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case wa:e.y-=Math.floor(e.y);break;case Ta:e.y=e.y<0?0:1;break;case Ea:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}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++}};ic.DEFAULT_IMAGE=null,ic.DEFAULT_MAPPING=300,ic.DEFAULT_ANISOTROPY=1;var ac=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}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,r){return this.x=e,this.y=t,this.z=n,this.w=r,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 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 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?1:e.w,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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,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);let 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,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let 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=vs(this.x,e.x,t.x),this.y=vs(this.y,e.y,t.y),this.z=vs(this.z,e.z,t.z),this.w=vs(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=vs(this.x,e,t),this.y=vs(this.y,e,t),this.z=vs(this.z,e,t),this.w=vs(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(vs(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}},oc=class extends fs{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Aa,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 ac(0,0,e,t),this.scissorTest=!1,this.viewport=new ac(0,0,e,t),this.textures=[];let r=new ic({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].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={}){let t={minFilter:Aa,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 e=0;e<this.textures.length;e++)this.textures[e].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 r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].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;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new ec(n)}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`})}},sc=class extends oc{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},cc=class extends ic{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Da,this.minFilter=Da,this.wrapR=Ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},lc=class extends ic{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Da,this.minFilter=Da,this.wrapR=Ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},uc=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){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,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 e().fromArray(this.elements)}copy(e){let 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){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let 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();let t=this.elements,n=e.elements,r=1/dc.setFromMatrixColumn(e,0).length(),i=1/dc.setFromMatrixColumn(e,1).length(),a=1/dc.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,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){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}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(pc,e,mc)}lookAt(e,t,n){let r=this.elements;return _c.subVectors(e,t),_c.lengthSq()===0&&(_c.z=1),_c.normalize(),hc.crossVectors(n,_c),hc.lengthSq()===0&&(Math.abs(n.z)===1?_c.x+=1e-4:_c.z+=1e-4,_c.normalize(),hc.crossVectors(n,_c)),hc.normalize(),gc.crossVectors(_c,hc),r[0]=hc.x,r[4]=gc.x,r[8]=_c.x,r[1]=hc.y,r[5]=gc.y,r[9]=_c.y,r[2]=hc.z,r[6]=gc.z,r[10]=_c.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],ee=r[14],M=r[3],N=r[7],P=r[11],te=r[15];return i[0]=a*x+o*T+s*k+c*M,i[4]=a*S+o*E+s*A+c*N,i[8]=a*C+o*D+s*j+c*P,i[12]=a*w+o*O+s*ee+c*te,i[1]=l*x+u*T+d*k+f*M,i[5]=l*S+u*E+d*A+f*N,i[9]=l*C+u*D+d*j+f*P,i[13]=l*w+u*O+d*ee+f*te,i[2]=p*x+m*T+h*k+g*M,i[6]=p*S+m*E+h*A+g*N,i[10]=p*C+m*D+h*j+g*P,i[14]=p*w+m*O+h*ee+g*te,i[3]=_*x+v*T+y*k+b*M,i[7]=_*S+v*E+y*A+b*N,i[11]=_*C+v*D+y*j+b*P,i[15]=_*w+v*O+y*ee+b*te,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,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){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let 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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}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){let 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){let 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){let 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){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+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,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=dc.set(r[0],r[1],r[2]).length(),o=dc.set(r[4],r[5],r[6]).length(),s=dc.set(r[8],r[9],r[10]).length();i<0&&(a=-a),fc.copy(this);let c=1/a,l=1/o,u=1/s;return fc.elements[0]*=c,fc.elements[1]*=c,fc.elements[2]*=c,fc.elements[4]*=l,fc.elements[5]*=l,fc.elements[6]*=l,fc.elements[8]*=u,fc.elements[9]*=u,fc.elements[10]*=u,t.setFromRotationMatrix(fc),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=$o,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=$o,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])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){let 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}},dc=new Z,fc=new uc,pc=new Z(0,0,0),mc=new Z(1,1,1),hc=new Z,gc=new Z,_c=new Z,vc=new uc,yc=new Bs,bc=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(vs(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-vs(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(vs(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-vs(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(vs(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-vs(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:ss(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return vc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return yc.setFromEuler(this),this.setFromQuaternion(yc,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}};bc.DEFAULT_ORDER=`XYZ`;var xc=class{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))}},Sc=0,Cc=new Z,wc=new Bs,Tc=new uc,Ec=new Z,Dc=new Z,Oc=new Z,kc=new Bs,Ac=new Z(1,0,0),jc=new Z(0,1,0),Mc=new Z(0,0,1),Nc={type:`added`},Pc={type:`removed`},Fc={type:`childadded`,child:null},Ic={type:`childremoved`,child:null},Lc=class e extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Sc++}),this.uuid=_s(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new Z,n=new bc,r=new Bs,i=new Z(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new uc},normalMatrix:{value:new Us}}),this.matrix=new uc,this.matrixWorld=new uc,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new xc,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 wc.setFromAxisAngle(e,t),this.quaternion.multiply(wc),this}rotateOnWorldAxis(e,t){return wc.setFromAxisAngle(e,t),this.quaternion.premultiply(wc),this}rotateX(e){return this.rotateOnAxis(Ac,e)}rotateY(e){return this.rotateOnAxis(jc,e)}rotateZ(e){return this.rotateOnAxis(Mc,e)}translateOnAxis(e,t){return Cc.copy(e).applyQuaternion(this.quaternion),this.position.add(Cc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ac,e)}translateY(e){return this.translateOnAxis(jc,e)}translateZ(e){return this.translateOnAxis(Mc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Tc.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ec.copy(e):Ec.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Dc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Tc.lookAt(Dc,Ec,this.up):Tc.lookAt(Ec,Dc,this.up),this.quaternion.setFromRotationMatrix(Tc),r&&(Tc.extractRotation(r.matrixWorld),wc.setFromRotationMatrix(Tc),this.quaternion.premultiply(wc.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(cs(`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(Nc),Fc.child=e,this.dispatchEvent(Fc),Fc.child=null):cs(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Pc),Ic.child=e,this.dispatchEvent(Ic),Ic.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Tc.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Tc.multiply(e.parent.matrixWorld)),e.applyMatrix4(Tc),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Nc),Fc.child=e,this.dispatchEvent(Fc),Fc.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,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].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(Dc,e,Oc),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Dc,kc,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}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);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.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){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let 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`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}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?null:e.pivot.clone(),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 t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};Lc.DEFAULT_UP=new Z(0,1,0),Lc.DEFAULT_MATRIX_AUTO_UPDATE=!0,Lc.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Rc=class extends Lc{constructor(){super(),this.isGroup=!0,this.type=`Group`}},zc={type:`move`},Bc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rc,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 Rc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z,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){let t=this._hand;if(t)for(let 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 r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(zc)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Rc;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Vc={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},Hc={h:0,s:0,l:0},Uc={h:0,s:0,l:0};function Wc(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Q=class{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){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=qo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Js.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Js.workingColorSpace){return this.r=e,this.g=t,this.b=n,Js.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Js.workingColorSpace){if(e=ys(e,1),t=vs(t,0,1),n=vs(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Wc(i,r,e+1/3),this.g=Wc(i,r,e),this.b=Wc(i,r,e-1/3)}return Js.colorSpaceToWorking(this,r),this}setStyle(e,t=qo){function n(t){t!==void 0&&parseFloat(t)<1&&ss(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:ss(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);ss(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=qo){let n=Vc[e.toLowerCase()];return n===void 0?ss(`Color: Unknown color `+e):this.setHex(n,t),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=Ys(e.r),this.g=Ys(e.g),this.b=Ys(e.b),this}copyLinearToSRGB(e){return this.r=Xs(e.r),this.g=Xs(e.g),this.b=Xs(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=qo){return Js.workingToColorSpace(Gc.copy(this),e),Math.round(vs(Gc.r*255,0,255))*65536+Math.round(vs(Gc.g*255,0,255))*256+Math.round(vs(Gc.b*255,0,255))}getHexString(e=qo){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Js.workingColorSpace){Js.workingToColorSpace(Gc.copy(this),t);let n=Gc.r,r=Gc.g,i=Gc.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Js.workingColorSpace){return Js.workingToColorSpace(Gc.copy(this),t),e.r=Gc.r,e.g=Gc.g,e.b=Gc.b,e}getStyle(e=qo){Js.workingToColorSpace(Gc.copy(this),e);let t=Gc.r,n=Gc.g,r=Gc.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Hc),this.setHSL(Hc.h+e,Hc.s+t,Hc.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(Hc),e.getHSL(Uc);let n=Ss(Hc.h,Uc.h,t),r=Ss(Hc.s,Uc.s,t),i=Ss(Hc.l,Uc.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,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}},Gc=new Q;Q.NAMES=Vc;var Kc=class extends Lc{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 bc,this.environmentIntensity=1,this.environmentRotation=new bc,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){let 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}},qc=new Z,Jc=new Z,Yc=new Z,Xc=new Z,Zc=new Z,Qc=new Z,$c=new Z,el=new Z,tl=new Z,nl=new Z,rl=new ac,il=new ac,al=new ac,ol=class e{constructor(e=new Z,t=new Z,n=new Z){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),qc.subVectors(e,t),r.cross(qc);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){qc.subVectors(r,t),Jc.subVectors(n,t),Yc.subVectors(e,t);let a=qc.dot(qc),o=qc.dot(Jc),s=qc.dot(Yc),c=Jc.dot(Jc),l=Jc.dot(Yc),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Xc)!==null&&Xc.x>=0&&Xc.y>=0&&Xc.x+Xc.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Xc)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Xc.x),s.addScaledVector(a,Xc.y),s.addScaledVector(o,Xc.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return rl.setScalar(0),il.setScalar(0),al.setScalar(0),rl.fromBufferAttribute(e,t),il.fromBufferAttribute(e,n),al.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(rl,i.x),a.addScaledVector(il,i.y),a.addScaledVector(al,i.z),a}static isFrontFacing(e,t,n,r){return qc.subVectors(n,t),Jc.subVectors(e,t),qc.cross(Jc).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 qc.subVectors(this.c,this.b),Jc.subVectors(this.a,this.b),qc.cross(Jc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Zc.subVectors(r,n),Qc.subVectors(i,n),el.subVectors(e,n);let s=Zc.dot(el),c=Qc.dot(el);if(s<=0&&c<=0)return t.copy(n);tl.subVectors(e,r);let l=Zc.dot(tl),u=Qc.dot(tl);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Zc,a);nl.subVectors(e,i);let f=Zc.dot(nl),p=Qc.dot(nl);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Qc,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return $c.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector($c,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Zc,a).addScaledVector(Qc,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},sl=class{constructor(e=new Z(1/0,1/0,1/0),t=new Z(-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(ll.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ll.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){let n=ll.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);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,ll):ll.fromBufferAttribute(r,t),ll.applyMatrix4(e.matrixWorld),this.expandByPoint(ll);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),ul.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),ul.copy(e.boundingBox)),ul.applyMatrix4(e.matrixWorld),this.union(ul)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],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,ll),ll.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(_l),vl.subVectors(this.max,_l),dl.subVectors(e.a,_l),fl.subVectors(e.b,_l),pl.subVectors(e.c,_l),ml.subVectors(fl,dl),hl.subVectors(pl,fl),gl.subVectors(dl,pl);let t=[0,-ml.z,ml.y,0,-hl.z,hl.y,0,-gl.z,gl.y,ml.z,0,-ml.x,hl.z,0,-hl.x,gl.z,0,-gl.x,-ml.y,ml.x,0,-hl.y,hl.x,0,-gl.y,gl.x,0];return!xl(t,dl,fl,pl,vl)||(t=[1,0,0,0,1,0,0,0,1],!xl(t,dl,fl,pl,vl))?!1:(yl.crossVectors(ml,hl),t=[yl.x,yl.y,yl.z],xl(t,dl,fl,pl,vl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ll).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ll).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:(cl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),cl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),cl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),cl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),cl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),cl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),cl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),cl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(cl),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}},cl=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],ll=new Z,ul=new sl,dl=new Z,fl=new Z,pl=new Z,ml=new Z,hl=new Z,gl=new Z,_l=new Z,vl=new Z,yl=new Z,bl=new Z;function xl(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){bl.fromArray(e,a);let o=i.x*Math.abs(bl.x)+i.y*Math.abs(bl.y)+i.z*Math.abs(bl.z),s=t.dot(bl),c=n.dot(bl),l=r.dot(bl);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Sl=Cl();function Cl(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function wl(e){Math.abs(e)>65504&&ss(`DataUtils.toHalfFloat(): Value out of range.`),e=vs(e,-65504,65504),Sl.floatView[0]=e;let t=Sl.uint32View[0],n=t>>23&511;return Sl.baseTable[n]+((t&8388607)>>Sl.shiftTable[n])}function Tl(e){let t=e>>10;return Sl.uint32View[0]=Sl.mantissaTable[Sl.offsetTable[t]+(e&1023)]+Sl.exponentTable[t],Sl.floatView[0]}var El=class{static toHalfFloat(e){return wl(e)}static fromHalfFloat(e){return Tl(e)}},Dl=new Z,Ol=new X,kl=0,Al=class extends fs{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:kl++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=Qo,this.updateRanges=[],this.gpuType=za,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 r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];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++)Ol.fromBufferAttribute(this,t),Ol.applyMatrix3(e),this.setXY(t,Ol.x,Ol.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.applyMatrix3(e),this.setXYZ(t,Dl.x,Dl.y,Dl.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.applyMatrix4(e),this.setXYZ(t,Dl.x,Dl.y,Dl.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.applyNormalMatrix(e),this.setXYZ(t,Dl.x,Dl.y,Dl.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.transformDirection(e),this.setXYZ(t,Dl.x,Dl.y,Dl.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=Ls(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Rs(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ls(t,this.array)),t}setX(e,t){return this.normalized&&(t=Rs(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ls(t,this.array)),t}setY(e,t){return this.normalized&&(t=Rs(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=Ls(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Rs(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=Ls(t,this.array)),t}setW(e,t){return this.normalized&&(t=Rs(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array),i=Rs(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let 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!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},jl=class extends Al{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Ml=class extends Al{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Nl=class extends Al{constructor(e,t,n){super(new Float32Array(e),t,n)}},Pl=new sl,Fl=new Z,Il=new Z,Ll=class{constructor(e=new Z,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){let n=this.center;t===void 0?Pl.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),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){let 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){let 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*=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;Fl.subVectors(e,this.center);let t=Fl.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Fl,n/e),this.radius+=n}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):(Il.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Fl.copy(e.center).add(Il)),this.expandByPoint(Fl.copy(e.center).sub(Il))),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}},Rl=0,zl=new uc,Bl=new Lc,Vl=new Z,Hl=new sl,Ul=new sl,Wl=new Z,Gl=class e extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Rl++}),this.uuid=_s(),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 this.index=Array.isArray(e)?new(es(e)?Ml:jl)(e,1):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){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new Us().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return zl.makeRotationFromQuaternion(e),this.applyMatrix4(zl),this}rotateX(e){return zl.makeRotationX(e),this.applyMatrix4(zl),this}rotateY(e){return zl.makeRotationY(e),this.applyMatrix4(zl),this}rotateZ(e){return zl.makeRotationZ(e),this.applyMatrix4(zl),this}translate(e,t,n){return zl.makeTranslation(e,t,n),this.applyMatrix4(zl),this}scale(e,t,n){return zl.makeScale(e,t,n),this.applyMatrix4(zl),this}lookAt(e){return Bl.lookAt(e),Bl.updateMatrix(),this.applyMatrix4(Bl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vl).negate(),this.translate(Vl.x,Vl.y,Vl.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Nl(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&ss(`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 sl);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){cs(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Hl.setFromBufferAttribute(n),this.morphTargetsRelative?(Wl.addVectors(this.boundingBox.min,Hl.min),this.boundingBox.expandByPoint(Wl),Wl.addVectors(this.boundingBox.max,Hl.max),this.boundingBox.expandByPoint(Wl)):(this.boundingBox.expandByPoint(Hl.min),this.boundingBox.expandByPoint(Hl.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&cs(`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 Ll);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){cs(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new Z,1/0);return}if(e){let n=this.boundingSphere.center;if(Hl.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ul.setFromBufferAttribute(n),this.morphTargetsRelative?(Wl.addVectors(Hl.min,Ul.min),Hl.expandByPoint(Wl),Wl.addVectors(Hl.max,Ul.max),Hl.expandByPoint(Wl)):(Hl.expandByPoint(Ul.min),Hl.expandByPoint(Ul.max))}Hl.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Wl.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Wl));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Wl.fromBufferAttribute(a,t),o&&(Vl.fromBufferAttribute(e,t),Wl.add(Vl)),r=Math.max(r,n.distanceToSquared(Wl))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&cs(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){cs(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new Al(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new Z,s[e]=new Z;let c=new Z,l=new Z,u=new Z,d=new X,f=new X,p=new X,m=new Z,h=new Z;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new Z,y=new Z,b=new Z,x=new Z;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let 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 Al(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new Z,i=new Z,a=new Z,o=new Z,s=new Z,c=new Z,l=new Z,u=new Z;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Wl.fromBufferAttribute(e,t),Wl.normalize(),e.setXYZ(t,Wl.x,Wl.y,Wl.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new Al(a,r,i)}if(this.index===null)return ss(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let 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){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let 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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.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`})}},Kl=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=Qo,this.updateRanges=[],this.version=0,this.uuid=_s()}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=_s()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=_s()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},ql=new Z,Jl=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ql.fromBufferAttribute(this,t),ql.applyMatrix4(e),this.setXYZ(t,ql.x,ql.y,ql.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ql.fromBufferAttribute(this,t),ql.applyNormalMatrix(e),this.setXYZ(t,ql.x,ql.y,ql.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ql.fromBufferAttribute(this,t),ql.transformDirection(e),this.setXYZ(t,ql.x,ql.y,ql.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ls(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Rs(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ls(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ls(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ls(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ls(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array),i=Rs(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){as(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Al(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){as(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Yl=0,Xl=class extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Yl++}),this.uuid=_s(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Q(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Zo,this.stencilZFail=Zo,this.stencilZPass=Zo,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(let t in e){let n=e[t];if(n===void 0){ss(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){ss(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let 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!==1&&(n.blending=this.blending),this.side!==0&&(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!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(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!==3&&(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!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(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 r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}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 Q().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&&(this.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0: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 t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new X().fromArray(t)}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 X().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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].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++}},Zl=class extends Xl{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new Q(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!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.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Ql,$l=new Z,eu=new Z,tu=new Z,nu=new X,ru=new X,iu=new uc,au=new Z,ou=new Z,su=new Z,cu=new X,lu=new X,uu=new X,du=class extends Lc{constructor(e=new Zl){if(super(),this.isSprite=!0,this.type=`Sprite`,Ql===void 0){Ql=new Gl;let e=new Kl(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Ql.setIndex([0,1,2,0,2,3]),Ql.setAttribute(`position`,new Jl(e,3,0,!1)),Ql.setAttribute(`uv`,new Jl(e,2,3,!1))}this.geometry=Ql,this.material=e,this.center=new X(.5,.5),this.count=1}raycast(e,t){e.camera===null&&cs(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),eu.setFromMatrixScale(this.matrixWorld),iu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),tu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&eu.multiplyScalar(-tu.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;fu(au.set(-.5,-.5,0),tu,a,eu,r,i),fu(ou.set(.5,-.5,0),tu,a,eu,r,i),fu(su.set(.5,.5,0),tu,a,eu,r,i),cu.set(0,0),lu.set(1,0),uu.set(1,1);let o=e.ray.intersectTriangle(au,ou,su,!1,$l);if(o===null&&(fu(ou.set(-.5,.5,0),tu,a,eu,r,i),lu.set(0,1),o=e.ray.intersectTriangle(au,su,ou,!1,$l),o===null))return;let s=e.ray.origin.distanceTo($l);s<e.near||s>e.far||t.push({distance:s,point:$l.clone(),uv:ol.getInterpolation($l,au,ou,su,cu,lu,uu,new X),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function fu(e,t,n,r,i,a){nu.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?ru.copy(nu):(ru.x=a*nu.x-i*nu.y,ru.y=i*nu.x+a*nu.y),e.copy(t),e.x+=ru.x,e.y+=ru.y,e.applyMatrix4(iu)}var pu=new Z,mu=new Z,hu=new Z,gu=new Z,_u=new Z,vu=new Z,yu=new Z,bu=class{constructor(e=new Z,t=new Z(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,pu)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let 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){let t=pu.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(pu.copy(this.origin).addScaledVector(this.direction,t),pu.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){mu.copy(e).add(t).multiplyScalar(.5),hu.copy(t).sub(e).normalize(),gu.copy(this.origin).sub(mu);let i=e.distanceTo(t)*.5,a=-this.direction.dot(hu),o=gu.dot(this.direction),s=-gu.dot(hu),c=gu.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(mu).addScaledVector(hu,d),f}intersectSphere(e,t){pu.subVectors(e.center,this.origin);let n=pu.dot(this.direction),r=pu.dot(pu)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,pu)!==null}intersectTriangle(e,t,n,r,i){_u.subVectors(t,e),vu.subVectors(n,e),yu.crossVectors(_u,vu);let a=this.direction.dot(yu),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;gu.subVectors(this.origin,e);let s=o*this.direction.dot(vu.crossVectors(gu,vu));if(s<0)return null;let c=o*this.direction.dot(_u.cross(gu));if(c<0||s+c>a)return null;let l=-o*gu.dot(yu);return l<0?null:this.at(l/a,i)}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)}},xu=class extends Xl{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Q(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 bc,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(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}},Su=new uc,Cu=new bu,wu=new Ll,Tu=new Z,Eu=new Z,Du=new Z,Ou=new Z,ku=new Z,Au=new Z,ju=new Z,Mu=new Z,Nu=class extends Lc{constructor(e=new Gl,t=new xu){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(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){Au.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(ku.fromBufferAttribute(s,e),a?Au.addScaledVector(ku,r):Au.addScaledVector(ku.sub(t),r))}t.add(Au)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),wu.copy(n.boundingSphere),wu.applyMatrix4(i),Cu.copy(e.ray).recast(e.near),!(wu.containsPoint(Cu.origin)===!1&&(Cu.intersectSphere(wu,Tu)===null||Cu.origin.distanceToSquared(Tu)>(e.far-e.near)**2))&&(Su.copy(i).invert(),Cu.copy(e.ray).applyMatrix4(Su),(n.boundingBox===null||Cu.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,Cu)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=Fu(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=Fu(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=Fu(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=Fu(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function Pu(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Mu.copy(s),Mu.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Mu);return l<n.near||l>n.far?null:{distance:l,point:Mu.clone(),object:e}}function Fu(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Eu),e.getVertexPosition(c,Du),e.getVertexPosition(l,Ou);let u=Pu(e,t,n,r,Eu,Du,Ou,ju);if(u){let e=new Z;ol.getBarycoord(ju,Eu,Du,Ou,e),i&&(u.uv=ol.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=ol.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=ol.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};ol.getNormal(Eu,Du,Ou,t.normal),u.face=t,u.barycoord=e}return u}var Iu=class extends ic{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Da,l=Da,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Lu=new Z,Ru=new Z,zu=new Us,Bu=class{constructor(e=new Z(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,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Lu.subVectors(n,t).cross(Ru.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){let r=e.delta(Lu),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let 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){let n=t||zu.getNormalMatrix(e),r=this.coplanarPoint(Lu).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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)}},Vu=new Ll,Hu=new X(.5,.5),Uu=new Z,Wu=class{constructor(e=new Bu,t=new Bu,n=new Bu,r=new Bu,i=new Bu,a=new Bu){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=$o,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Vu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vu)}intersectsSprite(e){return Vu.center.set(0,0,0),Vu.radius=.7071067811865476+Hu.distanceTo(e.center),Vu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vu)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(Uu.x=r.normal.x>0?e.max.x:e.min.x,Uu.y=r.normal.y>0?e.max.y:e.min.y,Uu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Uu)<0)return!1}return!0}containsPoint(e){let 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)}},Gu=class extends Xl{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new Q(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},Ku=new Z,qu=new Z,Ju=new uc,Yu=new bu,Xu=new Ll,Zu=new Z,Qu=new Z,$u=class extends Lc{constructor(e=new Gl,t=new Gu){super(),this.isLine=!0,this.type=`Line`,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}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)Ku.fromBufferAttribute(t,e-1),qu.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Ku.distanceTo(qu);e.setAttribute(`lineDistance`,new Nl(n,1))}else ss(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Xu.copy(n.boundingSphere),Xu.applyMatrix4(r),Xu.radius+=i,e.ray.intersectsSphere(Xu)===!1)return;Ju.copy(r).invert(),Yu.copy(e.ray).applyMatrix4(Ju);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=ed(this,e,Yu,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=ed(this,e,Yu,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=ed(this,e,Yu,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=ed(this,e,Yu,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function ed(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(Ku.fromBufferAttribute(s,i),qu.fromBufferAttribute(s,a),n.distanceSqToSegment(Ku,qu,Zu,Qu)>r)return;Zu.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Zu);if(!(c<t.near||c>t.far))return{distance:c,point:Qu.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var td=class extends Xl{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new Q(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}},nd=new uc,rd=new bu,id=new Ll,ad=new Z,od=class extends Lc{constructor(e=new Gl,t=new td){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){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),id.copy(n.boundingSphere),id.applyMatrix4(r),id.radius+=i,e.ray.intersectsSphere(id)===!1)return;nd.copy(r).invert(),rd.copy(e.ray).applyMatrix4(nd);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);ad.fromBufferAttribute(l,n),sd(ad,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)ad.fromBufferAttribute(l,a),sd(ad,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function sd(e,t,n,r,i,a,o){let s=rd.distanceSqToPoint(e);if(s<n){let n=new Z;rd.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var cd=class extends ic{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ld=class extends ic{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},ud=class extends ic{constructor(e,t,n=Ra,r,i,a,o=Da,s=Da,c,l=Ya,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ec(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},dd=class extends ud{constructor(e,t=Ra,n=301,r,i,a=Da,o=Da,s,c=Ya){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},fd=class extends ic{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},pd=class e extends Gl{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Nl(c,3)),this.setAttribute(`normal`,new Nl(l,3)),this.setAttribute(`uv`,new Nl(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},md=class e extends Gl{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=Math.PI*2){super(),this.type=`CylinderGeometry`,this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let c=this;r=Math.floor(r),i=Math.floor(i);let l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new Nl(u,3)),this.setAttribute(`normal`,new Nl(d,3)),this.setAttribute(`uv`,new Nl(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){let a=m[r][n],o=m[r+1][n],s=m[r+1][n+1],c=m[r][n+1];(e>0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=b+e;n===!0?l.push(r,r+1,t):l.push(r+1,r,t),_+=3}c.addGroup(g,_,n===!0?1:2),g+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},hd=new Z,gd=new Z,_d=new Z,vd=new ol,yd=class extends Gl{constructor(e=null,t=1){if(super(),this.type=`EdgesGeometry`,this.parameters={geometry:e,thresholdAngle:t},e!==null){let n=10**4,r=Math.cos(hs*t),i=e.getIndex(),a=e.getAttribute(`position`),o=i?i.count:a.count,s=[0,0,0],c=[`a`,`b`,`c`],l=[,,,],u={},d=[];for(let e=0;e<o;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:o,c:f}=vd;if(t.fromBufferAttribute(a,s[0]),o.fromBufferAttribute(a,s[1]),f.fromBufferAttribute(a,s[2]),vd.getNormal(_d),l[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,l[1]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,l[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],i=l[t],a=vd[c[e]],o=vd[c[t]],f=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(_d.dot(u[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(o.x,o.y,o.z)),u[p]=null):f in u||(u[f]={index0:s[e],index1:s[t],normal:_d.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:n}=u[e];hd.fromBufferAttribute(a,t),gd.fromBufferAttribute(a,n),d.push(hd.x,hd.y,hd.z),d.push(gd.x,gd.y,gd.z)}this.setAttribute(`position`,new Nl(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},bd=class e extends Gl{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Nl(p,3)),this.setAttribute(`normal`,new Nl(m,3)),this.setAttribute(`uv`,new Nl(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},xd=class extends Gl{constructor(e=null){if(super(),this.type=`WireframeGeometry`,this.parameters={geometry:e},e!==null){let t=[],n=new Set,r=new Z,i=new Z;if(e.index!==null){let a=e.attributes.position,o=e.index,s=e.groups;s.length===0&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,c=s.length;e<c;++e){let c=s[e],l=c.start,u=c.count;for(let e=l,s=l+u;e<s;e+=3)for(let s=0;s<3;s++){let c=o.getX(e+s),l=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,l),Sd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{let a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){let s=3*e+o,c=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),Sd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute(`position`,new Nl(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function Sd(e,t,n){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}function Cd(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(Td(i))i.isRenderTargetTexture?(ss(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i))if(Td(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice();else t[n][r]=i}}return t}function wd(e){let t={};for(let n=0;n<e.length;n++){let r=Cd(e[n]);for(let e in r)t[e]=r[e]}return t}function Td(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function Ed(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function Dd(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Js.workingColorSpace}var Od={clone:Cd,merge:wd},kd=`void main() {
1
+ import{$ as e,A as t,At as n,B as r,C as i,Dt as a,E as o,F as s,Ft as c,G as l,H as u,It as d,J as f,K as p,L as m,Lt as h,M as g,N as _,P as v,Pt as y,Q as b,Rt as x,S,T as C,U as w,V as T,W as E,X as D,Y as O,_t as k,a as A,at as j,bt as ee,c as M,dt as N,f as P,ft as te,g as ne,gt as F,h as re,it as I,j as ie,jt as ae,k as L,kt as R,lt as z,m as oe,mt as B,n as se,nt as ce,o as V,ot as le,q as ue,r as de,s as H,ut as U,v as fe,vt as pe,w as W,yt as G,z as K,zt as me}from"../chunks/Cke4knuE.js";import"../chunks/xihTtKlq.js";import{c as q,s as he,t as J}from"../chunks/CrKMaiko.js";import{i as ge,r as _e}from"../chunks/B2lr8IYb.js";import{C as ve,E as ye,d as be,n as xe,o as Se,p as Ce,r as we,s as Te,t as Ee,u as De,y as Y}from"../chunks/BWkyPB3e.js";import{n as Oe,t as ke}from"../chunks/DSGwkBAQ.js";import{a as Ae,c as je,d as Me,f as Ne,i as Pe,l as Fe,m as Ie,n as Le,o as Re,p as ze,r as Be,s as Ve,t as He,u as Ue}from"../chunks/BfekBVrn.js";import{t as We}from"../chunks/BRMiG9hK.js";import{t as Ge}from"../chunks/D0RK8yNo.js";import{t as Ke}from"../chunks/VJTh542u.js";import{t as qe}from"../chunks/DX2MELJa.js";import{t as Je}from"../chunks/CNcd_3er.js";import{t as Ye}from"../chunks/f9BZlcKm.js";import{t as Xe}from"../chunks/_YFjRYrV.js";import{n as Ze,r as Qe,t as $e}from"../chunks/0lP-Rpma.js";import{i as et,n as tt,r as nt,t as rt}from"../chunks/BzEuycjW.js";import{t as it}from"../chunks/CAB-AK4E.js";import{t as at}from"../chunks/gu4X15yF.js";import{t as ot}from"../chunks/CjPXNCS7.js";import{t as st}from"../chunks/BOS-wpIV.js";import{t as ct}from"../chunks/Dz00jH5u.js";import{D as lt,E as ut,O as dt,a as ft,d as pt,f as mt,o as ht,p as gt,t as _t,u as vt,v as yt,w as bt}from"../chunks/B50OBSAG.js";import{a as xt,c as St,d as Ct,i as wt,l as Tt,n as Et,o as Dt,r as Ot,s as kt,t as At,u as jt}from"../chunks/CzAXFvH8.js";import{D as Mt,M as Nt,O as Pt,T as Ft,c as It,d as Lt,f as Rt,h as zt,k as Bt,l as Vt,m as Ht,n as Ut,p as Wt,s as Gt,u as Kt,w as qt,x as Jt}from"../chunks/B1oMYNg6.js";import{a as Yt,i as Xt,n as Zt,r as Qt,t as $t}from"../chunks/CWlCxbnY.js";import{t as en}from"../chunks/C2ulfLBp.js";import{a as tn,i as nn,n as rn,r as an,t as on}from"../chunks/E0FrUJ1t.js";import{t as sn}from"../chunks/DpQ84QEi.js";import{n as cn,t as ln}from"../chunks/DJq7n-sf.js";import{t as un}from"../chunks/KXvDoa1V.js";import{n as dn,t as fn}from"../chunks/sPP9TUD-.js";import{t as pn}from"../chunks/D3p1tqid.js";import{t as mn}from"../chunks/DqR8kuM62.js";import{n as hn}from"../chunks/C57linrd2.js";var gn=new Set([`$$slots`,`$$events`,`$$legacy`]);function _n(e,t){let n=V(t,gn),r=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]];Oe(e,H({name:`box`},()=>n,{get iconNode(){return r}}))}var vn=new Set([`$$slots`,`$$events`,`$$legacy`]);function yn(e,t){let n=V(t,vn),r=[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`}],[`circle`,{cx:`12`,cy:`13`,r:`3`}]];Oe(e,H({name:`camera`},()=>n,{get iconNode(){return r}}))}var bn=new Set([`$$slots`,`$$events`,`$$legacy`]);function xn(e,t){let n=V(t,bn),r=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`}],[`path`,{d:`m9 11 3 3L22 4`}]];Oe(e,H({name:`circle-check-big`},()=>n,{get iconNode(){return r}}))}var Sn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cn(e,t){let n=V(t,Sn),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Oe(e,H({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var wn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tn(e,t){let n=V(t,wn),r=[[`path`,{d:`M12 15V3`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}],[`path`,{d:`m7 10 5 5 5-5`}]];Oe(e,H({name:`download`},()=>n,{get iconNode(){return r}}))}var En=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dn(e,t){let n=V(t,En),r=[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}],[`path`,{d:`m2 2 20 20`}]];Oe(e,H({name:`eye-off`},()=>n,{get iconNode(){return r}}))}var On=new Set([`$$slots`,`$$events`,`$$legacy`]);function kn(e,t){let n=V(t,On),r=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];Oe(e,H({name:`eye`},()=>n,{get iconNode(){return r}}))}var An=new Set([`$$slots`,`$$events`,`$$legacy`]);function jn(e,t){let n=V(t,An),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];Oe(e,H({name:`file`},()=>n,{get iconNode(){return r}}))}var Mn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Nn(e,t){let n=V(t,Mn),r=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];Oe(e,H({name:`folder`},()=>n,{get iconNode(){return r}}))}var Pn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fn(e,t){let n=V(t,Pn),r=[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`}]];Oe(e,H({name:`frame`},()=>n,{get iconNode(){return r}}))}var In=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ln(e,t){let n=V(t,In),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 9h18`}],[`path`,{d:`M3 15h18`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`M15 3v18`}]];Oe(e,H({name:`grid-3x3`},()=>n,{get iconNode(){return r}}))}var Rn=new Set([`$$slots`,`$$events`,`$$legacy`]);function zn(e,t){let n=V(t,Rn),r=[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`}]];Oe(e,H({name:`inbox`},()=>n,{get iconNode(){return r}}))}var Bn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vn(e,t){let n=V(t,Bn),r=[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`}]];Oe(e,H({name:`layers`},()=>n,{get iconNode(){return r}}))}var Hn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Un(e,t){let n=V(t,Hn),r=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}]];Oe(e,H({name:`link`},()=>n,{get iconNode(){return r}}))}var Wn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Gn(e,t){let n=V(t,Wn),r=[[`path`,{d:`M12 2v4`}],[`path`,{d:`m16.2 7.8 2.9-2.9`}],[`path`,{d:`M18 12h4`}],[`path`,{d:`m16.2 16.2 2.9 2.9`}],[`path`,{d:`M12 18v4`}],[`path`,{d:`m4.9 19.1 2.9-2.9`}],[`path`,{d:`M2 12h4`}],[`path`,{d:`m4.9 4.9 2.9 2.9`}]];Oe(e,H({name:`loader`},()=>n,{get iconNode(){return r}}))}var Kn=new Set([`$$slots`,`$$events`,`$$legacy`]);function qn(e,t){let n=V(t,Kn),r=[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`}]];Oe(e,H({name:`maximize`},()=>n,{get iconNode(){return r}}))}var Jn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Yn(e,t){let n=V(t,Jn),r=[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`}]];Oe(e,H({name:`minimize`},()=>n,{get iconNode(){return r}}))}var Xn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zn(e,t){let n=V(t,Xn),r=[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];Oe(e,H({name:`palette`},()=>n,{get iconNode(){return r}}))}var Qn=new Set([`$$slots`,`$$events`,`$$legacy`]);function $n(e,t){let n=V(t,Qn),r=[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`}],[`path`,{d:`m14.5 12.5 2-2`}],[`path`,{d:`m11.5 9.5 2-2`}],[`path`,{d:`m8.5 6.5 2-2`}],[`path`,{d:`m17.5 15.5 2-2`}]];Oe(e,H({name:`ruler`},()=>n,{get iconNode(){return r}}))}var er=new Set([`$$slots`,`$$events`,`$$legacy`]);function tr(e,t){let n=V(t,er),r=[[`path`,{d:`M14 17H5`}],[`path`,{d:`M19 7h-9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}],[`circle`,{cx:`7`,cy:`7`,r:`3`}]];Oe(e,H({name:`settings-2`},()=>n,{get iconNode(){return r}}))}var nr=new Set([`$$slots`,`$$events`,`$$legacy`]);function rr(e,t){let n=V(t,nr),r=[[`circle`,{cx:`19`,cy:`5`,r:`2`}],[`circle`,{cx:`5`,cy:`19`,r:`2`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`}]];Oe(e,H({name:`spline`},()=>n,{get iconNode(){return r}}))}var ir=new Set([`$$slots`,`$$events`,`$$legacy`]);function ar(e,t){let n=V(t,ir),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];Oe(e,H({name:`square`},()=>n,{get iconNode(){return r}}))}var or=new Set([`$$slots`,`$$events`,`$$legacy`]);function sr(e,t){let n=V(t,or),r=[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`}]];Oe(e,H({name:`zap`},()=>n,{get iconNode(){return r}}))}var cr=Se({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),lr=new dt(`Checkbox.Group`),ur=new dt(`Checkbox.Root`),dr=class e{static create(t,n=null){return ur.set(new e(t,n))}opts;group;#e=G(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return D(this.#e)}set trueName(e){B(this.#e,e)}#t=G(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return D(this.#t)}set trueRequired(e){B(this.#t,e)}#n=G(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return D(this.#n)}set trueDisabled(e){B(this.#n,e)}#r=G(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return D(this.#r)}set trueReadonly(e){B(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=De(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),ut.pre([()=>y(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{!e||!t||(this.opts.checked.current=e.includes(t))}),ut.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===`Enter`){e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),this.#i())}}#i(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current===`submit`){this.#i();return}e.preventDefault(),this.#i()}}#a=G(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return D(this.#a)}set snippetProps(e){B(this.#a,e)}#o=G(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Te(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":we(this.trueRequired),"aria-readonly":we(this.trueReadonly),"data-disabled":xe(this.trueDisabled),"data-readonly":xe(this.trueReadonly),"data-state":pr(this.opts.checked.current,this.opts.indeterminate.current),[cr.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},fr=class e{static create(){return new e(ur.get())}root;#e=G(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return D(this.#e)}set trueChecked(e){B(this.#e,e)}#t=G(()=>!!this.root.trueName);get shouldRender(){return D(this.#t)}set shouldRender(e){B(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){ht(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=G(()=>({type:`checkbox`,checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}};function pr(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}function mr(e,t){n(t,!0);let i=fr.create();var a=r(),o=U(a),c=e=>{jt(e,H(()=>i.props))};s(o,e=>{i.shouldRender&&e(c)}),K(e,a),R()}var hr=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),gr=T(`<button><!></button>`),_r=T(`<!> <!>`,1);function vr(e,i){let a=w();n(i,!0);let o=A(i,`checked`,15,!1),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`required`,3,!1),f=A(i,`name`,3,void 0),p=A(i,`value`,3,`on`),m=A(i,`id`,19,()=>Ee(a)),h=A(i,`indeterminate`,15,!1),g=A(i,`type`,3,`button`),_=V(i,hr),v=lr.getOr(null);v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1)),ut.pre(()=>p(),()=>{v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1))});let y=dr.create({checked:Y(()=>o(),e=>{o(e),i.onCheckedChange?.(e)}),disabled:Y(()=>l()??!1),required:Y(()=>u()),name:Y(()=>f()),value:Y(()=>p()),id:Y(()=>m()),ref:Y(()=>c(),e=>c(e)),indeterminate:Y(()=>h(),e=>{h(e),i.onIndeterminateChange?.(e)}),type:Y(()=>g()),readonly:Y(()=>!!i.readonly)},v),b=G(()=>be({..._},y.props));var S=_r(),C=U(S),T=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(b),...y.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},E=e=>{var n=gr();oe(n,()=>({...D(b)}));var r=z(n);t(r,()=>i.children??x,()=>y.snippetProps),d(n),K(e,n)};s(C,e=>{i.child?e(T):e(E,-1)}),mr(N(C,2),{}),K(e,S),R()}function yr(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`onOpenChange`,3,_t),s=A(i,`onOpenChangeComplete`,3,_t);zt.create({open:Y(()=>a(),e=>{a(e),o()?.(e)}),onOpenChangeComplete:Y(()=>s())}),St(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var br=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),xr=T(`<div><!></div>`);function Sr(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=A(i,`onSelect`,3,_t),f=A(i,`closeOnSelect`,3,!0),p=V(i,br),m=Vt.create({id:Y(()=>c()),disabled:Y(()=>l()),onSelect:Y(()=>u()),ref:Y(()=>o(),e=>o(e)),closeOnSelect:Y(()=>f())}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=xr();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var Cr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),wr=T(`<div><!></div>`);function Tr(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,Cr),u=Wt.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=wr();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var Er=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`loop`,`onInteractOutside`,`forceMount`,`onEscapeKeydown`,`interactOutsideBehavior`,`escapeKeydownBehavior`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onFocusOutside`,`side`,`trapFocus`,`style`]),Dr=T(`<div><div><!></div></div>`);function Or(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,_t),f=A(i,`forceMount`,3,!1),p=A(i,`onEscapeKeydown`,3,_t),m=A(i,`interactOutsideBehavior`,3,`defer-otherwise-close`),h=A(i,`escapeKeydownBehavior`,3,`defer-otherwise-close`),g=A(i,`onOpenAutoFocus`,3,_t),_=A(i,`onCloseAutoFocus`,3,_t),v=A(i,`onFocusOutside`,3,_t),y=A(i,`side`,3,`right`),b=A(i,`trapFocus`,3,!1),S=V(i,Er),C=It.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),isSub:!0,onCloseAutoFocus:Y(()=>j)});function T(e){let t=e.currentTarget.contains(e.target),n=qt[C.parentMenu.root.opts.dir.current].includes(e.key);t&&n&&(C.parentMenu.onClose(),C.parentMenu.triggerNode?.focus(),e.preventDefault())}let E=G(()=>C.parentMenu.root.getBitsAttr(`sub-content`)),O=G(()=>be(S,C.props,{side:y(),onkeydown:T,[D(E)]:``}));function k(e){g()(e),!e.defaultPrevented&&(e.preventDefault(),C.parentMenu.root.isUsingKeyboard&&C.parentMenu.contentNode&&Lt.dispatch(C.parentMenu.contentNode))}function j(e){_()(e),!e.defaultPrevented&&e.preventDefault()}function ee(e){u()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function M(e){p()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function N(e){if(v()(e),e.defaultPrevented||!ht(e.target)||e.target.id===C.parentMenu.triggerNode?.id)return;if((C.parentMenu.parentMenu?.contentNode)?.contains(e.target)){C.parentMenu.onClose(),e.preventDefault();return}let t=`[${C.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t)){e.preventDefault();return}C.parentMenu.onClose()}var P=r(),te=U(P),ne=e=>{xt(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onOpenAutoFocus:k,get enabled(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Tt(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Dr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},F=e=>{Dt(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onCloseAutoFocus:j,onOpenAutoFocus:k,get open(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Tt(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Dr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(te,e=>{f()?e(ne):f()||e(F,1)}),K(e,P),R()}var kr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`disabled`,`ref`,`children`,`child`,`onSelect`,`openDelay`]),Ar=T(`<div><!></div>`);function jr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`disabled`,3,!1),l=A(i,`ref`,15,null),u=A(i,`onSelect`,3,_t),f=A(i,`openDelay`,3,0),p=V(i,kr),m=Ht.create({disabled:Y(()=>c()),onSelect:Y(()=>u()),id:Y(()=>o()),ref:Y(()=>l(),e=>l(e)),openDelay:Y(()=>f())}),h=G(()=>be(p,m.props));kt(e,{get id(){return o()},get ref(){return m.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},l=e=>{var n=Ar();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}function Mr(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`dir`,3,`ltr`),s=A(i,`onOpenChange`,3,_t),c=A(i,`onOpenChangeComplete`,3,_t),l=A(i,`_internal_variant`,3,`dropdown-menu`),u=A(i,`_internal_should_skip_exit_animation`,3,void 0),d=Rt.create({variant:Y(()=>l()),dir:Y(()=>o()),onClose:()=>{a(!1),s()(!1)},shouldSkipExitAnimation:()=>u()?.()??!1});Kt.create({open:Y(()=>a(),e=>{a(e),s()(e)}),onOpenChangeComplete:Y(()=>c())},d),St(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var Nr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),Pr=T(`<div><div><!></div></div>`);function Fr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,_t),f=A(i,`onEscapeKeydown`,3,_t),p=A(i,`onCloseAutoFocus`,3,_t),m=A(i,`forceMount`,3,!1),h=A(i,`trapFocus`,3,!1),g=V(i,Nr),_=It.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),onCloseAutoFocus:Y(()=>p())}),v=G(()=>be(g,_.props));function y(e){if(_.handleInteractOutside(e),!e.defaultPrevented&&(u()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}_.parentMenu.onClose()}}function b(e){f()(e),!e.defaultPrevented&&_.parentMenu.onClose()}var S=r(),C=U(S),T=e=>{xt(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!0,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Tt(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Pr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},E=e=>{Dt(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get open(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!1,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Tt(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Pr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(C,e=>{m()?e(T):m()||e(E,1)}),K(e,S),R()}var Ir=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),Lr=T(`<button><!></button>`);function Rr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`type`,3,`button`),f=V(i,Ir),p=Gt.create({id:Y(()=>o()),disabled:Y(()=>l()??!1),ref:Y(()=>c(),e=>c(e))}),m=G(()=>be(f,p.props,{type:u()}));kt(e,{get id(){return o()},get ref(){return p.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(m)})),K(e,n)},l=e=>{var n=Lr();oe(n,()=>({...D(m)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}var zr=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),j(this.handler)}handler(){let e=0,t=this.#e();if(!t)return;let n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}},Br=class{opts;present;#e;#t=F(!1);#n=!1;#r=F(void 0);#i=null;constructor(e){this.opts=e,this.present=this.opts.open,B(this.#t,e.open.current,!0),this.#e=new Mt({ref:this.opts.ref,afterTick:this.opts.open}),Nt(()=>this.#o()),ut(()=>this.present.current,e=>{if(!this.#n){this.#n=!0;return}this.#o(),e&&B(this.#t,!0),B(this.#r,e?`starting`:`ending`,!0),e&&(this.#i=window.requestAnimationFrame(()=>{this.#i=null,this.present.current&&B(this.#r,void 0)})),this.#e.run(()=>{e===this.present.current&&(e||B(this.#t,!1),B(this.#r,void 0))})})}#a=G(()=>D(this.#t));get isPresent(){return D(this.#a)}set isPresent(e){B(this.#a,e)}get transitionStatus(){return D(this.#r)}#o(){this.#i!==null&&(window.cancelAnimationFrame(this.#i),this.#i=null)}};function Vr(e,i){n(i,!0);let a=new Br({open:Y(()=>i.open),ref:i.ref});var o=r(),c=U(o),l=e=>{var n=r(),o=U(n);t(o,()=>i.presence??x,()=>({present:a.isPresent,transitionStatus:a.transitionStatus})),K(e,n)};s(c,e=>{(i.forceMount||i.open||a.isPresent)&&e(l)}),K(e,o),R()}function Hr(e,t,n){return Math.min(n,Math.max(t,e))}var Ur=class{state;#e;constructor(e,t){this.state=ve(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}},Wr=Se({component:`scroll-area`,parts:[`root`,`viewport`,`corner`,`thumb`,`scrollbar`]}),Gr=new dt(`ScrollArea.Root`),Kr=new dt(`ScrollArea.Scrollbar`),qr=new dt(`ScrollArea.ScrollbarVisible`),Jr=new dt(`ScrollArea.ScrollbarAxis`),Yr=new dt(`ScrollArea.ScrollbarShared`),Xr=class e{static create(t){return Gr.set(new e(t))}opts;attachment;#e=F(null);get scrollAreaNode(){return D(this.#e)}set scrollAreaNode(e){B(this.#e,e,!0)}#t=F(null);get viewportNode(){return D(this.#t)}set viewportNode(e){B(this.#t,e,!0)}#n=F(null);get contentNode(){return D(this.#n)}set contentNode(e){B(this.#n,e,!0)}#r=F(null);get scrollbarXNode(){return D(this.#r)}set scrollbarXNode(e){B(this.#r,e,!0)}#i=F(null);get scrollbarYNode(){return D(this.#i)}set scrollbarYNode(e){B(this.#i,e,!0)}#a=F(0);get cornerWidth(){return D(this.#a)}set cornerWidth(e){B(this.#a,e,!0)}#o=F(0);get cornerHeight(){return D(this.#o)}set cornerHeight(e){B(this.#o,e,!0)}#s=F(!1);get scrollbarXEnabled(){return D(this.#s)}set scrollbarXEnabled(e){B(this.#s,e,!0)}#c=F(!1);get scrollbarYEnabled(){return D(this.#c)}set scrollbarYEnabled(e){B(this.#c,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref,e=>this.scrollAreaNode=e),this.domContext=new Pt(e.ref)}#l=G(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:`relative`,"--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[Wr.root]:``,...this.attachment}));get props(){return D(this.#l)}set props(e){B(this.#l,e)}},Zr=class e{static create(t){return new e(t,Gr.get())}opts;root;attachment;#e=ve(Ut());#t=ve(null);contentAttachment=De(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref,e=>this.root.viewportNode=e)}#n=G(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?`scroll`:`hidden`,overflowY:this.root.scrollbarYEnabled?`scroll`:`hidden`},[Wr.viewport]:``,...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}#r=G(()=>({id:this.#e.current,"data-scroll-area-content":``,style:{minWidth:this.root.scrollbarXEnabled?`fit-content`:void 0},...this.contentAttachment}));get contentProps(){return D(this.#r)}set contentProps(e){B(this.#r,e)}},Qr=class e{static create(t){return Kr.set(new e(t,Gr.get()))}opts;root;#e=G(()=>this.opts.orientation.current===`horizontal`);get isHorizontal(){return D(this.#e)}set isHorizontal(e){B(this.#e,e)}#t=F(!1);get hasThumb(){return D(this.#t)}set hasThumb(e){B(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,ut(()=>this.isHorizontal,e=>e?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}},$r=class t{static create(){return new t(Kr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(t){this.scrollbar=t,this.root=t.root,j(()=>{let t=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current,r=0;if(!t)return;let i=Ce(f(t,`pointerenter`,()=>{this.root.domContext.clearTimeout(r),e(()=>this.isVisible=!0)}),f(t,`pointerleave`,()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{e(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)}));return()=>{this.root.domContext.getWindow().clearTimeout(r),i()}})}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ei=class e{static create(){return new e(Kr.get())}scrollbar;root;machine=new Ur(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});#e=G(()=>this.machine.state.current===`hidden`);get isHidden(){return D(this.#e)}set isHidden(e){B(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;let t=lt(()=>this.machine.dispatch(`SCROLL_END`),100);j(()=>{let e=this.machine.state.current,t=this.root.opts.scrollHideDelay.current;if(e===`idle`){let e=this.root.domContext.setTimeout(()=>this.machine.dispatch(`HIDE`),t);return()=>this.root.domContext.clearTimeout(e)}}),j(()=>{let e=this.root.viewportNode;if(!e)return;let n=this.scrollbar.isHorizontal?`scrollLeft`:`scrollTop`,r=e[n];return f(e,`scroll`,()=>{let i=e[n];r!==i&&(this.machine.dispatch(`SCROLL`),t()),r=i})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch(`POINTER_ENTER`)}onpointerleave(e){this.machine.dispatch(`POINTER_LEAVE`)}#t=G(()=>({"data-state":this.machine.state.current===`hidden`?`hidden`:`visible`,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ti=class e{static create(){return new e(Kr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;let t=lt(()=>{let e=this.root.viewportNode;if(!e)return;let t=e.offsetWidth<e.scrollWidth,n=e.offsetHeight<e.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?t:n},10);new zr(()=>this.root.viewportNode,t),new zr(()=>this.root.contentNode,t)}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ni=class e{static create(){return qr.set(new e(Kr.get()))}scrollbar;root;#e=F(null);get thumbNode(){return D(this.#e)}set thumbNode(e){B(this.#e,e,!0)}#t=F(0);get pointerOffset(){return D(this.#t)}set pointerOffset(e){B(this.#t,e,!0)}#n=F({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return D(this.#n)}set sizes(e){B(this.#n,e)}#r=G(()=>li(this.sizes.viewport,this.sizes.content));get thumbRatio(){return D(this.#r)}set thumbRatio(e){B(this.#r,e)}#i=G(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return D(this.#i)}set hasThumb(e){B(this.#i,e)}#a=F(``);get prevTransformStyle(){return D(this.#a)}set prevTransformStyle(e){B(this.#a,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,j(()=>{this.scrollbar.hasThumb=this.hasThumb}),j(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return di({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollLeft,t=`translate3d(${fi({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollTop,t=`translate3d(0, ${fi({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}},ri=class e{static create(t){return Jr.set(new e(t,qr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarXNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),mi(n,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:ci(this.computedStyle.paddingLeft),paddingEnd:ci(this.computedStyle.paddingRight)}})};#t=G(()=>ui(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`horizontal`,style:{bottom:0,left:this.root.opts.dir.current===`rtl`?`var(--bits-scroll-area-corner-width)`:0,right:this.root.opts.dir.current===`ltr`?`var(--bits-scroll-area-corner-width)`:0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}},ii=class e{static create(t){return Jr.set(new e(t,qr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarYNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),mi(n,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:ci(this.computedStyle.paddingTop),paddingEnd:ci(this.computedStyle.paddingBottom)}})}#t=G(()=>ui(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`vertical`,style:{top:0,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:`var(--bits-scroll-area-corner-height)`,"--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}},ai=class t{static create(){return Yr.set(new t(Jr.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=F(null);get rect(){return D(this.#e)}set rect(e){B(this.#e,e)}#t=F(``);get prevWebkitUserSelect(){return D(this.#t)}set prevWebkitUserSelect(e){B(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=G(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return D(this.#n)}set maxScrollPos(e){B(this.#n,e)}constructor(t){this.scrollbarState=t,this.root=t.root,this.scrollbarVis=t.scrollbarVis,this.scrollbar=t.scrollbarVis.scrollbar,this.handleResize=lt(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,j(()=>{let e=this.maxScrollPos,t=this.scrollbar.opts.ref.current;return this.root.viewportNode,f(this.root.domContext.getDocument(),`wheel`,n=>{let r=n.target;t?.contains(r)&&this.handleWheelScroll(n,e)},{passive:!1})}),le(()=>{this.scrollbarVis.sizes,e(()=>this.handleThumbPositionChange())}),new zr(()=>this.scrollbar.opts.ref.current,this.handleResize),new zr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;let t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}#r(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=``),this.rect=null)}onpointerdown(e){e.button===0&&(e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect=`none`,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=`auto`),this.handleDragScroll(e))}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#r()}onlostpointercapture(e){this.#r()}#i=G(()=>be({...this.scrollbarState.props,style:{position:`absolute`,...this.scrollbarState.props.style},[Wr.scrollbar]:``,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return D(this.#i)}set props(e){B(this.#i,e)}},oi=class t{static create(e){return new t(e,Yr.get())}opts;scrollbarState;attachment;#e;#t=F();#n=lt(()=>{D(this.#t)&&(D(this.#t)(),B(this.#t,void 0))},100);constructor(t,n){this.opts=t,this.scrollbarState=n,this.#e=n.root,this.attachment=De(this.opts.ref,e=>this.scrollbarState.scrollbarVis.thumbNode=e),j(()=>{let t=this.#e.viewportNode;return t?(e(()=>this.scrollbarState.handleThumbPositionChange()),f(t,`scroll`,()=>{if(this.#n(),!D(this.#t)){let e=hi(t,this.scrollbarState.handleThumbPositionChange);B(this.#t,e,!0),this.scrollbarState.handleThumbPositionChange()}})):void 0}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){let t=e.target;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:r,y:i})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#r=G(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?`visible`:`hidden`,style:{width:`var(--bits-scroll-area-thumb-width)`,height:`var(--bits-scroll-area-thumb-height)`,transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[Wr.thumb]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}},si=class e{static create(t){return new e(t,Gr.get())}opts;root;attachment;#e=F(0);#t=F(0);#n=G(()=>!!(D(this.#e)&&D(this.#t)));get hasSize(){return D(this.#n)}set hasSize(e){B(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=De(this.opts.ref),new zr(()=>this.root.scrollbarXNode,()=>{let e=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=e,B(this.#t,e,!0)}),new zr(()=>this.root.scrollbarYNode,()=>{let e=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=e,B(this.#e,e,!0)})}#r=G(()=>({id:this.opts.id.current,style:{width:D(this.#e),height:D(this.#t),position:`absolute`,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:0},[Wr.corner]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}};function ci(e){return e?Number.parseInt(e,10):0}function li(e,t){let n=e/t;return Number.isNaN(n)?0:n}function ui(e){let t=li(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function di({pointerPos:e,pointerOffset:t,sizes:n,dir:r=`ltr`}){let i=ui(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return pi([c,l],d)(e)}function fi({scrollPos:e,sizes:t,dir:n=`ltr`}){let r=ui(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Hr(e,c[0],c[1]);return pi([0,o],[0,s])(l)}function pi(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function mi(e,t){return e>0&&e<t}function hi(e,t){let n={left:e.scrollLeft,top:e.scrollTop},r=0,i=Bt(e);return(function a(){let o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=i.requestAnimationFrame(a)})(),()=>i.cancelAnimationFrame(r)}var gi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`type`,`dir`,`scrollHideDelay`,`children`,`child`]),_i=T(`<div><!></div>`);function vi(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`type`,3,`hover`),u=A(i,`dir`,3,`ltr`),f=A(i,`scrollHideDelay`,3,600),p=V(i,gi),m=Xr.create({type:Y(()=>l()),dir:Y(()=>u()),scrollHideDelay:Y(()=>f()),id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=_i();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var yi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`]),bi=T(`<div><div><!></div></div>`);function xi(e,r){let i=w();n(r,!0);let a=A(r,`ref`,15,null),o=A(r,`id`,19,()=>Ee(i)),s=V(r,yi),c=Zr.create({id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(s,c.props)),u=G(()=>be({},c.contentProps));var f=bi();oe(f,()=>({...D(l)}));var p=z(f);oe(p,()=>({...D(u)}));var m=z(p);t(m,()=>r.children??x),d(p),d(f),K(e,f),R()}var Si=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`]),Ci=T(`<div><!></div>`);function wi(e,i){n(i,!0);let a=V(i,Si),o=ai.create(),c=G(()=>be(a,o.props));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(c)})),K(e,n)},p=e=>{var n=Ci();oe(n,()=>({...D(c)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l),R()}var Ti=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ei(e,t){n(t,!0);let r=V(t,Ti),i=new bt,a=ri.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));wi(e,H(()=>D(o))),R()}var Di=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oi(e,t){n(t,!0);let r=V(t,Di),i=new bt,a=ii.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));wi(e,H(()=>D(o))),R()}var ki=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ai(e,t){n(t,!0);let i=V(t,ki),a=ni.create();var o=r(),c=U(o),l=e=>{Ei(e,H(()=>i))},u=e=>{Oi(e,H(()=>i))};s(c,e=>{a.scrollbar.opts.orientation.current===`horizontal`?e(l):e(u,-1)}),K(e,o),R()}var ji=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Mi(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,ji),a=ti.create(),o=G(()=>be(i,a.props));{let t=e=>{Ai(e,H(()=>D(o)))},n=G(()=>r()||a.isVisible);Vr(e,{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Ni=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Pi(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Ni),a=ei.create(),o=G(()=>be(i,a.props));{let t=e=>{Ai(e,H(()=>D(o)))},n=G(()=>r()||!a.isHidden);Vr(e,H(()=>D(o),{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}}))}R()}var Fi=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Ii(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Fi),a=$r.create(),o=ti.create(),s=G(()=>be(i,a.props,o.props,{"data-state":a.isVisible?`visible`:`hidden`})),c=G(()=>r()||a.isVisible&&o.isVisible);Vr(e,{get open(){return D(c)},get ref(){return o.scrollbar.opts.ref},presence:e=>{Ai(e,H(()=>D(s)))},$$slots:{presence:!0}}),R()}var Li=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`]);function Ri(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,Li),l=Qr.create({orientation:Y(()=>t.orientation),id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),u=G(()=>l.root.opts.type.current);var d=r(),f=U(d),p=e=>{Ii(e,H(()=>c,{get id(){return o()}}))},m=e=>{Pi(e,H(()=>c,{get id(){return o()}}))},h=e=>{Mi(e,H(()=>c,{get id(){return o()}}))},g=e=>{Ai(e,H(()=>c,{get id(){return o()}}))};s(f,e=>{D(u)===`hover`?e(p):D(u)===`scroll`?e(m,1):D(u)===`auto`?e(h,2):D(u)===`always`&&e(g,3)}),K(e,d),R()}var zi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`,`present`]),Bi=T(`<div><!></div>`);function Vi(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,zi),c=new bt,l=oi.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e)),mounted:Y(()=>c.current)}),u=G(()=>be(o,l.props,{style:{hidden:!i.present}}));var f=r(),p=U(f),m=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(u)})),K(e,n)},h=e=>{var n=Bi();oe(n,()=>({...D(u)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(p,e=>{i.child?e(m):e(h,-1)}),K(e,f),R()}var Hi=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`]);function Ui(e,t){let r=w();n(t,!0);let i=A(t,`id`,19,()=>Ee(r)),a=A(t,`ref`,15,null),o=A(t,`forceMount`,3,!1),s=V(t,Hi),c=qr.get();{let t=(e,t)=>{let n=()=>(t?.()).present;Vi(e,H(()=>s,{get id(){return i()},get present(){return n()},get ref(){return a()},set ref(e){a(e)}}))},n=G(()=>o()||c.hasThumb);Vr(e,{get open(){return D(n)},get ref(){return c.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Wi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`,`child`]),Gi=T(`<div><!></div>`);function Ki(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,Wi),c=si.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(o,c.props));var u=r(),f=U(u),p=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(l)})),K(e,n)},m=e=>{var n=Gi();oe(n,()=>({...D(l)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(f,e=>{i.child?e(p):e(m,-1)}),K(e,u),R()}var qi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`]);function Ji(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,qi),l=Gr.get(),u=G(()=>!!(l.scrollbarXNode&&l.scrollbarYNode)),d=G(()=>l.opts.type.current!==`scroll`&&D(u));var f=r(),p=U(f),m=e=>{Ki(e,H(()=>c,{get id(){return o()},get ref(){return a()},set ref(e){a(e)}}))};s(p,e=>{D(d)&&e(m)}),K(e,f),R()}function Yi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.right=`${n}%`):e===`rl`?(r.right=`${t}%`,r.left=`${n}%`):e===`bt`?(r.bottom=`${t}%`,r.top=`${n}%`):(r.top=`${t}%`,r.bottom=`${n}%`),r}function Xi(e,t){let n={position:`absolute`};return e===`lr`?(n.left=`${t}%`,n.translate=`-50% 0`):e===`rl`?(n.right=`${t}%`,n.translate=`50% 0`):e===`bt`?(n.bottom=`${t}%`,n.translate=`0 50%`):(n.top=`${t}%`,n.translate=`0 -50%`),n}function Zi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.translate=`${n}% 0`):e===`rl`?(r.right=`${t}%`,r.translate=`${-n}% 0`):e===`bt`?(r.bottom=`${t}%`,r.translate=`0 ${-n}%`):(r.top=`${t}%`,r.translate=`0 ${n}%`),r}function Qi(e){if(Math.floor(e)===e)return 0;let t=e.toString();if(t.indexOf(`.`)!==-1&&t.indexOf(`e-`)===-1)return t.split(`.`)[1].length;if(t.indexOf(`e-`)!==-1){let e=t.split(`e-`);return parseInt(e[1],10)}return 0}function $i(e,t){let n=10**t;return Math.round(e*n)/n}function ea(e,t,n){if(typeof e==`number`){let r=n-t,i=Math.ceil(r/e),a=Qi(e),o=10**a;Math.round(r*o)%Math.round(e*o)===0&&i++;let s=[];for(let n=0;n<i;n++){let r=$i(t+n*e,a);s.push(r)}return s}return[...new Set(e)].filter(e=>e>=t&&e<=n).sort((e,t)=>e-t)}function ta(e,t){if(t.length===0)return e;let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}return n}function na(e,t,n){let r=t.indexOf(e);return r===-1?ta(e,t):n===`next`?r<t.length-1?t[r+1]:e:r>0?t[r-1]:e}function ra(e,t,n=!0){let[r,i]=e,[a,o]=t,s=(o-a)/(i-r);return e=>{let t=a+s*(e-r);return n?t>Math.max(a,o)?Math.max(a,o):t<Math.min(a,o)?Math.min(a,o):t:t}}var ia=Se({component:`slider`,parts:[`root`,`thumb`,`range`,`tick`,`tick-label`,`thumb-label`]}),aa=new dt(`Slider.Root`),oa=class{opts;attachment;#e=F(!1);get isActive(){return D(this.#e)}set isActive(e){B(this.#e,e,!0)}#t=F(0);#n=G(()=>this.opts.orientation.current===`horizontal`?this.opts.dir.current===`rtl`?`rl`:`lr`:this.opts.dir.current===`rtl`?`tb`:`bt`);get direction(){return D(this.#n)}set direction(e){B(this.#n,e)}#r=G(()=>ea(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return D(this.#r)}set normalizedSteps(e){B(this.#r,e)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref),this.domContext=new Pt(this.opts.ref),new zr(()=>this.opts.ref.current,this.#i)}#i=()=>{B(this.#t,D(this.#t)+1)};isThumbActive(e){return this.isActive}#a=G(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current===`horizontal`?`pan-y`:`pan-x`});getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(ia.selector(`thumb`))):[]};getThumbScale=()=>{D(this.#t);let e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current===`exact`)return[0,100];let t=this.opts.orientation.current===`vertical`,n=this.getAllThumbs()[0],r=t?n?.offsetHeight:n?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];let i=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(i===void 0||Number.isNaN(i)||i===0)return[0,100];let a=r/2/i*100;return[a,100-a]};getPositionFromValue=e=>{let t=this.getThumbScale();return ra([this.opts.min.current,this.opts.max.current],t)(e)};#o=G(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":xe(this.opts.disabled.current),style:{touchAction:D(this.#a)},[ia.root]:``,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},sa=class extends oa{opts;isMulti=!1;constructor(e){super(e),this.opts=e,Ct(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),ut([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ea(e,t,n),a=e=>i.includes(e),o=e=>ta(e,i);a(r)||(this.opts.value.current=o(r))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:n}){let r=this.opts.min.current,i=this.opts.max.current,a=(e-t)/(n-t)*(i-r)+r;if(a<r)this.updateValue(r);else if(a>i)this.updateValue(i);else{let e=this.normalizedSteps,t=ta(a,e);this.updateValue(t)}}updateValue=e=>{this.opts.value.current=ta(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!t||!n)return;n.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect();this.direction===`lr`?this.applyPosition({clientXY:e.clientX,start:r,end:i}):this.direction===`rl`?this.applyPosition({clientXY:e.clientX,start:i,end:r}):this.direction===`bt`?this.applyPosition({clientXY:e.clientY,start:o,end:a}):this.direction===`tb`&&this.applyPosition({clientXY:e.clientY,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!n||!t)return;let r=e.composedPath()[0]??e.target;!ft(r)||!t.contains(r)||(e.preventDefault(),n.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};#e=G(()=>{let e=this.opts.value.current;return Array.from({length:1},()=>{let t=e,n=this.getPositionFromValue(t),r=Xi(this.direction,n);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[ia.thumb]:``}})});get thumbsPropsArr(){return D(this.#e)}set thumbsPropsArr(e){B(this.#e,e)}#t=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#t)}set thumbsRenderArr(e){B(this.#t,e)}#n=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Zi(this.direction,i,s),l=n<=t;return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,"data-selected":this.isTickValueSelected(n)?``:void 0,style:c,[ia.tick]:``}})});get ticksPropsArr(){return D(this.#n)}set ticksPropsArr(e){B(this.#n,e)}#r=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#r)}set ticksRenderArr(e){B(this.#r,e)}#i=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#i)}set tickItemsArr(e){B(this.#i,e)}#a=G(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return D(this.#a)}set thumbItemsArr(e){B(this.#a,e)}#o=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#o)}set snippetProps(e){B(this.#o,e)}},ca=class extends oa{opts;isMulti=!0;#e=F(null);get activeThumb(){return D(this.#e)}set activeThumb(e){B(this.#e,e,!0)}#t=F(0);get currentThumbIdx(){return D(this.#t)}set currentThumbIdx(e){B(this.#t,e,!0)}constructor(e){super(e),this.opts=e,Ct(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),ut([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ea(e,t,n),a=e=>i.includes(e),o=e=>ta(e,i);r.some(e=>!a(e))&&(this.opts.value.current=r.map(o))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:n,end:r}){let i=this.opts.min.current,a=this.opts.max.current,o=(e-n)/(r-n)*(a-i)+i;if(o<i)this.updateValue(i,t);else if(o>a)this.updateValue(a,t);else{let e=this.normalizedSteps,n=ta(o,e);this.updateValue(n,t)}}#n=e=>{let t=this.getAllThumbs();if(!t.length)return;for(let e of t)e.blur();let n=t.map(t=>{if(this.opts.orientation.current===`horizontal`){let{left:n,right:r}=t.getBoundingClientRect();return Math.abs(e.clientX-(n+r)/2)}{let{top:n,bottom:r}=t.getBoundingClientRect();return Math.abs(e.clientY-(n+r)/2)}}),r=t[n.indexOf(Math.min(...n))];return{node:r,idx:t.indexOf(r)}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.activeThumb;if(!t||!n)return;n.node.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect(),s=this.direction;s===`lr`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:r,end:i}):s===`rl`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:i,end:r}):s===`bt`?this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:o,end:a}):s===`tb`&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;let t=this.opts.ref.current,n=this.#n(e);if(!n||!t)return;let r=e.composedPath()[0]??e.target;!ft(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=n,n.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(ia.selector(`thumb`))):[]};updateValue=(e,t)=>{let n=this.opts.value.current;if(!n.length){this.opts.value.current.push(e);return}if(n[t]===e)return;let r=[...n];if(!Jt(t,r))return;let i=r[t]>e?-1:1,a=()=>{let n=t+i;r[t]=r[n],r[n]=e;let a=this.getAllThumbs();a.length&&(a[n]?.focus(),this.activeThumb={node:a[n],idx:n})};if(this.opts.autoSort.current&&(i===-1&&e<r[t-1]||i===1&&e>r[t+1])){a(),this.opts.value.current=r;return}let o=this.normalizedSteps;r[t]=ta(e,o),this.opts.value.current=r};#r=G(()=>{let t=this.opts.value.current;return Array.from({length:t.length||1},(n,r)=>{let i=e(()=>this.currentThumbIdx);i<t.length&&e(()=>{this.currentThumbIdx=i+1});let a=t[r],o=this.getPositionFromValue(a??0),s=Xi(this.direction,o);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":a,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":a,"data-orientation":this.opts.orientation.current,style:s,[ia.thumb]:``}})});get thumbsPropsArr(){return D(this.#r)}set thumbsPropsArr(e){B(this.#r,e)}#i=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#i)}set thumbsRenderArr(e){B(this.#i,e)}#a=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Zi(this.direction,i,s),l=t.length===1?n<=t[0]:t[0]<=n&&n<=t[t.length-1];return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,style:c,[ia.tick]:``}})});get ticksPropsArr(){return D(this.#a)}set ticksPropsArr(e){B(this.#a,e)}#o=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#o)}set ticksRenderArr(e){B(this.#o,e)}#s=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#s)}set tickItemsArr(e){B(this.#s,e)}#c=G(()=>this.opts.value.current.map((e,t)=>({value:e,index:t})));get thumbItemsArr(){return D(this.#c)}set thumbItemsArr(e){B(this.#c,e)}#l=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#l)}set snippetProps(e){B(this.#l,e)}},la=class{static create(e){let{type:t,...n}=e,r=t===`single`?new sa(n):new ca(n);return aa.set(r)}},ua=[pt,mt,gt,vt,yt,`End`],da=class e{static create(t){return new e(t,aa.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref)}#e=G(()=>{if(Array.isArray(this.root.opts.value.current)){let e=this.root.opts.value.current.length>1?this.root.getPositionFromValue(Math.min(...this.root.opts.value.current)??0):0,t=100-this.root.getPositionFromValue(Math.max(...this.root.opts.value.current)??0);return{position:`absolute`,...Yi(this.root.direction,e,t)}}{let e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,n=this.root.opts.max.current,r=e!==void 0&&e>0&&t===n?0:100-this.root.getPositionFromValue(t);return{position:`absolute`,...Yi(this.root.direction,0,r)}}});get rangeStyles(){return D(this.#e)}set rangeStyles(e){B(this.#e,e)}#t=G(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":xe(this.root.opts.disabled.current),style:this.rangeStyles,[ia.range]:``,...this.attachment}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},fa=class e{static create(t){return new e(t,aa.get())}opts;root;attachment;#e=G(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref),this.onkeydown=this.onkeydown.bind(this)}#t(e){this.root.isMulti?this.root.updateValue(e,this.opts.index.current):this.root.updateValue(e)}onkeydown(e){if(D(this.#e))return;let t=this.opts.ref.current;if(!t)return;let n=this.root.getAllThumbs();if(!n.length)return;let r=n.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!ua.includes(e.key))return;e.preventDefault();let i=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,s=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,l=this.root.direction,u=this.root.normalizedSteps;switch(e.key){case yt:this.#t(i);break;case`End`:this.#t(a);break;case pt:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?a:i;this.#t(e)}else{let e=na(s,u,l===`rl`?`next`:`prev`);this.#t(e)}break;case mt:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?i:a;this.#t(e)}else{let e=na(s,u,l===`rl`?`prev`:`next`);this.#t(e)}break;case gt:if(e.metaKey){let e=l===`tb`?i:a;this.#t(e)}else{let e=na(s,u,l===`tb`?`prev`:`next`);this.#t(e)}break;case vt:if(e.metaKey){let e=l===`tb`?a:i;this.#t(e)}else{let e=na(s,u,l===`tb`?`next`:`prev`);this.#t(e)}}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=G(()=>({...this.root.thumbsPropsArr[this.opts.index.current],id:this.opts.id.current,onkeydown:this.onkeydown,"data-active":this.root.isThumbActive(this.opts.index.current)?``:void 0,"data-disabled":xe(this.opts.disabled.current||this.root.opts.disabled.current),tabindex:this.opts.disabled.current||this.root.opts.disabled.current?-1:0,...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}},pa=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`value`,`type`,`onValueChange`,`onValueCommit`,`disabled`,`min`,`max`,`step`,`dir`,`autoSort`,`orientation`,`thumbPositioning`,`trackPadding`]),ma=T(`<span><!></span>`);function ha(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`value`,15),u=A(i,`onValueChange`,3,_t),f=A(i,`onValueCommit`,3,_t),p=A(i,`disabled`,3,!1),m=A(i,`step`,3,1),h=A(i,`dir`,3,`ltr`),g=A(i,`autoSort`,3,!0),_=A(i,`orientation`,3,`horizontal`),v=A(i,`thumbPositioning`,3,`contain`),y=V(i,pa),b=G(()=>i.min===void 0?Array.isArray(m())?Math.min(...m()):0:i.min),S=G(()=>i.max===void 0?Array.isArray(m())?Math.max(...m()):100:i.max);function C(){if(l()===void 0)return i.type===`single`?D(b):[]}C(),ut.pre(()=>l(),()=>{C()});let T=la.create({id:Y(()=>o()),ref:Y(()=>c(),e=>c(e)),value:Y(()=>l(),e=>{l(e),u()(e)}),onValueCommit:Y(()=>f()),disabled:Y(()=>p()),min:Y(()=>D(b)),max:Y(()=>D(S)),step:Y(()=>m()),dir:Y(()=>h()),autoSort:Y(()=>g()),orientation:Y(()=>_()),thumbPositioning:Y(()=>v()),type:i.type,trackPadding:Y(()=>i.trackPadding)}),E=G(()=>be(y,T.props));var O=r(),k=U(O),j=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(E),...T.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},ee=e=>{var n=ma();oe(n,()=>({...D(E)}));var r=z(n);t(r,()=>i.children??x,()=>T.snippetProps),d(n),K(e,n)};s(k,e=>{i.child?e(j):e(ee,-1)}),K(e,O),R()}var ga=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_a=T(`<span><!></span>`);function va(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,ga),u=da.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=_a();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var ya=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`,`index`,`disabled`]),ba=T(`<span><!></span>`);function xa(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=V(i,ya),f=fa.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e)),index:Y(()=>i.index),disabled:Y(()=>l())}),p=G(()=>be(u,f.props));var m=r(),h=U(m),g=e=>{var n=r(),a=U(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current),props:D(p)}));t(a,()=>i.child,()=>D(e))}K(e,n)},_=e=>{var n=ba();oe(n,()=>({...D(p)}));var r=z(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current)}));t(r,()=>i.children??x,()=>D(e))}d(n),K(e,n)};s(h,e=>{i.child?e(g):e(_,-1)}),K(e,m),R()}var Sa={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ca={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},wa=1e3,Ta=1001,Ea=1002,Da=1003,Oa=1004,ka=1005,Aa=1006,ja=1007,Ma=1008,Na=1009,Pa=1010,Fa=1011,Ia=1012,La=1013,Ra=1014,za=1015,Ba=1016,Va=1017,Ha=1018,Ua=1020,Wa=35902,Ga=35899,Ka=1021,qa=1022,Ja=1023,Ya=1026,Xa=1027,Za=1028,Qa=1029,$a=1030,eo=1031,to=1033,no=33776,ro=33777,io=33778,ao=33779,oo=35840,so=35841,co=35842,lo=35843,uo=36196,fo=37492,po=37496,mo=37488,ho=37489,go=37490,_o=37491,vo=37808,yo=37809,bo=37810,xo=37811,So=37812,Co=37813,wo=37814,To=37815,Eo=37816,Do=37817,Oo=37818,ko=37819,Ao=37820,jo=37821,Mo=36492,No=36494,Po=36495,Fo=36283,Io=36284,Lo=36285,Ro=36286,zo=2300,Bo=2301,Vo=2302,Ho=2303,Uo=2400,Wo=2401,Go=2402,Ko=3200,qo=`srgb`,Jo=`srgb-linear`,Yo=`linear`,Xo=`srgb`,Zo=7680,Qo=35044,$o=2e3;function es(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function ts(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ns(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function rs(){let e=ns(`canvas`);return e.style.display=`block`,e}var is={};function as(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function os(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function ss(...e){e=os(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function cs(...e){e=os(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function ls(...e){let t=e.join(` `);t in is||(is[t]=!0,ss(...e))}function us(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var ds={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},fs=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},ps=`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`.split(`.`),ms=1234567,hs=Math.PI/180,gs=180/Math.PI;function _s(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ps[e&255]+ps[e>>8&255]+ps[e>>16&255]+ps[e>>24&255]+`-`+ps[t&255]+ps[t>>8&255]+`-`+ps[t>>16&15|64]+ps[t>>24&255]+`-`+ps[n&63|128]+ps[n>>8&255]+`-`+ps[n>>16&255]+ps[n>>24&255]+ps[r&255]+ps[r>>8&255]+ps[r>>16&255]+ps[r>>24&255]).toLowerCase()}function vs(e,t,n){return Math.max(t,Math.min(n,e))}function ys(e,t){return(e%t+t)%t}function bs(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function xs(e,t,n){return e===t?0:(n-e)/(t-e)}function Ss(e,t,n){return(1-n)*e+n*t}function Cs(e,t,n,r){return Ss(e,t,1-Math.exp(-n*r))}function ws(e,t=1){return t-Math.abs(ys(e,t*2)-t)}function Ts(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Es(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Ds(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Os(e,t){return e+Math.random()*(t-e)}function ks(e){return e*(.5-Math.random())}function As(e){e!==void 0&&(ms=e);let t=ms+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function js(e){return e*hs}function Ms(e){return e*gs}function Ns(e){return!(e&e-1)&&e!==0}function Ps(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Fs(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Is(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:ss(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Ls(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function Rs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}var zs={DEG2RAD:hs,RAD2DEG:gs,generateUUID:_s,clamp:vs,euclideanModulo:ys,mapLinear:bs,inverseLerp:xs,lerp:Ss,damp:Cs,pingpong:ws,smoothstep:Ts,smootherstep:Es,randInt:Ds,randFloat:Os,randFloatSpread:ks,seededRandom:As,degToRad:js,radToDeg:Ms,isPowerOfTwo:Ns,ceilPowerOfTwo:Ps,floorPowerOfTwo:Fs,setQuaternionFromProperEuler:Is,normalize:Rs,denormalize:Ls},X=class e{static{e.prototype.isVector2=!0}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 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 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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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=vs(this.x,e.x,t.x),this.y=vs(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=vs(this.x,e,t),this.y=vs(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(vs(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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(vs(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let 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){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Bs=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,r){return this._x=e,this._y=t,this._z=n,this._w=r,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){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:ss(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}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(vs(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*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}},Z=class e{static{e.prototype.isVector3=!0}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 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 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(Hs.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Hs.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-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){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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=vs(this.x,e.x,t.x),this.y=vs(this.y,e.y,t.y),this.z=vs(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=vs(this.x,e,t),this.y=vs(this.y,e,t),this.z=vs(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(vs(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){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Vs.copy(this).projectOnVector(e),this.sub(Vs)}reflect(e){return this.sub(Vs.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(vs(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*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){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,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(){let 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}},Vs=new Z,Hs=new Bs,Us=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let 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){let 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){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,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){let 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,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return ls(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Ws.makeScale(e,t)),this}rotate(e){return ls(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Ws.makeRotation(-e)),this}translate(e,t){return ls(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Ws.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){let 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){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])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){let 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)}},Ws=new Us,Gs=new Us().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ks=new Us().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function qs(){let e={enabled:!0,workingColorSpace:Jo,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=Ys(e.r),e.g=Ys(e.g),e.b=Ys(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Xs(e.r),e.g=Xs(e.g),e.b=Xs(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?Yo:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return ls(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return ls(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Jo]:{primaries:t,whitePoint:r,transfer:Yo,toXYZ:Gs,fromXYZ:Ks,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:qo},outputColorSpaceConfig:{drawingBufferColorSpace:qo}},[qo]:{primaries:t,whitePoint:r,transfer:Xo,toXYZ:Gs,fromXYZ:Ks,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:qo}}}),e}var Js=qs();function Ys(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Xs(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var Zs,Qs=class{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{Zs===void 0&&(Zs=ns(`canvas`)),Zs.width=e.width,Zs.height=e.height;let t=Zs.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Zs}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){let t=ns(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=Ys(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(Ys(t[e]/255)*255):t[e]=Ys(t[e]);return{data:t,width:e.width,height:e.height}}return ss(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},$s=0,ec=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:$s++}),this.uuid=_s(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let 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(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(tc(r[t].image)):e.push(tc(r[t]))}else e=tc(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function tc(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?Qs.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(ss(`Texture: Unable to serialize Texture.`),{})}var nc=0,rc=new Z,ic=class e extends fs{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=Ta,i=Ta,a=Aa,o=Ma,s=Ja,c=Na,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:nc++}),this.uuid=_s(),this.name=``,this.source=new ec(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new X(0,0),this.repeat=new X(1,1),this.center=new X(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Us,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=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(rc).x}get height(){return this.source.getSize(rc).y}get depth(){return this.source.getSize(rc).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(let t in e){let n=e[t];if(n===void 0){ss(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){ss(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let 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!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case wa:e.x-=Math.floor(e.x);break;case Ta:e.x=e.x<0?0:1;break;case Ea:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case wa:e.y-=Math.floor(e.y);break;case Ta:e.y=e.y<0?0:1;break;case Ea:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}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++}};ic.DEFAULT_IMAGE=null,ic.DEFAULT_MAPPING=300,ic.DEFAULT_ANISOTROPY=1;var ac=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}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,r){return this.x=e,this.y=t,this.z=n,this.w=r,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 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 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?1:e.w,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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,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);let 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,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let 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=vs(this.x,e.x,t.x),this.y=vs(this.y,e.y,t.y),this.z=vs(this.z,e.z,t.z),this.w=vs(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=vs(this.x,e,t),this.y=vs(this.y,e,t),this.z=vs(this.z,e,t),this.w=vs(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(vs(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}},oc=class extends fs{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Aa,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 ac(0,0,e,t),this.scissorTest=!1,this.viewport=new ac(0,0,e,t),this.textures=[];let r=new ic({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].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={}){let t={minFilter:Aa,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 e=0;e<this.textures.length;e++)this.textures[e].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 r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].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;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new ec(n)}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`})}},sc=class extends oc{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},cc=class extends ic{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Da,this.minFilter=Da,this.wrapR=Ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},lc=class extends ic{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Da,this.minFilter=Da,this.wrapR=Ta,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},uc=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){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,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 e().fromArray(this.elements)}copy(e){let 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){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let 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();let t=this.elements,n=e.elements,r=1/dc.setFromMatrixColumn(e,0).length(),i=1/dc.setFromMatrixColumn(e,1).length(),a=1/dc.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,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){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}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(pc,e,mc)}lookAt(e,t,n){let r=this.elements;return _c.subVectors(e,t),_c.lengthSq()===0&&(_c.z=1),_c.normalize(),hc.crossVectors(n,_c),hc.lengthSq()===0&&(Math.abs(n.z)===1?_c.x+=1e-4:_c.z+=1e-4,_c.normalize(),hc.crossVectors(n,_c)),hc.normalize(),gc.crossVectors(_c,hc),r[0]=hc.x,r[4]=gc.x,r[8]=_c.x,r[1]=hc.y,r[5]=gc.y,r[9]=_c.y,r[2]=hc.z,r[6]=gc.z,r[10]=_c.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],ee=r[14],M=r[3],N=r[7],P=r[11],te=r[15];return i[0]=a*x+o*T+s*k+c*M,i[4]=a*S+o*E+s*A+c*N,i[8]=a*C+o*D+s*j+c*P,i[12]=a*w+o*O+s*ee+c*te,i[1]=l*x+u*T+d*k+f*M,i[5]=l*S+u*E+d*A+f*N,i[9]=l*C+u*D+d*j+f*P,i[13]=l*w+u*O+d*ee+f*te,i[2]=p*x+m*T+h*k+g*M,i[6]=p*S+m*E+h*A+g*N,i[10]=p*C+m*D+h*j+g*P,i[14]=p*w+m*O+h*ee+g*te,i[3]=_*x+v*T+y*k+b*M,i[7]=_*S+v*E+y*A+b*N,i[11]=_*C+v*D+y*j+b*P,i[15]=_*w+v*O+y*ee+b*te,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,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){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let 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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}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){let 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){let 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){let 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){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+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,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=dc.set(r[0],r[1],r[2]).length(),o=dc.set(r[4],r[5],r[6]).length(),s=dc.set(r[8],r[9],r[10]).length();i<0&&(a=-a),fc.copy(this);let c=1/a,l=1/o,u=1/s;return fc.elements[0]*=c,fc.elements[1]*=c,fc.elements[2]*=c,fc.elements[4]*=l,fc.elements[5]*=l,fc.elements[6]*=l,fc.elements[8]*=u,fc.elements[9]*=u,fc.elements[10]*=u,t.setFromRotationMatrix(fc),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=$o,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=$o,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])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){let 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}},dc=new Z,fc=new uc,pc=new Z(0,0,0),mc=new Z(1,1,1),hc=new Z,gc=new Z,_c=new Z,vc=new uc,yc=new Bs,bc=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,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){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(vs(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-vs(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(vs(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-vs(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(vs(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-vs(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:ss(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return vc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return yc.setFromEuler(this),this.setFromQuaternion(yc,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}};bc.DEFAULT_ORDER=`XYZ`;var xc=class{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))}},Sc=0,Cc=new Z,wc=new Bs,Tc=new uc,Ec=new Z,Dc=new Z,Oc=new Z,kc=new Bs,Ac=new Z(1,0,0),jc=new Z(0,1,0),Mc=new Z(0,0,1),Nc={type:`added`},Pc={type:`removed`},Fc={type:`childadded`,child:null},Ic={type:`childremoved`,child:null},Lc=class e extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Sc++}),this.uuid=_s(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new Z,n=new bc,r=new Bs,i=new Z(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new uc},normalMatrix:{value:new Us}}),this.matrix=new uc,this.matrixWorld=new uc,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new xc,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 wc.setFromAxisAngle(e,t),this.quaternion.multiply(wc),this}rotateOnWorldAxis(e,t){return wc.setFromAxisAngle(e,t),this.quaternion.premultiply(wc),this}rotateX(e){return this.rotateOnAxis(Ac,e)}rotateY(e){return this.rotateOnAxis(jc,e)}rotateZ(e){return this.rotateOnAxis(Mc,e)}translateOnAxis(e,t){return Cc.copy(e).applyQuaternion(this.quaternion),this.position.add(Cc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ac,e)}translateY(e){return this.translateOnAxis(jc,e)}translateZ(e){return this.translateOnAxis(Mc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Tc.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ec.copy(e):Ec.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Dc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Tc.lookAt(Dc,Ec,this.up):Tc.lookAt(Ec,Dc,this.up),this.quaternion.setFromRotationMatrix(Tc),r&&(Tc.extractRotation(r.matrixWorld),wc.setFromRotationMatrix(Tc),this.quaternion.premultiply(wc.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(cs(`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(Nc),Fc.child=e,this.dispatchEvent(Fc),Fc.child=null):cs(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Pc),Ic.child=e,this.dispatchEvent(Ic),Ic.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Tc.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Tc.multiply(e.parent.matrixWorld)),e.applyMatrix4(Tc),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Nc),Fc.child=e,this.dispatchEvent(Fc),Fc.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,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].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(Dc,e,Oc),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Dc,kc,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[10]*r}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);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.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){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let 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`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}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?null:e.pivot.clone(),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 t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};Lc.DEFAULT_UP=new Z(0,1,0),Lc.DEFAULT_MATRIX_AUTO_UPDATE=!0,Lc.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Rc=class extends Lc{constructor(){super(),this.isGroup=!0,this.type=`Group`}},zc={type:`move`},Bc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rc,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 Rc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z,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){let t=this._hand;if(t)for(let 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 r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(zc)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Rc;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Vc={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},Hc={h:0,s:0,l:0},Uc={h:0,s:0,l:0};function Wc(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Q=class{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){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=qo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Js.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Js.workingColorSpace){return this.r=e,this.g=t,this.b=n,Js.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Js.workingColorSpace){if(e=ys(e,1),t=vs(t,0,1),n=vs(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Wc(i,r,e+1/3),this.g=Wc(i,r,e),this.b=Wc(i,r,e-1/3)}return Js.colorSpaceToWorking(this,r),this}setStyle(e,t=qo){function n(t){t!==void 0&&parseFloat(t)<1&&ss(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:ss(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);ss(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=qo){let n=Vc[e.toLowerCase()];return n===void 0?ss(`Color: Unknown color `+e):this.setHex(n,t),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=Ys(e.r),this.g=Ys(e.g),this.b=Ys(e.b),this}copyLinearToSRGB(e){return this.r=Xs(e.r),this.g=Xs(e.g),this.b=Xs(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=qo){return Js.workingToColorSpace(Gc.copy(this),e),Math.round(vs(Gc.r*255,0,255))*65536+Math.round(vs(Gc.g*255,0,255))*256+Math.round(vs(Gc.b*255,0,255))}getHexString(e=qo){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Js.workingColorSpace){Js.workingToColorSpace(Gc.copy(this),t);let n=Gc.r,r=Gc.g,i=Gc.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Js.workingColorSpace){return Js.workingToColorSpace(Gc.copy(this),t),e.r=Gc.r,e.g=Gc.g,e.b=Gc.b,e}getStyle(e=qo){Js.workingToColorSpace(Gc.copy(this),e);let t=Gc.r,n=Gc.g,r=Gc.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Hc),this.setHSL(Hc.h+e,Hc.s+t,Hc.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(Hc),e.getHSL(Uc);let n=Ss(Hc.h,Uc.h,t),r=Ss(Hc.s,Uc.s,t),i=Ss(Hc.l,Uc.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,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}},Gc=new Q;Q.NAMES=Vc;var Kc=class extends Lc{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 bc,this.environmentIntensity=1,this.environmentRotation=new bc,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){let 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}},qc=new Z,Jc=new Z,Yc=new Z,Xc=new Z,Zc=new Z,Qc=new Z,$c=new Z,el=new Z,tl=new Z,nl=new Z,rl=new ac,il=new ac,al=new ac,ol=class e{constructor(e=new Z,t=new Z,n=new Z){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),qc.subVectors(e,t),r.cross(qc);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){qc.subVectors(r,t),Jc.subVectors(n,t),Yc.subVectors(e,t);let a=qc.dot(qc),o=qc.dot(Jc),s=qc.dot(Yc),c=Jc.dot(Jc),l=Jc.dot(Yc),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Xc)!==null&&Xc.x>=0&&Xc.y>=0&&Xc.x+Xc.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Xc)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Xc.x),s.addScaledVector(a,Xc.y),s.addScaledVector(o,Xc.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return rl.setScalar(0),il.setScalar(0),al.setScalar(0),rl.fromBufferAttribute(e,t),il.fromBufferAttribute(e,n),al.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(rl,i.x),a.addScaledVector(il,i.y),a.addScaledVector(al,i.z),a}static isFrontFacing(e,t,n,r){return qc.subVectors(n,t),Jc.subVectors(e,t),qc.cross(Jc).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 qc.subVectors(this.c,this.b),Jc.subVectors(this.a,this.b),qc.cross(Jc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Zc.subVectors(r,n),Qc.subVectors(i,n),el.subVectors(e,n);let s=Zc.dot(el),c=Qc.dot(el);if(s<=0&&c<=0)return t.copy(n);tl.subVectors(e,r);let l=Zc.dot(tl),u=Qc.dot(tl);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Zc,a);nl.subVectors(e,i);let f=Zc.dot(nl),p=Qc.dot(nl);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Qc,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return $c.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector($c,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Zc,a).addScaledVector(Qc,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},sl=class{constructor(e=new Z(1/0,1/0,1/0),t=new Z(-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(ll.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ll.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){let n=ll.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);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,ll):ll.fromBufferAttribute(r,t),ll.applyMatrix4(e.matrixWorld),this.expandByPoint(ll);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),ul.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),ul.copy(e.boundingBox)),ul.applyMatrix4(e.matrixWorld),this.union(ul)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],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,ll),ll.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(_l),vl.subVectors(this.max,_l),dl.subVectors(e.a,_l),fl.subVectors(e.b,_l),pl.subVectors(e.c,_l),ml.subVectors(fl,dl),hl.subVectors(pl,fl),gl.subVectors(dl,pl);let t=[0,-ml.z,ml.y,0,-hl.z,hl.y,0,-gl.z,gl.y,ml.z,0,-ml.x,hl.z,0,-hl.x,gl.z,0,-gl.x,-ml.y,ml.x,0,-hl.y,hl.x,0,-gl.y,gl.x,0];return!xl(t,dl,fl,pl,vl)||(t=[1,0,0,0,1,0,0,0,1],!xl(t,dl,fl,pl,vl))?!1:(yl.crossVectors(ml,hl),t=[yl.x,yl.y,yl.z],xl(t,dl,fl,pl,vl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ll).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ll).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:(cl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),cl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),cl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),cl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),cl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),cl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),cl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),cl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(cl),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}},cl=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],ll=new Z,ul=new sl,dl=new Z,fl=new Z,pl=new Z,ml=new Z,hl=new Z,gl=new Z,_l=new Z,vl=new Z,yl=new Z,bl=new Z;function xl(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){bl.fromArray(e,a);let o=i.x*Math.abs(bl.x)+i.y*Math.abs(bl.y)+i.z*Math.abs(bl.z),s=t.dot(bl),c=n.dot(bl),l=r.dot(bl);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Sl=Cl();function Cl(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function wl(e){Math.abs(e)>65504&&ss(`DataUtils.toHalfFloat(): Value out of range.`),e=vs(e,-65504,65504),Sl.floatView[0]=e;let t=Sl.uint32View[0],n=t>>23&511;return Sl.baseTable[n]+((t&8388607)>>Sl.shiftTable[n])}function Tl(e){let t=e>>10;return Sl.uint32View[0]=Sl.mantissaTable[Sl.offsetTable[t]+(e&1023)]+Sl.exponentTable[t],Sl.floatView[0]}var El=class{static toHalfFloat(e){return wl(e)}static fromHalfFloat(e){return Tl(e)}},Dl=new Z,Ol=new X,kl=0,Al=class extends fs{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:kl++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=Qo,this.updateRanges=[],this.gpuType=za,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 r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];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++)Ol.fromBufferAttribute(this,t),Ol.applyMatrix3(e),this.setXY(t,Ol.x,Ol.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.applyMatrix3(e),this.setXYZ(t,Dl.x,Dl.y,Dl.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.applyMatrix4(e),this.setXYZ(t,Dl.x,Dl.y,Dl.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.applyNormalMatrix(e),this.setXYZ(t,Dl.x,Dl.y,Dl.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Dl.fromBufferAttribute(this,t),Dl.transformDirection(e),this.setXYZ(t,Dl.x,Dl.y,Dl.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=Ls(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Rs(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ls(t,this.array)),t}setX(e,t){return this.normalized&&(t=Rs(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ls(t,this.array)),t}setY(e,t){return this.normalized&&(t=Rs(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=Ls(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Rs(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=Ls(t,this.array)),t}setW(e,t){return this.normalized&&(t=Rs(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array),i=Rs(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let 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!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},jl=class extends Al{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Ml=class extends Al{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Nl=class extends Al{constructor(e,t,n){super(new Float32Array(e),t,n)}},Pl=new sl,Fl=new Z,Il=new Z,Ll=class{constructor(e=new Z,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){let n=this.center;t===void 0?Pl.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),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){let 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){let 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*=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;Fl.subVectors(e,this.center);let t=Fl.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Fl,n/e),this.radius+=n}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):(Il.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Fl.copy(e.center).add(Il)),this.expandByPoint(Fl.copy(e.center).sub(Il))),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}},Rl=0,zl=new uc,Bl=new Lc,Vl=new Z,Hl=new sl,Ul=new sl,Wl=new Z,Gl=class e extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Rl++}),this.uuid=_s(),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 this.index=Array.isArray(e)?new(es(e)?Ml:jl)(e,1):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){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new Us().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return zl.makeRotationFromQuaternion(e),this.applyMatrix4(zl),this}rotateX(e){return zl.makeRotationX(e),this.applyMatrix4(zl),this}rotateY(e){return zl.makeRotationY(e),this.applyMatrix4(zl),this}rotateZ(e){return zl.makeRotationZ(e),this.applyMatrix4(zl),this}translate(e,t,n){return zl.makeTranslation(e,t,n),this.applyMatrix4(zl),this}scale(e,t,n){return zl.makeScale(e,t,n),this.applyMatrix4(zl),this}lookAt(e){return Bl.lookAt(e),Bl.updateMatrix(),this.applyMatrix4(Bl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vl).negate(),this.translate(Vl.x,Vl.y,Vl.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Nl(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&ss(`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 sl);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){cs(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Hl.setFromBufferAttribute(n),this.morphTargetsRelative?(Wl.addVectors(this.boundingBox.min,Hl.min),this.boundingBox.expandByPoint(Wl),Wl.addVectors(this.boundingBox.max,Hl.max),this.boundingBox.expandByPoint(Wl)):(this.boundingBox.expandByPoint(Hl.min),this.boundingBox.expandByPoint(Hl.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&cs(`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 Ll);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){cs(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new Z,1/0);return}if(e){let n=this.boundingSphere.center;if(Hl.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ul.setFromBufferAttribute(n),this.morphTargetsRelative?(Wl.addVectors(Hl.min,Ul.min),Hl.expandByPoint(Wl),Wl.addVectors(Hl.max,Ul.max),Hl.expandByPoint(Wl)):(Hl.expandByPoint(Ul.min),Hl.expandByPoint(Ul.max))}Hl.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Wl.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Wl));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Wl.fromBufferAttribute(a,t),o&&(Vl.fromBufferAttribute(e,t),Wl.add(Vl)),r=Math.max(r,n.distanceToSquared(Wl))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&cs(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){cs(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new Al(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new Z,s[e]=new Z;let c=new Z,l=new Z,u=new Z,d=new X,f=new X,p=new X,m=new Z,h=new Z;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new Z,y=new Z,b=new Z,x=new Z;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let 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 Al(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new Z,i=new Z,a=new Z,o=new Z,s=new Z,c=new Z,l=new Z,u=new Z;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Wl.fromBufferAttribute(e,t),Wl.normalize(),e.setXYZ(t,Wl.x,Wl.y,Wl.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new Al(a,r,i)}if(this.index===null)return ss(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let 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){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let 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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.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`})}},Kl=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=Qo,this.updateRanges=[],this.version=0,this.uuid=_s()}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=_s()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=_s()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},ql=new Z,Jl=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ql.fromBufferAttribute(this,t),ql.applyMatrix4(e),this.setXYZ(t,ql.x,ql.y,ql.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ql.fromBufferAttribute(this,t),ql.applyNormalMatrix(e),this.setXYZ(t,ql.x,ql.y,ql.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ql.fromBufferAttribute(this,t),ql.transformDirection(e),this.setXYZ(t,ql.x,ql.y,ql.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ls(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Rs(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Rs(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ls(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ls(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ls(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ls(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Rs(t,this.array),n=Rs(n,this.array),r=Rs(r,this.array),i=Rs(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){as(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Al(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){as(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},Yl=0,Xl=class extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Yl++}),this.uuid=_s(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Q(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Zo,this.stencilZFail=Zo,this.stencilZPass=Zo,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(let t in e){let n=e[t];if(n===void 0){ss(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){ss(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let 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!==1&&(n.blending=this.blending),this.side!==0&&(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!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(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!==3&&(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!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(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 r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}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 Q().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&&(this.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0: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 t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new X().fromArray(t)}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 X().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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].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++}},Zl=class extends Xl{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new Q(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!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.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Ql,$l=new Z,eu=new Z,tu=new Z,nu=new X,ru=new X,iu=new uc,au=new Z,ou=new Z,su=new Z,cu=new X,lu=new X,uu=new X,du=class extends Lc{constructor(e=new Zl){if(super(),this.isSprite=!0,this.type=`Sprite`,Ql===void 0){Ql=new Gl;let e=new Kl(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Ql.setIndex([0,1,2,0,2,3]),Ql.setAttribute(`position`,new Jl(e,3,0,!1)),Ql.setAttribute(`uv`,new Jl(e,2,3,!1))}this.geometry=Ql,this.material=e,this.center=new X(.5,.5),this.count=1}raycast(e,t){e.camera===null&&cs(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),eu.setFromMatrixScale(this.matrixWorld),iu.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),tu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&eu.multiplyScalar(-tu.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;fu(au.set(-.5,-.5,0),tu,a,eu,r,i),fu(ou.set(.5,-.5,0),tu,a,eu,r,i),fu(su.set(.5,.5,0),tu,a,eu,r,i),cu.set(0,0),lu.set(1,0),uu.set(1,1);let o=e.ray.intersectTriangle(au,ou,su,!1,$l);if(o===null&&(fu(ou.set(-.5,.5,0),tu,a,eu,r,i),lu.set(0,1),o=e.ray.intersectTriangle(au,su,ou,!1,$l),o===null))return;let s=e.ray.origin.distanceTo($l);s<e.near||s>e.far||t.push({distance:s,point:$l.clone(),uv:ol.getInterpolation($l,au,ou,su,cu,lu,uu,new X),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function fu(e,t,n,r,i,a){nu.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?ru.copy(nu):(ru.x=a*nu.x-i*nu.y,ru.y=i*nu.x+a*nu.y),e.copy(t),e.x+=ru.x,e.y+=ru.y,e.applyMatrix4(iu)}var pu=new Z,mu=new Z,hu=new Z,gu=new Z,_u=new Z,vu=new Z,yu=new Z,bu=class{constructor(e=new Z,t=new Z(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,pu)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let 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){let t=pu.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(pu.copy(this.origin).addScaledVector(this.direction,t),pu.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){mu.copy(e).add(t).multiplyScalar(.5),hu.copy(t).sub(e).normalize(),gu.copy(this.origin).sub(mu);let i=e.distanceTo(t)*.5,a=-this.direction.dot(hu),o=gu.dot(this.direction),s=-gu.dot(hu),c=gu.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(mu).addScaledVector(hu,d),f}intersectSphere(e,t){pu.subVectors(e.center,this.origin);let n=pu.dot(this.direction),r=pu.dot(pu)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,pu)!==null}intersectTriangle(e,t,n,r,i){_u.subVectors(t,e),vu.subVectors(n,e),yu.crossVectors(_u,vu);let a=this.direction.dot(yu),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;gu.subVectors(this.origin,e);let s=o*this.direction.dot(vu.crossVectors(gu,vu));if(s<0)return null;let c=o*this.direction.dot(_u.cross(gu));if(c<0||s+c>a)return null;let l=-o*gu.dot(yu);return l<0?null:this.at(l/a,i)}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)}},xu=class extends Xl{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Q(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 bc,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(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}},Su=new uc,Cu=new bu,wu=new Ll,Tu=new Z,Eu=new Z,Du=new Z,Ou=new Z,ku=new Z,Au=new Z,ju=new Z,Mu=new Z,Nu=class extends Lc{constructor(e=new Gl,t=new xu){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(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){Au.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(ku.fromBufferAttribute(s,e),a?Au.addScaledVector(ku,r):Au.addScaledVector(ku.sub(t),r))}t.add(Au)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),wu.copy(n.boundingSphere),wu.applyMatrix4(i),Cu.copy(e.ray).recast(e.near),!(wu.containsPoint(Cu.origin)===!1&&(Cu.intersectSphere(wu,Tu)===null||Cu.origin.distanceToSquared(Tu)>(e.far-e.near)**2))&&(Su.copy(i).invert(),Cu.copy(e.ray).applyMatrix4(Su),(n.boundingBox===null||Cu.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,Cu)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=Fu(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=Fu(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=Fu(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=Fu(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function Pu(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Mu.copy(s),Mu.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Mu);return l<n.near||l>n.far?null:{distance:l,point:Mu.clone(),object:e}}function Fu(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Eu),e.getVertexPosition(c,Du),e.getVertexPosition(l,Ou);let u=Pu(e,t,n,r,Eu,Du,Ou,ju);if(u){let e=new Z;ol.getBarycoord(ju,Eu,Du,Ou,e),i&&(u.uv=ol.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=ol.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=ol.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};ol.getNormal(Eu,Du,Ou,t.normal),u.face=t,u.barycoord=e}return u}var Iu=class extends ic{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Da,l=Da,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Lu=new Z,Ru=new Z,zu=new Us,Bu=class{constructor(e=new Z(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,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Lu.subVectors(n,t).cross(Ru.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){let r=e.delta(Lu),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let 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){let n=t||zu.getNormalMatrix(e),r=this.coplanarPoint(Lu).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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)}},Vu=new Ll,Hu=new X(.5,.5),Uu=new Z,Wu=class{constructor(e=new Bu,t=new Bu,n=new Bu,r=new Bu,i=new Bu,a=new Bu){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=$o,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Vu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vu)}intersectsSprite(e){return Vu.center.set(0,0,0),Vu.radius=.7071067811865476+Hu.distanceTo(e.center),Vu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vu)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(Uu.x=r.normal.x>0?e.max.x:e.min.x,Uu.y=r.normal.y>0?e.max.y:e.min.y,Uu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Uu)<0)return!1}return!0}containsPoint(e){let 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)}},Gu=class extends Xl{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new Q(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},Ku=new Z,qu=new Z,Ju=new uc,Yu=new bu,Xu=new Ll,Zu=new Z,Qu=new Z,$u=class extends Lc{constructor(e=new Gl,t=new Gu){super(),this.isLine=!0,this.type=`Line`,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}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)Ku.fromBufferAttribute(t,e-1),qu.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Ku.distanceTo(qu);e.setAttribute(`lineDistance`,new Nl(n,1))}else ss(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Xu.copy(n.boundingSphere),Xu.applyMatrix4(r),Xu.radius+=i,e.ray.intersectsSphere(Xu)===!1)return;Ju.copy(r).invert(),Yu.copy(e.ray).applyMatrix4(Ju);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=ed(this,e,Yu,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=ed(this,e,Yu,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=ed(this,e,Yu,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=ed(this,e,Yu,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function ed(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(Ku.fromBufferAttribute(s,i),qu.fromBufferAttribute(s,a),n.distanceSqToSegment(Ku,qu,Zu,Qu)>r)return;Zu.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Zu);if(!(c<t.near||c>t.far))return{distance:c,point:Qu.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var td=class extends Xl{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new Q(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}},nd=new uc,rd=new bu,id=new Ll,ad=new Z,od=class extends Lc{constructor(e=new Gl,t=new td){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){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),id.copy(n.boundingSphere),id.applyMatrix4(r),id.radius+=i,e.ray.intersectsSphere(id)===!1)return;nd.copy(r).invert(),rd.copy(e.ray).applyMatrix4(nd);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);ad.fromBufferAttribute(l,n),sd(ad,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)ad.fromBufferAttribute(l,a),sd(ad,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function sd(e,t,n,r,i,a,o){let s=rd.distanceSqToPoint(e);if(s<n){let n=new Z;rd.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var cd=class extends ic{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ld=class extends ic{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},ud=class extends ic{constructor(e,t,n=Ra,r,i,a,o=Da,s=Da,c,l=Ya,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ec(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},dd=class extends ud{constructor(e,t=Ra,n=301,r,i,a=Da,o=Da,s,c=Ya){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},fd=class extends ic{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},pd=class e extends Gl{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Nl(c,3)),this.setAttribute(`normal`,new Nl(l,3)),this.setAttribute(`uv`,new Nl(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},md=class e extends Gl{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=Math.PI*2){super(),this.type=`CylinderGeometry`,this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let c=this;r=Math.floor(r),i=Math.floor(i);let l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new Nl(u,3)),this.setAttribute(`normal`,new Nl(d,3)),this.setAttribute(`uv`,new Nl(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){let a=m[r][n],o=m[r+1][n],s=m[r+1][n+1],c=m[r][n+1];(e>0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=b+e;n===!0?l.push(r,r+1,t):l.push(r+1,r,t),_+=3}c.addGroup(g,_,n===!0?1:2),g+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},hd=new Z,gd=new Z,_d=new Z,vd=new ol,yd=class extends Gl{constructor(e=null,t=1){if(super(),this.type=`EdgesGeometry`,this.parameters={geometry:e,thresholdAngle:t},e!==null){let n=10**4,r=Math.cos(hs*t),i=e.getIndex(),a=e.getAttribute(`position`),o=i?i.count:a.count,s=[0,0,0],c=[`a`,`b`,`c`],l=[,,,],u={},d=[];for(let e=0;e<o;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:o,c:f}=vd;if(t.fromBufferAttribute(a,s[0]),o.fromBufferAttribute(a,s[1]),f.fromBufferAttribute(a,s[2]),vd.getNormal(_d),l[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,l[1]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,l[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],i=l[t],a=vd[c[e]],o=vd[c[t]],f=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(_d.dot(u[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(o.x,o.y,o.z)),u[p]=null):f in u||(u[f]={index0:s[e],index1:s[t],normal:_d.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:n}=u[e];hd.fromBufferAttribute(a,t),gd.fromBufferAttribute(a,n),d.push(hd.x,hd.y,hd.z),d.push(gd.x,gd.y,gd.z)}this.setAttribute(`position`,new Nl(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},bd=class e extends Gl{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Nl(p,3)),this.setAttribute(`normal`,new Nl(m,3)),this.setAttribute(`uv`,new Nl(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},xd=class extends Gl{constructor(e=null){if(super(),this.type=`WireframeGeometry`,this.parameters={geometry:e},e!==null){let t=[],n=new Set,r=new Z,i=new Z;if(e.index!==null){let a=e.attributes.position,o=e.index,s=e.groups;s.length===0&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,c=s.length;e<c;++e){let c=s[e],l=c.start,u=c.count;for(let e=l,s=l+u;e<s;e+=3)for(let s=0;s<3;s++){let c=o.getX(e+s),l=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,l),Sd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{let a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){let s=3*e+o,c=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),Sd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute(`position`,new Nl(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function Sd(e,t,n){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}function Cd(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(Td(i))i.isRenderTargetTexture?(ss(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i))if(Td(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice();else t[n][r]=i}}return t}function wd(e){let t={};for(let n=0;n<e.length;n++){let r=Cd(e[n]);for(let e in r)t[e]=r[e]}return t}function Td(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function Ed(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function Dd(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Js.workingColorSpace}var Od={clone:Cd,merge:wd},kd=`void main() {
2
2
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3
3
  }`,Ad=`void main() {
4
4
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );