@selvajs/selva 2.0.10 → 2.0.11

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 (326) hide show
  1. package/build/client/_app/immutable/chunks/{Bgf48GEj.js → C7vGxU6A.js} +1 -1
  2. package/build/client/_app/immutable/chunks/C7vGxU6A.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/C7vGxU6A.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/{CGG8rM-6.js → CQbfyd2L.js} +1 -1
  5. package/build/client/_app/immutable/chunks/CQbfyd2L.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/CQbfyd2L.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/{CQQ--RFk.js → DhVbSqkb.js} +1 -1
  8. package/build/client/_app/immutable/chunks/DhVbSqkb.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/DhVbSqkb.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/{A6Vs_oZV.js → DmaxIj00.js} +1 -1
  11. package/build/client/_app/immutable/chunks/DmaxIj00.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/DmaxIj00.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/m_mdPJGt.js +3 -0
  14. package/build/client/_app/immutable/chunks/m_mdPJGt.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/m_mdPJGt.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/{DaXfFNFB.js → o98Aze-n.js} +1 -1
  17. package/build/client/_app/immutable/chunks/o98Aze-n.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/o98Aze-n.js.gz +0 -0
  19. package/build/client/_app/immutable/entry/{app.CKMPJJRF.js → app.BTWTTuAm.js} +2 -2
  20. package/build/client/_app/immutable/entry/app.BTWTTuAm.js.br +0 -0
  21. package/build/client/_app/immutable/entry/app.BTWTTuAm.js.gz +0 -0
  22. package/build/client/_app/immutable/entry/start.BH_CUTR9.js +1 -0
  23. package/build/client/_app/immutable/entry/start.BH_CUTR9.js.br +2 -0
  24. package/build/client/_app/immutable/entry/start.BH_CUTR9.js.gz +0 -0
  25. package/build/client/_app/immutable/nodes/{1.CBSGNp0x.js → 1.DwOSHATI.js} +1 -1
  26. package/build/client/_app/immutable/nodes/1.DwOSHATI.js.br +0 -0
  27. package/build/client/_app/immutable/nodes/1.DwOSHATI.js.gz +0 -0
  28. package/build/client/_app/immutable/nodes/{11.D8vq6hbM.js → 11.Zly9hDVc.js} +1 -1
  29. package/build/client/_app/immutable/nodes/11.Zly9hDVc.js.br +0 -0
  30. package/build/client/_app/immutable/nodes/{11.D8vq6hbM.js.gz → 11.Zly9hDVc.js.gz} +0 -0
  31. package/build/client/_app/immutable/nodes/{13.CAeK6ncz.js → 13.DPp5H0wF.js} +1 -1
  32. package/build/client/_app/immutable/nodes/13.DPp5H0wF.js.br +0 -0
  33. package/build/client/_app/immutable/nodes/13.DPp5H0wF.js.gz +0 -0
  34. package/build/client/_app/immutable/nodes/{14.BQgMKGR9.js → 14.Ckr1Pg-5.js} +1 -1
  35. package/build/client/_app/immutable/nodes/14.Ckr1Pg-5.js.br +0 -0
  36. package/build/client/_app/immutable/nodes/14.Ckr1Pg-5.js.gz +0 -0
  37. package/build/client/_app/immutable/nodes/{16.COqS-C2g.js → 16.D28cXk6c.js} +1 -1
  38. package/build/client/_app/immutable/nodes/16.D28cXk6c.js.br +0 -0
  39. package/build/client/_app/immutable/nodes/16.D28cXk6c.js.gz +0 -0
  40. package/build/client/_app/immutable/nodes/{17.DFOKDpKT.js → 17.zVEt35IE.js} +1 -1
  41. package/build/client/_app/immutable/nodes/17.zVEt35IE.js.br +0 -0
  42. package/build/client/_app/immutable/nodes/17.zVEt35IE.js.gz +0 -0
  43. package/build/client/_app/immutable/nodes/{19.Dvf5ii3B.js → 19.BVpcFyka.js} +1 -1
  44. package/build/client/_app/immutable/nodes/19.BVpcFyka.js.br +0 -0
  45. package/build/client/_app/immutable/nodes/19.BVpcFyka.js.gz +0 -0
  46. package/build/client/_app/immutable/nodes/{2.B4hNrAp8.js → 2.CQHOuONl.js} +1 -1
  47. package/build/client/_app/immutable/nodes/2.CQHOuONl.js.br +0 -0
  48. package/build/client/_app/immutable/nodes/2.CQHOuONl.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/{20.DXexjElq.js → 20.BCewwiaR.js} +1 -1
  50. package/build/client/_app/immutable/nodes/20.BCewwiaR.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/20.BCewwiaR.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/21.BsayWLjJ.js +4 -0
  53. package/build/client/_app/immutable/nodes/21.BsayWLjJ.js.br +0 -0
  54. package/build/client/_app/immutable/nodes/21.BsayWLjJ.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/{23.DuFwz8Vn.js → 23.DqdpBgOG.js} +1 -1
  56. package/build/client/_app/immutable/nodes/23.DqdpBgOG.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/23.DqdpBgOG.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/{24.DxzLaZvY.js → 24.PfN1WmGB.js} +1 -1
  59. package/build/client/_app/immutable/nodes/24.PfN1WmGB.js.br +0 -0
  60. package/build/client/_app/immutable/nodes/24.PfN1WmGB.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{27.BuC47dzM.js → 27.ps76gC2y.js} +1 -1
  62. package/build/client/_app/immutable/nodes/27.ps76gC2y.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/27.ps76gC2y.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/{28.C_uTKWGO.js → 28.jwW5ZPBb.js} +1 -1
  65. package/build/client/_app/immutable/nodes/28.jwW5ZPBb.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/28.jwW5ZPBb.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{29.8zDETWDm.js → 29.C4UksAwf.js} +1 -1
  68. package/build/client/_app/immutable/nodes/29.C4UksAwf.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/29.C4UksAwf.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/{3.Bfn3gVJk.js → 3.DeyGtotz.js} +1 -1
  71. package/build/client/_app/immutable/nodes/3.DeyGtotz.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/3.DeyGtotz.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/{30.e6k62qmr.js → 30.Ba8GVvTS.js} +1 -1
  74. package/build/client/_app/immutable/nodes/30.Ba8GVvTS.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/30.Ba8GVvTS.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{5.BuIfvCG_.js → 5.CEzlqY4U.js} +1 -1
  77. package/build/client/_app/immutable/nodes/5.CEzlqY4U.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/5.CEzlqY4U.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{6.7n3uXlRb.js → 6.CUbjblGG.js} +1 -1
  80. package/build/client/_app/immutable/nodes/6.CUbjblGG.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/6.CUbjblGG.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/{7.hY96lcAK.js → 7.C7uFakzg.js} +1 -1
  83. package/build/client/_app/immutable/nodes/7.C7uFakzg.js.br +0 -0
  84. package/build/client/_app/immutable/nodes/7.C7uFakzg.js.gz +0 -0
  85. package/build/client/_app/immutable/nodes/{8.BJVGDvKO.js → 8.DV-QvL-P.js} +1 -1
  86. package/build/client/_app/immutable/nodes/8.DV-QvL-P.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/8.DV-QvL-P.js.gz +0 -0
  88. package/build/client/_app/immutable/nodes/9.Cowm-e34.js +1 -0
  89. package/build/client/_app/immutable/nodes/9.Cowm-e34.js.br +0 -0
  90. package/build/client/_app/immutable/nodes/9.Cowm-e34.js.gz +0 -0
  91. package/build/client/_app/version.json +1 -1
  92. package/build/client/_app/version.json.br +0 -0
  93. package/build/client/_app/version.json.gz +0 -0
  94. package/build/server/chunks/{0-BwkJawM9.js → 0-Dr_3KI7H.js} +2 -2
  95. package/build/server/chunks/{0-BwkJawM9.js.map → 0-Dr_3KI7H.js.map} +1 -1
  96. package/build/server/chunks/{1-DHXobBGu.js → 1-DpVveeAx.js} +2 -2
  97. package/build/server/chunks/{1-DHXobBGu.js.map → 1-DpVveeAx.js.map} +1 -1
  98. package/build/server/chunks/{10-B96sdHm3.js → 10-2TpR0PL8.js} +4 -4
  99. package/build/server/chunks/{10-B96sdHm3.js.map → 10-2TpR0PL8.js.map} +1 -1
  100. package/build/server/chunks/{11-BDWsB0ko.js → 11-Bc-lK9-m.js} +6 -6
  101. package/build/server/chunks/{11-BDWsB0ko.js.map → 11-Bc-lK9-m.js.map} +1 -1
  102. package/build/server/chunks/{12-Djatn5UB.js → 12-ChbvAloo.js} +2 -2
  103. package/build/server/chunks/{12-Djatn5UB.js.map → 12-ChbvAloo.js.map} +1 -1
  104. package/build/server/chunks/{13-C2yj7_Mb.js → 13-Dlj23jh3.js} +3 -3
  105. package/build/server/chunks/{13-C2yj7_Mb.js.map → 13-Dlj23jh3.js.map} +1 -1
  106. package/build/server/chunks/{14-BQlCNoCl.js → 14-D1elkPr9.js} +3 -3
  107. package/build/server/chunks/{14-BQlCNoCl.js.map → 14-D1elkPr9.js.map} +1 -1
  108. package/build/server/chunks/{15-CHrs6UVa.js → 15-DPDMpQHT.js} +3 -3
  109. package/build/server/chunks/{15-CHrs6UVa.js.map → 15-DPDMpQHT.js.map} +1 -1
  110. package/build/server/chunks/{16-CgRtwJn8.js → 16-BAIR1y-G.js} +5 -5
  111. package/build/server/chunks/{16-CgRtwJn8.js.map → 16-BAIR1y-G.js.map} +1 -1
  112. package/build/server/chunks/{17-BQigDlDw.js → 17-Bgy8wV-3.js} +2 -2
  113. package/build/server/chunks/{17-BQigDlDw.js.map → 17-Bgy8wV-3.js.map} +1 -1
  114. package/build/server/chunks/{18-ZllBwU0v.js → 18-B12TC_xG.js} +2 -2
  115. package/build/server/chunks/{18-ZllBwU0v.js.map → 18-B12TC_xG.js.map} +1 -1
  116. package/build/server/chunks/{19-rqqB4i4s.js → 19-DFUJ-cPC.js} +3 -3
  117. package/build/server/chunks/{19-rqqB4i4s.js.map → 19-DFUJ-cPC.js.map} +1 -1
  118. package/build/server/chunks/{2-BYd4MZUE.js → 2-C5cHr5Wg.js} +5 -5
  119. package/build/server/chunks/{2-BYd4MZUE.js.map → 2-C5cHr5Wg.js.map} +1 -1
  120. package/build/server/chunks/{20-DooF4BHq.js → 20-7IiGDCfi.js} +9 -9
  121. package/build/server/chunks/{20-DooF4BHq.js.map → 20-7IiGDCfi.js.map} +1 -1
  122. package/build/server/chunks/{21-BNS0VEZs.js → 21-CNigSlHO.js} +16 -7
  123. package/build/server/chunks/21-CNigSlHO.js.map +1 -0
  124. package/build/server/chunks/{23-CrylGvWo.js → 23-Co-jOKsq.js} +6 -6
  125. package/build/server/chunks/{23-CrylGvWo.js.map → 23-Co-jOKsq.js.map} +1 -1
  126. package/build/server/chunks/{24-DX03r0Ku.js → 24-DvOkSXb5.js} +4 -4
  127. package/build/server/chunks/{24-DX03r0Ku.js.map → 24-DvOkSXb5.js.map} +1 -1
  128. package/build/server/chunks/{25-DaOQwMkm.js → 25-CryepyT_.js} +2 -2
  129. package/build/server/chunks/{25-DaOQwMkm.js.map → 25-CryepyT_.js.map} +1 -1
  130. package/build/server/chunks/{27-BumS-Wey.js → 27-DtqBEyra.js} +4 -4
  131. package/build/server/chunks/{27-BumS-Wey.js.map → 27-DtqBEyra.js.map} +1 -1
  132. package/build/server/chunks/{28-Bs0ilm4z.js → 28-nphTAiOz.js} +3 -3
  133. package/build/server/chunks/{28-Bs0ilm4z.js.map → 28-nphTAiOz.js.map} +1 -1
  134. package/build/server/chunks/{29-eOSgz-Q6.js → 29-qD2ff8yc.js} +3 -3
  135. package/build/server/chunks/{29-eOSgz-Q6.js.map → 29-qD2ff8yc.js.map} +1 -1
  136. package/build/server/chunks/{3-C1Hnunxq.js → 3-C1ShQmRn.js} +2 -2
  137. package/build/server/chunks/{3-C1Hnunxq.js.map → 3-C1ShQmRn.js.map} +1 -1
  138. package/build/server/chunks/{30-B_fYQ406.js → 30-DWf41Hl_.js} +3 -3
  139. package/build/server/chunks/{30-B_fYQ406.js.map → 30-DWf41Hl_.js.map} +1 -1
  140. package/build/server/chunks/{31-B1XsXSZ-.js → 31-S98r5Afv.js} +2 -2
  141. package/build/server/chunks/{31-B1XsXSZ-.js.map → 31-S98r5Afv.js.map} +1 -1
  142. package/build/server/chunks/{32-Dczg8t26.js → 32-EvYDgnSw.js} +2 -2
  143. package/build/server/chunks/{32-Dczg8t26.js.map → 32-EvYDgnSw.js.map} +1 -1
  144. package/build/server/chunks/{5-Bhs6XBN_.js → 5-DTeumakx.js} +2 -2
  145. package/build/server/chunks/{5-Bhs6XBN_.js.map → 5-DTeumakx.js.map} +1 -1
  146. package/build/server/chunks/{6-DQiiyzxX.js → 6-BYo6Qo8b.js} +3 -3
  147. package/build/server/chunks/{6-DQiiyzxX.js.map → 6-BYo6Qo8b.js.map} +1 -1
  148. package/build/server/chunks/{7-Mh6-dFfT.js → 7-qSmAP9RY.js} +2 -2
  149. package/build/server/chunks/{7-Mh6-dFfT.js.map → 7-qSmAP9RY.js.map} +1 -1
  150. package/build/server/chunks/{8-tu9jPKDH.js → 8-DeuHkUMB.js} +3 -3
  151. package/build/server/chunks/{8-tu9jPKDH.js.map → 8-DeuHkUMB.js.map} +1 -1
  152. package/build/server/chunks/{9-Blq9VO5M.js → 9-g6Y-orbL.js} +4 -4
  153. package/build/server/chunks/{9-Blq9VO5M.js.map → 9-g6Y-orbL.js.map} +1 -1
  154. package/build/server/chunks/{_page.svelte-DSpONoJg.js → _page.svelte-CqD36W22.js} +10 -3
  155. package/build/server/chunks/_page.svelte-CqD36W22.js.map +1 -0
  156. package/build/server/chunks/{_page.svelte-DFumYbGi.js → _page.svelte-ewKjgRGP.js} +5 -5
  157. package/build/server/chunks/_page.svelte-ewKjgRGP.js.map +1 -0
  158. package/build/server/chunks/{_server.ts-HHpSHV0x.js → _server.ts-8QjiYm48.js} +4 -4
  159. package/build/server/chunks/{_server.ts-HHpSHV0x.js.map → _server.ts-8QjiYm48.js.map} +1 -1
  160. package/build/server/chunks/{_server.ts-DFSeb1Vi.js → _server.ts-BB8U11yC.js} +4 -4
  161. package/build/server/chunks/{_server.ts-DFSeb1Vi.js.map → _server.ts-BB8U11yC.js.map} +1 -1
  162. package/build/server/chunks/{_server.ts-DqAlXFFH.js → _server.ts-BNhuuE9J.js} +6 -6
  163. package/build/server/chunks/{_server.ts-DqAlXFFH.js.map → _server.ts-BNhuuE9J.js.map} +1 -1
  164. package/build/server/chunks/{_server.ts-Cw0SJh0B.js → _server.ts-BctA3275.js} +4 -4
  165. package/build/server/chunks/{_server.ts-Cw0SJh0B.js.map → _server.ts-BctA3275.js.map} +1 -1
  166. package/build/server/chunks/{_server.ts-B8Klg9b0.js → _server.ts-C72MeQO4.js} +2 -2
  167. package/build/server/chunks/{_server.ts-B8Klg9b0.js.map → _server.ts-C72MeQO4.js.map} +1 -1
  168. package/build/server/chunks/{_server.ts-CWhAZS7d.js → _server.ts-C9Y8O11v.js} +4 -4
  169. package/build/server/chunks/{_server.ts-CWhAZS7d.js.map → _server.ts-C9Y8O11v.js.map} +1 -1
  170. package/build/server/chunks/{_server.ts-BJxv0nGq.js → _server.ts-CBXJ3sWT.js} +4 -4
  171. package/build/server/chunks/{_server.ts-BJxv0nGq.js.map → _server.ts-CBXJ3sWT.js.map} +1 -1
  172. package/build/server/chunks/{_server.ts-DA0Lq54y.js → _server.ts-CBupEVgc.js} +3 -3
  173. package/build/server/chunks/{_server.ts-DA0Lq54y.js.map → _server.ts-CBupEVgc.js.map} +1 -1
  174. package/build/server/chunks/{_server.ts-DHk_Z16q.js → _server.ts-CCaOj5qQ.js} +4 -4
  175. package/build/server/chunks/{_server.ts-DHk_Z16q.js.map → _server.ts-CCaOj5qQ.js.map} +1 -1
  176. package/build/server/chunks/{_server.ts-CU_uO5Be.js → _server.ts-CVDCtecg.js} +4 -4
  177. package/build/server/chunks/{_server.ts-CU_uO5Be.js.map → _server.ts-CVDCtecg.js.map} +1 -1
  178. package/build/server/chunks/{_server.ts-CWgMDUW5.js → _server.ts-CYRzm3Te.js} +4 -4
  179. package/build/server/chunks/{_server.ts-CWgMDUW5.js.map → _server.ts-CYRzm3Te.js.map} +1 -1
  180. package/build/server/chunks/{_server.ts-CXxbYs18.js → _server.ts-CapRJaU0.js} +4 -4
  181. package/build/server/chunks/{_server.ts-CXxbYs18.js.map → _server.ts-CapRJaU0.js.map} +1 -1
  182. package/build/server/chunks/{_server.ts-CYg1-gUK.js → _server.ts-CffaoluO.js} +4 -4
  183. package/build/server/chunks/{_server.ts-CYg1-gUK.js.map → _server.ts-CffaoluO.js.map} +1 -1
  184. package/build/server/chunks/{_server.ts-BauREevi.js → _server.ts-Ci4bczRU.js} +3 -3
  185. package/build/server/chunks/{_server.ts-BauREevi.js.map → _server.ts-Ci4bczRU.js.map} +1 -1
  186. package/build/server/chunks/{_server.ts-CoEHLvhd.js → _server.ts-D0jpDtY6.js} +7 -7
  187. package/build/server/chunks/{_server.ts-CoEHLvhd.js.map → _server.ts-D0jpDtY6.js.map} +1 -1
  188. package/build/server/chunks/{_server.ts-Dty-h13-.js → _server.ts-D3U55JtM.js} +5 -5
  189. package/build/server/chunks/{_server.ts-Dty-h13-.js.map → _server.ts-D3U55JtM.js.map} +1 -1
  190. package/build/server/chunks/{_server.ts-BZI6uyQW.js → _server.ts-DA2gHOEv.js} +4 -4
  191. package/build/server/chunks/{_server.ts-BZI6uyQW.js.map → _server.ts-DA2gHOEv.js.map} +1 -1
  192. package/build/server/chunks/{_server.ts-DMQx2USs.js → _server.ts-DH46mwMu.js} +4 -4
  193. package/build/server/chunks/{_server.ts-DMQx2USs.js.map → _server.ts-DH46mwMu.js.map} +1 -1
  194. package/build/server/chunks/{_server.ts-wKzFLxYm.js → _server.ts-DIA0nypE.js} +4 -4
  195. package/build/server/chunks/{_server.ts-wKzFLxYm.js.map → _server.ts-DIA0nypE.js.map} +1 -1
  196. package/build/server/chunks/{_server.ts-Bv7Vz5Xn.js → _server.ts-DIDUPMUT.js} +4 -4
  197. package/build/server/chunks/{_server.ts-Bv7Vz5Xn.js.map → _server.ts-DIDUPMUT.js.map} +1 -1
  198. package/build/server/chunks/{_server.ts-B9dyak6S.js → _server.ts-DLL3XSZW.js} +5 -5
  199. package/build/server/chunks/{_server.ts-B9dyak6S.js.map → _server.ts-DLL3XSZW.js.map} +1 -1
  200. package/build/server/chunks/{_server.ts-Dnhj7lwZ.js → _server.ts-DT5OwjDI.js} +4 -4
  201. package/build/server/chunks/{_server.ts-Dnhj7lwZ.js.map → _server.ts-DT5OwjDI.js.map} +1 -1
  202. package/build/server/chunks/{_server.ts-BNeRrZiC.js → _server.ts-DZfNclhh.js} +4 -4
  203. package/build/server/chunks/{_server.ts-BNeRrZiC.js.map → _server.ts-DZfNclhh.js.map} +1 -1
  204. package/build/server/chunks/{_server.ts-HtL-WwFA.js → _server.ts-DkekkLe3.js} +4 -4
  205. package/build/server/chunks/{_server.ts-HtL-WwFA.js.map → _server.ts-DkekkLe3.js.map} +1 -1
  206. package/build/server/chunks/{_server.ts-JUsPxh3B.js → _server.ts-DqSYGJwj.js} +4 -4
  207. package/build/server/chunks/{_server.ts-JUsPxh3B.js.map → _server.ts-DqSYGJwj.js.map} +1 -1
  208. package/build/server/chunks/{_server.ts-CRWYKoKH.js → _server.ts-Dvw_Z0Cw.js} +4 -4
  209. package/build/server/chunks/{_server.ts-CRWYKoKH.js.map → _server.ts-Dvw_Z0Cw.js.map} +1 -1
  210. package/build/server/chunks/{_server.ts-C6-TzfcL.js → _server.ts-L9E2K0UZ.js} +4 -4
  211. package/build/server/chunks/{_server.ts-C6-TzfcL.js.map → _server.ts-L9E2K0UZ.js.map} +1 -1
  212. package/build/server/chunks/{_server.ts-DZIvAAI3.js → _server.ts-OFmjL3-M.js} +4 -4
  213. package/build/server/chunks/{_server.ts-DZIvAAI3.js.map → _server.ts-OFmjL3-M.js.map} +1 -1
  214. package/build/server/chunks/{_server.ts-CasH9SwH.js → _server.ts-PFG4aGE3.js} +4 -4
  215. package/build/server/chunks/{_server.ts-CasH9SwH.js.map → _server.ts-PFG4aGE3.js.map} +1 -1
  216. package/build/server/chunks/{_server.ts-CeMGFK8t.js → _server.ts-SVtgpOfH.js} +3 -3
  217. package/build/server/chunks/{_server.ts-CeMGFK8t.js.map → _server.ts-SVtgpOfH.js.map} +1 -1
  218. package/build/server/chunks/{_server.ts-DEwvCClL.js → _server.ts-YJbrc522.js} +4 -4
  219. package/build/server/chunks/{_server.ts-DEwvCClL.js.map → _server.ts-YJbrc522.js.map} +1 -1
  220. package/build/server/chunks/{_server.ts-BOkX-0DJ.js → _server.ts-bN4Lz9RH.js} +4 -4
  221. package/build/server/chunks/{_server.ts-BOkX-0DJ.js.map → _server.ts-bN4Lz9RH.js.map} +1 -1
  222. package/build/server/chunks/{_server.ts-CM4bU3nb.js → _server.ts-bnATlqbs.js} +5 -5
  223. package/build/server/chunks/{_server.ts-CM4bU3nb.js.map → _server.ts-bnATlqbs.js.map} +1 -1
  224. package/build/server/chunks/{_server.ts-HrxAWCu8.js → _server.ts-eUYIsIFa.js} +4 -4
  225. package/build/server/chunks/{_server.ts-HrxAWCu8.js.map → _server.ts-eUYIsIFa.js.map} +1 -1
  226. package/build/server/chunks/{_server.ts-BzyWxO2V.js → _server.ts-pQtrhbNR.js} +5 -5
  227. package/build/server/chunks/{_server.ts-BzyWxO2V.js.map → _server.ts-pQtrhbNR.js.map} +1 -1
  228. package/build/server/chunks/{_server.ts-B-Q-Ll-v.js → _server.ts-tZLezQ2K.js} +4 -4
  229. package/build/server/chunks/{_server.ts-B-Q-Ll-v.js.map → _server.ts-tZLezQ2K.js.map} +1 -1
  230. package/build/server/chunks/{_server.ts-CJ3r_HVJ.js → _server.ts-yWNI61C2.js} +5 -5
  231. package/build/server/chunks/{_server.ts-CJ3r_HVJ.js.map → _server.ts-yWNI61C2.js.map} +1 -1
  232. package/build/server/chunks/{_server.ts-B1Y6yftf.js → _server.ts-z7zvXa1n.js} +3 -3
  233. package/build/server/chunks/{_server.ts-B1Y6yftf.js.map → _server.ts-z7zvXa1n.js.map} +1 -1
  234. package/build/server/chunks/{access.server-Cpz6F2ZC.js → access.server-BIbrdwtI.js} +3 -3
  235. package/build/server/chunks/{access.server-Cpz6F2ZC.js.map → access.server-BIbrdwtI.js.map} +1 -1
  236. package/build/server/chunks/{api-errors-CBEdAg2T.js → api-errors-Dvd_bb0g.js} +2 -2
  237. package/build/server/chunks/{api-errors-CBEdAg2T.js.map → api-errors-Dvd_bb0g.js.map} +1 -1
  238. package/build/server/chunks/{auth-bootstrap.server-BnBerntQ.js → auth-bootstrap.server-B93MMm50.js} +2 -2
  239. package/build/server/chunks/{auth-bootstrap.server-BnBerntQ.js.map → auth-bootstrap.server-B93MMm50.js.map} +1 -1
  240. package/build/server/chunks/{bootHealth.server-XLXnMQ_j.js → bootHealth.server-CCMjOn0m.js} +2 -2
  241. package/build/server/chunks/{bootHealth.server-XLXnMQ_j.js.map → bootHealth.server-CCMjOn0m.js.map} +1 -1
  242. package/build/server/chunks/{hooks.server-CWpJXpT3.js → hooks.server-BEJK3uzD.js} +15 -6
  243. package/build/server/chunks/hooks.server-BEJK3uzD.js.map +1 -0
  244. package/build/server/chunks/{permissions.server-zTQc77dD.js → permissions.server-Bfvp6EaK.js} +2 -2
  245. package/build/server/chunks/{permissions.server-zTQc77dD.js.map → permissions.server-Bfvp6EaK.js.map} +1 -1
  246. package/build/server/chunks/{providers.server-D1dTI3cw.js → providers.server-CuhJFeVB.js} +15 -2
  247. package/build/server/chunks/providers.server-CuhJFeVB.js.map +1 -0
  248. package/build/server/chunks/{resolve.server-DmsjqGqj.js → resolve.server-ButnJP6T.js} +3 -3
  249. package/build/server/chunks/{resolve.server-DmsjqGqj.js.map → resolve.server-ButnJP6T.js.map} +1 -1
  250. package/build/server/chunks/{resolve.server2-WBINVOER.js → resolve.server2-BniR9tSC.js} +2 -2
  251. package/build/server/chunks/{resolve.server2-WBINVOER.js.map → resolve.server2-BniR9tSC.js.map} +1 -1
  252. package/build/server/chunks/{utils2-fF4hylrs.js → utils2-BZ2tVtxn.js} +2 -2
  253. package/build/server/chunks/{utils2-fF4hylrs.js.map → utils2-BZ2tVtxn.js.map} +1 -1
  254. package/build/server/index.js +2 -2
  255. package/build/server/index.js.map +1 -1
  256. package/build/server/manifest.js +69 -69
  257. package/build/server/manifest.js.map +1 -1
  258. package/package.json +3 -3
  259. package/build/client/_app/immutable/chunks/A6Vs_oZV.js.br +0 -0
  260. package/build/client/_app/immutable/chunks/A6Vs_oZV.js.gz +0 -0
  261. package/build/client/_app/immutable/chunks/Bgf48GEj.js.br +0 -0
  262. package/build/client/_app/immutable/chunks/Bgf48GEj.js.gz +0 -0
  263. package/build/client/_app/immutable/chunks/CGG8rM-6.js.br +0 -0
  264. package/build/client/_app/immutable/chunks/CGG8rM-6.js.gz +0 -0
  265. package/build/client/_app/immutable/chunks/CQQ--RFk.js.br +0 -0
  266. package/build/client/_app/immutable/chunks/CQQ--RFk.js.gz +0 -0
  267. package/build/client/_app/immutable/chunks/CTEi7jkr.js +0 -3
  268. package/build/client/_app/immutable/chunks/CTEi7jkr.js.br +0 -0
  269. package/build/client/_app/immutable/chunks/CTEi7jkr.js.gz +0 -0
  270. package/build/client/_app/immutable/chunks/DaXfFNFB.js.br +0 -0
  271. package/build/client/_app/immutable/chunks/DaXfFNFB.js.gz +0 -0
  272. package/build/client/_app/immutable/entry/app.CKMPJJRF.js.br +0 -0
  273. package/build/client/_app/immutable/entry/app.CKMPJJRF.js.gz +0 -0
  274. package/build/client/_app/immutable/entry/start.BNxKlw9Q.js +0 -1
  275. package/build/client/_app/immutable/entry/start.BNxKlw9Q.js.br +0 -2
  276. package/build/client/_app/immutable/entry/start.BNxKlw9Q.js.gz +0 -0
  277. package/build/client/_app/immutable/nodes/1.CBSGNp0x.js.br +0 -0
  278. package/build/client/_app/immutable/nodes/1.CBSGNp0x.js.gz +0 -0
  279. package/build/client/_app/immutable/nodes/11.D8vq6hbM.js.br +0 -0
  280. package/build/client/_app/immutable/nodes/13.CAeK6ncz.js.br +0 -0
  281. package/build/client/_app/immutable/nodes/13.CAeK6ncz.js.gz +0 -0
  282. package/build/client/_app/immutable/nodes/14.BQgMKGR9.js.br +0 -0
  283. package/build/client/_app/immutable/nodes/14.BQgMKGR9.js.gz +0 -0
  284. package/build/client/_app/immutable/nodes/16.COqS-C2g.js.br +0 -0
  285. package/build/client/_app/immutable/nodes/16.COqS-C2g.js.gz +0 -0
  286. package/build/client/_app/immutable/nodes/17.DFOKDpKT.js.br +0 -0
  287. package/build/client/_app/immutable/nodes/17.DFOKDpKT.js.gz +0 -0
  288. package/build/client/_app/immutable/nodes/19.Dvf5ii3B.js.br +0 -0
  289. package/build/client/_app/immutable/nodes/19.Dvf5ii3B.js.gz +0 -0
  290. package/build/client/_app/immutable/nodes/2.B4hNrAp8.js.br +0 -0
  291. package/build/client/_app/immutable/nodes/2.B4hNrAp8.js.gz +0 -0
  292. package/build/client/_app/immutable/nodes/20.DXexjElq.js.br +0 -0
  293. package/build/client/_app/immutable/nodes/20.DXexjElq.js.gz +0 -0
  294. package/build/client/_app/immutable/nodes/21.CY6vTFDO.js +0 -3
  295. package/build/client/_app/immutable/nodes/21.CY6vTFDO.js.br +0 -0
  296. package/build/client/_app/immutable/nodes/21.CY6vTFDO.js.gz +0 -0
  297. package/build/client/_app/immutable/nodes/23.DuFwz8Vn.js.br +0 -0
  298. package/build/client/_app/immutable/nodes/23.DuFwz8Vn.js.gz +0 -0
  299. package/build/client/_app/immutable/nodes/24.DxzLaZvY.js.br +0 -0
  300. package/build/client/_app/immutable/nodes/24.DxzLaZvY.js.gz +0 -0
  301. package/build/client/_app/immutable/nodes/27.BuC47dzM.js.br +0 -0
  302. package/build/client/_app/immutable/nodes/27.BuC47dzM.js.gz +0 -0
  303. package/build/client/_app/immutable/nodes/28.C_uTKWGO.js.br +0 -0
  304. package/build/client/_app/immutable/nodes/28.C_uTKWGO.js.gz +0 -0
  305. package/build/client/_app/immutable/nodes/29.8zDETWDm.js.br +0 -0
  306. package/build/client/_app/immutable/nodes/29.8zDETWDm.js.gz +0 -0
  307. package/build/client/_app/immutable/nodes/3.Bfn3gVJk.js.br +0 -0
  308. package/build/client/_app/immutable/nodes/3.Bfn3gVJk.js.gz +0 -0
  309. package/build/client/_app/immutable/nodes/30.e6k62qmr.js.br +0 -0
  310. package/build/client/_app/immutable/nodes/30.e6k62qmr.js.gz +0 -0
  311. package/build/client/_app/immutable/nodes/5.BuIfvCG_.js.br +0 -0
  312. package/build/client/_app/immutable/nodes/5.BuIfvCG_.js.gz +0 -0
  313. package/build/client/_app/immutable/nodes/6.7n3uXlRb.js.br +0 -0
  314. package/build/client/_app/immutable/nodes/6.7n3uXlRb.js.gz +0 -0
  315. package/build/client/_app/immutable/nodes/7.hY96lcAK.js.br +0 -0
  316. package/build/client/_app/immutable/nodes/7.hY96lcAK.js.gz +0 -0
  317. package/build/client/_app/immutable/nodes/8.BJVGDvKO.js.br +0 -0
  318. package/build/client/_app/immutable/nodes/8.BJVGDvKO.js.gz +0 -0
  319. package/build/client/_app/immutable/nodes/9.DfzNXXlu.js +0 -1
  320. package/build/client/_app/immutable/nodes/9.DfzNXXlu.js.br +0 -0
  321. package/build/client/_app/immutable/nodes/9.DfzNXXlu.js.gz +0 -0
  322. package/build/server/chunks/21-BNS0VEZs.js.map +0 -1
  323. package/build/server/chunks/_page.svelte-DFumYbGi.js.map +0 -1
  324. package/build/server/chunks/_page.svelte-DSpONoJg.js.map +0 -1
  325. package/build/server/chunks/hooks.server-CWpJXpT3.js.map +0 -1
  326. package/build/server/chunks/providers.server-D1dTI3cw.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import"../chunks/DsnmJJEf.js";import{a$ as ap,bb as op,bl as lp,S as cp,R as ha,T as up,g as d,j as O,e as we,u as z,k as Rt,K as nn,p as nt,f as ae,a as it,s as ue,c as Q,n as Ut,r as q,ax as dp,t as Le,a8 as $i,b as ct,h as $n,J as hp,bm as jd,i as fp,at as lu,bn as cu}from"../chunks/ooPBmYPj.js";import{c as Pe,a as D,p as Un,f as Z,t as Tt,d as pp}from"../chunks/_OLpdTiI.js";import{i as _e}from"../chunks/C8ko2SLk.js";import{_ as qd}from"../chunks/BapAUJpM.js";import{o as Kt,s as Ze,a as Lt,d as Gn,c as mp,e as gp}from"../chunks/BMGykAfL.js";import{S as vp}from"../chunks/DRDjLZb3.js";import{a as _p,D as Kd,A as xp,U as bp}from"../chunks/A6Vs_oZV.js";import{A as Sp,o as yp,d as Zd,u as Mp,g as Ep,k as wp}from"../chunks/CZ1oTCKP.js";import{f as sn,r as kl,e as Ht,a as Vt,c as At,d as fa,k as $d,l as za,j as hi,s as Tp}from"../chunks/C1aQuqo_.js";import{s as _t,p as me,r as lt,c as We,b as Nn}from"../chunks/CcYNc8-G.js";import{p as uu}from"../chunks/CGG8rM-6.js";import{o as Ea,a as Jd}from"../chunks/D0QMYypb.js";import{w as Js,F as du}from"../chunks/2_FEXmq1.js";import{b as Qd}from"../chunks/DEBBEmC0.js";import{S as is}from"../chunks/C1Sz0rtw.js";import{S as pa}from"../chunks/D_wr-JLf.js";import{S as hu}from"../chunks/Doks8ISn.js";import{C as eh}from"../chunks/hRoV10UM.js";import{I as an,c as Ln}from"../chunks/Bnpwcepm.js";import{X as Ap}from"../chunks/CEnIp_6Y.js";import{R as Ar,D as Rr,b as Ji,T as Qs,a as rs,c as ss}from"../chunks/CpGv0MSX.js";import{s as Ct}from"../chunks/BNScKugQ.js";import{a as Hn,e as tr,h as ma,x as Rp,c as Vl,b as xi,d as ut,m as fn,s as Io,r as Hl,S as Cp,y as Pp}from"../chunks/CRRzXoPz.js";import{B as mn}from"../chunks/azBeeLR0.js";import{P as Dp,F as fu,D as ka,U as pu}from"../chunks/C26nmevH.js";import{C as th}from"../chunks/Zf7VV5ZB.js";import{C as zi,w as Fi,E as Ip,S as Lp,i as Np,b as nh,a as ih,A as rh,c as sh,H as ah,d as oh,f as lh,n as mu}from"../chunks/gMllmzma.js";import{i as Up,H as Fp,o as ch,c as Op,R as Bp,S as zp,a as kp,b as Vp}from"../chunks/BGxzXVpM.js";import{h as Hp}from"../chunks/iEBlyxZv.js";import{T as Gp,a as Wp,b as Xp,d as Yp,c as jp}from"../chunks/1s2jTHrf.js";import{C as uh,a as Cr}from"../chunks/wamM80bu.js";import{C as dh}from"../chunks/D99uXqZb.js";import{C as qp,a as Kp}from"../chunks/uINs3xv3.js";import{C as Zp}from"../chunks/BU9URCkw.js";import{C as $p}from"../chunks/D7l1JayF.js";import{L as Di}from"../chunks/B8uG8z2c.js";import{I as Pr}from"../chunks/jFKgkeON.js";import{t as Jp}from"../chunks/BoR6OKl6.js";import{F as Qp}from"../chunks/pRg-f8xU.js";import{r as em}from"../chunks/Cbu9Tg11.js";import{C as tm}from"../chunks/BjkQG7dw.js";const nm=[];function Gl(n,e=!1,t=!1){return ea(n,new Map,"",nm,null,t)}function ea(n,e,t,i,r=null,s=!1){if(typeof n=="object"&&n!==null){var a=e.get(n);if(a!==void 0)return a;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(ap(n)){var o=Array(n.length);e.set(n,o),r!==null&&e.set(r,o);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(o[l]=ea(c,e,t,i,null,s))}return o}if(op(n)===lp){o={},e.set(n,o),r!==null&&e.set(r,o);for(var u of Object.keys(n))o[u]=ea(n[u],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return ea(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class im{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return cp(this.#t)}get(){const e=ha(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ha(this.#t);return t===void 0?e:t}set(e){return up(this.#t,e)}}function rm(n,e){if(Up(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function wa(n,e){let t=we(null);const i=z(()=>rm(e,250));function r(...s){if(d(t))d(t).timeout&&clearTimeout(d(t).timeout);else{let a,o;const l=new Promise((c,u)=>{a=c,o=u});O(t,{timeout:null,runner:null,promise:l,resolve:a,reject:o},!0)}return d(t).runner=async()=>{if(!d(t))return;const a=d(t);O(t,null);try{a.resolve(await n.apply(this,s))}catch(o){a.reject(o)}},d(t).timeout=setTimeout(d(t).runner,d(i)),d(t).promise}return r.cancel=async()=>{(!d(t)||d(t).timeout===null)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||d(t).timeout===null)||(clearTimeout(d(t).timeout),d(t).reject("Cancelled"),O(t,null))},r.runScheduledNow=async()=>{(!d(t)||!d(t).timeout)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||!d(t).timeout)||(clearTimeout(d(t).timeout),d(t).timeout=null,await d(t).runner?.())},Object.defineProperty(r,"pending",{enumerable:!0,get(){return!!d(t)?.timeout}}),r}class Wl{#e=we(!1);constructor(){Rt(()=>(nn(()=>O(this.#e,!0)),()=>{O(this.#e,!1)}))}get current(){return d(this.#e)}}const sm=Vl({component:"checkbox",parts:["root","group","group-label","input"]}),am=new zi("Checkbox.Group"),hh=new zi("Checkbox.Root");class Xl{static create(e,t=null){return hh.set(new Xl(e,t))}opts;group;#e=z(()=>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){O(this.#e,e)}#t=z(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return d(this.#t)}set trueRequired(e){O(this.#t,e)}#n=z(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return d(this.#n)}set trueDisabled(e){O(this.#n,e)}#i=z(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return d(this.#i)}set trueReadonly(e){O(this.#i,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Hn(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),Fi.pre([()=>Gl(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),Fi.pre(()=>this.opts.checked.current,i=>{this.group&&(i?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===Ip){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===Lp&&(e.preventDefault(),this.#r())}}#r(){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.#r();return}e.preventDefault(),this.#r()}}#s=z(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return d(this.#s)}set snippetProps(e){O(this.#s,e)}#a=z(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Rp(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":ma(this.trueRequired),"aria-readonly":ma(this.trueReadonly),"data-disabled":tr(this.trueDisabled),"data-readonly":tr(this.trueReadonly),"data-state":om(this.opts.checked.current,this.opts.indeterminate.current),[sm.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Yl{static create(){return new Yl(hh.get())}root;#e=z(()=>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){O(this.#e,e)}#t=z(()=>!!this.root.trueName);get shouldRender(){return d(this.#t)}set shouldRender(e){O(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Np(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=z(()=>({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){O(this.#n,e)}}function om(n,e){return e?"indeterminate":n?"checked":"unchecked"}function lm(n,e){nt(e,!0);const t=Yl.create();var i=Pe(),r=ae(i);{var s=a=>{Fp(a,_t(()=>t.props))};_e(r,a=>{t.shouldRender&&a(s)})}D(n,i),it()}var cm=Z("<button><!></button>"),um=Z("<!> <!>",1);function dm(n,e){const t=Un();nt(e,!0);let i=me(e,"checked",15,!1),r=me(e,"ref",15,null),s=me(e,"disabled",3,!1),a=me(e,"required",3,!1),o=me(e,"name",3,void 0),l=me(e,"value",3,"on"),c=me(e,"id",19,()=>xi(t)),u=me(e,"indeterminate",15,!1),h=me(e,"type",3,"button"),f=lt(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const p=am.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),Fi.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const v=Xl.create({checked:ut(()=>i(),C=>{i(C),e.onCheckedChange?.(C)}),disabled:ut(()=>s()??!1),required:ut(()=>a()),name:ut(()=>o()),value:ut(()=>l()),id:ut(()=>c()),ref:ut(()=>r(),C=>r(C)),indeterminate:ut(()=>u(),C=>{u(C),e.onIndeterminateChange?.(C)}),type:ut(()=>h()),readonly:ut(()=>!!e.readonly)},p),S=z(()=>fn({...f},v.props));var g=um(),m=ae(g);{var x=C=>{var y=Pe(),I=ae(y);{let _=z(()=>({props:d(S),...v.snippetProps}));Ct(I,()=>e.child,()=>d(_))}D(C,y)},M=C=>{var y=cm();sn(y,()=>({...d(S)}));var I=Q(y);Ct(I,()=>e.children??Ut,()=>v.snippetProps),q(y),D(C,y)};_e(m,C=>{e.child?C(x):C(M,-1)})}var T=ue(m,2);lm(T,{}),D(n,g),it()}class nr{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Rt(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const i=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return i.observe(t),()=>{window.cancelAnimationFrame(e),i.unobserve(t)}}}class hm{opts;present;#e;#t=we(!1);#n=!1;#i=we(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,O(this.#t,e.open.current,!0),this.#e=new Sp({ref:this.opts.ref,afterTick:this.opts.open}),yp(()=>this.#a()),Fi(()=>this.present.current,t=>{if(!this.#n){this.#n=!0;return}this.#a(),t&&O(this.#t,!0),O(this.#i,t?"starting":"ending",!0),t&&(this.#r=window.requestAnimationFrame(()=>{this.#r=null,this.present.current&&O(this.#i,void 0)})),this.#e.run(()=>{t===this.present.current&&(t||O(this.#t,!1),O(this.#i,void 0))})})}#s=z(()=>d(this.#t));get isPresent(){return d(this.#s)}set isPresent(e){O(this.#s,e)}get transitionStatus(){return d(this.#i)}#a(){this.#r!==null&&(window.cancelAnimationFrame(this.#r),this.#r=null)}}function Ta(n,e){nt(e,!0);const t=new hm({open:ut(()=>e.open),ref:e.ref});var i=Pe(),r=ae(i);{var s=a=>{var o=Pe(),l=ae(o);Ct(l,()=>e.presence??Ut,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),D(a,o)};_e(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}D(n,i),it()}function fm(n,e,t){return Math.min(t,Math.max(e,n))}class pm{state;#e;constructor(e,t){this.state=Io(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)}}const ps=Vl({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),ms=new zi("ScrollArea.Root"),gs=new zi("ScrollArea.Scrollbar"),Aa=new zi("ScrollArea.ScrollbarVisible"),jl=new zi("ScrollArea.ScrollbarAxis"),fh=new zi("ScrollArea.ScrollbarShared");class ql{static create(e){return ms.set(new ql(e))}opts;attachment;#e=we(null);get scrollAreaNode(){return d(this.#e)}set scrollAreaNode(e){O(this.#e,e,!0)}#t=we(null);get viewportNode(){return d(this.#t)}set viewportNode(e){O(this.#t,e,!0)}#n=we(null);get contentNode(){return d(this.#n)}set contentNode(e){O(this.#n,e,!0)}#i=we(null);get scrollbarXNode(){return d(this.#i)}set scrollbarXNode(e){O(this.#i,e,!0)}#r=we(null);get scrollbarYNode(){return d(this.#r)}set scrollbarYNode(e){O(this.#r,e,!0)}#s=we(0);get cornerWidth(){return d(this.#s)}set cornerWidth(e){O(this.#s,e,!0)}#a=we(0);get cornerHeight(){return d(this.#a)}set cornerHeight(e){O(this.#a,e,!0)}#o=we(!1);get scrollbarXEnabled(){return d(this.#o)}set scrollbarXEnabled(e){O(this.#o,e,!0)}#l=we(!1);get scrollbarYEnabled(){return d(this.#l)}set scrollbarYEnabled(e){O(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref,t=>this.scrollAreaNode=t),this.domContext=new Zd(e.ref)}#c=z(()=>({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`},[ps.root]:"",...this.attachment}));get props(){return d(this.#c)}set props(e){O(this.#c,e)}}class Kl{static create(e){return new Kl(e,ms.get())}opts;root;attachment;#e=Io(Mp());#t=Io(null);contentAttachment=Hn(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref,i=>this.root.viewportNode=i)}#n=z(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[ps.viewport]:"",...this.attachment}));get props(){return d(this.#n)}set props(e){O(this.#n,e)}#i=z(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return d(this.#i)}set contentProps(e){O(this.#i,e)}}class Zl{static create(e){return gs.set(new Zl(e,ms.get()))}opts;root;#e=z(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return d(this.#e)}set isHorizontal(e){O(this.#e,e)}#t=we(!1);get hasThumb(){return d(this.#t)}set hasThumb(e){O(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,Fi(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class $l{static create(){return new $l(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{const t=this.root.scrollAreaNode,i=this.root.opts.scrollHideDelay.current;let r=0;if(!t)return;const s=()=>{this.root.domContext.clearTimeout(r),nn(()=>this.isVisible=!0)},a=()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{nn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},i)},o=Hl(Kt(t,"pointerenter",s),Kt(t,"pointerleave",a));return()=>{this.root.domContext.getWindow().clearTimeout(r),o()}})}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Jl{static create(){return new Jl(gs.get())}scrollbar;root;machine=new pm("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=z(()=>this.machine.state.current==="hidden");get isHidden(){return d(this.#e)}set isHidden(e){O(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>this.machine.dispatch("SCROLL_END"),100);Rt(()=>{const i=this.machine.state.current,r=this.root.opts.scrollHideDelay.current;if(i==="idle"){const s=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),r);return()=>this.root.domContext.clearTimeout(s)}}),Rt(()=>{const i=this.root.viewportNode;if(!i)return;const r=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let s=i[r];return Kt(i,"scroll",()=>{const l=i[r];s!==l&&(this.machine.dispatch("SCROLL"),t()),s=l})}),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=z(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ra{static create(){return new Ra(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>{const i=this.root.viewportNode;if(!i)return;const r=i.offsetWidth<i.scrollWidth,s=i.offsetHeight<i.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?r:s},10);new nr(()=>this.root.viewportNode,t),new nr(()=>this.root.contentNode,t)}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ql{static create(){return Aa.set(new Ql(gs.get()))}scrollbar;root;#e=we(null);get thumbNode(){return d(this.#e)}set thumbNode(e){O(this.#e,e,!0)}#t=we(0);get pointerOffset(){return d(this.#t)}set pointerOffset(e){O(this.#t,e,!0)}#n=we({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return d(this.#n)}set sizes(e){O(this.#n,e)}#i=z(()=>ph(this.sizes.viewport,this.sizes.content));get thumbRatio(){return d(this.#i)}set thumbRatio(e){O(this.#i,e)}#r=z(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return d(this.#r)}set hasThumb(e){O(this.#r,e)}#s=we("");get prevTransformStyle(){return d(this.#s)}set prevTransformStyle(e){O(this.#s,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{this.scrollbar.hasThumb=this.hasThumb}),Rt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return mm({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;const e=this.root.viewportNode.scrollLeft,i=`translate3d(${gu({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}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;const e=this.root.viewportNode.scrollTop,i=`translate3d(0, ${gu({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}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))}}class ec{static create(e){return jl.set(new ec(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarXNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{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;const i=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(i),gh(i,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:ga(this.computedStyle.paddingLeft),paddingEnd:ga(this.computedStyle.paddingRight)}})};#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class tc{static create(e){return jl.set(new tc(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarYNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{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;const i=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(i),gh(i,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:ga(this.computedStyle.paddingTop),paddingEnd:ga(this.computedStyle.paddingBottom)}})}#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class nc{static create(){return fh.set(new nc(jl.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=we(null);get rect(){return d(this.#e)}set rect(e){O(this.#e,e)}#t=we("");get prevWebkitUserSelect(){return d(this.#t)}set prevWebkitUserSelect(e){O(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=z(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return d(this.#n)}set maxScrollPos(e){O(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=wa(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Rt(()=>{const t=this.maxScrollPos,i=this.scrollbar.opts.ref.current;this.root.viewportNode;const r=a=>{const o=a.target;i?.contains(o)&&this.handleWheelScroll(a,t)};return Kt(this.root.domContext.getDocument(),"wheel",r,{passive:!1})}),dp(()=>{this.scrollbarVis.sizes,nn(()=>this.handleThumbPositionChange())}),new nr(()=>this.scrollbar.opts.ref.current,this.handleResize),new nr(()=>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;const t=e.clientX-this.rect.left,i=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:i})}#i(){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){if(e.button!==0)return;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){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#i()}onlostpointercapture(e){this.#i()}#r=z(()=>fn({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[ps.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return d(this.#r)}set props(e){O(this.#r,e)}}class ic{static create(e){return new ic(e,fh.get())}opts;scrollbarState;attachment;#e;#t=we();#n=wa(()=>{d(this.#t)&&(d(this.#t)(),O(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=Hn(this.opts.ref,i=>this.scrollbarState.scrollbarVis.thumbNode=i),Rt(()=>{const i=this.#e.viewportNode;if(!i)return;const r=()=>{if(this.#n(),!d(this.#t)){const a=gm(i,this.scrollbarState.handleThumbPositionChange);O(this.#t,a,!0),this.scrollbarState.handleThumbPositionChange()}};return nn(()=>this.scrollbarState.handleThumbPositionChange()),Kt(i,"scroll",r)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;this.scrollbarState.handleThumbPointerDown({x:r,y:s})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#i=z(()=>({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,[ps.thumb]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}class rc{static create(e){return new rc(e,ms.get())}opts;root;attachment;#e=we(0);#t=we(0);#n=z(()=>!!(d(this.#e)&&d(this.#t)));get hasSize(){return d(this.#n)}set hasSize(e){O(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(this.opts.ref),new nr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,O(this.#t,i,!0)}),new nr(()=>this.root.scrollbarYNode,()=>{const i=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=i,O(this.#e,i,!0)})}#i=z(()=>({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},[ps.corner]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}function ga(n){return n?Number.parseInt(n,10):0}function ph(n,e){const t=n/e;return Number.isNaN(t)?0:t}function Ca(n){const e=ph(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function mm({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=Ca(t),s=r/2,a=e||s,o=r-a,l=t.scrollbar.paddingStart+a,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,u=t.content-t.viewport,h=i==="ltr"?[0,u]:[u*-1,0];return mh([l,c],h)(n)}function gu({scrollPos:n,sizes:e,dir:t="ltr"}){const i=Ca(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,o=s-i,l=t==="ltr"?[0,a]:[a*-1,0],c=fm(n,l[0],l[1]);return mh([0,a],[0,o])(c)}function mh(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(n[1]-n[0]);return e[0]+i*(t-n[0])}}function gh(n,e){return n>0&&n<e}function gm(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=Ep(n);return(function s(){const a={left:n.scrollLeft,top:n.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&e(),t=a,i=r.requestAnimationFrame(s)})(),()=>r.cancelAnimationFrame(i)}var vm=Z("<div><!></div>");function _m(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"type",3,"hover"),a=me(e,"dir",3,"ltr"),o=me(e,"scrollHideDelay",3,600),l=lt(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=ql.create({type:ut(()=>s()),dir:ut(()=>a()),scrollHideDelay:ut(()=>o()),id:ut(()=>r()),ref:ut(()=>i(),S=>i(S))}),u=z(()=>fn(l,c.props));var h=Pe(),f=ae(h);{var p=S=>{var g=Pe(),m=ae(g);Ct(m,()=>e.child,()=>({props:d(u)})),D(S,g)},v=S=>{var g=vm();sn(g,()=>({...d(u)}));var m=Q(g);Ct(m,()=>e.children??Ut),q(g),D(S,g)};_e(f,S=>{e.child?S(p):S(v,-1)})}D(n,h),it()}var xm=Z("<div><div><!></div></div>");function bm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","children"]);const a=Kl.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props)),l=z(()=>fn({},a.contentProps));var c=xm();sn(c,()=>({...d(o)}));var u=Q(c);sn(u,()=>({...d(l)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),q(c),D(n,c),it()}var Sm=Z("<div><!></div>");function vh(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy","child","children"]);const i=nc.create(),r=z(()=>fn(t,i.props));var s=Pe(),a=ae(s);{var o=c=>{var u=Pe(),h=ae(u);Ct(h,()=>e.child,()=>({props:d(r)})),D(c,u)},l=c=>{var u=Sm();sn(u,()=>({...d(r)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),D(c,u)};_e(a,c=>{e.child?c(o):c(l,-1)})}D(n,s),it()}function ym(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=ec.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Mm(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=tc.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Pa(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=Ql.create();var r=Pe(),s=ae(r);{var a=l=>{ym(l,_t(()=>t))},o=l=>{Mm(l,_t(()=>t))};_e(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}D(n,r),it()}function Em(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Ra.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||r.isVisible);Ta(n,{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}it()}function wm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Jl.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||!r.isHidden);Ta(n,_t(()=>d(s),{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}it()}function Tm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=$l.create(),s=Ra.create(),a=z(()=>fn(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=z(()=>t()||r.isVisible&&s.isVisible);Ta(n,{get open(){return d(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{Pa(c,_t(()=>d(a)))},$$slots:{presence:!0}}),it()}function Am(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const a=Zl.create({orientation:ut(()=>e.orientation),id:ut(()=>r()),ref:ut(()=>i(),v=>i(v))}),o=z(()=>a.root.opts.type.current);var l=Pe(),c=ae(l);{var u=v=>{Tm(v,_t(()=>s,{get id(){return r()}}))},h=v=>{wm(v,_t(()=>s,{get id(){return r()}}))},f=v=>{Em(v,_t(()=>s,{get id(){return r()}}))},p=v=>{Pa(v,_t(()=>s,{get id(){return r()}}))};_e(c,v=>{d(o)==="hover"?v(u):d(o)==="scroll"?v(h,1):d(o)==="auto"?v(f,2):d(o)==="always"&&v(p,3)})}D(n,l),it()}var Rm=Z("<div><!></div>");function Cm(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const r=new Wl,s=ic.create({id:ut(()=>e.id),ref:ut(()=>t(),h=>t(h)),mounted:ut(()=>r.current)}),a=z(()=>fn(i,s.props,{style:{hidden:!e.present}}));var o=Pe(),l=ae(o);{var c=h=>{var f=Pe(),p=ae(f);Ct(p,()=>e.child,()=>({props:d(a)})),D(h,f)},u=h=>{var f=Rm();sn(f,()=>({...d(a)}));var p=Q(f);Ct(p,()=>e.children??Ut),q(f),D(h,f)};_e(l,h=>{e.child?h(c):h(u,-1)})}D(n,o),it()}function Pm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"forceMount",3,!1),a=lt(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=Aa.get();{const l=(u,h)=>{let f=()=>h?.().present;Cm(u,_t(()=>a,{get id(){return i()},get present(){return f()},get ref(){return r()},set ref(p){r(p)}}))};let c=z(()=>s()||o.hasThumb);Ta(n,{get open(){return d(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}it()}var Dm=Z("<div><!></div>");function Im(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=rc.create({id:ut(()=>e.id),ref:ut(()=>t(),u=>t(u))}),s=z(()=>fn(i,r.props));var a=Pe(),o=ae(a);{var l=u=>{var h=Pe(),f=ae(h);Ct(f,()=>e.child,()=>({props:d(s)})),D(u,h)},c=u=>{var h=Dm();sn(h,()=>({...d(s)}));var f=Q(h);Ct(f,()=>e.children??Ut),q(h),D(u,h)};_e(o,u=>{e.child?u(l):u(c,-1)})}D(n,a),it()}function Lm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id"]);const a=ms.get(),o=z(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=z(()=>a.opts.type.current!=="scroll"&&d(o));var c=Pe(),u=ae(c);{var h=f=>{Im(f,_t(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};_e(u,f=>{d(l)&&f(h)})}D(n,c),it()}function vu(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.right=`${t}%`):n==="rl"?(i.right=`${e}%`,i.left=`${t}%`):n==="bt"?(i.bottom=`${e}%`,i.top=`${t}%`):(i.top=`${e}%`,i.bottom=`${t}%`),i}function _h(n,e){const t={position:"absolute"};return n==="lr"?(t.left=`${e}%`,t.translate="-50% 0"):n==="rl"?(t.right=`${e}%`,t.translate="50% 0"):n==="bt"?(t.bottom=`${e}%`,t.translate="0 50%"):(t.top=`${e}%`,t.translate="0 -50%"),t}function xh(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.translate=`${t}% 0`):n==="rl"?(i.right=`${e}%`,i.translate=`${-t}% 0`):n==="bt"?(i.bottom=`${e}%`,i.translate=`0 ${-t}%`):(i.top=`${e}%`,i.translate=`0 ${t}%`),i}function Nm(n){if(Math.floor(n)===n)return 0;const e=n.toString();if(e.indexOf(".")!==-1&&e.indexOf("e-")===-1)return e.split(".")[1].length;if(e.indexOf("e-")!==-1){const t=e.split("e-");return parseInt(t[1],10)}return 0}function Um(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function sc(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=Nm(n),a=Math.pow(10,s),o=Math.round(i*a),l=Math.round(n*a);o%l===0&&r++;const c=[];for(let u=0;u<r;u++){const h=e+u*n,f=Um(h,s);c.push(f)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Qi(n,e){if(e.length===0)return n;let t=e[0],i=Math.abs(n-t);for(const r of e){const s=Math.abs(n-r);s<i&&(i=s,t=r)}return t}function Ms(n,e,t){const i=e.indexOf(n);return i===-1?Qi(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function Fm(n,e,t=!0){const[i,r]=n,[s,a]=e,o=(a-s)/(r-i);return l=>{const c=s+o*(l-i);return t?c>Math.max(s,a)?Math.max(s,a):c<Math.min(s,a)?Math.min(s,a):c:c}}const Ni=Vl({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),ac=new zi("Slider.Root");class bh{opts;attachment;#e=we(!1);get isActive(){return d(this.#e)}set isActive(e){O(this.#e,e,!0)}#t=we(0);#n=z(()=>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){O(this.#n,e)}#i=z(()=>sc(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return d(this.#i)}set normalizedSteps(e){O(this.#i,e)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref),this.domContext=new Zd(this.opts.ref),new nr(()=>this.opts.ref.current,this.#r)}#r=()=>{O(this.#t,d(this.#t)+1)};isThumbActive(e){return this.isActive}#s=z(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current==="horizontal"?"pan-y":"pan-x"});getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};getThumbScale=()=>{d(this.#t);const e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current==="exact")return[0,100];const t=this.opts.orientation.current==="vertical",i=this.getAllThumbs()[0],r=t?i?.offsetHeight:i?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];const s=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(s===void 0||Number.isNaN(s)||s===0)return[0,100];const a=r/2/s*100,o=a,l=100-a;return[o,l]};getPositionFromValue=e=>{const t=this.getThumbScale();return Fm([this.opts.min.current,this.opts.max.current],t)(e)};#a=z(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":tr(this.opts.disabled.current),style:{touchAction:d(this.#s)},[Ni.root]:"",...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Om extends bh{opts;isMulti=!1;constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);o(s)||(this.opts.value.current=l(s))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:i}){const r=this.opts.min.current,s=this.opts.max.current,o=(e-t)/(i-t)*(s-r)+r;if(o<r)this.updateValue(r);else if(o>s)this.updateValue(s);else{const l=this.normalizedSteps,c=Qi(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Qi(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!t||!i)return;i.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect();this.direction==="lr"?this.applyPosition({clientXY:e.clientX,start:r,end:s}):this.direction==="rl"?this.applyPosition({clientXY:e.clientX,start:s,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;const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),i.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};#e=z(()=>{const e=this.opts.value.current;return Array.from({length:1},()=>{const t=e,i=this.getPositionFromValue(t),r=_h(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#e)}set thumbsPropsArr(e){O(this.#e,e)}#t=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#t)}set thumbsRenderArr(e){O(this.#t,e)}#n=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=i<=t;return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,"data-selected":this.isTickValueSelected(i)?"":void 0,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#n)}set ticksPropsArr(e){O(this.#n,e)}#i=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#i)}set ticksRenderArr(e){O(this.#i,e)}#r=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#r)}set tickItemsArr(e){O(this.#r,e)}#s=z(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return d(this.#s)}set thumbItemsArr(e){O(this.#s,e)}#a=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#a)}set snippetProps(e){O(this.#a,e)}}class Bm extends bh{opts;isMulti=!0;#e=we(null);get activeThumb(){return d(this.#e)}set activeThumb(e){O(this.#e,e,!0)}#t=we(0);get currentThumbIdx(){return d(this.#t)}set currentThumbIdx(e){O(this.#t,e,!0)}constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);s.some(c=>!o(c))&&(this.opts.value.current=s.map(l))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:i,end:r}){const s=this.opts.min.current,a=this.opts.max.current,l=(e-i)/(r-i)*(a-s)+s;if(l<s)this.updateValue(s,t);else if(l>a)this.updateValue(a,t);else{const c=this.normalizedSteps,u=Qi(l,c);this.updateValue(u,t)}}#n=e=>{const t=this.getAllThumbs();if(!t.length)return;for(const a of t)a.blur();const i=t.map(a=>{if(this.opts.orientation.current==="horizontal"){const{left:o,right:l}=a.getBoundingClientRect();return Math.abs(e.clientX-(o+l)/2)}else{const{top:o,bottom:l}=a.getBoundingClientRect();return Math.abs(e.clientY-(o+l)/2)}}),r=t[i.indexOf(Math.min(...i))],s=t.indexOf(r);return{node:r,idx:s}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.activeThumb;if(!t||!i)return;i.node.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect(),l=this.direction;l==="lr"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:r,end:s}):l==="rl"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:s,end:r}):l==="bt"?this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:o,end:a}):l==="tb"&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.#n(e);if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=i,i.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};updateValue=(e,t)=>{const i=this.opts.value.current;if(!i.length){this.opts.value.current.push(e);return}if(i[t]===e)return;const s=[...i];if(!Op(t,s))return;const a=s[t]>e?-1:1,o=()=>{const c=t+a;s[t]=s[c],s[c]=e;const u=this.getAllThumbs();u.length&&(u[c]?.focus(),this.activeThumb={node:u[c],idx:c})};if(this.opts.autoSort.current&&(a===-1&&e<s[t-1]||a===1&&e>s[t+1])){o(),this.opts.value.current=s;return}const l=this.normalizedSteps;s[t]=Qi(e,l),this.opts.value.current=s};#i=z(()=>{const e=this.opts.value.current;return Array.from({length:e.length||1},(t,i)=>{const r=nn(()=>this.currentThumbIdx);r<e.length&&nn(()=>{this.currentThumbIdx=r+1});const s=e[i],a=this.getPositionFromValue(s??0),o=_h(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#i)}set thumbsPropsArr(e){O(this.#i,e)}#r=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#r)}set thumbsRenderArr(e){O(this.#r,e)}#s=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#s)}set ticksPropsArr(e){O(this.#s,e)}#a=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#a)}set ticksRenderArr(e){O(this.#a,e)}#o=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#o)}set tickItemsArr(e){O(this.#o,e)}#l=z(()=>this.opts.value.current.map((t,i)=>({value:t,index:i})));get thumbItemsArr(){return d(this.#l)}set thumbItemsArr(e){O(this.#l,e)}#c=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#c)}set snippetProps(e){O(this.#c,e)}}class zm{static create(e){const{type:t,...i}=e,r=t==="single"?new Om(i):new Bm(i);return ac.set(r)}}const km=[nh,ih,rh,sh,ah,oh];class oc{static create(e){return new oc(e,ac.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref)}#e=z(()=>{if(Array.isArray(this.root.opts.value.current)){const 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",...vu(this.root.direction,e,t)}}else{const e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,i=this.root.opts.max.current,r=0,s=e!==void 0&&e>0&&t===i?0:100-this.root.getPositionFromValue(t);return{position:"absolute",...vu(this.root.direction,r,s)}}});get rangeStyles(){return d(this.#e)}set rangeStyles(e){O(this.#e,e)}#t=z(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":tr(this.root.opts.disabled.current),style:this.rangeStyles,[Ni.range]:"",...this.attachment}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class lc{static create(e){return new lc(e,ac.get())}opts;root;attachment;#e=z(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(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;const t=this.opts.ref.current;if(!t)return;const i=this.root.getAllThumbs();if(!i.length)return;const r=i.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!km.includes(e.key))return;e.preventDefault();const s=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,l=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,u=this.root.direction,h=this.root.normalizedSteps;switch(e.key){case ah:this.#t(s);break;case oh:this.#t(a);break;case nh:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"next":"prev");this.#t(p)}break;case ih:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"prev":"next");this.#t(p)}break;case rh:if(e.metaKey){const f=u==="tb"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"prev":"next");this.#t(p)}break;case sh:if(e.metaKey){const f=u==="tb"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"next":"prev");this.#t(p)}break}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=z(()=>({...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":tr(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){O(this.#n,e)}}var Vm=Z("<span><!></span>");function Hm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"value",15),a=me(e,"onValueChange",3,mu),o=me(e,"onValueCommit",3,mu),l=me(e,"disabled",3,!1),c=me(e,"step",3,1),u=me(e,"dir",3,"ltr"),h=me(e,"autoSort",3,!0),f=me(e,"orientation",3,"horizontal"),p=me(e,"thumbPositioning",3,"contain"),v=lt(e,["$$slots","$$events","$$legacy","children","child","id","ref","value","type","onValueChange","onValueCommit","disabled","min","max","step","dir","autoSort","orientation","thumbPositioning","trackPadding"]);const S=z(()=>e.min!==void 0?e.min:Array.isArray(c())?Math.min(...c()):0),g=z(()=>e.max!==void 0?e.max:Array.isArray(c())?Math.max(...c()):100);function m(){if(s()===void 0)return e.type==="single"?d(S):[]}m(),Fi.pre(()=>s(),()=>{m()});const x=zm.create({id:ut(()=>i()),ref:ut(()=>r(),_=>r(_)),value:ut(()=>s(),_=>{s(_),a()(_)}),onValueCommit:ut(()=>o()),disabled:ut(()=>l()),min:ut(()=>d(S)),max:ut(()=>d(g)),step:ut(()=>c()),dir:ut(()=>u()),autoSort:ut(()=>h()),orientation:ut(()=>f()),thumbPositioning:ut(()=>p()),type:e.type,trackPadding:ut(()=>e.trackPadding)}),M=z(()=>fn(v,x.props));var T=Pe(),C=ae(T);{var y=_=>{var E=Pe(),L=ae(E);{let P=z(()=>({props:d(M),...x.snippetProps}));Ct(L,()=>e.child,()=>d(P))}D(_,E)},I=_=>{var E=Vm();sn(E,()=>({...d(M)}));var L=Q(E);Ct(L,()=>e.children??Ut,()=>x.snippetProps),q(E),D(_,E)};_e(C,_=>{e.child?_(y):_(I,-1)})}D(n,T),it()}var Gm=Z("<span><!></span>");function Wm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=oc.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props));var l=Pe(),c=ae(l);{var u=f=>{var p=Pe(),v=ae(p);Ct(v,()=>e.child,()=>({props:d(o)})),D(f,p)},h=f=>{var p=Gm();sn(p,()=>({...d(o)}));var v=Q(p);Ct(v,()=>e.children??Ut),q(p),D(f,p)};_e(c,f=>{e.child?f(u):f(h,-1)})}D(n,l),it()}var Xm=Z("<span><!></span>");function Ym(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"disabled",3,!1),a=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id","index","disabled"]);const o=lc.create({id:ut(()=>r()),ref:ut(()=>i(),p=>i(p)),index:ut(()=>e.index),disabled:ut(()=>s())}),l=z(()=>fn(a,o.props));var c=Pe(),u=ae(c);{var h=p=>{var v=Pe(),S=ae(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current),props:d(l)}));Ct(S,()=>e.child,()=>d(g))}D(p,v)},f=p=>{var v=Xm();sn(v,()=>({...d(l)}));var S=Q(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current)}));Ct(S,()=>e.children??Ut,()=>d(g))}q(v),D(p,v)};_e(u,p=>{e.child?p(h):p(f,-1)})}D(n,c),it()}function jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"camera"},()=>t,{get iconNode(){return i}}))}function qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];an(n,_t({name:"circle-check-big"},()=>t,{get iconNode(){return i}}))}function Km(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];an(n,_t({name:"circle-check"},()=>t,{get iconNode(){return i}}))}function Zm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"circle-question-mark"},()=>t,{get iconNode(){return i}}))}function Sh(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"download"},()=>t,{get iconNode(){return i}}))}function Va(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"eye-off"},()=>t,{get iconNode(){return i}}))}function Ha(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"eye"},()=>t,{get iconNode(){return i}}))}function $m(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"file"},()=>t,{get iconNode(){return i}}))}function Jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"folder"},()=>t,{get iconNode(){return i}}))}function Qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"inbox"},()=>t,{get iconNode(){return i}}))}function eg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];an(n,_t({name:"info"},()=>t,{get iconNode(){return i}}))}function tg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"layers"},()=>t,{get iconNode(){return i}}))}function ng(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"link"},()=>t,{get iconNode(){return i}}))}function cc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"loader"},()=>t,{get iconNode(){return i}}))}function uc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"maximize"},()=>t,{get iconNode(){return i}}))}function dc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"minimize"},()=>t,{get iconNode(){return i}}))}function ig(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M5 12h14"}]];an(n,_t({name:"minus"},()=>t,{get iconNode(){return i}}))}function rg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];an(n,_t({name:"zap"},()=>t,{get iconNode(){return i}}))}const Nr={FILE_UPLOAD:{MAX_SIZE_MB:150,MAX_SIZE_BYTES:150*1024*1024},TIMEOUTS:{SOLVE_STATE_DURATION:3500,PARAM_EXPORT_DELAY:100,DRAWER_ANIMATION_MS:350},SOLVING_INDICATOR:{FAST_THRESHOLD_MS:200,SLOW_THRESHOLD_MS:600,ANIMATION_DELAY:300,HISTORY_SIZE:3},FILE_SIZE:{BYTES_PER_KB:1024}};var yh=Object.defineProperty,sg=(n,e,t)=>e in n?yh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ag=(n,e)=>{for(var t in e)yh(n,t,{get:e[t],enumerable:!0})},Es=(n,e,t)=>sg(n,typeof e!="symbol"?e+"":e,t),gi={VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_STATE:"INVALID_STATE",INVALID_INPUT:"INVALID_INPUT",BROWSER_ONLY:"BROWSER_ONLY"},Ui=class Lo extends Error{constructor(e,t="UNKNOWN_ERROR",i){super(e),Es(this,"code"),Es(this,"statusCode"),Es(this,"context"),Es(this,"originalError"),this.name="RhinoComputeError",this.code=t,this.statusCode=i?.statusCode,this.context=i?.context,this.originalError=i?.originalError,i?.originalError&&(this.cause=i.originalError)}static missingValues(e,t,i){return new Lo(`Input "${e}" has no values defined${t?` (expected ${t})`:""}`,gi.INVALID_INPUT,{context:{inputName:e,expectedType:t,...i}})}static unknownParamType(e,t,i){return new Lo(`Unknown paramType: ${e}`,gi.VALIDATION_ERROR,{context:{receivedParamType:e,paramName:t,...i}})}},og=class{debug(){}info(){}warn(){}error(){}},lg=new og;function zt(){return lg}function Mh(n){if(typeof globalThis.Buffer=="function"){let e=globalThis.Buffer.from(n,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof globalThis.atob=="function"){let e=globalThis.atob(n),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i)&255;return t}throw new Ui("Base64 decoding not supported in this environment.",gi.INVALID_STATE,{context:{environmentInfo:"atob or Buffer not available"}})}const hc="184",Dr={ROTATE:0,DOLLY:1,PAN:2},Mr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cg=0,_u=1,ug=2,ta=1,dg=2,Er=3,Sn=0,xn=1,In=2,fi=0,Ir=1,xu=2,bu=3,Su=4,hg=5,ji=100,fg=101,pg=102,mg=103,gg=104,vg=200,_g=201,xg=202,bg=203,No=204,Uo=205,Sg=206,yg=207,Mg=208,Eg=209,wg=210,Tg=211,Ag=212,Rg=213,Cg=214,Fo=0,Oo=1,Bo=2,Ur=3,zo=4,ko=5,Vo=6,Ho=7,Eh=0,Pg=1,Dg=2,Qn=0,wh=1,Th=2,Ah=3,Rh=4,Ch=5,Ph=6,fc=7,Dh=300,ir=301,Fr=302,na=303,Ga=304,Da=306,Go=1e3,kn=1001,Wo=1002,on=1003,Ig=1004,ws=1005,Zt=1006,Wa=1007,Ii=1008,Tn=1009,Ih=1010,Lh=1011,os=1012,pc=1013,ti=1014,An=1015,Rn=1016,mc=1017,gc=1018,ls=1020,Nh=35902,Uh=35899,Fh=1021,Oh=1022,Vn=1023,vi=1026,Ki=1027,Bh=1028,vc=1029,rr=1030,_c=1031,xc=1033,ia=33776,ra=33777,sa=33778,aa=33779,Xo=35840,Yo=35841,jo=35842,qo=35843,Ko=36196,Zo=37492,$o=37496,Jo=37488,Qo=37489,va=37490,el=37491,tl=37808,nl=37809,il=37810,rl=37811,sl=37812,al=37813,ol=37814,ll=37815,cl=37816,ul=37817,dl=37818,hl=37819,fl=37820,pl=37821,ml=36492,gl=36494,vl=36495,_l=36283,xl=36284,_a=36285,bl=36286,Lg=3200,Sl=0,Ng=1,Pi="",wn="srgb",cs="srgb-linear",xa="linear",Pt="srgb",or=7680,yu=519,Ug=512,Fg=513,Og=514,bc=515,Bg=516,zg=517,Sc=518,kg=519,Mu=35044,Eu="300 es",Jn=2e3,us=2001;function Vg(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function ba(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Hg(){const n=ba("canvas");return n.style.display="block",n}const wu={};function Tu(...n){const e="THREE."+n.shift();console.log(e,...n)}function zh(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ot(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function yt(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function yl(...n){const e=n.join(" ");e in wu||(wu[e]=!0,ot(...n))}function Gg(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const Wg={[Fo]:Oo,[Bo]:Vo,[zo]:Ho,[Ur]:ko,[Oo]:Fo,[Vo]:Bo,[Ho]:zo,[ko]:Ur};class ki{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const cn=["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"],oa=Math.PI/180,Ml=180/Math.PI;function vs(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(cn[n&255]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]+"-"+cn[e&255]+cn[e>>8&255]+"-"+cn[e>>16&15|64]+cn[e>>24&255]+"-"+cn[t&63|128]+cn[t>>8&255]+"-"+cn[t>>16&255]+cn[t>>24&255]+cn[i&255]+cn[i>>8&255]+cn[i>>16&255]+cn[i>>24&255]).toLowerCase()}function bt(n,e,t){return Math.max(e,Math.min(t,n))}function Xg(n,e){return(n%e+e)%e}function Xa(n,e,t){return(1-t)*n+t*e}function Hr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function gn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Yg={DEG2RAD:oa},Kc=class Kc{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+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=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kc.prototype.isVector2=!0;let ht=Kc;class Oi{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],f=s[a+0],p=s[a+1],v=s[a+2],S=s[a+3];if(h!==S||l!==f||c!==p||u!==v){let g=l*f+c*p+u*v+h*S;g<0&&(f=-f,p=-p,v=-v,S=-S,g=-g);let m=1-o;if(g<.9995){const x=Math.acos(g),M=Math.sin(x);m=Math.sin(m*x)/M,o=Math.sin(o*x)/M,l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o}else{l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o;const x=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=x,c*=x,u*=x,h*=x}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[a],f=s[a+1],p=s[a+2],v=s[a+3];return e[t]=o*v+u*h+l*p-c*f,e[t+1]=l*v+u*f+c*h-o*p,e[t+2]=c*v+u*p+o*f-l*h,e[t+3]=u*v-o*h-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,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){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),u=o(r/2),h=o(s/2),f=l(i/2),p=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"YXZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"ZXY":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"ZYX":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"YZX":this._x=f*u*h+c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h-f*p*v;break;case"XZY":this._x=f*u*h-c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h+f*p*v;break;default:ot("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=i+o+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(a-r)*p}else if(i>o&&i>h){const p=2*Math.sqrt(1+i-o-h);this._w=(u-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+c)/p}else if(o>h){const p=2*Math.sqrt(1+o-i-h);this._w=(s-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-o);this._w=(a-r)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(bt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);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=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+a*o+r*c-s*l,this._y=r*u+a*l+s*o-i*c,this._z=s*u+a*c+i*l-r*o,this._w=a*u-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Zc=class Zc{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("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(Au.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Au.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*i),u=2*(o*t-s*r),h=2*(s*i-a*t);return this.x=t+l*c+a*h-o*u,this.y=i+l*u+o*c-s*h,this.z=r+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[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=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ya.copy(this).projectOnVector(e),this.sub(Ya)}reflect(e){return this.sub(Ya.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+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,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Zc.prototype.isVector3=!0;let te=Zc;const Ya=new te,Au=new Oi,$c=class $c{constructor(e,t,i,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c)}set(e,t,i,r,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],p=i[5],v=i[8],S=r[0],g=r[3],m=r[6],x=r[1],M=r[4],T=r[7],C=r[2],y=r[5],I=r[8];return s[0]=a*S+o*x+l*C,s[3]=a*g+o*M+l*y,s[6]=a*m+o*T+l*I,s[1]=c*S+u*x+h*C,s[4]=c*g+u*M+h*y,s[7]=c*m+u*T+h*I,s[2]=f*S+p*x+v*C,s[5]=f*g+p*M+v*y,s[8]=f*m+p*T+v*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-i*s*u+i*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,f=o*l-u*s,p=c*s-a*l,v=t*h+i*f+r*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/v;return e[0]=h*S,e[1]=(r*c-u*i)*S,e[2]=(o*i-r*a)*S,e[3]=f*S,e[4]=(u*t-r*l)*S,e[5]=(r*s-o*t)*S,e[6]=p*S,e[7]=(i*l-c*t)*S,e[8]=(a*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ja.makeScale(e,t)),this}rotate(e){return this.premultiply(ja.makeRotation(-e)),this}translate(e,t){return this.premultiply(ja.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};$c.prototype.isMatrix3=!0;let pt=$c;const ja=new pt,Ru=new pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Cu=new pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function jg(){const n={enabled:!0,workingColorSpace:cs,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Pt&&(r.r=pi(r.r),r.g=pi(r.g),r.b=pi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Pt&&(r.r=Lr(r.r),r.g=Lr(r.g),r.b=Lr(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Pi?xa:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return yl("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return yl("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[cs]:{primaries:e,whitePoint:i,transfer:xa,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:wn},outputColorSpaceConfig:{drawingBufferColorSpace:wn}},[wn]:{primaries:e,whitePoint:i,transfer:Pt,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:wn}}}),n}const Mt=jg();function pi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Lr(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let lr;class qg{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{lr===void 0&&(lr=ba("canvas")),lr.width=e.width,lr.height=e.height;const r=lr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=lr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ba("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=pi(s[a]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(pi(t[i]/255)*255):t[i]=pi(t[i]);return{data:t,width:e.width,height:e.height}}else return ot("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Kg=0;class yc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Kg++}),this.uuid=vs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(qa(r[a].image)):s.push(qa(r[a]))}else s=qa(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function qa(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?qg.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ot("Texture: Unable to serialize Texture."),{})}let Zg=0;const Ka=new te;class dn extends ki{constructor(e=dn.DEFAULT_IMAGE,t=dn.DEFAULT_MAPPING,i=kn,r=kn,s=Zt,a=Ii,o=Vn,l=Tn,c=dn.DEFAULT_ANISOTROPY,u=Pi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Zg++}),this.uuid=vs(),this.name="",this.source=new yc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ht(0,0),this.repeat=new ht(1,1),this.center=new ht(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Ka).x}get height(){return this.source.getSize(Ka).y}get depth(){return this.source.getSize(Ka).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ot(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Dh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Go:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Wo:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Go:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Wo:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}dn.DEFAULT_IMAGE=null;dn.DEFAULT_MAPPING=Dh;dn.DEFAULT_ANISOTROPY=1;const Jc=class Jc{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,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,i,r){return this.x=e,this.y=t,this.z=i,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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],v=l[9],S=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-S)<.01&&Math.abs(v-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+S)<.1&&Math.abs(v+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(c+1)/2,T=(p+1)/2,C=(m+1)/2,y=(u+f)/4,I=(h+S)/4,_=(v+g)/4;return M>T&&M>C?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=y/i,s=I/i):T>C?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=y/r,s=_/r):C<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(C),i=I/s,r=_/s),this.set(i,r,s,t),this}let x=Math.sqrt((g-v)*(g-v)+(h-S)*(h-S)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-v)/x,this.y=(h-S)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this.w=bt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this.w=bt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,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}};Jc.prototype.isVector4=!0;let Wt=Jc;class $g extends ki{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},s=new dn(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:Zt,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 i=0;i<this.textures.length;i++)this.textures[i].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,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,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,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new yc(r)}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}dispose(){this.dispatchEvent({type:"dispose"})}}class ei extends $g{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class kh extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Jg extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ma=class Ma{constructor(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){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,i,r,s,a,o,l,c,u,h,f,p,v,S,g)}set(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=p,m[7]=v,m[11]=S,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ma().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/cr.setFromMatrixColumn(e,0).length(),s=1/cr.setFromMatrixColumn(e,1).length(),a=1/cr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+v*c,t[5]=f-S*c,t[9]=-o*l,t[2]=S-f*c,t[6]=v+p*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f+S*o,t[4]=v*o-p,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=p*o-v,t[6]=S+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f-S*o,t[4]=-a*h,t[8]=v+p*o,t[1]=p+v*o,t[5]=a*u,t[9]=S-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=v*c-p,t[8]=f*c+S,t[1]=l*h,t[5]=S*c+f,t[9]=p*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=S-f*h,t[8]=v*h+p,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=p*h+v,t[10]=f-S*h}else if(e.order==="XZY"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+S,t[5]=a*u,t[9]=p*h-v,t[2]=v*h-p,t[6]=o*u,t[10]=S*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Qg,e,ev)}lookAt(e,t,i){const r=this.elements;return Mn.subVectors(e,t),Mn.lengthSq()===0&&(Mn.z=1),Mn.normalize(),Mi.crossVectors(i,Mn),Mi.lengthSq()===0&&(Math.abs(i.z)===1?Mn.x+=1e-4:Mn.z+=1e-4,Mn.normalize(),Mi.crossVectors(i,Mn)),Mi.normalize(),Ts.crossVectors(Mn,Mi),r[0]=Mi.x,r[4]=Ts.x,r[8]=Mn.x,r[1]=Mi.y,r[5]=Ts.y,r[9]=Mn.y,r[2]=Mi.z,r[6]=Ts.z,r[10]=Mn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],p=i[13],v=i[2],S=i[6],g=i[10],m=i[14],x=i[3],M=i[7],T=i[11],C=i[15],y=r[0],I=r[4],_=r[8],E=r[12],L=r[1],P=r[5],k=r[9],W=r[13],H=r[2],N=r[6],R=r[10],F=r[14],U=r[3],X=r[7],V=r[11],$=r[15];return s[0]=a*y+o*L+l*H+c*U,s[4]=a*I+o*P+l*N+c*X,s[8]=a*_+o*k+l*R+c*V,s[12]=a*E+o*W+l*F+c*$,s[1]=u*y+h*L+f*H+p*U,s[5]=u*I+h*P+f*N+p*X,s[9]=u*_+h*k+f*R+p*V,s[13]=u*E+h*W+f*F+p*$,s[2]=v*y+S*L+g*H+m*U,s[6]=v*I+S*P+g*N+m*X,s[10]=v*_+S*k+g*R+m*V,s[14]=v*E+S*W+g*F+m*$,s[3]=x*y+M*L+T*H+C*U,s[7]=x*I+M*P+T*N+C*X,s[11]=x*_+M*k+T*R+C*V,s[15]=x*E+M*W+T*F+C*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],p=e[14],v=e[3],S=e[7],g=e[11],m=e[15],x=l*p-c*f,M=o*p-c*h,T=o*f-l*h,C=a*p-c*u,y=a*f-l*u,I=a*h-o*u;return t*(S*x-g*M+m*T)-i*(v*x-g*C+m*y)+r*(v*M-S*C+m*I)-s*(v*T-S*y+g*I)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const 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]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],v=e[12],S=e[13],g=e[14],m=e[15],x=t*o-i*a,M=t*l-r*a,T=t*c-s*a,C=i*l-r*o,y=i*c-s*o,I=r*c-s*l,_=u*S-h*v,E=u*g-f*v,L=u*m-p*v,P=h*g-f*S,k=h*m-p*S,W=f*m-p*g,H=x*W-M*k+T*P+C*L-y*E+I*_;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/H;return e[0]=(o*W-l*k+c*P)*N,e[1]=(r*k-i*W-s*P)*N,e[2]=(S*I-g*y+m*C)*N,e[3]=(f*y-h*I-p*C)*N,e[4]=(l*L-a*W-c*E)*N,e[5]=(t*W-r*L+s*E)*N,e[6]=(g*T-v*I-m*M)*N,e[7]=(u*I-f*T+p*M)*N,e[8]=(a*k-o*L+c*_)*N,e[9]=(i*L-t*k-s*_)*N,e[10]=(v*y-S*T+m*x)*N,e[11]=(h*T-u*y-p*x)*N,e[12]=(o*E-a*P-l*_)*N,e[13]=(t*P-i*E+r*_)*N,e[14]=(S*M-v*C-g*x)*N,e[15]=(u*C-h*M+f*x)*N,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=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,i,r))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+i,u*l-r*a,0,c*l-r*o,u*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,f=s*c,p=s*u,v=s*h,S=a*u,g=a*h,m=o*h,x=l*c,M=l*u,T=l*h,C=i.x,y=i.y,I=i.z;return r[0]=(1-(S+m))*C,r[1]=(p+T)*C,r[2]=(v-M)*C,r[3]=0,r[4]=(p-T)*y,r[5]=(1-(f+m))*y,r[6]=(g+x)*y,r[7]=0,r[8]=(v+M)*I,r[9]=(g-x)*I,r[10]=(1-(f+S))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),t.identity(),this;let a=cr.set(r[0],r[1],r[2]).length();const o=cr.set(r[4],r[5],r[6]).length(),l=cr.set(r[8],r[9],r[10]).length();s<0&&(a=-a),Fn.copy(this);const c=1/a,u=1/o,h=1/l;return Fn.elements[0]*=c,Fn.elements[1]*=c,Fn.elements[2]*=c,Fn.elements[4]*=u,Fn.elements[5]*=u,Fn.elements[6]*=u,Fn.elements[8]*=h,Fn.elements[9]*=h,Fn.elements[10]*=h,t.setFromRotationMatrix(Fn),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(i-r),f=(t+e)/(t-e),p=(i+r)/(i-r);let v,S;if(l)v=s/(a-s),S=a*s/(a-s);else if(o===Jn)v=-(a+s)/(a-s),S=-2*a*s/(a-s);else if(o===us)v=-a/(a-s),S=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2/(t-e),h=2/(i-r),f=-(t+e)/(t-e),p=-(i+r)/(i-r);let v,S;if(l)v=1/(a-s),S=a/(a-s);else if(o===Jn)v=-2/(a-s),S=-(a+s)/(a-s);else if(o===us)v=-1/(a-s),S=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};Ma.prototype.isMatrix4=!0;let Xt=Ma;const cr=new te,Fn=new Xt,Qg=new te(0,0,0),ev=new te(1,1,1),Mi=new te,Ts=new te,Mn=new te,Pu=new Xt,Du=new Oi;class Bi{constructor(e=0,t=0,i=0,r=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}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,i,r=this._order){return this._x=e,this._y=t,this._z=i,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,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],u=r[9],h=r[2],f=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(bt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-bt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(bt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-bt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(bt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-bt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:ot("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Pu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pu,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Du.setFromEuler(this),this.setFromQuaternion(Du,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}}Bi.DEFAULT_ORDER="XYZ";class Mc{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let tv=0;const Iu=new te,ur=new Oi,ri=new Xt,As=new te,Gr=new te,nv=new te,iv=new Oi,Lu=new te(1,0,0),Nu=new te(0,1,0),Uu=new te(0,0,1),Fu={type:"added"},rv={type:"removed"},dr={type:"childadded",child:null},Za={type:"childremoved",child:null};class hn extends ki{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tv++}),this.uuid=vs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hn.DEFAULT_UP.clone();const e=new te,t=new Bi,i=new Oi,r=new te(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Xt},normalMatrix:{value:new pt}}),this.matrix=new Xt,this.matrixWorld=new Xt,this.matrixAutoUpdate=hn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Mc,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 ur.setFromAxisAngle(e,t),this.quaternion.multiply(ur),this}rotateOnWorldAxis(e,t){return ur.setFromAxisAngle(e,t),this.quaternion.premultiply(ur),this}rotateX(e){return this.rotateOnAxis(Lu,e)}rotateY(e){return this.rotateOnAxis(Nu,e)}rotateZ(e){return this.rotateOnAxis(Uu,e)}translateOnAxis(e,t){return Iu.copy(e).applyQuaternion(this.quaternion),this.position.add(Iu.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Lu,e)}translateY(e){return this.translateOnAxis(Nu,e)}translateZ(e){return this.translateOnAxis(Uu,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ri.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?As.copy(e):As.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Gr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ri.lookAt(Gr,As,this.up):ri.lookAt(As,Gr,this.up),this.quaternion.setFromRotationMatrix(ri),r&&(ri.extractRotation(r.matrixWorld),ur.setFromRotationMatrix(ri),this.quaternion.premultiply(ur.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(yt("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(Fu),dr.child=e,this.dispatchEvent(dr),dr.child=null):yt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(rv),Za.child=e,this.dispatchEvent(Za),Za.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ri.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ri.multiply(e.parent.matrixWorld)),e.applyMatrix4(ri),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Fu),dr.child=e,this.dispatchEvent(dr),dr.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 i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,e,nv),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,iv,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*i-s[8]*r,s[13]+=i-s[1]*t-s[5]*i-s[9]*r,s[14]+=r-s[2]*t-s[6]*i-s[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);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const 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(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),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 s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?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=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),f=a(e.skeletons),p=a(e.animations),v=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p),v.length>0&&(i.nodes=v)}return i.object=r,i;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}hn.DEFAULT_UP=new te(0,1,0);hn.DEFAULT_MATRIX_AUTO_UPDATE=!0;hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Rs=class extends hn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const sv={type:"move"};class $a{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rs,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 Rs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}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,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const S of e.hand.values()){const g=t.getJointPose(S,i),m=this._getHandJoint(c,S);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),p=.02,v=.005;c.inputState.pinching&&f>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),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(sv)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Rs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Vh={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},Ei={h:0,s:0,l:0},Cs={h:0,s:0,l:0};function Ja(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class at{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=wn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Mt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mt.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Mt.workingColorSpace){if(e=Xg(e,1),t=bt(t,0,1),i=bt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Ja(a,s,e+1/3),this.g=Ja(a,s,e),this.b=Ja(a,s,e-1/3)}return Mt.colorSpaceToWorking(this,r),this}setStyle(e,t=wn){function i(s){s!==void 0&&parseFloat(s)<1&&ot("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:ot("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);ot("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=wn){const i=Vh[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ot("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=Lr(e.r),this.g=Lr(e.g),this.b=Lr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=wn){return Mt.workingToColorSpace(un.copy(this),e),Math.round(bt(un.r*255,0,255))*65536+Math.round(bt(un.g*255,0,255))*256+Math.round(bt(un.b*255,0,255))}getHexString(e=wn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mt.workingColorSpace){Mt.workingToColorSpace(un.copy(this),t);const i=un.r,r=un.g,s=un.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case i:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-i)/h+2;break;case s:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Mt.workingColorSpace){return Mt.workingToColorSpace(un.copy(this),t),e.r=un.r,e.g=un.g,e.b=un.b,e}getStyle(e=wn){Mt.workingToColorSpace(un.copy(this),e);const t=un.r,i=un.g,r=un.b;return e!==wn?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Ei),this.setHSL(Ei.h+e,Ei.s+t,Ei.l+i)}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,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Ei),e.getHSL(Cs);const i=Xa(Ei.h,Cs.h,t),r=Xa(Ei.s,Cs.s,t),s=Xa(Ei.l,Cs.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[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}}const un=new at;at.NAMES=Vh;class av extends hn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Bi,this.environmentIntensity=1,this.environmentRotation=new Bi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const On=new te,si=new te,Qa=new te,ai=new te,hr=new te,fr=new te,Ou=new te,eo=new te,to=new te,no=new te,io=new Wt,ro=new Wt,so=new Wt;class zn{constructor(e=new te,t=new te,i=new te){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),On.subVectors(e,t),r.cross(On);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){On.subVectors(r,t),si.subVectors(i,t),Qa.subVectors(e,t);const a=On.dot(On),o=On.dot(si),l=On.dot(Qa),c=si.dot(si),u=si.dot(Qa),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(c*l-o*u)*f,v=(a*u-o*l)*f;return s.set(1-p-v,v,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ai)===null?!1:ai.x>=0&&ai.y>=0&&ai.x+ai.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,ai)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ai.x),l.addScaledVector(a,ai.y),l.addScaledVector(o,ai.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return io.setScalar(0),ro.setScalar(0),so.setScalar(0),io.fromBufferAttribute(e,t),ro.fromBufferAttribute(e,i),so.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(io,s.x),a.addScaledVector(ro,s.y),a.addScaledVector(so,s.z),a}static isFrontFacing(e,t,i,r){return On.subVectors(i,t),si.subVectors(e,t),On.cross(si).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),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 On.subVectors(this.c,this.b),si.subVectors(this.a,this.b),On.cross(si).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;hr.subVectors(r,i),fr.subVectors(s,i),eo.subVectors(e,i);const l=hr.dot(eo),c=fr.dot(eo);if(l<=0&&c<=0)return t.copy(i);to.subVectors(e,r);const u=hr.dot(to),h=fr.dot(to);if(u>=0&&h<=u)return t.copy(r);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(i).addScaledVector(hr,a);no.subVectors(e,s);const p=hr.dot(no),v=fr.dot(no);if(v>=0&&p<=v)return t.copy(s);const S=p*c-l*v;if(S<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(fr,o);const g=u*v-p*h;if(g<=0&&h-u>=0&&p-v>=0)return Ou.subVectors(s,r),o=(h-u)/(h-u+(p-v)),t.copy(r).addScaledVector(Ou,o);const m=1/(g+S+f);return a=S*m,o=f*m,t.copy(i).addScaledVector(hr,a).addScaledVector(fr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class _i{constructor(e=new te(1/0,1/0,1/0),t=new te(-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,i=e.length;t<i;t+=3)this.expandByPoint(Bn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Bn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Bn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Bn):Bn.fromBufferAttribute(s,a),Bn.applyMatrix4(e.matrixWorld),this.expandByPoint(Bn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ps.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ps.copy(i.boundingBox)),Ps.applyMatrix4(e.matrixWorld),this.union(Ps)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Bn),Bn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wr),Ds.subVectors(this.max,Wr),pr.subVectors(e.a,Wr),mr.subVectors(e.b,Wr),gr.subVectors(e.c,Wr),wi.subVectors(mr,pr),Ti.subVectors(gr,mr),Gi.subVectors(pr,gr);let t=[0,-wi.z,wi.y,0,-Ti.z,Ti.y,0,-Gi.z,Gi.y,wi.z,0,-wi.x,Ti.z,0,-Ti.x,Gi.z,0,-Gi.x,-wi.y,wi.x,0,-Ti.y,Ti.x,0,-Gi.y,Gi.x,0];return!ao(t,pr,mr,gr,Ds)||(t=[1,0,0,0,1,0,0,0,1],!ao(t,pr,mr,gr,Ds))?!1:(Is.crossVectors(wi,Ti),t=[Is.x,Is.y,Is.z],ao(t,pr,mr,gr,Ds))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bn).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:(oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(oi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const oi=[new te,new te,new te,new te,new te,new te,new te,new te],Bn=new te,Ps=new _i,pr=new te,mr=new te,gr=new te,wi=new te,Ti=new te,Gi=new te,Wr=new te,Ds=new te,Is=new te,Wi=new te;function ao(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Wi.fromArray(n,s);const o=r.x*Math.abs(Wi.x)+r.y*Math.abs(Wi.y)+r.z*Math.abs(Wi.z),l=e.dot(Wi),c=t.dot(Wi),u=i.dot(Wi);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const di=ov();function ov(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function lv(n){Math.abs(n)>65504&&ot("DataUtils.toHalfFloat(): Value out of range."),n=bt(n,-65504,65504),di.floatView[0]=n;const e=di.uint32View[0],t=e>>23&511;return di.baseTable[t]+((e&8388607)>>di.shiftTable[t])}function cv(n){const e=n>>10;return di.uint32View[0]=di.mantissaTable[di.offsetTable[e]+(n&1023)]+di.exponentTable[e],di.floatView[0]}class Ls{static toHalfFloat(e){return lv(e)}static fromHalfFloat(e){return cv(e)}}const $t=new te,Ns=new ht;let uv=0;class bn extends ki{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:uv++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Mu,this.updateRanges=[],this.gpuType=An,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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Ns.fromBufferAttribute(this,t),Ns.applyMatrix3(e),this.setXY(t,Ns.x,Ns.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix3(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix4(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyNormalMatrix(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.transformDirection(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Hr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=gn(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Hr(t,this.array)),t}setX(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Hr(t,this.array)),t}setY(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setW(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array),s=gn(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Mu&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class Hh extends bn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Gh extends bn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class mi extends bn{constructor(e,t,i){super(new Float32Array(e),t,i)}}const dv=new _i,Xr=new te,oo=new te;class Ec{constructor(e=new te,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):dv.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));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){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Xr.subVectors(e,this.center);const t=Xr.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Xr,r/i),this.radius+=r}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):(oo.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Xr.copy(e.center).add(oo)),this.expandByPoint(Xr.copy(e.center).sub(oo))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let hv=0;const Pn=new Xt,lo=new hn,vr=new te,En=new _i,Yr=new _i,tn=new te;class Wn extends ki{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:hv++}),this.uuid=vs(),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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Vg(e)?Gh:Hh)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new pt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const 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}applyQuaternion(e){return Pn.makeRotationFromQuaternion(e),this.applyMatrix4(Pn),this}rotateX(e){return Pn.makeRotationX(e),this.applyMatrix4(Pn),this}rotateY(e){return Pn.makeRotationY(e),this.applyMatrix4(Pn),this}rotateZ(e){return Pn.makeRotationZ(e),this.applyMatrix4(Pn),this}translate(e,t,i){return Pn.makeTranslation(e,t,i),this.applyMatrix4(Pn),this}scale(e,t,i){return Pn.makeScale(e,t,i),this.applyMatrix4(Pn),this}lookAt(e){return lo.lookAt(e),lo.updateMatrix(),this.applyMatrix4(lo.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vr).negate(),this.translate(vr.x,vr.y,vr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mi(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&ot("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 _i);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];En.setFromBufferAttribute(s),this.morphTargetsRelative?(tn.addVectors(this.boundingBox.min,En.min),this.boundingBox.expandByPoint(tn),tn.addVectors(this.boundingBox.max,En.max),this.boundingBox.expandByPoint(tn)):(this.boundingBox.expandByPoint(En.min),this.boundingBox.expandByPoint(En.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&yt('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 Ec);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new te,1/0);return}if(e){const i=this.boundingSphere.center;if(En.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Yr.setFromBufferAttribute(o),this.morphTargetsRelative?(tn.addVectors(En.min,Yr.min),En.expandByPoint(tn),tn.addVectors(En.max,Yr.max),En.expandByPoint(tn)):(En.expandByPoint(Yr.min),En.expandByPoint(Yr.max))}En.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)tn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(tn));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)tn.fromBufferAttribute(o,c),l&&(vr.fromBufferAttribute(e,c),tn.add(vr)),r=Math.max(r,i.distanceToSquared(tn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&yt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){yt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new te,l[_]=new te;const c=new te,u=new te,h=new te,f=new ht,p=new ht,v=new ht,S=new te,g=new te;function m(_,E,L){c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,E),h.fromBufferAttribute(i,L),f.fromBufferAttribute(s,_),p.fromBufferAttribute(s,E),v.fromBufferAttribute(s,L),u.sub(c),h.sub(c),p.sub(f),v.sub(f);const P=1/(p.x*v.y-v.x*p.y);isFinite(P)&&(S.copy(u).multiplyScalar(v.y).addScaledVector(h,-p.y).multiplyScalar(P),g.copy(h).multiplyScalar(p.x).addScaledVector(u,-v.x).multiplyScalar(P),o[_].add(S),o[E].add(S),o[L].add(S),l[_].add(g),l[E].add(g),l[L].add(g))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const M=new te,T=new te,C=new te,y=new te;function I(_){C.fromBufferAttribute(r,_),y.copy(C);const E=o[_];M.copy(E),M.sub(C.multiplyScalar(C.dot(E))).normalize(),T.crossVectors(y,E);const P=T.dot(l[_])<0?-1:1;a.setXYZW(_,M.x,M.y,M.z,P)}for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)I(e.getX(W+0)),I(e.getX(W+1)),I(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new bn(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);const r=new te,s=new te,a=new te,o=new te,l=new te,c=new te,u=new te,h=new te;if(e)for(let f=0,p=e.count;f<p;f+=3){const v=e.getX(f+0),S=e.getX(f+1),g=e.getX(f+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,S),a.fromBufferAttribute(t,g),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,S),c.fromBufferAttribute(i,g),o.add(u),l.add(u),c.add(u),i.setXYZ(v,o.x,o.y,o.z),i.setXYZ(S,l.x,l.y,l.z),i.setXYZ(g,c.x,c.y,c.z)}else for(let f=0,p=t.count;f<p;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),i.setXYZ(f+0,u.x,u.y,u.z),i.setXYZ(f+1,u.x,u.y,u.z),i.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)tn.fromBufferAttribute(e,t),tn.normalize(),e.setXYZ(t,tn.x,tn.y,tn.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,f=new c.constructor(l.length*u);let p=0,v=0;for(let S=0,g=l.length;S<g;S++){o.isInterleavedBufferAttribute?p=l[S]*o.data.stride+o.offset:p=l[S]*u;for(let m=0;m<u;m++)f[v++]=c[p++]}return new bn(f,u,h)}if(this.index===null)return ot("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Wn,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const f=c[u],p=e(f,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){const p=c[h];u.push(p.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f<p;f++)u.push(h[f].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let fv=0;class kr extends ki{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fv++}),this.uuid=vs(),this.name="",this.type="Material",this.blending=Ir,this.side=Sn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=No,this.blendDst=Uo,this.blendEquation=ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new at(0,0,0),this.blendAlpha=0,this.depthFunc=Ur,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=yu,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=or,this.stencilZFail=or,this.stencilZPass=or,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ot(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ir&&(i.blending=this.blending),this.side!==Sn&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==No&&(i.blendSrc=this.blendSrc),this.blendDst!==Uo&&(i.blendDst=this.blendDst),this.blendEquation!==ji&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ur&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yu&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==or&&(i.stencilFail=this.stencilFail),this.stencilZFail!==or&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==or&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const li=new te,co=new te,Us=new te,Ai=new te,uo=new te,Fs=new te,ho=new te;class wc{constructor(e=new te,t=new te(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,li)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=li.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(li.copy(this.origin).addScaledVector(this.direction,t),li.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){co.copy(e).add(t).multiplyScalar(.5),Us.copy(t).sub(e).normalize(),Ai.copy(this.origin).sub(co);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Us),o=Ai.dot(this.direction),l=-Ai.dot(Us),c=Ai.lengthSq(),u=Math.abs(1-a*a);let h,f,p,v;if(u>0)if(h=a*l-o,f=a*o-l,v=s*u,h>=0)if(f>=-v)if(f<=v){const S=1/u;h*=S,f*=S,p=h*(h+a*f+2*o)+f*(a*h+f+2*l)+c}else f=s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f<=-v?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c):f<=v?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(co).addScaledVector(Us,f),p}intersectSphere(e,t){li.subVectors(e.center,this.origin);const i=li.dot(this.direction),r=li.dot(li)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,li)!==null}intersectTriangle(e,t,i,r,s){uo.subVectors(t,e),Fs.subVectors(i,e),ho.crossVectors(uo,Fs);let a=this.direction.dot(ho),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ai.subVectors(this.origin,e);const l=o*this.direction.dot(Fs.crossVectors(Ai,Fs));if(l<0)return null;const c=o*this.direction.dot(uo.cross(Ai));if(c<0||l+c>a)return null;const u=-o*Ai.dot(ho);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Wh extends kr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new at(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 Bi,this.combine=Eh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Bu=new Xt,Xi=new wc,Os=new Ec,zu=new te,Bs=new te,zs=new te,ks=new te,fo=new te,Vs=new te,ku=new te,Hs=new te;class rn extends hn{constructor(e=new Wn,t=new Wh){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){Vs.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(fo.fromBufferAttribute(h,e),a?Vs.addScaledVector(fo,u):Vs.addScaledVector(fo.sub(t),u))}t.add(Vs)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Os.copy(i.boundingSphere),Os.applyMatrix4(s),Xi.copy(e.ray).recast(e.near),!(Os.containsPoint(Xi.origin)===!1&&(Xi.intersectSphere(Os,zu)===null||Xi.origin.distanceToSquared(zu)>(e.far-e.near)**2))&&(Bu.copy(s).invert(),Xi.copy(e.ray).applyMatrix4(Bu),!(i.boundingBox!==null&&Xi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Xi)))}_computeIntersections(e,t,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=o.getX(T),I=o.getX(T+1),_=o.getX(T+2);r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(o.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=o.getX(g),M=o.getX(g+1),T=o.getX(g+2);r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=T,I=T+1,_=T+2;r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(l.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=g,M=g+1,T=g+2;r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function pv(n,e,t,i,r,s,a,o){let l;if(e.side===xn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Sn,o),l===null)return null;Hs.copy(o),Hs.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(Hs);return c<t.near||c>t.far?null:{distance:c,point:Hs.clone(),object:n}}function Gs(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Bs),n.getVertexPosition(l,zs),n.getVertexPosition(c,ks);const u=pv(n,e,t,i,Bs,zs,ks,ku);if(u){const h=new te;zn.getBarycoord(ku,Bs,zs,ks,h),r&&(u.uv=zn.getInterpolatedAttribute(r,o,l,c,h,new ht)),s&&(u.uv1=zn.getInterpolatedAttribute(s,o,l,c,h,new ht)),a&&(u.normal=zn.getInterpolatedAttribute(a,o,l,c,h,new te),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new te,materialIndex:0};zn.getNormal(Bs,zs,ks,f.normal),u.face=f,u.barycoord=h}return u}class Xh extends dn{constructor(e=null,t=1,i=1,r,s,a,o,l,c=on,u=on,h,f){super(null,a,o,l,c,u,r,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const po=new te,mv=new te,gv=new pt;class Ci{constructor(e=new te(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,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=po.subVectors(i,t).cross(mv.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const r=e.delta(po),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||gv.getNormalMatrix(e),r=this.coplanarPoint(po).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yi=new Ec,vv=new ht(.5,.5),Ws=new te;class Tc{constructor(e=new Ci,t=new Ci,i=new Ci,r=new Ci,s=new Ci,a=new Ci){this.planes=[e,t,i,r,s,a]}set(e,t,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Jn,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],p=s[7],v=s[8],S=s[9],g=s[10],m=s[11],x=s[12],M=s[13],T=s[14],C=s[15];if(r[0].setComponents(c-a,p-u,m-v,C-x).normalize(),r[1].setComponents(c+a,p+u,m+v,C+x).normalize(),r[2].setComponents(c+o,p+h,m+S,C+M).normalize(),r[3].setComponents(c-o,p-h,m-S,C-M).normalize(),i)r[4].setComponents(l,f,g,T).normalize(),r[5].setComponents(c-l,p-f,m-g,C-T).normalize();else if(r[4].setComponents(c-l,p-f,m-g,C-T).normalize(),t===Jn)r[5].setComponents(c+l,p+f,m+g,C+T).normalize();else if(t===us)r[5].setComponents(l,f,g,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Yi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Yi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Yi)}intersectsSprite(e){Yi.center.set(0,0,0);const t=vv.distanceTo(e.center);return Yi.radius=.7071067811865476+t,Yi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yi)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ws.x=r.normal.x>0?e.max.x:e.min.x,Ws.y=r.normal.y>0?e.max.y:e.min.y,Ws.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ws)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Yh extends dn{constructor(e=[],t=ir,i,r,s,a,o,l,c,u){super(e,t,i,r,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Or extends dn{constructor(e,t,i=ti,r,s,a,o=on,l=on,c,u=vi,h=1){if(u!==vi&&u!==Ki)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,r,s,a,o,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new yc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class _v extends Or{constructor(e,t=ti,i=ir,r,s,a=on,o=on,l,c=vi){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,i,r,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class jh extends dn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class _s extends Wn{constructor(e=1,t=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let f=0,p=0;v("z","y","x",-1,-1,i,t,e,a,s,0),v("z","y","x",1,-1,i,t,-e,a,s,1),v("x","z","y",1,1,e,i,t,r,a,2),v("x","z","y",1,-1,e,i,-t,r,a,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new mi(c,3)),this.setAttribute("normal",new mi(u,3)),this.setAttribute("uv",new mi(h,2));function v(S,g,m,x,M,T,C,y,I,_,E){const L=T/I,P=C/_,k=T/2,W=C/2,H=y/2,N=I+1,R=_+1;let F=0,U=0;const X=new te;for(let V=0;V<R;V++){const $=V*P-W;for(let ee=0;ee<N;ee++){const Se=ee*L-k;X[S]=Se*x,X[g]=$*M,X[m]=H,c.push(X.x,X.y,X.z),X[S]=0,X[g]=0,X[m]=y>0?1:-1,u.push(X.x,X.y,X.z),h.push(ee/I),h.push(1-V/_),F+=1}}for(let V=0;V<_;V++)for(let $=0;$<I;$++){const ee=f+$+N*V,Se=f+$+N*(V+1),ye=f+($+1)+N*(V+1),ve=f+($+1)+N*V;l.push(ee,Se,ve),l.push(Se,ye,ve),U+=6}o.addGroup(p,U,E),p+=U,f+=F}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _s(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xs extends Wn{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(i),l=Math.floor(r),c=o+1,u=l+1,h=e/o,f=t/l,p=[],v=[],S=[],g=[];for(let m=0;m<u;m++){const x=m*f-a;for(let M=0;M<c;M++){const T=M*h-s;v.push(T,-x,0),S.push(0,0,1),g.push(M/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let x=0;x<o;x++){const M=x+c*m,T=x+c*(m+1),C=x+1+c*(m+1),y=x+1+c*m;p.push(M,T,y),p.push(T,C,y)}this.setIndex(p),this.setAttribute("position",new mi(v,3)),this.setAttribute("normal",new mi(S,3)),this.setAttribute("uv",new mi(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xs(e.width,e.height,e.widthSegments,e.heightSegments)}}function Br(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Vu(r))r.isRenderTargetTexture?(ot("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone();else if(Array.isArray(r))if(Vu(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][i]=s}else e[t][i]=r.slice();else e[t][i]=r}}return e}function pn(n){const e={};for(let t=0;t<n.length;t++){const i=Br(n[t]);for(const r in i)e[r]=i[r]}return e}function Vu(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function xv(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function qh(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Mt.workingColorSpace}const bv={clone:Br,merge:pn};var Sv=`void main() {
1
+ import"../chunks/DsnmJJEf.js";import{a$ as ap,bb as op,bl as lp,S as cp,R as ha,T as up,g as d,j as O,e as we,u as z,k as Rt,K as nn,p as nt,f as ae,a as it,s as ue,c as Q,n as Ut,r as q,ax as dp,t as Le,a8 as $i,b as ct,h as $n,J as hp,bm as jd,i as fp,at as lu,bn as cu}from"../chunks/ooPBmYPj.js";import{c as Pe,a as D,p as Un,f as Z,t as Tt,d as pp}from"../chunks/_OLpdTiI.js";import{i as _e}from"../chunks/C8ko2SLk.js";import{_ as qd}from"../chunks/BapAUJpM.js";import{o as Kt,s as Ze,a as Lt,d as Gn,c as mp,e as gp}from"../chunks/BMGykAfL.js";import{S as vp}from"../chunks/DRDjLZb3.js";import{a as _p,D as Kd,A as xp,U as bp}from"../chunks/DmaxIj00.js";import{A as Sp,o as yp,d as Zd,u as Mp,g as Ep,k as wp}from"../chunks/CZ1oTCKP.js";import{f as sn,r as kl,e as Ht,a as Vt,c as At,d as fa,k as $d,l as za,j as hi,s as Tp}from"../chunks/C1aQuqo_.js";import{s as _t,p as me,r as lt,c as We,b as Nn}from"../chunks/CcYNc8-G.js";import{p as uu}from"../chunks/CQbfyd2L.js";import{o as Ea,a as Jd}from"../chunks/D0QMYypb.js";import{w as Js,F as du}from"../chunks/2_FEXmq1.js";import{b as Qd}from"../chunks/DEBBEmC0.js";import{S as is}from"../chunks/C1Sz0rtw.js";import{S as pa}from"../chunks/D_wr-JLf.js";import{S as hu}from"../chunks/Doks8ISn.js";import{C as eh}from"../chunks/hRoV10UM.js";import{I as an,c as Ln}from"../chunks/Bnpwcepm.js";import{X as Ap}from"../chunks/CEnIp_6Y.js";import{R as Ar,D as Rr,b as Ji,T as Qs,a as rs,c as ss}from"../chunks/CpGv0MSX.js";import{s as Ct}from"../chunks/BNScKugQ.js";import{a as Hn,e as tr,h as ma,x as Rp,c as Vl,b as xi,d as ut,m as fn,s as Io,r as Hl,S as Cp,y as Pp}from"../chunks/CRRzXoPz.js";import{B as mn}from"../chunks/azBeeLR0.js";import{P as Dp,F as fu,D as ka,U as pu}from"../chunks/C26nmevH.js";import{C as th}from"../chunks/Zf7VV5ZB.js";import{C as zi,w as Fi,E as Ip,S as Lp,i as Np,b as nh,a as ih,A as rh,c as sh,H as ah,d as oh,f as lh,n as mu}from"../chunks/gMllmzma.js";import{i as Up,H as Fp,o as ch,c as Op,R as Bp,S as zp,a as kp,b as Vp}from"../chunks/BGxzXVpM.js";import{h as Hp}from"../chunks/iEBlyxZv.js";import{T as Gp,a as Wp,b as Xp,d as Yp,c as jp}from"../chunks/1s2jTHrf.js";import{C as uh,a as Cr}from"../chunks/wamM80bu.js";import{C as dh}from"../chunks/D99uXqZb.js";import{C as qp,a as Kp}from"../chunks/uINs3xv3.js";import{C as Zp}from"../chunks/BU9URCkw.js";import{C as $p}from"../chunks/D7l1JayF.js";import{L as Di}from"../chunks/B8uG8z2c.js";import{I as Pr}from"../chunks/jFKgkeON.js";import{t as Jp}from"../chunks/BoR6OKl6.js";import{F as Qp}from"../chunks/pRg-f8xU.js";import{r as em}from"../chunks/Cbu9Tg11.js";import{C as tm}from"../chunks/BjkQG7dw.js";const nm=[];function Gl(n,e=!1,t=!1){return ea(n,new Map,"",nm,null,t)}function ea(n,e,t,i,r=null,s=!1){if(typeof n=="object"&&n!==null){var a=e.get(n);if(a!==void 0)return a;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(ap(n)){var o=Array(n.length);e.set(n,o),r!==null&&e.set(r,o);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(o[l]=ea(c,e,t,i,null,s))}return o}if(op(n)===lp){o={},e.set(n,o),r!==null&&e.set(r,o);for(var u of Object.keys(n))o[u]=ea(n[u],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return ea(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class im{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return cp(this.#t)}get(){const e=ha(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ha(this.#t);return t===void 0?e:t}set(e){return up(this.#t,e)}}function rm(n,e){if(Up(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function wa(n,e){let t=we(null);const i=z(()=>rm(e,250));function r(...s){if(d(t))d(t).timeout&&clearTimeout(d(t).timeout);else{let a,o;const l=new Promise((c,u)=>{a=c,o=u});O(t,{timeout:null,runner:null,promise:l,resolve:a,reject:o},!0)}return d(t).runner=async()=>{if(!d(t))return;const a=d(t);O(t,null);try{a.resolve(await n.apply(this,s))}catch(o){a.reject(o)}},d(t).timeout=setTimeout(d(t).runner,d(i)),d(t).promise}return r.cancel=async()=>{(!d(t)||d(t).timeout===null)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||d(t).timeout===null)||(clearTimeout(d(t).timeout),d(t).reject("Cancelled"),O(t,null))},r.runScheduledNow=async()=>{(!d(t)||!d(t).timeout)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||!d(t).timeout)||(clearTimeout(d(t).timeout),d(t).timeout=null,await d(t).runner?.())},Object.defineProperty(r,"pending",{enumerable:!0,get(){return!!d(t)?.timeout}}),r}class Wl{#e=we(!1);constructor(){Rt(()=>(nn(()=>O(this.#e,!0)),()=>{O(this.#e,!1)}))}get current(){return d(this.#e)}}const sm=Vl({component:"checkbox",parts:["root","group","group-label","input"]}),am=new zi("Checkbox.Group"),hh=new zi("Checkbox.Root");class Xl{static create(e,t=null){return hh.set(new Xl(e,t))}opts;group;#e=z(()=>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){O(this.#e,e)}#t=z(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return d(this.#t)}set trueRequired(e){O(this.#t,e)}#n=z(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return d(this.#n)}set trueDisabled(e){O(this.#n,e)}#i=z(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return d(this.#i)}set trueReadonly(e){O(this.#i,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Hn(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),Fi.pre([()=>Gl(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),Fi.pre(()=>this.opts.checked.current,i=>{this.group&&(i?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===Ip){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===Lp&&(e.preventDefault(),this.#r())}}#r(){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.#r();return}e.preventDefault(),this.#r()}}#s=z(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return d(this.#s)}set snippetProps(e){O(this.#s,e)}#a=z(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Rp(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":ma(this.trueRequired),"aria-readonly":ma(this.trueReadonly),"data-disabled":tr(this.trueDisabled),"data-readonly":tr(this.trueReadonly),"data-state":om(this.opts.checked.current,this.opts.indeterminate.current),[sm.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Yl{static create(){return new Yl(hh.get())}root;#e=z(()=>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){O(this.#e,e)}#t=z(()=>!!this.root.trueName);get shouldRender(){return d(this.#t)}set shouldRender(e){O(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Np(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=z(()=>({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){O(this.#n,e)}}function om(n,e){return e?"indeterminate":n?"checked":"unchecked"}function lm(n,e){nt(e,!0);const t=Yl.create();var i=Pe(),r=ae(i);{var s=a=>{Fp(a,_t(()=>t.props))};_e(r,a=>{t.shouldRender&&a(s)})}D(n,i),it()}var cm=Z("<button><!></button>"),um=Z("<!> <!>",1);function dm(n,e){const t=Un();nt(e,!0);let i=me(e,"checked",15,!1),r=me(e,"ref",15,null),s=me(e,"disabled",3,!1),a=me(e,"required",3,!1),o=me(e,"name",3,void 0),l=me(e,"value",3,"on"),c=me(e,"id",19,()=>xi(t)),u=me(e,"indeterminate",15,!1),h=me(e,"type",3,"button"),f=lt(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const p=am.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),Fi.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const v=Xl.create({checked:ut(()=>i(),C=>{i(C),e.onCheckedChange?.(C)}),disabled:ut(()=>s()??!1),required:ut(()=>a()),name:ut(()=>o()),value:ut(()=>l()),id:ut(()=>c()),ref:ut(()=>r(),C=>r(C)),indeterminate:ut(()=>u(),C=>{u(C),e.onIndeterminateChange?.(C)}),type:ut(()=>h()),readonly:ut(()=>!!e.readonly)},p),S=z(()=>fn({...f},v.props));var g=um(),m=ae(g);{var x=C=>{var y=Pe(),I=ae(y);{let _=z(()=>({props:d(S),...v.snippetProps}));Ct(I,()=>e.child,()=>d(_))}D(C,y)},M=C=>{var y=cm();sn(y,()=>({...d(S)}));var I=Q(y);Ct(I,()=>e.children??Ut,()=>v.snippetProps),q(y),D(C,y)};_e(m,C=>{e.child?C(x):C(M,-1)})}var T=ue(m,2);lm(T,{}),D(n,g),it()}class nr{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Rt(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const i=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return i.observe(t),()=>{window.cancelAnimationFrame(e),i.unobserve(t)}}}class hm{opts;present;#e;#t=we(!1);#n=!1;#i=we(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,O(this.#t,e.open.current,!0),this.#e=new Sp({ref:this.opts.ref,afterTick:this.opts.open}),yp(()=>this.#a()),Fi(()=>this.present.current,t=>{if(!this.#n){this.#n=!0;return}this.#a(),t&&O(this.#t,!0),O(this.#i,t?"starting":"ending",!0),t&&(this.#r=window.requestAnimationFrame(()=>{this.#r=null,this.present.current&&O(this.#i,void 0)})),this.#e.run(()=>{t===this.present.current&&(t||O(this.#t,!1),O(this.#i,void 0))})})}#s=z(()=>d(this.#t));get isPresent(){return d(this.#s)}set isPresent(e){O(this.#s,e)}get transitionStatus(){return d(this.#i)}#a(){this.#r!==null&&(window.cancelAnimationFrame(this.#r),this.#r=null)}}function Ta(n,e){nt(e,!0);const t=new hm({open:ut(()=>e.open),ref:e.ref});var i=Pe(),r=ae(i);{var s=a=>{var o=Pe(),l=ae(o);Ct(l,()=>e.presence??Ut,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),D(a,o)};_e(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}D(n,i),it()}function fm(n,e,t){return Math.min(t,Math.max(e,n))}class pm{state;#e;constructor(e,t){this.state=Io(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)}}const ps=Vl({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),ms=new zi("ScrollArea.Root"),gs=new zi("ScrollArea.Scrollbar"),Aa=new zi("ScrollArea.ScrollbarVisible"),jl=new zi("ScrollArea.ScrollbarAxis"),fh=new zi("ScrollArea.ScrollbarShared");class ql{static create(e){return ms.set(new ql(e))}opts;attachment;#e=we(null);get scrollAreaNode(){return d(this.#e)}set scrollAreaNode(e){O(this.#e,e,!0)}#t=we(null);get viewportNode(){return d(this.#t)}set viewportNode(e){O(this.#t,e,!0)}#n=we(null);get contentNode(){return d(this.#n)}set contentNode(e){O(this.#n,e,!0)}#i=we(null);get scrollbarXNode(){return d(this.#i)}set scrollbarXNode(e){O(this.#i,e,!0)}#r=we(null);get scrollbarYNode(){return d(this.#r)}set scrollbarYNode(e){O(this.#r,e,!0)}#s=we(0);get cornerWidth(){return d(this.#s)}set cornerWidth(e){O(this.#s,e,!0)}#a=we(0);get cornerHeight(){return d(this.#a)}set cornerHeight(e){O(this.#a,e,!0)}#o=we(!1);get scrollbarXEnabled(){return d(this.#o)}set scrollbarXEnabled(e){O(this.#o,e,!0)}#l=we(!1);get scrollbarYEnabled(){return d(this.#l)}set scrollbarYEnabled(e){O(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref,t=>this.scrollAreaNode=t),this.domContext=new Zd(e.ref)}#c=z(()=>({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`},[ps.root]:"",...this.attachment}));get props(){return d(this.#c)}set props(e){O(this.#c,e)}}class Kl{static create(e){return new Kl(e,ms.get())}opts;root;attachment;#e=Io(Mp());#t=Io(null);contentAttachment=Hn(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref,i=>this.root.viewportNode=i)}#n=z(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[ps.viewport]:"",...this.attachment}));get props(){return d(this.#n)}set props(e){O(this.#n,e)}#i=z(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return d(this.#i)}set contentProps(e){O(this.#i,e)}}class Zl{static create(e){return gs.set(new Zl(e,ms.get()))}opts;root;#e=z(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return d(this.#e)}set isHorizontal(e){O(this.#e,e)}#t=we(!1);get hasThumb(){return d(this.#t)}set hasThumb(e){O(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,Fi(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class $l{static create(){return new $l(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{const t=this.root.scrollAreaNode,i=this.root.opts.scrollHideDelay.current;let r=0;if(!t)return;const s=()=>{this.root.domContext.clearTimeout(r),nn(()=>this.isVisible=!0)},a=()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{nn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},i)},o=Hl(Kt(t,"pointerenter",s),Kt(t,"pointerleave",a));return()=>{this.root.domContext.getWindow().clearTimeout(r),o()}})}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Jl{static create(){return new Jl(gs.get())}scrollbar;root;machine=new pm("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=z(()=>this.machine.state.current==="hidden");get isHidden(){return d(this.#e)}set isHidden(e){O(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>this.machine.dispatch("SCROLL_END"),100);Rt(()=>{const i=this.machine.state.current,r=this.root.opts.scrollHideDelay.current;if(i==="idle"){const s=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),r);return()=>this.root.domContext.clearTimeout(s)}}),Rt(()=>{const i=this.root.viewportNode;if(!i)return;const r=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let s=i[r];return Kt(i,"scroll",()=>{const l=i[r];s!==l&&(this.machine.dispatch("SCROLL"),t()),s=l})}),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=z(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ra{static create(){return new Ra(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>{const i=this.root.viewportNode;if(!i)return;const r=i.offsetWidth<i.scrollWidth,s=i.offsetHeight<i.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?r:s},10);new nr(()=>this.root.viewportNode,t),new nr(()=>this.root.contentNode,t)}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ql{static create(){return Aa.set(new Ql(gs.get()))}scrollbar;root;#e=we(null);get thumbNode(){return d(this.#e)}set thumbNode(e){O(this.#e,e,!0)}#t=we(0);get pointerOffset(){return d(this.#t)}set pointerOffset(e){O(this.#t,e,!0)}#n=we({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return d(this.#n)}set sizes(e){O(this.#n,e)}#i=z(()=>ph(this.sizes.viewport,this.sizes.content));get thumbRatio(){return d(this.#i)}set thumbRatio(e){O(this.#i,e)}#r=z(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return d(this.#r)}set hasThumb(e){O(this.#r,e)}#s=we("");get prevTransformStyle(){return d(this.#s)}set prevTransformStyle(e){O(this.#s,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{this.scrollbar.hasThumb=this.hasThumb}),Rt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return mm({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;const e=this.root.viewportNode.scrollLeft,i=`translate3d(${gu({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}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;const e=this.root.viewportNode.scrollTop,i=`translate3d(0, ${gu({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}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))}}class ec{static create(e){return jl.set(new ec(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarXNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{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;const i=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(i),gh(i,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:ga(this.computedStyle.paddingLeft),paddingEnd:ga(this.computedStyle.paddingRight)}})};#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class tc{static create(e){return jl.set(new tc(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarYNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{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;const i=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(i),gh(i,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:ga(this.computedStyle.paddingTop),paddingEnd:ga(this.computedStyle.paddingBottom)}})}#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class nc{static create(){return fh.set(new nc(jl.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=we(null);get rect(){return d(this.#e)}set rect(e){O(this.#e,e)}#t=we("");get prevWebkitUserSelect(){return d(this.#t)}set prevWebkitUserSelect(e){O(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=z(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return d(this.#n)}set maxScrollPos(e){O(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=wa(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Rt(()=>{const t=this.maxScrollPos,i=this.scrollbar.opts.ref.current;this.root.viewportNode;const r=a=>{const o=a.target;i?.contains(o)&&this.handleWheelScroll(a,t)};return Kt(this.root.domContext.getDocument(),"wheel",r,{passive:!1})}),dp(()=>{this.scrollbarVis.sizes,nn(()=>this.handleThumbPositionChange())}),new nr(()=>this.scrollbar.opts.ref.current,this.handleResize),new nr(()=>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;const t=e.clientX-this.rect.left,i=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:i})}#i(){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){if(e.button!==0)return;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){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#i()}onlostpointercapture(e){this.#i()}#r=z(()=>fn({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[ps.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return d(this.#r)}set props(e){O(this.#r,e)}}class ic{static create(e){return new ic(e,fh.get())}opts;scrollbarState;attachment;#e;#t=we();#n=wa(()=>{d(this.#t)&&(d(this.#t)(),O(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=Hn(this.opts.ref,i=>this.scrollbarState.scrollbarVis.thumbNode=i),Rt(()=>{const i=this.#e.viewportNode;if(!i)return;const r=()=>{if(this.#n(),!d(this.#t)){const a=gm(i,this.scrollbarState.handleThumbPositionChange);O(this.#t,a,!0),this.scrollbarState.handleThumbPositionChange()}};return nn(()=>this.scrollbarState.handleThumbPositionChange()),Kt(i,"scroll",r)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;this.scrollbarState.handleThumbPointerDown({x:r,y:s})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#i=z(()=>({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,[ps.thumb]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}class rc{static create(e){return new rc(e,ms.get())}opts;root;attachment;#e=we(0);#t=we(0);#n=z(()=>!!(d(this.#e)&&d(this.#t)));get hasSize(){return d(this.#n)}set hasSize(e){O(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(this.opts.ref),new nr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,O(this.#t,i,!0)}),new nr(()=>this.root.scrollbarYNode,()=>{const i=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=i,O(this.#e,i,!0)})}#i=z(()=>({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},[ps.corner]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}function ga(n){return n?Number.parseInt(n,10):0}function ph(n,e){const t=n/e;return Number.isNaN(t)?0:t}function Ca(n){const e=ph(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function mm({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=Ca(t),s=r/2,a=e||s,o=r-a,l=t.scrollbar.paddingStart+a,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,u=t.content-t.viewport,h=i==="ltr"?[0,u]:[u*-1,0];return mh([l,c],h)(n)}function gu({scrollPos:n,sizes:e,dir:t="ltr"}){const i=Ca(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,o=s-i,l=t==="ltr"?[0,a]:[a*-1,0],c=fm(n,l[0],l[1]);return mh([0,a],[0,o])(c)}function mh(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(n[1]-n[0]);return e[0]+i*(t-n[0])}}function gh(n,e){return n>0&&n<e}function gm(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=Ep(n);return(function s(){const a={left:n.scrollLeft,top:n.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&e(),t=a,i=r.requestAnimationFrame(s)})(),()=>r.cancelAnimationFrame(i)}var vm=Z("<div><!></div>");function _m(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"type",3,"hover"),a=me(e,"dir",3,"ltr"),o=me(e,"scrollHideDelay",3,600),l=lt(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=ql.create({type:ut(()=>s()),dir:ut(()=>a()),scrollHideDelay:ut(()=>o()),id:ut(()=>r()),ref:ut(()=>i(),S=>i(S))}),u=z(()=>fn(l,c.props));var h=Pe(),f=ae(h);{var p=S=>{var g=Pe(),m=ae(g);Ct(m,()=>e.child,()=>({props:d(u)})),D(S,g)},v=S=>{var g=vm();sn(g,()=>({...d(u)}));var m=Q(g);Ct(m,()=>e.children??Ut),q(g),D(S,g)};_e(f,S=>{e.child?S(p):S(v,-1)})}D(n,h),it()}var xm=Z("<div><div><!></div></div>");function bm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","children"]);const a=Kl.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props)),l=z(()=>fn({},a.contentProps));var c=xm();sn(c,()=>({...d(o)}));var u=Q(c);sn(u,()=>({...d(l)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),q(c),D(n,c),it()}var Sm=Z("<div><!></div>");function vh(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy","child","children"]);const i=nc.create(),r=z(()=>fn(t,i.props));var s=Pe(),a=ae(s);{var o=c=>{var u=Pe(),h=ae(u);Ct(h,()=>e.child,()=>({props:d(r)})),D(c,u)},l=c=>{var u=Sm();sn(u,()=>({...d(r)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),D(c,u)};_e(a,c=>{e.child?c(o):c(l,-1)})}D(n,s),it()}function ym(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=ec.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Mm(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=tc.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Pa(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=Ql.create();var r=Pe(),s=ae(r);{var a=l=>{ym(l,_t(()=>t))},o=l=>{Mm(l,_t(()=>t))};_e(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}D(n,r),it()}function Em(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Ra.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||r.isVisible);Ta(n,{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}it()}function wm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Jl.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||!r.isHidden);Ta(n,_t(()=>d(s),{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}it()}function Tm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=$l.create(),s=Ra.create(),a=z(()=>fn(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=z(()=>t()||r.isVisible&&s.isVisible);Ta(n,{get open(){return d(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{Pa(c,_t(()=>d(a)))},$$slots:{presence:!0}}),it()}function Am(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const a=Zl.create({orientation:ut(()=>e.orientation),id:ut(()=>r()),ref:ut(()=>i(),v=>i(v))}),o=z(()=>a.root.opts.type.current);var l=Pe(),c=ae(l);{var u=v=>{Tm(v,_t(()=>s,{get id(){return r()}}))},h=v=>{wm(v,_t(()=>s,{get id(){return r()}}))},f=v=>{Em(v,_t(()=>s,{get id(){return r()}}))},p=v=>{Pa(v,_t(()=>s,{get id(){return r()}}))};_e(c,v=>{d(o)==="hover"?v(u):d(o)==="scroll"?v(h,1):d(o)==="auto"?v(f,2):d(o)==="always"&&v(p,3)})}D(n,l),it()}var Rm=Z("<div><!></div>");function Cm(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const r=new Wl,s=ic.create({id:ut(()=>e.id),ref:ut(()=>t(),h=>t(h)),mounted:ut(()=>r.current)}),a=z(()=>fn(i,s.props,{style:{hidden:!e.present}}));var o=Pe(),l=ae(o);{var c=h=>{var f=Pe(),p=ae(f);Ct(p,()=>e.child,()=>({props:d(a)})),D(h,f)},u=h=>{var f=Rm();sn(f,()=>({...d(a)}));var p=Q(f);Ct(p,()=>e.children??Ut),q(f),D(h,f)};_e(l,h=>{e.child?h(c):h(u,-1)})}D(n,o),it()}function Pm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"forceMount",3,!1),a=lt(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=Aa.get();{const l=(u,h)=>{let f=()=>h?.().present;Cm(u,_t(()=>a,{get id(){return i()},get present(){return f()},get ref(){return r()},set ref(p){r(p)}}))};let c=z(()=>s()||o.hasThumb);Ta(n,{get open(){return d(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}it()}var Dm=Z("<div><!></div>");function Im(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=rc.create({id:ut(()=>e.id),ref:ut(()=>t(),u=>t(u))}),s=z(()=>fn(i,r.props));var a=Pe(),o=ae(a);{var l=u=>{var h=Pe(),f=ae(h);Ct(f,()=>e.child,()=>({props:d(s)})),D(u,h)},c=u=>{var h=Dm();sn(h,()=>({...d(s)}));var f=Q(h);Ct(f,()=>e.children??Ut),q(h),D(u,h)};_e(o,u=>{e.child?u(l):u(c,-1)})}D(n,a),it()}function Lm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id"]);const a=ms.get(),o=z(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=z(()=>a.opts.type.current!=="scroll"&&d(o));var c=Pe(),u=ae(c);{var h=f=>{Im(f,_t(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};_e(u,f=>{d(l)&&f(h)})}D(n,c),it()}function vu(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.right=`${t}%`):n==="rl"?(i.right=`${e}%`,i.left=`${t}%`):n==="bt"?(i.bottom=`${e}%`,i.top=`${t}%`):(i.top=`${e}%`,i.bottom=`${t}%`),i}function _h(n,e){const t={position:"absolute"};return n==="lr"?(t.left=`${e}%`,t.translate="-50% 0"):n==="rl"?(t.right=`${e}%`,t.translate="50% 0"):n==="bt"?(t.bottom=`${e}%`,t.translate="0 50%"):(t.top=`${e}%`,t.translate="0 -50%"),t}function xh(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.translate=`${t}% 0`):n==="rl"?(i.right=`${e}%`,i.translate=`${-t}% 0`):n==="bt"?(i.bottom=`${e}%`,i.translate=`0 ${-t}%`):(i.top=`${e}%`,i.translate=`0 ${t}%`),i}function Nm(n){if(Math.floor(n)===n)return 0;const e=n.toString();if(e.indexOf(".")!==-1&&e.indexOf("e-")===-1)return e.split(".")[1].length;if(e.indexOf("e-")!==-1){const t=e.split("e-");return parseInt(t[1],10)}return 0}function Um(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function sc(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=Nm(n),a=Math.pow(10,s),o=Math.round(i*a),l=Math.round(n*a);o%l===0&&r++;const c=[];for(let u=0;u<r;u++){const h=e+u*n,f=Um(h,s);c.push(f)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Qi(n,e){if(e.length===0)return n;let t=e[0],i=Math.abs(n-t);for(const r of e){const s=Math.abs(n-r);s<i&&(i=s,t=r)}return t}function Ms(n,e,t){const i=e.indexOf(n);return i===-1?Qi(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function Fm(n,e,t=!0){const[i,r]=n,[s,a]=e,o=(a-s)/(r-i);return l=>{const c=s+o*(l-i);return t?c>Math.max(s,a)?Math.max(s,a):c<Math.min(s,a)?Math.min(s,a):c:c}}const Ni=Vl({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),ac=new zi("Slider.Root");class bh{opts;attachment;#e=we(!1);get isActive(){return d(this.#e)}set isActive(e){O(this.#e,e,!0)}#t=we(0);#n=z(()=>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){O(this.#n,e)}#i=z(()=>sc(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return d(this.#i)}set normalizedSteps(e){O(this.#i,e)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref),this.domContext=new Zd(this.opts.ref),new nr(()=>this.opts.ref.current,this.#r)}#r=()=>{O(this.#t,d(this.#t)+1)};isThumbActive(e){return this.isActive}#s=z(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current==="horizontal"?"pan-y":"pan-x"});getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};getThumbScale=()=>{d(this.#t);const e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current==="exact")return[0,100];const t=this.opts.orientation.current==="vertical",i=this.getAllThumbs()[0],r=t?i?.offsetHeight:i?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];const s=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(s===void 0||Number.isNaN(s)||s===0)return[0,100];const a=r/2/s*100,o=a,l=100-a;return[o,l]};getPositionFromValue=e=>{const t=this.getThumbScale();return Fm([this.opts.min.current,this.opts.max.current],t)(e)};#a=z(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":tr(this.opts.disabled.current),style:{touchAction:d(this.#s)},[Ni.root]:"",...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Om extends bh{opts;isMulti=!1;constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);o(s)||(this.opts.value.current=l(s))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:i}){const r=this.opts.min.current,s=this.opts.max.current,o=(e-t)/(i-t)*(s-r)+r;if(o<r)this.updateValue(r);else if(o>s)this.updateValue(s);else{const l=this.normalizedSteps,c=Qi(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Qi(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!t||!i)return;i.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect();this.direction==="lr"?this.applyPosition({clientXY:e.clientX,start:r,end:s}):this.direction==="rl"?this.applyPosition({clientXY:e.clientX,start:s,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;const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),i.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};#e=z(()=>{const e=this.opts.value.current;return Array.from({length:1},()=>{const t=e,i=this.getPositionFromValue(t),r=_h(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#e)}set thumbsPropsArr(e){O(this.#e,e)}#t=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#t)}set thumbsRenderArr(e){O(this.#t,e)}#n=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=i<=t;return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,"data-selected":this.isTickValueSelected(i)?"":void 0,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#n)}set ticksPropsArr(e){O(this.#n,e)}#i=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#i)}set ticksRenderArr(e){O(this.#i,e)}#r=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#r)}set tickItemsArr(e){O(this.#r,e)}#s=z(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return d(this.#s)}set thumbItemsArr(e){O(this.#s,e)}#a=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#a)}set snippetProps(e){O(this.#a,e)}}class Bm extends bh{opts;isMulti=!0;#e=we(null);get activeThumb(){return d(this.#e)}set activeThumb(e){O(this.#e,e,!0)}#t=we(0);get currentThumbIdx(){return d(this.#t)}set currentThumbIdx(e){O(this.#t,e,!0)}constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);s.some(c=>!o(c))&&(this.opts.value.current=s.map(l))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:i,end:r}){const s=this.opts.min.current,a=this.opts.max.current,l=(e-i)/(r-i)*(a-s)+s;if(l<s)this.updateValue(s,t);else if(l>a)this.updateValue(a,t);else{const c=this.normalizedSteps,u=Qi(l,c);this.updateValue(u,t)}}#n=e=>{const t=this.getAllThumbs();if(!t.length)return;for(const a of t)a.blur();const i=t.map(a=>{if(this.opts.orientation.current==="horizontal"){const{left:o,right:l}=a.getBoundingClientRect();return Math.abs(e.clientX-(o+l)/2)}else{const{top:o,bottom:l}=a.getBoundingClientRect();return Math.abs(e.clientY-(o+l)/2)}}),r=t[i.indexOf(Math.min(...i))],s=t.indexOf(r);return{node:r,idx:s}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.activeThumb;if(!t||!i)return;i.node.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect(),l=this.direction;l==="lr"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:r,end:s}):l==="rl"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:s,end:r}):l==="bt"?this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:o,end:a}):l==="tb"&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.#n(e);if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=i,i.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};updateValue=(e,t)=>{const i=this.opts.value.current;if(!i.length){this.opts.value.current.push(e);return}if(i[t]===e)return;const s=[...i];if(!Op(t,s))return;const a=s[t]>e?-1:1,o=()=>{const c=t+a;s[t]=s[c],s[c]=e;const u=this.getAllThumbs();u.length&&(u[c]?.focus(),this.activeThumb={node:u[c],idx:c})};if(this.opts.autoSort.current&&(a===-1&&e<s[t-1]||a===1&&e>s[t+1])){o(),this.opts.value.current=s;return}const l=this.normalizedSteps;s[t]=Qi(e,l),this.opts.value.current=s};#i=z(()=>{const e=this.opts.value.current;return Array.from({length:e.length||1},(t,i)=>{const r=nn(()=>this.currentThumbIdx);r<e.length&&nn(()=>{this.currentThumbIdx=r+1});const s=e[i],a=this.getPositionFromValue(s??0),o=_h(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#i)}set thumbsPropsArr(e){O(this.#i,e)}#r=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#r)}set thumbsRenderArr(e){O(this.#r,e)}#s=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#s)}set ticksPropsArr(e){O(this.#s,e)}#a=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#a)}set ticksRenderArr(e){O(this.#a,e)}#o=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#o)}set tickItemsArr(e){O(this.#o,e)}#l=z(()=>this.opts.value.current.map((t,i)=>({value:t,index:i})));get thumbItemsArr(){return d(this.#l)}set thumbItemsArr(e){O(this.#l,e)}#c=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#c)}set snippetProps(e){O(this.#c,e)}}class zm{static create(e){const{type:t,...i}=e,r=t==="single"?new Om(i):new Bm(i);return ac.set(r)}}const km=[nh,ih,rh,sh,ah,oh];class oc{static create(e){return new oc(e,ac.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref)}#e=z(()=>{if(Array.isArray(this.root.opts.value.current)){const 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",...vu(this.root.direction,e,t)}}else{const e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,i=this.root.opts.max.current,r=0,s=e!==void 0&&e>0&&t===i?0:100-this.root.getPositionFromValue(t);return{position:"absolute",...vu(this.root.direction,r,s)}}});get rangeStyles(){return d(this.#e)}set rangeStyles(e){O(this.#e,e)}#t=z(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":tr(this.root.opts.disabled.current),style:this.rangeStyles,[Ni.range]:"",...this.attachment}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class lc{static create(e){return new lc(e,ac.get())}opts;root;attachment;#e=z(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(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;const t=this.opts.ref.current;if(!t)return;const i=this.root.getAllThumbs();if(!i.length)return;const r=i.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!km.includes(e.key))return;e.preventDefault();const s=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,l=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,u=this.root.direction,h=this.root.normalizedSteps;switch(e.key){case ah:this.#t(s);break;case oh:this.#t(a);break;case nh:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"next":"prev");this.#t(p)}break;case ih:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"prev":"next");this.#t(p)}break;case rh:if(e.metaKey){const f=u==="tb"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"prev":"next");this.#t(p)}break;case sh:if(e.metaKey){const f=u==="tb"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"next":"prev");this.#t(p)}break}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=z(()=>({...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":tr(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){O(this.#n,e)}}var Vm=Z("<span><!></span>");function Hm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"value",15),a=me(e,"onValueChange",3,mu),o=me(e,"onValueCommit",3,mu),l=me(e,"disabled",3,!1),c=me(e,"step",3,1),u=me(e,"dir",3,"ltr"),h=me(e,"autoSort",3,!0),f=me(e,"orientation",3,"horizontal"),p=me(e,"thumbPositioning",3,"contain"),v=lt(e,["$$slots","$$events","$$legacy","children","child","id","ref","value","type","onValueChange","onValueCommit","disabled","min","max","step","dir","autoSort","orientation","thumbPositioning","trackPadding"]);const S=z(()=>e.min!==void 0?e.min:Array.isArray(c())?Math.min(...c()):0),g=z(()=>e.max!==void 0?e.max:Array.isArray(c())?Math.max(...c()):100);function m(){if(s()===void 0)return e.type==="single"?d(S):[]}m(),Fi.pre(()=>s(),()=>{m()});const x=zm.create({id:ut(()=>i()),ref:ut(()=>r(),_=>r(_)),value:ut(()=>s(),_=>{s(_),a()(_)}),onValueCommit:ut(()=>o()),disabled:ut(()=>l()),min:ut(()=>d(S)),max:ut(()=>d(g)),step:ut(()=>c()),dir:ut(()=>u()),autoSort:ut(()=>h()),orientation:ut(()=>f()),thumbPositioning:ut(()=>p()),type:e.type,trackPadding:ut(()=>e.trackPadding)}),M=z(()=>fn(v,x.props));var T=Pe(),C=ae(T);{var y=_=>{var E=Pe(),L=ae(E);{let P=z(()=>({props:d(M),...x.snippetProps}));Ct(L,()=>e.child,()=>d(P))}D(_,E)},I=_=>{var E=Vm();sn(E,()=>({...d(M)}));var L=Q(E);Ct(L,()=>e.children??Ut,()=>x.snippetProps),q(E),D(_,E)};_e(C,_=>{e.child?_(y):_(I,-1)})}D(n,T),it()}var Gm=Z("<span><!></span>");function Wm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=oc.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props));var l=Pe(),c=ae(l);{var u=f=>{var p=Pe(),v=ae(p);Ct(v,()=>e.child,()=>({props:d(o)})),D(f,p)},h=f=>{var p=Gm();sn(p,()=>({...d(o)}));var v=Q(p);Ct(v,()=>e.children??Ut),q(p),D(f,p)};_e(c,f=>{e.child?f(u):f(h,-1)})}D(n,l),it()}var Xm=Z("<span><!></span>");function Ym(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"disabled",3,!1),a=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id","index","disabled"]);const o=lc.create({id:ut(()=>r()),ref:ut(()=>i(),p=>i(p)),index:ut(()=>e.index),disabled:ut(()=>s())}),l=z(()=>fn(a,o.props));var c=Pe(),u=ae(c);{var h=p=>{var v=Pe(),S=ae(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current),props:d(l)}));Ct(S,()=>e.child,()=>d(g))}D(p,v)},f=p=>{var v=Xm();sn(v,()=>({...d(l)}));var S=Q(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current)}));Ct(S,()=>e.children??Ut,()=>d(g))}q(v),D(p,v)};_e(u,p=>{e.child?p(h):p(f,-1)})}D(n,c),it()}function jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"camera"},()=>t,{get iconNode(){return i}}))}function qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];an(n,_t({name:"circle-check-big"},()=>t,{get iconNode(){return i}}))}function Km(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];an(n,_t({name:"circle-check"},()=>t,{get iconNode(){return i}}))}function Zm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"circle-question-mark"},()=>t,{get iconNode(){return i}}))}function Sh(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"download"},()=>t,{get iconNode(){return i}}))}function Va(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"eye-off"},()=>t,{get iconNode(){return i}}))}function Ha(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"eye"},()=>t,{get iconNode(){return i}}))}function $m(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"file"},()=>t,{get iconNode(){return i}}))}function Jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"folder"},()=>t,{get iconNode(){return i}}))}function Qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"inbox"},()=>t,{get iconNode(){return i}}))}function eg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];an(n,_t({name:"info"},()=>t,{get iconNode(){return i}}))}function tg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"layers"},()=>t,{get iconNode(){return i}}))}function ng(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"link"},()=>t,{get iconNode(){return i}}))}function cc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"loader"},()=>t,{get iconNode(){return i}}))}function uc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"maximize"},()=>t,{get iconNode(){return i}}))}function dc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["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"}]];an(n,_t({name:"minimize"},()=>t,{get iconNode(){return i}}))}function ig(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M5 12h14"}]];an(n,_t({name:"minus"},()=>t,{get iconNode(){return i}}))}function rg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];an(n,_t({name:"zap"},()=>t,{get iconNode(){return i}}))}const Nr={FILE_UPLOAD:{MAX_SIZE_MB:150,MAX_SIZE_BYTES:150*1024*1024},TIMEOUTS:{SOLVE_STATE_DURATION:3500,PARAM_EXPORT_DELAY:100,DRAWER_ANIMATION_MS:350},SOLVING_INDICATOR:{FAST_THRESHOLD_MS:200,SLOW_THRESHOLD_MS:600,ANIMATION_DELAY:300,HISTORY_SIZE:3},FILE_SIZE:{BYTES_PER_KB:1024}};var yh=Object.defineProperty,sg=(n,e,t)=>e in n?yh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ag=(n,e)=>{for(var t in e)yh(n,t,{get:e[t],enumerable:!0})},Es=(n,e,t)=>sg(n,typeof e!="symbol"?e+"":e,t),gi={VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_STATE:"INVALID_STATE",INVALID_INPUT:"INVALID_INPUT",BROWSER_ONLY:"BROWSER_ONLY"},Ui=class Lo extends Error{constructor(e,t="UNKNOWN_ERROR",i){super(e),Es(this,"code"),Es(this,"statusCode"),Es(this,"context"),Es(this,"originalError"),this.name="RhinoComputeError",this.code=t,this.statusCode=i?.statusCode,this.context=i?.context,this.originalError=i?.originalError,i?.originalError&&(this.cause=i.originalError)}static missingValues(e,t,i){return new Lo(`Input "${e}" has no values defined${t?` (expected ${t})`:""}`,gi.INVALID_INPUT,{context:{inputName:e,expectedType:t,...i}})}static unknownParamType(e,t,i){return new Lo(`Unknown paramType: ${e}`,gi.VALIDATION_ERROR,{context:{receivedParamType:e,paramName:t,...i}})}},og=class{debug(){}info(){}warn(){}error(){}},lg=new og;function zt(){return lg}function Mh(n){if(typeof globalThis.Buffer=="function"){let e=globalThis.Buffer.from(n,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof globalThis.atob=="function"){let e=globalThis.atob(n),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i)&255;return t}throw new Ui("Base64 decoding not supported in this environment.",gi.INVALID_STATE,{context:{environmentInfo:"atob or Buffer not available"}})}const hc="184",Dr={ROTATE:0,DOLLY:1,PAN:2},Mr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cg=0,_u=1,ug=2,ta=1,dg=2,Er=3,Sn=0,xn=1,In=2,fi=0,Ir=1,xu=2,bu=3,Su=4,hg=5,ji=100,fg=101,pg=102,mg=103,gg=104,vg=200,_g=201,xg=202,bg=203,No=204,Uo=205,Sg=206,yg=207,Mg=208,Eg=209,wg=210,Tg=211,Ag=212,Rg=213,Cg=214,Fo=0,Oo=1,Bo=2,Ur=3,zo=4,ko=5,Vo=6,Ho=7,Eh=0,Pg=1,Dg=2,Qn=0,wh=1,Th=2,Ah=3,Rh=4,Ch=5,Ph=6,fc=7,Dh=300,ir=301,Fr=302,na=303,Ga=304,Da=306,Go=1e3,kn=1001,Wo=1002,on=1003,Ig=1004,ws=1005,Zt=1006,Wa=1007,Ii=1008,Tn=1009,Ih=1010,Lh=1011,os=1012,pc=1013,ti=1014,An=1015,Rn=1016,mc=1017,gc=1018,ls=1020,Nh=35902,Uh=35899,Fh=1021,Oh=1022,Vn=1023,vi=1026,Ki=1027,Bh=1028,vc=1029,rr=1030,_c=1031,xc=1033,ia=33776,ra=33777,sa=33778,aa=33779,Xo=35840,Yo=35841,jo=35842,qo=35843,Ko=36196,Zo=37492,$o=37496,Jo=37488,Qo=37489,va=37490,el=37491,tl=37808,nl=37809,il=37810,rl=37811,sl=37812,al=37813,ol=37814,ll=37815,cl=37816,ul=37817,dl=37818,hl=37819,fl=37820,pl=37821,ml=36492,gl=36494,vl=36495,_l=36283,xl=36284,_a=36285,bl=36286,Lg=3200,Sl=0,Ng=1,Pi="",wn="srgb",cs="srgb-linear",xa="linear",Pt="srgb",or=7680,yu=519,Ug=512,Fg=513,Og=514,bc=515,Bg=516,zg=517,Sc=518,kg=519,Mu=35044,Eu="300 es",Jn=2e3,us=2001;function Vg(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function ba(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Hg(){const n=ba("canvas");return n.style.display="block",n}const wu={};function Tu(...n){const e="THREE."+n.shift();console.log(e,...n)}function zh(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ot(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function yt(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function yl(...n){const e=n.join(" ");e in wu||(wu[e]=!0,ot(...n))}function Gg(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const Wg={[Fo]:Oo,[Bo]:Vo,[zo]:Ho,[Ur]:ko,[Oo]:Fo,[Vo]:Bo,[Ho]:zo,[ko]:Ur};class ki{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const cn=["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"],oa=Math.PI/180,Ml=180/Math.PI;function vs(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(cn[n&255]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]+"-"+cn[e&255]+cn[e>>8&255]+"-"+cn[e>>16&15|64]+cn[e>>24&255]+"-"+cn[t&63|128]+cn[t>>8&255]+"-"+cn[t>>16&255]+cn[t>>24&255]+cn[i&255]+cn[i>>8&255]+cn[i>>16&255]+cn[i>>24&255]).toLowerCase()}function bt(n,e,t){return Math.max(e,Math.min(t,n))}function Xg(n,e){return(n%e+e)%e}function Xa(n,e,t){return(1-t)*n+t*e}function Hr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function gn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Yg={DEG2RAD:oa},Kc=class Kc{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+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=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kc.prototype.isVector2=!0;let ht=Kc;class Oi{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],f=s[a+0],p=s[a+1],v=s[a+2],S=s[a+3];if(h!==S||l!==f||c!==p||u!==v){let g=l*f+c*p+u*v+h*S;g<0&&(f=-f,p=-p,v=-v,S=-S,g=-g);let m=1-o;if(g<.9995){const x=Math.acos(g),M=Math.sin(x);m=Math.sin(m*x)/M,o=Math.sin(o*x)/M,l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o}else{l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o;const x=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=x,c*=x,u*=x,h*=x}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[a],f=s[a+1],p=s[a+2],v=s[a+3];return e[t]=o*v+u*h+l*p-c*f,e[t+1]=l*v+u*f+c*h-o*p,e[t+2]=c*v+u*p+o*f-l*h,e[t+3]=u*v-o*h-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,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){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),u=o(r/2),h=o(s/2),f=l(i/2),p=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"YXZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"ZXY":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"ZYX":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"YZX":this._x=f*u*h+c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h-f*p*v;break;case"XZY":this._x=f*u*h-c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h+f*p*v;break;default:ot("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=i+o+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(a-r)*p}else if(i>o&&i>h){const p=2*Math.sqrt(1+i-o-h);this._w=(u-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+c)/p}else if(o>h){const p=2*Math.sqrt(1+o-i-h);this._w=(s-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-o);this._w=(a-r)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(bt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);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=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+a*o+r*c-s*l,this._y=r*u+a*l+s*o-i*c,this._z=s*u+a*c+i*l-r*o,this._w=a*u-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Zc=class Zc{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("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(Au.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Au.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*i),u=2*(o*t-s*r),h=2*(s*i-a*t);return this.x=t+l*c+a*h-o*u,this.y=i+l*u+o*c-s*h,this.z=r+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[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=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ya.copy(this).projectOnVector(e),this.sub(Ya)}reflect(e){return this.sub(Ya.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+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,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Zc.prototype.isVector3=!0;let te=Zc;const Ya=new te,Au=new Oi,$c=class $c{constructor(e,t,i,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c)}set(e,t,i,r,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],p=i[5],v=i[8],S=r[0],g=r[3],m=r[6],x=r[1],M=r[4],T=r[7],C=r[2],y=r[5],I=r[8];return s[0]=a*S+o*x+l*C,s[3]=a*g+o*M+l*y,s[6]=a*m+o*T+l*I,s[1]=c*S+u*x+h*C,s[4]=c*g+u*M+h*y,s[7]=c*m+u*T+h*I,s[2]=f*S+p*x+v*C,s[5]=f*g+p*M+v*y,s[8]=f*m+p*T+v*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-i*s*u+i*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,f=o*l-u*s,p=c*s-a*l,v=t*h+i*f+r*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/v;return e[0]=h*S,e[1]=(r*c-u*i)*S,e[2]=(o*i-r*a)*S,e[3]=f*S,e[4]=(u*t-r*l)*S,e[5]=(r*s-o*t)*S,e[6]=p*S,e[7]=(i*l-c*t)*S,e[8]=(a*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ja.makeScale(e,t)),this}rotate(e){return this.premultiply(ja.makeRotation(-e)),this}translate(e,t){return this.premultiply(ja.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};$c.prototype.isMatrix3=!0;let pt=$c;const ja=new pt,Ru=new pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Cu=new pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function jg(){const n={enabled:!0,workingColorSpace:cs,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Pt&&(r.r=pi(r.r),r.g=pi(r.g),r.b=pi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Pt&&(r.r=Lr(r.r),r.g=Lr(r.g),r.b=Lr(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Pi?xa:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return yl("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return yl("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[cs]:{primaries:e,whitePoint:i,transfer:xa,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:wn},outputColorSpaceConfig:{drawingBufferColorSpace:wn}},[wn]:{primaries:e,whitePoint:i,transfer:Pt,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:wn}}}),n}const Mt=jg();function pi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Lr(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let lr;class qg{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{lr===void 0&&(lr=ba("canvas")),lr.width=e.width,lr.height=e.height;const r=lr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=lr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ba("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=pi(s[a]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(pi(t[i]/255)*255):t[i]=pi(t[i]);return{data:t,width:e.width,height:e.height}}else return ot("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Kg=0;class yc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Kg++}),this.uuid=vs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(qa(r[a].image)):s.push(qa(r[a]))}else s=qa(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function qa(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?qg.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ot("Texture: Unable to serialize Texture."),{})}let Zg=0;const Ka=new te;class dn extends ki{constructor(e=dn.DEFAULT_IMAGE,t=dn.DEFAULT_MAPPING,i=kn,r=kn,s=Zt,a=Ii,o=Vn,l=Tn,c=dn.DEFAULT_ANISOTROPY,u=Pi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Zg++}),this.uuid=vs(),this.name="",this.source=new yc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ht(0,0),this.repeat=new ht(1,1),this.center=new ht(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Ka).x}get height(){return this.source.getSize(Ka).y}get depth(){return this.source.getSize(Ka).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ot(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Dh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Go:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Wo:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Go:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Wo:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}dn.DEFAULT_IMAGE=null;dn.DEFAULT_MAPPING=Dh;dn.DEFAULT_ANISOTROPY=1;const Jc=class Jc{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,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,i,r){return this.x=e,this.y=t,this.z=i,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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],v=l[9],S=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-S)<.01&&Math.abs(v-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+S)<.1&&Math.abs(v+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(c+1)/2,T=(p+1)/2,C=(m+1)/2,y=(u+f)/4,I=(h+S)/4,_=(v+g)/4;return M>T&&M>C?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=y/i,s=I/i):T>C?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=y/r,s=_/r):C<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(C),i=I/s,r=_/s),this.set(i,r,s,t),this}let x=Math.sqrt((g-v)*(g-v)+(h-S)*(h-S)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-v)/x,this.y=(h-S)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this.w=bt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this.w=bt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,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}};Jc.prototype.isVector4=!0;let Wt=Jc;class $g extends ki{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},s=new dn(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:Zt,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 i=0;i<this.textures.length;i++)this.textures[i].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,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,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,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new yc(r)}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}dispose(){this.dispatchEvent({type:"dispose"})}}class ei extends $g{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class kh extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Jg extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ma=class Ma{constructor(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){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,i,r,s,a,o,l,c,u,h,f,p,v,S,g)}set(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=p,m[7]=v,m[11]=S,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ma().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/cr.setFromMatrixColumn(e,0).length(),s=1/cr.setFromMatrixColumn(e,1).length(),a=1/cr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+v*c,t[5]=f-S*c,t[9]=-o*l,t[2]=S-f*c,t[6]=v+p*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f+S*o,t[4]=v*o-p,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=p*o-v,t[6]=S+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f-S*o,t[4]=-a*h,t[8]=v+p*o,t[1]=p+v*o,t[5]=a*u,t[9]=S-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=v*c-p,t[8]=f*c+S,t[1]=l*h,t[5]=S*c+f,t[9]=p*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=S-f*h,t[8]=v*h+p,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=p*h+v,t[10]=f-S*h}else if(e.order==="XZY"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+S,t[5]=a*u,t[9]=p*h-v,t[2]=v*h-p,t[6]=o*u,t[10]=S*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Qg,e,ev)}lookAt(e,t,i){const r=this.elements;return Mn.subVectors(e,t),Mn.lengthSq()===0&&(Mn.z=1),Mn.normalize(),Mi.crossVectors(i,Mn),Mi.lengthSq()===0&&(Math.abs(i.z)===1?Mn.x+=1e-4:Mn.z+=1e-4,Mn.normalize(),Mi.crossVectors(i,Mn)),Mi.normalize(),Ts.crossVectors(Mn,Mi),r[0]=Mi.x,r[4]=Ts.x,r[8]=Mn.x,r[1]=Mi.y,r[5]=Ts.y,r[9]=Mn.y,r[2]=Mi.z,r[6]=Ts.z,r[10]=Mn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],p=i[13],v=i[2],S=i[6],g=i[10],m=i[14],x=i[3],M=i[7],T=i[11],C=i[15],y=r[0],I=r[4],_=r[8],E=r[12],L=r[1],P=r[5],k=r[9],W=r[13],H=r[2],N=r[6],R=r[10],F=r[14],U=r[3],X=r[7],V=r[11],$=r[15];return s[0]=a*y+o*L+l*H+c*U,s[4]=a*I+o*P+l*N+c*X,s[8]=a*_+o*k+l*R+c*V,s[12]=a*E+o*W+l*F+c*$,s[1]=u*y+h*L+f*H+p*U,s[5]=u*I+h*P+f*N+p*X,s[9]=u*_+h*k+f*R+p*V,s[13]=u*E+h*W+f*F+p*$,s[2]=v*y+S*L+g*H+m*U,s[6]=v*I+S*P+g*N+m*X,s[10]=v*_+S*k+g*R+m*V,s[14]=v*E+S*W+g*F+m*$,s[3]=x*y+M*L+T*H+C*U,s[7]=x*I+M*P+T*N+C*X,s[11]=x*_+M*k+T*R+C*V,s[15]=x*E+M*W+T*F+C*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],p=e[14],v=e[3],S=e[7],g=e[11],m=e[15],x=l*p-c*f,M=o*p-c*h,T=o*f-l*h,C=a*p-c*u,y=a*f-l*u,I=a*h-o*u;return t*(S*x-g*M+m*T)-i*(v*x-g*C+m*y)+r*(v*M-S*C+m*I)-s*(v*T-S*y+g*I)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const 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]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],v=e[12],S=e[13],g=e[14],m=e[15],x=t*o-i*a,M=t*l-r*a,T=t*c-s*a,C=i*l-r*o,y=i*c-s*o,I=r*c-s*l,_=u*S-h*v,E=u*g-f*v,L=u*m-p*v,P=h*g-f*S,k=h*m-p*S,W=f*m-p*g,H=x*W-M*k+T*P+C*L-y*E+I*_;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/H;return e[0]=(o*W-l*k+c*P)*N,e[1]=(r*k-i*W-s*P)*N,e[2]=(S*I-g*y+m*C)*N,e[3]=(f*y-h*I-p*C)*N,e[4]=(l*L-a*W-c*E)*N,e[5]=(t*W-r*L+s*E)*N,e[6]=(g*T-v*I-m*M)*N,e[7]=(u*I-f*T+p*M)*N,e[8]=(a*k-o*L+c*_)*N,e[9]=(i*L-t*k-s*_)*N,e[10]=(v*y-S*T+m*x)*N,e[11]=(h*T-u*y-p*x)*N,e[12]=(o*E-a*P-l*_)*N,e[13]=(t*P-i*E+r*_)*N,e[14]=(S*M-v*C-g*x)*N,e[15]=(u*C-h*M+f*x)*N,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=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,i,r))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+i,u*l-r*a,0,c*l-r*o,u*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,f=s*c,p=s*u,v=s*h,S=a*u,g=a*h,m=o*h,x=l*c,M=l*u,T=l*h,C=i.x,y=i.y,I=i.z;return r[0]=(1-(S+m))*C,r[1]=(p+T)*C,r[2]=(v-M)*C,r[3]=0,r[4]=(p-T)*y,r[5]=(1-(f+m))*y,r[6]=(g+x)*y,r[7]=0,r[8]=(v+M)*I,r[9]=(g-x)*I,r[10]=(1-(f+S))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),t.identity(),this;let a=cr.set(r[0],r[1],r[2]).length();const o=cr.set(r[4],r[5],r[6]).length(),l=cr.set(r[8],r[9],r[10]).length();s<0&&(a=-a),Fn.copy(this);const c=1/a,u=1/o,h=1/l;return Fn.elements[0]*=c,Fn.elements[1]*=c,Fn.elements[2]*=c,Fn.elements[4]*=u,Fn.elements[5]*=u,Fn.elements[6]*=u,Fn.elements[8]*=h,Fn.elements[9]*=h,Fn.elements[10]*=h,t.setFromRotationMatrix(Fn),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(i-r),f=(t+e)/(t-e),p=(i+r)/(i-r);let v,S;if(l)v=s/(a-s),S=a*s/(a-s);else if(o===Jn)v=-(a+s)/(a-s),S=-2*a*s/(a-s);else if(o===us)v=-a/(a-s),S=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2/(t-e),h=2/(i-r),f=-(t+e)/(t-e),p=-(i+r)/(i-r);let v,S;if(l)v=1/(a-s),S=a/(a-s);else if(o===Jn)v=-2/(a-s),S=-(a+s)/(a-s);else if(o===us)v=-1/(a-s),S=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};Ma.prototype.isMatrix4=!0;let Xt=Ma;const cr=new te,Fn=new Xt,Qg=new te(0,0,0),ev=new te(1,1,1),Mi=new te,Ts=new te,Mn=new te,Pu=new Xt,Du=new Oi;class Bi{constructor(e=0,t=0,i=0,r=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}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,i,r=this._order){return this._x=e,this._y=t,this._z=i,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,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],u=r[9],h=r[2],f=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(bt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-bt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(bt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-bt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(bt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-bt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:ot("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Pu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pu,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Du.setFromEuler(this),this.setFromQuaternion(Du,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}}Bi.DEFAULT_ORDER="XYZ";class Mc{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let tv=0;const Iu=new te,ur=new Oi,ri=new Xt,As=new te,Gr=new te,nv=new te,iv=new Oi,Lu=new te(1,0,0),Nu=new te(0,1,0),Uu=new te(0,0,1),Fu={type:"added"},rv={type:"removed"},dr={type:"childadded",child:null},Za={type:"childremoved",child:null};class hn extends ki{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tv++}),this.uuid=vs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hn.DEFAULT_UP.clone();const e=new te,t=new Bi,i=new Oi,r=new te(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Xt},normalMatrix:{value:new pt}}),this.matrix=new Xt,this.matrixWorld=new Xt,this.matrixAutoUpdate=hn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Mc,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 ur.setFromAxisAngle(e,t),this.quaternion.multiply(ur),this}rotateOnWorldAxis(e,t){return ur.setFromAxisAngle(e,t),this.quaternion.premultiply(ur),this}rotateX(e){return this.rotateOnAxis(Lu,e)}rotateY(e){return this.rotateOnAxis(Nu,e)}rotateZ(e){return this.rotateOnAxis(Uu,e)}translateOnAxis(e,t){return Iu.copy(e).applyQuaternion(this.quaternion),this.position.add(Iu.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Lu,e)}translateY(e){return this.translateOnAxis(Nu,e)}translateZ(e){return this.translateOnAxis(Uu,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ri.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?As.copy(e):As.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Gr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ri.lookAt(Gr,As,this.up):ri.lookAt(As,Gr,this.up),this.quaternion.setFromRotationMatrix(ri),r&&(ri.extractRotation(r.matrixWorld),ur.setFromRotationMatrix(ri),this.quaternion.premultiply(ur.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(yt("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(Fu),dr.child=e,this.dispatchEvent(dr),dr.child=null):yt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(rv),Za.child=e,this.dispatchEvent(Za),Za.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ri.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ri.multiply(e.parent.matrixWorld)),e.applyMatrix4(ri),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Fu),dr.child=e,this.dispatchEvent(dr),dr.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 i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,e,nv),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,iv,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*i-s[8]*r,s[13]+=i-s[1]*t-s[5]*i-s[9]*r,s[14]+=r-s[2]*t-s[6]*i-s[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);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const 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(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),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 s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?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=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),f=a(e.skeletons),p=a(e.animations),v=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p),v.length>0&&(i.nodes=v)}return i.object=r,i;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}hn.DEFAULT_UP=new te(0,1,0);hn.DEFAULT_MATRIX_AUTO_UPDATE=!0;hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Rs=class extends hn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const sv={type:"move"};class $a{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rs,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 Rs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}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,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const S of e.hand.values()){const g=t.getJointPose(S,i),m=this._getHandJoint(c,S);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),p=.02,v=.005;c.inputState.pinching&&f>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),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(sv)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Rs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Vh={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},Ei={h:0,s:0,l:0},Cs={h:0,s:0,l:0};function Ja(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class at{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=wn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Mt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mt.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Mt.workingColorSpace){if(e=Xg(e,1),t=bt(t,0,1),i=bt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Ja(a,s,e+1/3),this.g=Ja(a,s,e),this.b=Ja(a,s,e-1/3)}return Mt.colorSpaceToWorking(this,r),this}setStyle(e,t=wn){function i(s){s!==void 0&&parseFloat(s)<1&&ot("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:ot("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);ot("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=wn){const i=Vh[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ot("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=Lr(e.r),this.g=Lr(e.g),this.b=Lr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=wn){return Mt.workingToColorSpace(un.copy(this),e),Math.round(bt(un.r*255,0,255))*65536+Math.round(bt(un.g*255,0,255))*256+Math.round(bt(un.b*255,0,255))}getHexString(e=wn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mt.workingColorSpace){Mt.workingToColorSpace(un.copy(this),t);const i=un.r,r=un.g,s=un.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case i:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-i)/h+2;break;case s:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Mt.workingColorSpace){return Mt.workingToColorSpace(un.copy(this),t),e.r=un.r,e.g=un.g,e.b=un.b,e}getStyle(e=wn){Mt.workingToColorSpace(un.copy(this),e);const t=un.r,i=un.g,r=un.b;return e!==wn?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Ei),this.setHSL(Ei.h+e,Ei.s+t,Ei.l+i)}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,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Ei),e.getHSL(Cs);const i=Xa(Ei.h,Cs.h,t),r=Xa(Ei.s,Cs.s,t),s=Xa(Ei.l,Cs.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[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}}const un=new at;at.NAMES=Vh;class av extends hn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Bi,this.environmentIntensity=1,this.environmentRotation=new Bi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const On=new te,si=new te,Qa=new te,ai=new te,hr=new te,fr=new te,Ou=new te,eo=new te,to=new te,no=new te,io=new Wt,ro=new Wt,so=new Wt;class zn{constructor(e=new te,t=new te,i=new te){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),On.subVectors(e,t),r.cross(On);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){On.subVectors(r,t),si.subVectors(i,t),Qa.subVectors(e,t);const a=On.dot(On),o=On.dot(si),l=On.dot(Qa),c=si.dot(si),u=si.dot(Qa),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(c*l-o*u)*f,v=(a*u-o*l)*f;return s.set(1-p-v,v,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ai)===null?!1:ai.x>=0&&ai.y>=0&&ai.x+ai.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,ai)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ai.x),l.addScaledVector(a,ai.y),l.addScaledVector(o,ai.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return io.setScalar(0),ro.setScalar(0),so.setScalar(0),io.fromBufferAttribute(e,t),ro.fromBufferAttribute(e,i),so.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(io,s.x),a.addScaledVector(ro,s.y),a.addScaledVector(so,s.z),a}static isFrontFacing(e,t,i,r){return On.subVectors(i,t),si.subVectors(e,t),On.cross(si).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),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 On.subVectors(this.c,this.b),si.subVectors(this.a,this.b),On.cross(si).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;hr.subVectors(r,i),fr.subVectors(s,i),eo.subVectors(e,i);const l=hr.dot(eo),c=fr.dot(eo);if(l<=0&&c<=0)return t.copy(i);to.subVectors(e,r);const u=hr.dot(to),h=fr.dot(to);if(u>=0&&h<=u)return t.copy(r);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(i).addScaledVector(hr,a);no.subVectors(e,s);const p=hr.dot(no),v=fr.dot(no);if(v>=0&&p<=v)return t.copy(s);const S=p*c-l*v;if(S<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(fr,o);const g=u*v-p*h;if(g<=0&&h-u>=0&&p-v>=0)return Ou.subVectors(s,r),o=(h-u)/(h-u+(p-v)),t.copy(r).addScaledVector(Ou,o);const m=1/(g+S+f);return a=S*m,o=f*m,t.copy(i).addScaledVector(hr,a).addScaledVector(fr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class _i{constructor(e=new te(1/0,1/0,1/0),t=new te(-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,i=e.length;t<i;t+=3)this.expandByPoint(Bn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Bn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Bn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Bn):Bn.fromBufferAttribute(s,a),Bn.applyMatrix4(e.matrixWorld),this.expandByPoint(Bn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ps.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ps.copy(i.boundingBox)),Ps.applyMatrix4(e.matrixWorld),this.union(Ps)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Bn),Bn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wr),Ds.subVectors(this.max,Wr),pr.subVectors(e.a,Wr),mr.subVectors(e.b,Wr),gr.subVectors(e.c,Wr),wi.subVectors(mr,pr),Ti.subVectors(gr,mr),Gi.subVectors(pr,gr);let t=[0,-wi.z,wi.y,0,-Ti.z,Ti.y,0,-Gi.z,Gi.y,wi.z,0,-wi.x,Ti.z,0,-Ti.x,Gi.z,0,-Gi.x,-wi.y,wi.x,0,-Ti.y,Ti.x,0,-Gi.y,Gi.x,0];return!ao(t,pr,mr,gr,Ds)||(t=[1,0,0,0,1,0,0,0,1],!ao(t,pr,mr,gr,Ds))?!1:(Is.crossVectors(wi,Ti),t=[Is.x,Is.y,Is.z],ao(t,pr,mr,gr,Ds))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bn).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:(oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(oi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const oi=[new te,new te,new te,new te,new te,new te,new te,new te],Bn=new te,Ps=new _i,pr=new te,mr=new te,gr=new te,wi=new te,Ti=new te,Gi=new te,Wr=new te,Ds=new te,Is=new te,Wi=new te;function ao(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Wi.fromArray(n,s);const o=r.x*Math.abs(Wi.x)+r.y*Math.abs(Wi.y)+r.z*Math.abs(Wi.z),l=e.dot(Wi),c=t.dot(Wi),u=i.dot(Wi);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const di=ov();function ov(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function lv(n){Math.abs(n)>65504&&ot("DataUtils.toHalfFloat(): Value out of range."),n=bt(n,-65504,65504),di.floatView[0]=n;const e=di.uint32View[0],t=e>>23&511;return di.baseTable[t]+((e&8388607)>>di.shiftTable[t])}function cv(n){const e=n>>10;return di.uint32View[0]=di.mantissaTable[di.offsetTable[e]+(n&1023)]+di.exponentTable[e],di.floatView[0]}class Ls{static toHalfFloat(e){return lv(e)}static fromHalfFloat(e){return cv(e)}}const $t=new te,Ns=new ht;let uv=0;class bn extends ki{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:uv++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Mu,this.updateRanges=[],this.gpuType=An,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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Ns.fromBufferAttribute(this,t),Ns.applyMatrix3(e),this.setXY(t,Ns.x,Ns.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix3(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix4(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyNormalMatrix(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.transformDirection(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Hr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=gn(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Hr(t,this.array)),t}setX(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Hr(t,this.array)),t}setY(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setW(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array),s=gn(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Mu&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class Hh extends bn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Gh extends bn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class mi extends bn{constructor(e,t,i){super(new Float32Array(e),t,i)}}const dv=new _i,Xr=new te,oo=new te;class Ec{constructor(e=new te,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):dv.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));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){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Xr.subVectors(e,this.center);const t=Xr.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Xr,r/i),this.radius+=r}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):(oo.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Xr.copy(e.center).add(oo)),this.expandByPoint(Xr.copy(e.center).sub(oo))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let hv=0;const Pn=new Xt,lo=new hn,vr=new te,En=new _i,Yr=new _i,tn=new te;class Wn extends ki{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:hv++}),this.uuid=vs(),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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Vg(e)?Gh:Hh)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new pt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const 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}applyQuaternion(e){return Pn.makeRotationFromQuaternion(e),this.applyMatrix4(Pn),this}rotateX(e){return Pn.makeRotationX(e),this.applyMatrix4(Pn),this}rotateY(e){return Pn.makeRotationY(e),this.applyMatrix4(Pn),this}rotateZ(e){return Pn.makeRotationZ(e),this.applyMatrix4(Pn),this}translate(e,t,i){return Pn.makeTranslation(e,t,i),this.applyMatrix4(Pn),this}scale(e,t,i){return Pn.makeScale(e,t,i),this.applyMatrix4(Pn),this}lookAt(e){return lo.lookAt(e),lo.updateMatrix(),this.applyMatrix4(lo.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vr).negate(),this.translate(vr.x,vr.y,vr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mi(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&ot("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 _i);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];En.setFromBufferAttribute(s),this.morphTargetsRelative?(tn.addVectors(this.boundingBox.min,En.min),this.boundingBox.expandByPoint(tn),tn.addVectors(this.boundingBox.max,En.max),this.boundingBox.expandByPoint(tn)):(this.boundingBox.expandByPoint(En.min),this.boundingBox.expandByPoint(En.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&yt('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 Ec);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new te,1/0);return}if(e){const i=this.boundingSphere.center;if(En.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Yr.setFromBufferAttribute(o),this.morphTargetsRelative?(tn.addVectors(En.min,Yr.min),En.expandByPoint(tn),tn.addVectors(En.max,Yr.max),En.expandByPoint(tn)):(En.expandByPoint(Yr.min),En.expandByPoint(Yr.max))}En.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)tn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(tn));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)tn.fromBufferAttribute(o,c),l&&(vr.fromBufferAttribute(e,c),tn.add(vr)),r=Math.max(r,i.distanceToSquared(tn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&yt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){yt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new te,l[_]=new te;const c=new te,u=new te,h=new te,f=new ht,p=new ht,v=new ht,S=new te,g=new te;function m(_,E,L){c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,E),h.fromBufferAttribute(i,L),f.fromBufferAttribute(s,_),p.fromBufferAttribute(s,E),v.fromBufferAttribute(s,L),u.sub(c),h.sub(c),p.sub(f),v.sub(f);const P=1/(p.x*v.y-v.x*p.y);isFinite(P)&&(S.copy(u).multiplyScalar(v.y).addScaledVector(h,-p.y).multiplyScalar(P),g.copy(h).multiplyScalar(p.x).addScaledVector(u,-v.x).multiplyScalar(P),o[_].add(S),o[E].add(S),o[L].add(S),l[_].add(g),l[E].add(g),l[L].add(g))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const M=new te,T=new te,C=new te,y=new te;function I(_){C.fromBufferAttribute(r,_),y.copy(C);const E=o[_];M.copy(E),M.sub(C.multiplyScalar(C.dot(E))).normalize(),T.crossVectors(y,E);const P=T.dot(l[_])<0?-1:1;a.setXYZW(_,M.x,M.y,M.z,P)}for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)I(e.getX(W+0)),I(e.getX(W+1)),I(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new bn(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);const r=new te,s=new te,a=new te,o=new te,l=new te,c=new te,u=new te,h=new te;if(e)for(let f=0,p=e.count;f<p;f+=3){const v=e.getX(f+0),S=e.getX(f+1),g=e.getX(f+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,S),a.fromBufferAttribute(t,g),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,S),c.fromBufferAttribute(i,g),o.add(u),l.add(u),c.add(u),i.setXYZ(v,o.x,o.y,o.z),i.setXYZ(S,l.x,l.y,l.z),i.setXYZ(g,c.x,c.y,c.z)}else for(let f=0,p=t.count;f<p;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),i.setXYZ(f+0,u.x,u.y,u.z),i.setXYZ(f+1,u.x,u.y,u.z),i.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)tn.fromBufferAttribute(e,t),tn.normalize(),e.setXYZ(t,tn.x,tn.y,tn.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,f=new c.constructor(l.length*u);let p=0,v=0;for(let S=0,g=l.length;S<g;S++){o.isInterleavedBufferAttribute?p=l[S]*o.data.stride+o.offset:p=l[S]*u;for(let m=0;m<u;m++)f[v++]=c[p++]}return new bn(f,u,h)}if(this.index===null)return ot("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Wn,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const f=c[u],p=e(f,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){const p=c[h];u.push(p.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f<p;f++)u.push(h[f].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let fv=0;class kr extends ki{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fv++}),this.uuid=vs(),this.name="",this.type="Material",this.blending=Ir,this.side=Sn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=No,this.blendDst=Uo,this.blendEquation=ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new at(0,0,0),this.blendAlpha=0,this.depthFunc=Ur,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=yu,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=or,this.stencilZFail=or,this.stencilZPass=or,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ot(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ir&&(i.blending=this.blending),this.side!==Sn&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==No&&(i.blendSrc=this.blendSrc),this.blendDst!==Uo&&(i.blendDst=this.blendDst),this.blendEquation!==ji&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ur&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yu&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==or&&(i.stencilFail=this.stencilFail),this.stencilZFail!==or&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==or&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const li=new te,co=new te,Us=new te,Ai=new te,uo=new te,Fs=new te,ho=new te;class wc{constructor(e=new te,t=new te(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,li)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=li.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(li.copy(this.origin).addScaledVector(this.direction,t),li.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){co.copy(e).add(t).multiplyScalar(.5),Us.copy(t).sub(e).normalize(),Ai.copy(this.origin).sub(co);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Us),o=Ai.dot(this.direction),l=-Ai.dot(Us),c=Ai.lengthSq(),u=Math.abs(1-a*a);let h,f,p,v;if(u>0)if(h=a*l-o,f=a*o-l,v=s*u,h>=0)if(f>=-v)if(f<=v){const S=1/u;h*=S,f*=S,p=h*(h+a*f+2*o)+f*(a*h+f+2*l)+c}else f=s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f<=-v?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c):f<=v?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(co).addScaledVector(Us,f),p}intersectSphere(e,t){li.subVectors(e.center,this.origin);const i=li.dot(this.direction),r=li.dot(li)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,li)!==null}intersectTriangle(e,t,i,r,s){uo.subVectors(t,e),Fs.subVectors(i,e),ho.crossVectors(uo,Fs);let a=this.direction.dot(ho),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ai.subVectors(this.origin,e);const l=o*this.direction.dot(Fs.crossVectors(Ai,Fs));if(l<0)return null;const c=o*this.direction.dot(uo.cross(Ai));if(c<0||l+c>a)return null;const u=-o*Ai.dot(ho);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Wh extends kr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new at(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 Bi,this.combine=Eh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Bu=new Xt,Xi=new wc,Os=new Ec,zu=new te,Bs=new te,zs=new te,ks=new te,fo=new te,Vs=new te,ku=new te,Hs=new te;class rn extends hn{constructor(e=new Wn,t=new Wh){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){Vs.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(fo.fromBufferAttribute(h,e),a?Vs.addScaledVector(fo,u):Vs.addScaledVector(fo.sub(t),u))}t.add(Vs)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Os.copy(i.boundingSphere),Os.applyMatrix4(s),Xi.copy(e.ray).recast(e.near),!(Os.containsPoint(Xi.origin)===!1&&(Xi.intersectSphere(Os,zu)===null||Xi.origin.distanceToSquared(zu)>(e.far-e.near)**2))&&(Bu.copy(s).invert(),Xi.copy(e.ray).applyMatrix4(Bu),!(i.boundingBox!==null&&Xi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Xi)))}_computeIntersections(e,t,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=o.getX(T),I=o.getX(T+1),_=o.getX(T+2);r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(o.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=o.getX(g),M=o.getX(g+1),T=o.getX(g+2);r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=T,I=T+1,_=T+2;r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(l.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=g,M=g+1,T=g+2;r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function pv(n,e,t,i,r,s,a,o){let l;if(e.side===xn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Sn,o),l===null)return null;Hs.copy(o),Hs.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(Hs);return c<t.near||c>t.far?null:{distance:c,point:Hs.clone(),object:n}}function Gs(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Bs),n.getVertexPosition(l,zs),n.getVertexPosition(c,ks);const u=pv(n,e,t,i,Bs,zs,ks,ku);if(u){const h=new te;zn.getBarycoord(ku,Bs,zs,ks,h),r&&(u.uv=zn.getInterpolatedAttribute(r,o,l,c,h,new ht)),s&&(u.uv1=zn.getInterpolatedAttribute(s,o,l,c,h,new ht)),a&&(u.normal=zn.getInterpolatedAttribute(a,o,l,c,h,new te),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new te,materialIndex:0};zn.getNormal(Bs,zs,ks,f.normal),u.face=f,u.barycoord=h}return u}class Xh extends dn{constructor(e=null,t=1,i=1,r,s,a,o,l,c=on,u=on,h,f){super(null,a,o,l,c,u,r,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const po=new te,mv=new te,gv=new pt;class Ci{constructor(e=new te(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,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=po.subVectors(i,t).cross(mv.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const r=e.delta(po),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||gv.getNormalMatrix(e),r=this.coplanarPoint(po).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yi=new Ec,vv=new ht(.5,.5),Ws=new te;class Tc{constructor(e=new Ci,t=new Ci,i=new Ci,r=new Ci,s=new Ci,a=new Ci){this.planes=[e,t,i,r,s,a]}set(e,t,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Jn,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],p=s[7],v=s[8],S=s[9],g=s[10],m=s[11],x=s[12],M=s[13],T=s[14],C=s[15];if(r[0].setComponents(c-a,p-u,m-v,C-x).normalize(),r[1].setComponents(c+a,p+u,m+v,C+x).normalize(),r[2].setComponents(c+o,p+h,m+S,C+M).normalize(),r[3].setComponents(c-o,p-h,m-S,C-M).normalize(),i)r[4].setComponents(l,f,g,T).normalize(),r[5].setComponents(c-l,p-f,m-g,C-T).normalize();else if(r[4].setComponents(c-l,p-f,m-g,C-T).normalize(),t===Jn)r[5].setComponents(c+l,p+f,m+g,C+T).normalize();else if(t===us)r[5].setComponents(l,f,g,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Yi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Yi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Yi)}intersectsSprite(e){Yi.center.set(0,0,0);const t=vv.distanceTo(e.center);return Yi.radius=.7071067811865476+t,Yi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yi)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ws.x=r.normal.x>0?e.max.x:e.min.x,Ws.y=r.normal.y>0?e.max.y:e.min.y,Ws.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ws)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Yh extends dn{constructor(e=[],t=ir,i,r,s,a,o,l,c,u){super(e,t,i,r,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Or extends dn{constructor(e,t,i=ti,r,s,a,o=on,l=on,c,u=vi,h=1){if(u!==vi&&u!==Ki)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,r,s,a,o,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new yc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class _v extends Or{constructor(e,t=ti,i=ir,r,s,a=on,o=on,l,c=vi){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,i,r,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class jh extends dn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class _s extends Wn{constructor(e=1,t=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let f=0,p=0;v("z","y","x",-1,-1,i,t,e,a,s,0),v("z","y","x",1,-1,i,t,-e,a,s,1),v("x","z","y",1,1,e,i,t,r,a,2),v("x","z","y",1,-1,e,i,-t,r,a,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new mi(c,3)),this.setAttribute("normal",new mi(u,3)),this.setAttribute("uv",new mi(h,2));function v(S,g,m,x,M,T,C,y,I,_,E){const L=T/I,P=C/_,k=T/2,W=C/2,H=y/2,N=I+1,R=_+1;let F=0,U=0;const X=new te;for(let V=0;V<R;V++){const $=V*P-W;for(let ee=0;ee<N;ee++){const Se=ee*L-k;X[S]=Se*x,X[g]=$*M,X[m]=H,c.push(X.x,X.y,X.z),X[S]=0,X[g]=0,X[m]=y>0?1:-1,u.push(X.x,X.y,X.z),h.push(ee/I),h.push(1-V/_),F+=1}}for(let V=0;V<_;V++)for(let $=0;$<I;$++){const ee=f+$+N*V,Se=f+$+N*(V+1),ye=f+($+1)+N*(V+1),ve=f+($+1)+N*V;l.push(ee,Se,ve),l.push(Se,ye,ve),U+=6}o.addGroup(p,U,E),p+=U,f+=F}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _s(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xs extends Wn{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(i),l=Math.floor(r),c=o+1,u=l+1,h=e/o,f=t/l,p=[],v=[],S=[],g=[];for(let m=0;m<u;m++){const x=m*f-a;for(let M=0;M<c;M++){const T=M*h-s;v.push(T,-x,0),S.push(0,0,1),g.push(M/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let x=0;x<o;x++){const M=x+c*m,T=x+c*(m+1),C=x+1+c*(m+1),y=x+1+c*m;p.push(M,T,y),p.push(T,C,y)}this.setIndex(p),this.setAttribute("position",new mi(v,3)),this.setAttribute("normal",new mi(S,3)),this.setAttribute("uv",new mi(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xs(e.width,e.height,e.widthSegments,e.heightSegments)}}function Br(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Vu(r))r.isRenderTargetTexture?(ot("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone();else if(Array.isArray(r))if(Vu(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][i]=s}else e[t][i]=r.slice();else e[t][i]=r}}return e}function pn(n){const e={};for(let t=0;t<n.length;t++){const i=Br(n[t]);for(const r in i)e[r]=i[r]}return e}function Vu(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function xv(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function qh(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Mt.workingColorSpace}const bv={clone:Br,merge:pn};var Sv=`void main() {
2
2
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3
3
  }`,yv=`void main() {
4
4
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );