shaders 2.2.23 → 2.2.25

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 (213) hide show
  1. package/dist/core/AngularBlur-Dl2gwk68.js +64 -0
  2. package/dist/core/Ascii-Dha_QpT3.js +286 -0
  3. package/dist/core/Beam-CTN9Ni43.js +139 -0
  4. package/dist/core/Blob-CxFDZovO.js +218 -0
  5. package/dist/core/Blur-Y2FsmFk_.js +77 -0
  6. package/dist/core/Bulge-Cb-t0xqI.js +132 -0
  7. package/dist/core/CRTScreen-CtERsenz.js +112 -0
  8. package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
  9. package/dist/core/Checkerboard-CgB-egNY.js +83 -0
  10. package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
  11. package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
  12. package/dist/core/Circle-Daziv5d7.js +67 -0
  13. package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
  14. package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
  15. package/dist/core/Dither-D2Nf4p3w.js +66 -0
  16. package/dist/core/DotGrid-CzOwquo4.js +75 -0
  17. package/dist/core/Duotone-XuTN9tI7.js +65 -0
  18. package/dist/core/FilmGrain-D3-nbi12.js +28 -0
  19. package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
  20. package/dist/core/GlassTiles-CnjCvajI.js +69 -0
  21. package/dist/core/Glow-BluFc9be.js +75 -0
  22. package/dist/core/Godrays-ChLh_vGl.js +144 -0
  23. package/dist/core/Grayscale-DRny75A9.js +20 -0
  24. package/dist/core/Grid-DgyDa4H1.js +58 -0
  25. package/dist/core/GridDistortion-BAspCYvp.js +188 -0
  26. package/dist/core/Group-Dul7PUBl.js +14 -0
  27. package/dist/core/Halftone-Ifv5F_FT.js +65 -0
  28. package/dist/core/HueShift-De8ukMWs.js +31 -0
  29. package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
  30. package/dist/core/Invert-Fz0NtIJc.js +21 -0
  31. package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
  32. package/dist/core/LinearGradient-xbloQjzt.js +133 -0
  33. package/dist/core/Liquify-DMe1V5-O.js +175 -0
  34. package/dist/core/Pixelate-Cv8537Pj.js +37 -0
  35. package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
  36. package/dist/core/Posterize-3m3xkWOz.js +29 -0
  37. package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
  38. package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
  39. package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
  40. package/dist/core/Ripples-8XaZaXQF.js +117 -0
  41. package/dist/core/Saturation-CYFI1jzN.js +30 -0
  42. package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
  43. package/dist/core/SineWave-Dl3nFO1W.js +120 -0
  44. package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
  45. package/dist/core/Spherize-C-jZEUsN.js +128 -0
  46. package/dist/core/Spiral-BSB_R39p.js +132 -0
  47. package/dist/core/Strands-0stO5BMy.js +161 -0
  48. package/dist/core/Stretch-B645paha.js +133 -0
  49. package/dist/core/Swirl-CVnbawit.js +173 -0
  50. package/dist/core/TiltShift-0CxNRI6L.js +134 -0
  51. package/dist/core/Tritone-Daa-I5UD.js +76 -0
  52. package/dist/core/Twirl-2CJVZEtk.js +96 -0
  53. package/dist/core/Vibrance-DRtecEvb.js +30 -0
  54. package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
  55. package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
  56. package/dist/core/colorMixing-BXiTAqJU.js +69 -0
  57. package/dist/core/edges-Bn_OIa_h.js +26 -0
  58. package/dist/core/index.js +2257 -1604
  59. package/dist/core/shaderRegistry.d.ts.map +1 -1
  60. package/dist/core/shaders/AngularBlur/index.js +3 -7
  61. package/dist/core/shaders/Ascii/index.js +2 -6
  62. package/dist/core/shaders/Beam/index.d.ts +71 -0
  63. package/dist/core/shaders/Beam/index.d.ts.map +1 -0
  64. package/dist/core/shaders/Beam/index.js +4 -0
  65. package/dist/core/shaders/Blob/index.js +5 -9
  66. package/dist/core/shaders/Blur/index.js +2 -6
  67. package/dist/core/shaders/Bulge/index.js +4 -8
  68. package/dist/core/shaders/CRTScreen/index.js +2 -6
  69. package/dist/core/shaders/ChannelBlur/index.js +2 -6
  70. package/dist/core/shaders/Checkerboard/index.js +4 -8
  71. package/dist/core/shaders/ChromaFlow/index.js +3 -7
  72. package/dist/core/shaders/ChromaticAberration/index.js +3 -7
  73. package/dist/core/shaders/Circle/index.js +3 -7
  74. package/dist/core/shaders/CursorTrail/index.js +4 -8
  75. package/dist/core/shaders/DiffuseBlur/index.js +4 -8
  76. package/dist/core/shaders/Dither/index.js +3 -7
  77. package/dist/core/shaders/DotGrid/index.js +3 -7
  78. package/dist/core/shaders/Duotone/index.js +4 -8
  79. package/dist/core/shaders/FilmGrain/index.js +2 -6
  80. package/dist/core/shaders/FloatingParticles/index.js +3 -7
  81. package/dist/core/shaders/GlassTiles/index.js +2 -6
  82. package/dist/core/shaders/Glow/index.js +2 -6
  83. package/dist/core/shaders/Godrays/index.js +3 -7
  84. package/dist/core/shaders/Grayscale/index.js +2 -8
  85. package/dist/core/shaders/Grid/index.js +3 -7
  86. package/dist/core/shaders/GridDistortion/index.js +4 -8
  87. package/dist/core/shaders/Group/index.js +2 -6
  88. package/dist/core/shaders/Halftone/index.js +3 -7
  89. package/dist/core/shaders/HueShift/index.js +2 -8
  90. package/dist/core/shaders/ImageTexture/index.js +2 -6
  91. package/dist/core/shaders/Invert/index.js +2 -6
  92. package/dist/core/shaders/LinearBlur/index.js +3 -7
  93. package/dist/core/shaders/LinearGradient/index.js +4 -8
  94. package/dist/core/shaders/Liquify/index.js +4 -8
  95. package/dist/core/shaders/Pixelate/index.js +2 -6
  96. package/dist/core/shaders/PolarCoordinates/index.js +4 -8
  97. package/dist/core/shaders/Posterize/index.js +2 -7
  98. package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
  99. package/dist/core/shaders/RadialGradient/index.js +4 -8
  100. package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
  101. package/dist/core/shaders/Ripples/index.js +5 -9
  102. package/dist/core/shaders/Saturation/index.js +2 -8
  103. package/dist/core/shaders/SimplexNoise/index.js +5 -9
  104. package/dist/core/shaders/SineWave/index.js +3 -7
  105. package/dist/core/shaders/SolidColor/index.js +3 -7
  106. package/dist/core/shaders/Spherize/index.js +3 -7
  107. package/dist/core/shaders/Spiral/index.js +4 -8
  108. package/dist/core/shaders/Strands/index.js +4 -8
  109. package/dist/core/shaders/Stretch/index.js +4 -8
  110. package/dist/core/shaders/Swirl/index.js +5 -9
  111. package/dist/core/shaders/TiltShift/index.js +3 -7
  112. package/dist/core/shaders/Tritone/index.js +4 -8
  113. package/dist/core/shaders/Twirl/index.js +4 -8
  114. package/dist/core/shaders/Vibrance/index.js +2 -8
  115. package/dist/core/shaders/WaveDistortion/index.js +4 -8
  116. package/dist/core/shaders/ZoomBlur/index.js +3 -7
  117. package/dist/core/telemetry/index.js +189 -157
  118. package/dist/core/time-CTJvRUZ4.js +10 -0
  119. package/dist/core/transformations-DxfQXZWi.js +4715 -0
  120. package/dist/react/components/Beam.d.ts +31 -0
  121. package/dist/react/components/Beam.d.ts.map +1 -0
  122. package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
  123. package/dist/react/index.d.ts +1 -0
  124. package/dist/react/index.d.ts.map +1 -1
  125. package/dist/react/index.js +7649 -104600
  126. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  127. package/dist/react/utils/generatePresetCode.js +2 -5
  128. package/dist/registry.js +224 -0
  129. package/dist/solid/components/Beam.d.ts +28 -0
  130. package/dist/solid/components/Beam.d.ts.map +1 -0
  131. package/dist/solid/index.d.ts +1 -0
  132. package/dist/solid/index.d.ts.map +1 -1
  133. package/dist/solid/index.js +6691 -102524
  134. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  135. package/dist/solid/utils/generatePresetCode.js +586 -537
  136. package/dist/svelte/components/Beam.svelte.d.ts +19 -0
  137. package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
  138. package/dist/svelte/index.d.ts +1 -0
  139. package/dist/svelte/index.js +6175 -102455
  140. package/dist/svelte/utils/generatePresetCode.js +2 -5
  141. package/dist/vue/components/Beam.vue.d.ts +57 -0
  142. package/dist/vue/components/Beam.vue.d.ts.map +1 -0
  143. package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
  144. package/dist/vue/index.d.ts +1 -0
  145. package/dist/vue/index.d.ts.map +1 -1
  146. package/dist/vue/index.js +6929 -103492
  147. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  148. package/dist/vue/utils/generatePresetCode.js +2 -5
  149. package/package.json +12 -1
  150. package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
  151. package/dist/core/Ascii-BT0-K_vw.js +0 -196
  152. package/dist/core/Blob-BlQ_1T_8.js +0 -169
  153. package/dist/core/Blur-421AjWLH.js +0 -64
  154. package/dist/core/Bulge-CZRVoR6C.js +0 -103
  155. package/dist/core/CRTScreen-C_U9g_IR.js +0 -91
  156. package/dist/core/ChannelBlur-5pzcB6Zv.js +0 -89
  157. package/dist/core/Checkerboard-CrQkqXhD.js +0 -75
  158. package/dist/core/ChromaFlow-CNrQdL8f.js +0 -134
  159. package/dist/core/ChromaticAberration-D9H7O17Y.js +0 -82
  160. package/dist/core/Circle-DnLaDn8V.js +0 -62
  161. package/dist/core/ColorAdjustment-CKwpE_4M.js +0 -14
  162. package/dist/core/CursorTrail-NY6n97VG.js +0 -105
  163. package/dist/core/DiffuseBlur-C_n01ABk.js +0 -69
  164. package/dist/core/Dither-4s-c4zh4.js +0 -61
  165. package/dist/core/DotGrid-BYl8XdMi.js +0 -61
  166. package/dist/core/Duotone-DbewOoB4.js +0 -66
  167. package/dist/core/FilmGrain-zA_-knOw.js +0 -28
  168. package/dist/core/FloatingParticles-BhVnqMsE.js +0 -160
  169. package/dist/core/GlassTiles-CFI57glh.js +0 -52
  170. package/dist/core/Glow-CQgl3IoS.js +0 -66
  171. package/dist/core/Godrays-BHMix_Bh.js +0 -105
  172. package/dist/core/Grayscale-CAEFLteL.js +0 -21
  173. package/dist/core/Grid-DlM-rVbZ.js +0 -50
  174. package/dist/core/GridDistortion-ZOZphSAT.js +0 -147
  175. package/dist/core/Group-BQAs3RiH.js +0 -17
  176. package/dist/core/Halftone-ci4ga-_J.js +0 -55
  177. package/dist/core/HueShift-CyxzPcJV.js +0 -32
  178. package/dist/core/ImageTexture-CdAGsPuH.js +0 -105
  179. package/dist/core/Invert-iPsiIqNZ.js +0 -20
  180. package/dist/core/LinearBlur-BEaaoIk-.js +0 -56
  181. package/dist/core/LinearGradient-DR_7RxLX.js +0 -111
  182. package/dist/core/Liquify-Bi02_ugh.js +0 -139
  183. package/dist/core/Pixelate-CSsdT1rr.js +0 -38
  184. package/dist/core/PolarCoordinates-D626ml58.js +0 -103
  185. package/dist/core/Posterize-DhZkMaC7.js +0 -46
  186. package/dist/core/ProgressiveBlur-CGtCfLF8.js +0 -102
  187. package/dist/core/RadialGradient-C0_WzmbH.js +0 -71
  188. package/dist/core/RectangularCoordinates-DfXw7fhI.js +0 -92
  189. package/dist/core/Ripples-DkemN3eh.js +0 -106
  190. package/dist/core/Saturation-Dup81Pnq.js +0 -31
  191. package/dist/core/SimplexNoise-BYEiCjDj.js +0 -94
  192. package/dist/core/SineWave-C6MRPtsy.js +0 -107
  193. package/dist/core/SolidColor-BZHRczgb.js +0 -22
  194. package/dist/core/Spherize-DOAnDx2l.js +0 -103
  195. package/dist/core/Spiral-BMjnWXh1.js +0 -115
  196. package/dist/core/Strands-BOVsuJLe.js +0 -125
  197. package/dist/core/Stretch-D6bHc6yp.js +0 -103
  198. package/dist/core/Swirl-BFoc0ImG.js +0 -148
  199. package/dist/core/TSLBase-BFMvTOak.js +0 -8053
  200. package/dist/core/TiltShift-BiNvvhzj.js +0 -114
  201. package/dist/core/Tritone-gdx2AA0m.js +0 -75
  202. package/dist/core/Twirl-BsV8YbqC.js +0 -82
  203. package/dist/core/Vibrance-C182fbSw.js +0 -31
  204. package/dist/core/WaveDistortion-CmaS2zDB.js +0 -132
  205. package/dist/core/ZoomBlur-DLf5xQ16.js +0 -56
  206. package/dist/core/colorMixing--dhzx0ch.js +0 -21
  207. package/dist/core/edges-CDzKsauJ.js +0 -15
  208. package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
  209. package/dist/core/time-DbRMw6Jm.js +0 -10
  210. package/dist/core/transformations-CsrIJXh-.js +0 -3992
  211. package/dist/react/generatePresetCode-DaS7jkcT.js +0 -626
  212. package/dist/svelte/generatePresetCode-DaS7jkcT.js +0 -626
  213. package/dist/vue/generatePresetCode-Cd1B-Y9j.js +0 -632
@@ -1,7 +1,3 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../transformations-CsrIJXh-.js";
3
- import { n as r, t as a } from "../../SolidColor-BZHRczgb.js";
4
- export {
5
- r as componentDefinition,
6
- a as default
7
- };
1
+ import "../../transformations-DxfQXZWi.js";
2
+ import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-CWGq_Bjq.js";
3
+ export { componentDefinition, SolidColor_default as default };
@@ -1,7 +1,3 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../transformations-CsrIJXh-.js";
3
- import { n as i, t as p } from "../../Spherize-DOAnDx2l.js";
4
- export {
5
- i as componentDefinition,
6
- p as default
7
- };
1
+ import "../../transformations-DxfQXZWi.js";
2
+ import { n as componentDefinition, t as Spherize_default } from "../../Spherize-C-jZEUsN.js";
3
+ export { componentDefinition, Spherize_default as default };
@@ -1,8 +1,4 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../transformations-CsrIJXh-.js";
3
- import "../../colorMixing--dhzx0ch.js";
4
- import { n as r, t as a } from "../../Spiral-BMjnWXh1.js";
5
- export {
6
- r as componentDefinition,
7
- a as default
8
- };
1
+ import "../../transformations-DxfQXZWi.js";
2
+ import "../../colorMixing-BXiTAqJU.js";
3
+ import { n as componentDefinition, t as Spiral_default } from "../../Spiral-BSB_R39p.js";
4
+ export { componentDefinition, Spiral_default as default };
@@ -1,8 +1,4 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../time-DbRMw6Jm.js";
3
- import "../../transformations-CsrIJXh-.js";
4
- import { n as a, t as m } from "../../Strands-BOVsuJLe.js";
5
- export {
6
- a as componentDefinition,
7
- m as default
8
- };
1
+ import "../../time-CTJvRUZ4.js";
2
+ import "../../transformations-DxfQXZWi.js";
3
+ import { n as componentDefinition, t as Strands_default } from "../../Strands-0stO5BMy.js";
4
+ export { componentDefinition, Strands_default as default };
@@ -1,8 +1,4 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../edges-CDzKsauJ.js";
3
- import "../../transformations-CsrIJXh-.js";
4
- import { n as e, t as m } from "../../Stretch-D6bHc6yp.js";
5
- export {
6
- e as componentDefinition,
7
- m as default
8
- };
1
+ import "../../edges-Bn_OIa_h.js";
2
+ import "../../transformations-DxfQXZWi.js";
3
+ import { n as componentDefinition, t as Stretch_default } from "../../Stretch-B645paha.js";
4
+ export { componentDefinition, Stretch_default as default };
@@ -1,9 +1,5 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../time-DbRMw6Jm.js";
3
- import "../../transformations-CsrIJXh-.js";
4
- import "../../colorMixing--dhzx0ch.js";
5
- import { n as p, t as a } from "../../Swirl-BFoc0ImG.js";
6
- export {
7
- p as componentDefinition,
8
- a as default
9
- };
1
+ import "../../time-CTJvRUZ4.js";
2
+ import "../../transformations-DxfQXZWi.js";
3
+ import "../../colorMixing-BXiTAqJU.js";
4
+ import { n as componentDefinition, t as Swirl_default } from "../../Swirl-CVnbawit.js";
5
+ export { componentDefinition, Swirl_default as default };
@@ -1,7 +1,3 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../transformations-CsrIJXh-.js";
3
- import { n as a, t as e } from "../../TiltShift-BiNvvhzj.js";
4
- export {
5
- a as componentDefinition,
6
- e as default
7
- };
1
+ import "../../transformations-DxfQXZWi.js";
2
+ import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-0CxNRI6L.js";
3
+ export { componentDefinition, TiltShift_default as default };
@@ -1,8 +1,4 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../transformations-CsrIJXh-.js";
3
- import "../../colorMixing--dhzx0ch.js";
4
- import { n as e, t as m } from "../../Tritone-gdx2AA0m.js";
5
- export {
6
- e as componentDefinition,
7
- m as default
8
- };
1
+ import "../../transformations-DxfQXZWi.js";
2
+ import "../../colorMixing-BXiTAqJU.js";
3
+ import { n as componentDefinition, t as Tritone_default } from "../../Tritone-Daa-I5UD.js";
4
+ export { componentDefinition, Tritone_default as default };
@@ -1,8 +1,4 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../edges-CDzKsauJ.js";
3
- import "../../transformations-CsrIJXh-.js";
4
- import { n as m, t as p } from "../../Twirl-BsV8YbqC.js";
5
- export {
6
- m as componentDefinition,
7
- p as default
8
- };
1
+ import "../../edges-Bn_OIa_h.js";
2
+ import "../../transformations-DxfQXZWi.js";
3
+ import { n as componentDefinition, t as Twirl_default } from "../../Twirl-2CJVZEtk.js";
4
+ export { componentDefinition, Twirl_default as default };
@@ -1,8 +1,2 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../TSLBase-BFMvTOak.js";
3
- import "../../ColorAdjustment-CKwpE_4M.js";
4
- import { n as a, t as e } from "../../Vibrance-C182fbSw.js";
5
- export {
6
- a as componentDefinition,
7
- e as default
8
- };
1
+ import { n as componentDefinition, t as Vibrance_default } from "../../Vibrance-DRtecEvb.js";
2
+ export { componentDefinition, Vibrance_default as default };
@@ -1,8 +1,4 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../edges-CDzKsauJ.js";
3
- import "../../transformations-CsrIJXh-.js";
4
- import { n as a, t as e } from "../../WaveDistortion-CmaS2zDB.js";
5
- export {
6
- a as componentDefinition,
7
- e as default
8
- };
1
+ import "../../edges-Bn_OIa_h.js";
2
+ import "../../transformations-DxfQXZWi.js";
3
+ import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-BscXN2rs.js";
4
+ export { componentDefinition, WaveDistortion_default as default };
@@ -1,7 +1,3 @@
1
- import "../../three.tsl-Btj1hLsf.js";
2
- import "../../transformations-CsrIJXh-.js";
3
- import { n as m, t as r } from "../../ZoomBlur-DLf5xQ16.js";
4
- export {
5
- m as componentDefinition,
6
- r as default
7
- };
1
+ import "../../transformations-DxfQXZWi.js";
2
+ import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-CAqK0Kju.js";
3
+ export { componentDefinition, ZoomBlur_default as default };
@@ -1,162 +1,194 @@
1
- const s = {
2
- samplingRate: 0.05,
3
- collectionDuration: 1e4,
4
- warmupDuration: 1e3,
5
- sampleInterval: 100,
6
- apiEndpoint: "https://shaders.com/api/telemetry"
1
+ const TELEMETRY_CONFIG = {
2
+ samplingRate: .05,
3
+ collectionDuration: 1e4,
4
+ warmupDuration: 1e3,
5
+ sampleInterval: 100,
6
+ apiEndpoint: "https://shaders.com/api/telemetry"
7
7
  };
8
- function p() {
9
- return typeof window > "u" || typeof navigator > "u" ? {
10
- domain: "unknown",
11
- url: "unknown",
12
- userAgent: "unknown",
13
- viewport: {
14
- width: 0,
15
- height: 0
16
- },
17
- devicePixelRatio: 1,
18
- locale: "en-US"
19
- } : {
20
- domain: window.location.hostname,
21
- url: window.location.pathname,
22
- userAgent: navigator.userAgent,
23
- viewport: {
24
- width: window.innerWidth,
25
- height: window.innerHeight
26
- },
27
- devicePixelRatio: window.devicePixelRatio,
28
- locale: navigator.language
29
- };
8
+ function collectEnvironment() {
9
+ if (typeof window === "undefined" || typeof navigator === "undefined") return {
10
+ domain: "unknown",
11
+ url: "unknown",
12
+ userAgent: "unknown",
13
+ viewport: {
14
+ width: 0,
15
+ height: 0
16
+ },
17
+ devicePixelRatio: 1,
18
+ locale: "en-US"
19
+ };
20
+ return {
21
+ domain: window.location.hostname,
22
+ url: window.location.pathname,
23
+ userAgent: navigator.userAgent,
24
+ viewport: {
25
+ width: window.innerWidth,
26
+ height: window.innerHeight
27
+ },
28
+ devicePixelRatio: window.devicePixelRatio,
29
+ locale: navigator.language
30
+ };
30
31
  }
31
- var h = class {
32
- renderer;
33
- sessionId;
34
- frameSamples = [];
35
- sampleInterval = null;
36
- stopped = !1;
37
- constructor(e) {
38
- this.renderer = e, this.sessionId = `tel_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
39
- }
40
- stop() {
41
- this.stopped = !0, this.sampleInterval && (clearInterval(this.sampleInterval), this.sampleInterval = null);
42
- }
43
- async start() {
44
- try {
45
- if (await this.sleep(s.warmupDuration), this.stopped || (this.sampleInterval = setInterval(() => {
46
- if (!this.stopped)
47
- try {
48
- const e = this.renderer.getPerformanceStats();
49
- this.frameSamples.push(e);
50
- } catch (e) {
51
- console.error("Telemetry sampling error:", e);
52
- }
53
- }, s.sampleInterval), await this.sleep(s.collectionDuration - s.warmupDuration), this.stopped)) return;
54
- if (this.sampleInterval && (clearInterval(this.sampleInterval), this.sampleInterval = null), !this.stopped && this.frameSamples.length >= 10) {
55
- const e = this.aggregateData();
56
- await this.sendTelemetry(e);
57
- } else this.frameSamples.length < 10 && console.log("[Telemetry] Insufficient samples collected, skipping send");
58
- } catch (e) {
59
- console.error("Telemetry collection error:", e);
60
- }
61
- }
62
- sleep(e) {
63
- return new Promise((t) => setTimeout(t, e));
64
- }
65
- aggregateData() {
66
- const e = this.aggregatePerformance(), t = this.detectRendererType(), n = this.extractComponents(), r = p();
67
- return {
68
- sessionId: this.sessionId,
69
- timestamp: Date.now(),
70
- collectionDuration: s.collectionDuration,
71
- performance: e,
72
- renderer: t,
73
- components: n,
74
- environment: r
75
- };
76
- }
77
- aggregatePerformance() {
78
- if (this.frameSamples.length === 0) return {
79
- fps: 0,
80
- frameTime: {
81
- avg: 0,
82
- min: 0,
83
- max: 0,
84
- p99: 0
85
- },
86
- jankPercent: 0,
87
- budgetUsed: 0
88
- };
89
- const e = this.frameSamples.map((a) => a.avgFrameTime), t = this.frameSamples.map((a) => a.jankPercent), n = this.frameSamples.map((a) => a.budgetUsed), r = this.frameSamples.map((a) => a.fps), o = this.calculateMedian(r), i = this.calculateMean(e), l = Math.min(...e), c = Math.max(...e), m = this.calculatePercentile(e, 99), d = this.calculateMean(t), u = this.calculateMean(n);
90
- return {
91
- fps: Math.round(o * 10) / 10,
92
- frameTime: {
93
- avg: Math.round(i * 10) / 10,
94
- min: Math.round(l * 10) / 10,
95
- max: Math.round(c * 10) / 10,
96
- p99: Math.round(m * 10) / 10
97
- },
98
- jankPercent: Math.round(d * 10) / 10,
99
- budgetUsed: Math.round(u * 10) / 10
100
- };
101
- }
102
- detectRendererType() {
103
- const e = this.frameSamples[this.frameSamples.length - 1];
104
- return {
105
- type: this.renderer.getRendererType?.() || "webgl",
106
- drawCalls: e?.drawCalls ?? null,
107
- textureCount: e?.textureCount ?? null
108
- };
109
- }
110
- extractComponents() {
111
- try {
112
- const e = this.renderer.getNodeRegistry(), t = [];
113
- for (const [n, r] of e.nodes)
114
- r.parentId !== null && t.push({
115
- name: r.componentName,
116
- requiresRTT: r.requiresRTT,
117
- renderOrder: r.metadata.renderOrder
118
- });
119
- return t.sort((n, r) => n.renderOrder - r.renderOrder);
120
- } catch (e) {
121
- return console.error("Failed to extract components:", e), [];
122
- }
123
- }
124
- async sendTelemetry(e) {
125
- try {
126
- const t = await fetch(s.apiEndpoint, {
127
- method: "POST",
128
- headers: { "Content-Type": "application/json" },
129
- body: JSON.stringify(e)
130
- });
131
- t.ok || console.warn("Telemetry send failed:", t.status, t.statusText);
132
- } catch (t) {
133
- console.error("Telemetry send error:", t);
134
- }
135
- }
136
- calculateMean(e) {
137
- return e.length === 0 ? 0 : e.reduce((t, n) => t + n, 0) / e.length;
138
- }
139
- calculateMedian(e) {
140
- if (e.length === 0) return 0;
141
- const t = [...e].sort((r, o) => r - o), n = Math.floor(t.length / 2);
142
- return t.length % 2 === 0 ? (t[n - 1] + t[n]) / 2 : t[n];
143
- }
144
- calculatePercentile(e, t) {
145
- if (e.length === 0) return 0;
146
- const n = [...e].sort((o, i) => o - i), r = Math.ceil(t / 100 * n.length) - 1;
147
- return n[Math.max(0, r)];
148
- }
32
+ var TelemetryCollector = class {
33
+ renderer;
34
+ sessionId;
35
+ frameSamples = [];
36
+ sampleInterval = null;
37
+ stopped = false;
38
+ constructor(renderer) {
39
+ this.renderer = renderer;
40
+ this.sessionId = `tel_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
41
+ }
42
+ stop() {
43
+ this.stopped = true;
44
+ if (this.sampleInterval) {
45
+ clearInterval(this.sampleInterval);
46
+ this.sampleInterval = null;
47
+ }
48
+ }
49
+ async start() {
50
+ try {
51
+ await this.sleep(TELEMETRY_CONFIG.warmupDuration);
52
+ if (this.stopped) return;
53
+ this.sampleInterval = setInterval(() => {
54
+ if (this.stopped) return;
55
+ try {
56
+ const stats = this.renderer.getPerformanceStats();
57
+ this.frameSamples.push(stats);
58
+ } catch (error) {
59
+ console.error("Telemetry sampling error:", error);
60
+ }
61
+ }, TELEMETRY_CONFIG.sampleInterval);
62
+ await this.sleep(TELEMETRY_CONFIG.collectionDuration - TELEMETRY_CONFIG.warmupDuration);
63
+ if (this.stopped) return;
64
+ if (this.sampleInterval) {
65
+ clearInterval(this.sampleInterval);
66
+ this.sampleInterval = null;
67
+ }
68
+ if (!this.stopped && this.frameSamples.length >= 10) {
69
+ const payload = this.aggregateData();
70
+ await this.sendTelemetry(payload);
71
+ } else if (this.frameSamples.length < 10) console.log("[Telemetry] Insufficient samples collected, skipping send");
72
+ } catch (error) {
73
+ console.error("Telemetry collection error:", error);
74
+ }
75
+ }
76
+ sleep(ms) {
77
+ return new Promise((resolve) => setTimeout(resolve, ms));
78
+ }
79
+ aggregateData() {
80
+ const performance = this.aggregatePerformance();
81
+ const renderer = this.detectRendererType();
82
+ const components = this.extractComponents();
83
+ const environment = collectEnvironment();
84
+ return {
85
+ sessionId: this.sessionId,
86
+ timestamp: Date.now(),
87
+ collectionDuration: TELEMETRY_CONFIG.collectionDuration,
88
+ performance,
89
+ renderer,
90
+ components,
91
+ environment
92
+ };
93
+ }
94
+ aggregatePerformance() {
95
+ if (this.frameSamples.length === 0) return {
96
+ fps: 0,
97
+ frameTime: {
98
+ avg: 0,
99
+ min: 0,
100
+ max: 0,
101
+ p99: 0
102
+ },
103
+ jankPercent: 0,
104
+ budgetUsed: 0
105
+ };
106
+ const frameTimes = this.frameSamples.map((s) => s.avgFrameTime);
107
+ const jankPercents = this.frameSamples.map((s) => s.jankPercent);
108
+ const budgetUseds = this.frameSamples.map((s) => s.budgetUsed);
109
+ const fpsValues = this.frameSamples.map((s) => s.fps);
110
+ const fps = this.calculateMedian(fpsValues);
111
+ const avgFrameTime = this.calculateMean(frameTimes);
112
+ const minFrameTime = Math.min(...frameTimes);
113
+ const maxFrameTime = Math.max(...frameTimes);
114
+ const p99FrameTime = this.calculatePercentile(frameTimes, 99);
115
+ const jankPercent = this.calculateMean(jankPercents);
116
+ const budgetUsed = this.calculateMean(budgetUseds);
117
+ return {
118
+ fps: Math.round(fps * 10) / 10,
119
+ frameTime: {
120
+ avg: Math.round(avgFrameTime * 10) / 10,
121
+ min: Math.round(minFrameTime * 10) / 10,
122
+ max: Math.round(maxFrameTime * 10) / 10,
123
+ p99: Math.round(p99FrameTime * 10) / 10
124
+ },
125
+ jankPercent: Math.round(jankPercent * 10) / 10,
126
+ budgetUsed: Math.round(budgetUsed * 10) / 10
127
+ };
128
+ }
129
+ detectRendererType() {
130
+ const latestSample = this.frameSamples[this.frameSamples.length - 1];
131
+ return {
132
+ type: this.renderer.getRendererType?.() || "webgl",
133
+ drawCalls: latestSample?.drawCalls ?? null,
134
+ textureCount: latestSample?.textureCount ?? null
135
+ };
136
+ }
137
+ extractComponents() {
138
+ try {
139
+ const nodeRegistry = this.renderer.getNodeRegistry();
140
+ const components = [];
141
+ for (const [_, nodeInfo] of nodeRegistry.nodes) {
142
+ if (nodeInfo.parentId === null) continue;
143
+ components.push({
144
+ name: nodeInfo.componentName,
145
+ requiresRTT: nodeInfo.requiresRTT,
146
+ renderOrder: nodeInfo.metadata.renderOrder
147
+ });
148
+ }
149
+ return components.sort((a, b) => a.renderOrder - b.renderOrder);
150
+ } catch (error) {
151
+ console.error("Failed to extract components:", error);
152
+ return [];
153
+ }
154
+ }
155
+ async sendTelemetry(payload) {
156
+ try {
157
+ const response = await fetch(TELEMETRY_CONFIG.apiEndpoint, {
158
+ method: "POST",
159
+ headers: { "Content-Type": "application/json" },
160
+ body: JSON.stringify(payload)
161
+ });
162
+ if (!response.ok) console.warn("Telemetry send failed:", response.status, response.statusText);
163
+ } catch (error) {
164
+ console.error("Telemetry send error:", error);
165
+ }
166
+ }
167
+ calculateMean(values) {
168
+ if (values.length === 0) return 0;
169
+ return values.reduce((a, b) => a + b, 0) / values.length;
170
+ }
171
+ calculateMedian(values) {
172
+ if (values.length === 0) return 0;
173
+ const sorted = [...values].sort((a, b) => a - b);
174
+ const mid = Math.floor(sorted.length / 2);
175
+ if (sorted.length % 2 === 0) return (sorted[mid - 1] + sorted[mid]) / 2;
176
+ else return sorted[mid];
177
+ }
178
+ calculatePercentile(values, percentile) {
179
+ if (values.length === 0) return 0;
180
+ const sorted = [...values].sort((a, b) => a - b);
181
+ const index = Math.ceil(percentile / 100 * sorted.length) - 1;
182
+ return sorted[Math.max(0, index)];
183
+ }
149
184
  };
150
- function f() {
151
- return typeof window < "u" && window.location?.search?.includes("telemetry=true") ? !0 : Math.random() < s.samplingRate;
185
+ function shouldCollectTelemetry() {
186
+ if (typeof window !== "undefined" && window.location?.search?.includes("telemetry=true")) return true;
187
+ return Math.random() < TELEMETRY_CONFIG.samplingRate;
152
188
  }
153
- function g() {
154
- if (typeof window > "u" || !window.location) return !1;
155
- const e = window.location.hostname;
156
- return !e.includes("shaders.com") && e !== "localhost" && e !== "127.0.0.1";
189
+ function isExternalUser() {
190
+ if (typeof window === "undefined" || !window.location) return false;
191
+ const hostname = window.location.hostname;
192
+ return !hostname.includes("shaders.com") && hostname !== "localhost" && hostname !== "127.0.0.1";
157
193
  }
158
- export {
159
- h as TelemetryCollector,
160
- g as isExternalUser,
161
- f as shouldCollectTelemetry
162
- };
194
+ export { TelemetryCollector, isExternalUser, shouldCollectTelemetry };
@@ -0,0 +1,10 @@
1
+ import { uniform } from "three/tsl";
2
+ const createAnimatedTime = (params, speedUniform, seedUniform) => {
3
+ const accumulatedTime = uniform(0);
4
+ params.onBeforeRender(({ deltaTime }) => {
5
+ accumulatedTime.value += deltaTime * speedUniform.uniform.value;
6
+ });
7
+ if (seedUniform) return accumulatedTime.add(seedUniform.uniform);
8
+ return accumulatedTime;
9
+ };
10
+ export { createAnimatedTime as t };