@aguacerowx/react-native 0.0.8 → 0.0.12

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 (469) hide show
  1. package/README.md +60 -60
  2. package/android/build.gradle +83 -84
  3. package/android/src/main/AndroidManifest.xml +6 -6
  4. package/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
  5. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +611 -607
  6. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +299 -297
  7. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +117 -117
  8. package/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -63
  9. package/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
  10. package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -165
  11. package/android/src/main/java/com/facebook/react/viewmanagers/.gitkeep +0 -0
  12. package/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +0 -0
  13. package/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +0 -0
  14. package/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
  15. package/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
  16. package/android/src/main/res/raw/fragment_shader.glsl +97 -97
  17. package/android/src/main/res/raw/vertex_shader.glsl +19 -19
  18. package/index.js +1 -1
  19. package/ios/AguaceroPackage.m +19 -0
  20. package/ios/FragmentUniforms.swift +14 -0
  21. package/ios/GridRenderLayer.swift +962 -62
  22. package/ios/GridRenderLayerBridge.swift +30 -0
  23. package/ios/GridRenderLayerManager.mm +145 -139
  24. package/ios/GridRenderLayerView.h +23 -0
  25. package/ios/GridRenderLayerView.m +199 -0
  26. package/ios/InspectorDataCache.swift +66 -0
  27. package/ios/InspectorModule.m +10 -0
  28. package/ios/InspectorModule.swift +64 -0
  29. package/ios/Shaders.metal +131 -0
  30. package/ios/WeatherFrameProcessorModule.m +16 -0
  31. package/ios/WeatherFrameProcessorModule.swift +104 -0
  32. package/ios/aguacerowx-react-native.podspec +36 -28
  33. package/ios/generated/.gitkeep +0 -0
  34. package/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
  35. package/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
  36. package/lib/commonjs/README.md +60 -60
  37. package/lib/commonjs/android/build.gradle +83 -84
  38. package/lib/commonjs/android/src/main/AndroidManifest.xml +6 -6
  39. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
  40. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +611 -607
  41. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +299 -297
  42. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +117 -117
  43. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -63
  44. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
  45. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -165
  46. package/lib/commonjs/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +0 -0
  47. package/lib/commonjs/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +0 -0
  48. package/lib/commonjs/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
  49. package/lib/commonjs/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
  50. package/lib/commonjs/android/src/main/res/raw/fragment_shader.glsl +97 -97
  51. package/lib/commonjs/android/src/main/res/raw/vertex_shader.glsl +19 -19
  52. package/lib/commonjs/babel.config.js.map +1 -1
  53. package/lib/commonjs/index.js.map +1 -1
  54. package/lib/commonjs/ios/AguaceroPackage.m +19 -0
  55. package/lib/commonjs/ios/FragmentUniforms.swift +14 -0
  56. package/lib/commonjs/ios/GridRenderLayer.swift +962 -0
  57. package/lib/commonjs/ios/GridRenderLayerBridge.swift +30 -0
  58. package/lib/commonjs/ios/GridRenderLayerManager.mm +146 -0
  59. package/lib/commonjs/ios/GridRenderLayerView.h +23 -0
  60. package/lib/commonjs/ios/GridRenderLayerView.m +199 -0
  61. package/lib/commonjs/ios/InspectorDataCache.swift +66 -0
  62. package/lib/commonjs/ios/InspectorModule.m +10 -0
  63. package/lib/commonjs/ios/InspectorModule.swift +64 -0
  64. package/lib/commonjs/ios/Shaders.metal +131 -0
  65. package/lib/commonjs/ios/WeatherFrameProcessorModule.m +16 -0
  66. package/lib/commonjs/ios/WeatherFrameProcessorModule.swift +104 -0
  67. package/lib/commonjs/ios/aguacerowx-react-native.podspec +37 -0
  68. package/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
  69. package/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
  70. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  71. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  72. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  73. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  74. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  75. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  76. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  77. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  78. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  79. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  80. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  81. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  82. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  83. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  84. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  85. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  86. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  87. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  88. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  89. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  90. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  91. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +1029 -0
  92. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  93. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +381 -0
  94. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  95. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1229 -0
  96. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  97. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4023 -0
  98. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  99. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +38 -0
  100. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  101. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +30 -0
  102. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  103. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +27 -0
  104. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  105. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +41 -0
  106. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  107. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +301 -0
  108. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  109. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +126 -0
  110. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  111. package/lib/commonjs/package.json +71 -73
  112. package/lib/commonjs/react-native-builder-bob.config.js.map +1 -1
  113. package/lib/commonjs/src/AguaceroContext.js.map +1 -1
  114. package/lib/commonjs/src/GridRenderLayer.js +32 -7
  115. package/lib/commonjs/src/GridRenderLayer.js.map +1 -1
  116. package/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -1
  117. package/lib/commonjs/src/MapManager.js +1 -4
  118. package/lib/commonjs/src/MapManager.js.map +1 -1
  119. package/lib/commonjs/src/MapRegistry.js.map +1 -1
  120. package/lib/commonjs/src/StyleApplicator.js +6 -6
  121. package/lib/commonjs/src/StyleApplicator.js.map +1 -1
  122. package/lib/commonjs/src/WeatherLayerManager.js +238 -212
  123. package/lib/commonjs/src/WeatherLayerManager.js.map +1 -1
  124. package/lib/commonjs/tsconfig.json +23 -23
  125. package/lib/module/README.md +60 -60
  126. package/lib/module/android/build.gradle +83 -84
  127. package/lib/module/android/src/main/AndroidManifest.xml +6 -6
  128. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
  129. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +611 -607
  130. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +299 -297
  131. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +117 -117
  132. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -63
  133. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
  134. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -165
  135. package/lib/module/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +0 -0
  136. package/lib/module/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +0 -0
  137. package/lib/module/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
  138. package/lib/module/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
  139. package/lib/module/android/src/main/res/raw/fragment_shader.glsl +97 -97
  140. package/lib/module/android/src/main/res/raw/vertex_shader.glsl +19 -19
  141. package/lib/module/babel.config.js.map +1 -1
  142. package/lib/module/index.js.map +1 -1
  143. package/lib/module/ios/AguaceroPackage.m +19 -0
  144. package/lib/module/ios/FragmentUniforms.swift +14 -0
  145. package/lib/module/ios/GridRenderLayer.swift +962 -0
  146. package/lib/module/ios/GridRenderLayerBridge.swift +30 -0
  147. package/lib/module/ios/GridRenderLayerManager.mm +146 -0
  148. package/lib/module/ios/GridRenderLayerView.h +23 -0
  149. package/lib/module/ios/GridRenderLayerView.m +199 -0
  150. package/lib/module/ios/InspectorDataCache.swift +66 -0
  151. package/lib/module/ios/InspectorModule.m +10 -0
  152. package/lib/module/ios/InspectorModule.swift +64 -0
  153. package/lib/module/ios/Shaders.metal +131 -0
  154. package/lib/module/ios/WeatherFrameProcessorModule.m +16 -0
  155. package/lib/module/ios/WeatherFrameProcessorModule.swift +104 -0
  156. package/lib/module/ios/aguacerowx-react-native.podspec +37 -0
  157. package/lib/module/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
  158. package/lib/module/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
  159. package/lib/module/lib/commonjs/README.md +60 -60
  160. package/lib/module/lib/commonjs/android/build.gradle +83 -84
  161. package/lib/module/lib/commonjs/android/src/main/AndroidManifest.xml +6 -6
  162. package/lib/module/lib/commonjs/babel.config.js.map +1 -1
  163. package/lib/module/lib/commonjs/index.js.map +1 -1
  164. package/lib/module/lib/commonjs/ios/AguaceroPackage.m +19 -0
  165. package/lib/module/lib/commonjs/ios/FragmentUniforms.swift +14 -0
  166. package/lib/module/lib/commonjs/ios/GridRenderLayer.swift +962 -0
  167. package/lib/module/lib/commonjs/ios/GridRenderLayerBridge.swift +30 -0
  168. package/lib/module/lib/commonjs/ios/GridRenderLayerManager.mm +146 -0
  169. package/lib/module/lib/commonjs/ios/GridRenderLayerView.h +23 -0
  170. package/lib/module/lib/commonjs/ios/GridRenderLayerView.m +199 -0
  171. package/lib/module/lib/commonjs/ios/InspectorDataCache.swift +66 -0
  172. package/lib/module/lib/commonjs/ios/InspectorModule.m +10 -0
  173. package/lib/module/lib/commonjs/ios/InspectorModule.swift +64 -0
  174. package/lib/module/lib/commonjs/ios/Shaders.metal +131 -0
  175. package/lib/module/lib/commonjs/ios/WeatherFrameProcessorModule.m +16 -0
  176. package/lib/module/lib/commonjs/ios/WeatherFrameProcessorModule.swift +104 -0
  177. package/lib/module/lib/commonjs/ios/aguacerowx-react-native.podspec +37 -0
  178. package/lib/module/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
  179. package/lib/module/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
  180. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  181. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  182. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  183. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  184. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  185. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  186. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  187. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  188. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  189. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  190. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  191. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  192. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  193. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  194. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  195. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  196. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  197. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  198. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  199. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  200. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  201. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +1033 -0
  202. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  203. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +381 -0
  204. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  205. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1229 -0
  206. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  207. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4023 -0
  208. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  209. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +38 -0
  210. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  211. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +30 -0
  212. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  213. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +27 -0
  214. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  215. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +41 -0
  216. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  217. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +301 -0
  218. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  219. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +126 -0
  220. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  221. package/lib/module/lib/commonjs/package.json +71 -73
  222. package/lib/module/lib/commonjs/react-native-builder-bob.config.js.map +1 -1
  223. package/lib/module/lib/commonjs/src/AguaceroContext.js.map +1 -1
  224. package/lib/module/lib/commonjs/src/GridRenderLayer.js +32 -7
  225. package/lib/module/lib/commonjs/src/GridRenderLayer.js.map +1 -1
  226. package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -1
  227. package/lib/module/lib/commonjs/src/MapManager.js +1 -4
  228. package/lib/module/lib/commonjs/src/MapManager.js.map +1 -1
  229. package/lib/module/lib/commonjs/src/MapRegistry.js.map +1 -1
  230. package/lib/module/lib/commonjs/src/StyleApplicator.js +6 -6
  231. package/lib/module/lib/commonjs/src/StyleApplicator.js.map +1 -1
  232. package/lib/module/lib/commonjs/src/WeatherLayerManager.js +238 -212
  233. package/lib/module/lib/commonjs/src/WeatherLayerManager.js.map +1 -1
  234. package/lib/module/lib/commonjs/tsconfig.json +23 -23
  235. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  236. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  237. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  238. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  239. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  240. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  241. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  242. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  243. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  244. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  245. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  246. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  247. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  248. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  249. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  250. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  251. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  252. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  253. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  254. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  255. package/lib/module/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  256. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +1021 -0
  257. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  258. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +375 -0
  259. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  260. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1223 -0
  261. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  262. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4017 -0
  263. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  264. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js +31 -0
  265. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  266. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +29 -0
  267. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  268. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +21 -0
  269. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  270. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js +12 -0
  271. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  272. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +295 -0
  273. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  274. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +119 -0
  275. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  276. package/lib/module/package.json +71 -73
  277. package/lib/module/react-native-builder-bob.config.js.map +1 -1
  278. package/lib/module/src/AguaceroContext.js.map +1 -1
  279. package/lib/module/src/GridRenderLayer.js +32 -7
  280. package/lib/module/src/GridRenderLayer.js.map +1 -1
  281. package/lib/module/src/GridRenderLayerNativeComponent.js.map +1 -1
  282. package/lib/module/src/MapManager.js +1 -4
  283. package/lib/module/src/MapManager.js.map +1 -1
  284. package/lib/module/src/MapRegistry.js.map +1 -1
  285. package/lib/module/src/StyleApplicator.js +6 -6
  286. package/lib/module/src/StyleApplicator.js.map +1 -1
  287. package/lib/module/src/WeatherLayerManager.js +239 -213
  288. package/lib/module/src/WeatherLayerManager.js.map +1 -1
  289. package/lib/module/tsconfig.json +23 -23
  290. package/lib/typescript/src/GridRenderLayer.d.ts.map +1 -1
  291. package/lib/typescript/src/MapManager.d.ts.map +1 -1
  292. package/lib/typescript/src/WeatherLayerManager.d.ts.map +1 -1
  293. package/package.json +71 -73
  294. package/src/AguaceroContext.js +4 -0
  295. package/src/GridRenderLayer.js +205 -0
  296. package/src/GridRenderLayerNativeComponent.ts +16 -0
  297. package/src/MapManager.js +156 -0
  298. package/src/MapRegistry.js +35 -0
  299. package/src/StyleApplicator.js +241 -0
  300. package/src/WeatherLayerManager.js +873 -0
  301. package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/results.bin +0 -1
  302. package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/transformed/classes/classes_dex/classes.dex +0 -0
  303. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/results.bin +0 -1
  304. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/AguaceroPackage.dex +0 -0
  305. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/BuildConfig.dex +0 -0
  306. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.dex +0 -0
  307. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer.dex +0 -0
  308. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayerView.dex +0 -0
  309. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderManager.dex +0 -0
  310. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/InspectorModule.dex +0 -0
  311. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/ShaderUtils.dex +0 -0
  312. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/WeatherFrameProcessorModule.dex +0 -0
  313. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  314. package/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +0 -10
  315. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -8
  316. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  317. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  318. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  319. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  320. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  321. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -4
  322. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  323. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  324. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  325. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  326. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -5
  327. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  328. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
  329. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  330. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  331. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  332. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  333. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  334. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  335. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  336. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  337. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  338. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  339. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  340. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -6
  341. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -8
  342. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -8
  343. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  344. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  345. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +0 -13
  346. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +0 -13
  347. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +0 -98
  348. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +0 -20
  349. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  350. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  351. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  352. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  353. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  354. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  355. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  356. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  357. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  358. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  359. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -5
  360. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
  361. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId1 +0 -0
  362. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  363. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderManager.class.uniqueId3 +0 -0
  364. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/InspectorModule.class.uniqueId0 +0 -0
  365. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  366. package/lib/commonjs/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +0 -10
  367. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -8
  368. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  369. package/lib/commonjs/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  370. package/lib/commonjs/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  371. package/lib/commonjs/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  372. package/lib/commonjs/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  373. package/lib/commonjs/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -4
  374. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  375. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  376. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  377. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  378. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -5
  379. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  380. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
  381. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  382. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  383. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  384. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  385. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  386. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  387. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  388. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  389. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  390. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  391. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  392. package/lib/commonjs/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -6
  393. package/lib/commonjs/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -8
  394. package/lib/commonjs/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -8
  395. package/lib/commonjs/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  396. package/lib/commonjs/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  397. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +0 -13
  398. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +0 -13
  399. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +0 -98
  400. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +0 -20
  401. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  402. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  403. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  404. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  405. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  406. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  407. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  408. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  409. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  410. package/lib/commonjs/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  411. package/lib/commonjs/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -5
  412. package/lib/commonjs/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
  413. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId1 +0 -0
  414. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  415. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderManager.class.uniqueId3 +0 -0
  416. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/InspectorModule.class.uniqueId0 +0 -0
  417. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  418. package/lib/module/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +0 -10
  419. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -8
  420. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  421. package/lib/module/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  422. package/lib/module/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  423. package/lib/module/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  424. package/lib/module/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  425. package/lib/module/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -4
  426. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  427. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  428. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  429. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  430. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -5
  431. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  432. package/lib/module/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
  433. package/lib/module/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  434. package/lib/module/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  435. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  436. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  437. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  438. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  439. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  440. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  441. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  442. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  443. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  444. package/lib/module/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -6
  445. package/lib/module/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -8
  446. package/lib/module/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -8
  447. package/lib/module/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  448. package/lib/module/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  449. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +0 -13
  450. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +0 -13
  451. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +0 -98
  452. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +0 -20
  453. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  454. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  455. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  456. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  457. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  458. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  459. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  460. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  461. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  462. package/lib/module/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  463. package/lib/module/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -5
  464. package/lib/module/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
  465. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId1 +0 -0
  466. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  467. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderManager.class.uniqueId3 +0 -0
  468. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/InspectorModule.class.uniqueId0 +0 -0
  469. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
@@ -0,0 +1,1033 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AguaceroCore = void 0;
7
+ var _events = require("./events.js");
8
+ var _coordinate_configs = require("./coordinate_configs.js");
9
+ var _unitConversions = require("./unitConversions.js");
10
+ var _dictionaries = require("./dictionaries.js");
11
+ var _defaultColormaps = require("./default-colormaps.js");
12
+ var _proj = _interopRequireDefault(require("proj4"));
13
+ var _getBundleId = require("./getBundleId");
14
+ function _interopRequireDefault(e) {
15
+ return e && e.__esModule ? e : {
16
+ default: e
17
+ };
18
+ }
19
+ // AguaceroCore.js - The Headless "Engine"
20
+
21
+ // --- Non-UI Imports ---
22
+
23
+ // --- Non-UI Helper Functions ---
24
+ function hrdpsObliqueTransform(rotated_lon, rotated_lat) {
25
+ const o_lat_p = 53.91148;
26
+ const o_lon_p = 245.305142;
27
+ const DEG_TO_RAD = Math.PI / 180.0;
28
+ const RAD_TO_DEG = 180.0 / Math.PI;
29
+ const o_lat_p_rad = o_lat_p * DEG_TO_RAD;
30
+ const rot_lon_rad = rotated_lon * DEG_TO_RAD;
31
+ const rot_lat_rad = rotated_lat * DEG_TO_RAD;
32
+ const sin_rot_lat = Math.sin(rot_lat_rad);
33
+ const cos_rot_lat = Math.cos(rot_lat_rad);
34
+ const sin_rot_lon = Math.sin(rot_lon_rad);
35
+ const cos_rot_lon = Math.cos(rot_lon_rad);
36
+ const sin_o_lat_p = Math.sin(o_lat_p_rad);
37
+ const cos_o_lat_p = Math.cos(o_lat_p_rad);
38
+ const sin_lat = cos_o_lat_p * sin_rot_lat + sin_o_lat_p * cos_rot_lat * cos_rot_lon;
39
+ let lat = Math.asin(sin_lat) * RAD_TO_DEG;
40
+ const sin_lon_num = cos_rot_lat * sin_rot_lon;
41
+ const sin_lon_den = -sin_o_lat_p * sin_rot_lat + cos_o_lat_p * cos_rot_lat * cos_rot_lon;
42
+ let lon = Math.atan2(sin_lon_num, sin_lon_den) * RAD_TO_DEG + o_lon_p;
43
+ if (lon > 180) lon -= 360;else if (lon < -180) lon += 360;
44
+ return [lon, lat];
45
+ }
46
+ function findLatestModelRun(modelsData, modelName) {
47
+ const model = modelsData?.[modelName];
48
+ if (!model) return null;
49
+ const availableDates = Object.keys(model).sort((a, b) => b.localeCompare(a));
50
+ for (const date of availableDates) {
51
+ const runs = model[date];
52
+ if (!runs) continue;
53
+ const availableRuns = Object.keys(runs).sort((a, b) => b.localeCompare(a));
54
+ if (availableRuns.length > 0) return {
55
+ date: date,
56
+ run: availableRuns[0]
57
+ };
58
+ }
59
+ return null;
60
+ }
61
+ class AguaceroCore extends _events.EventEmitter {
62
+ constructor(options = {}) {
63
+ super();
64
+ this.isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
65
+ this.apiKey = options.apiKey;
66
+ this.bundleId = (0, _getBundleId.getBundleId)();
67
+ this.baseGridUrl = 'https://d3dc62msmxkrd7.cloudfront.net';
68
+ if (!this.isReactNative) {
69
+ this.worker = this.createWorker();
70
+ this.workerRequestId = 0;
71
+ this.workerResolvers = new Map();
72
+ this.worker.addEventListener('message', this._handleWorkerMessage.bind(this));
73
+ this.resultQueue = [];
74
+ this.isProcessingQueue = false;
75
+ } else {
76
+ this.worker = null;
77
+ }
78
+ this.statusUrl = 'https://d3dc62msmxkrd7.cloudfront.net/model-status';
79
+ this.modelStatus = null;
80
+ this.mrmsStatus = null;
81
+ this.dataCache = new Map();
82
+ this.abortControllers = new Map();
83
+ this.isPlaying = false;
84
+ this.playIntervalId = null;
85
+ this.playbackSpeed = options.playbackSpeed || 500;
86
+ this.customColormaps = options.customColormaps || {};
87
+ const userLayerOptions = options.layerOptions || {};
88
+ const initialVariable = userLayerOptions.variable || null;
89
+ this.state = {
90
+ model: userLayerOptions.model || 'gfs',
91
+ isMRMS: false,
92
+ mrmsTimestamp: null,
93
+ variable: initialVariable,
94
+ date: null,
95
+ run: null,
96
+ forecastHour: 0,
97
+ visible: true,
98
+ opacity: userLayerOptions.opacity ?? 1,
99
+ units: options.initialUnit || 'imperial',
100
+ shaderSmoothingEnabled: options.shaderSmoothingEnabled ?? true
101
+ };
102
+ this.autoRefreshEnabled = options.autoRefresh ?? false;
103
+ this.autoRefreshIntervalSeconds = options.autoRefreshInterval ?? 60;
104
+ this.autoRefreshIntervalId = null;
105
+ }
106
+ async setState(newState) {
107
+ Object.assign(this.state, newState);
108
+ this._emitStateChange();
109
+ }
110
+ _emitStateChange() {
111
+ const {
112
+ colormap,
113
+ baseUnit
114
+ } = this._getColormapForVariable(this.state.variable);
115
+ const toUnit = this._getTargetUnit(baseUnit, this.state.units);
116
+ const displayColormap = this._convertColormapUnits(colormap, baseUnit, toUnit);
117
+ let availableTimestamps = [];
118
+ if (this.state.isMRMS && this.state.variable && this.mrmsStatus) {
119
+ const timestamps = this.mrmsStatus[this.state.variable] || [];
120
+ availableTimestamps = [...timestamps].reverse();
121
+ }
122
+ const eventPayload = {
123
+ ...this.state,
124
+ availableModels: this.modelStatus ? Object.keys(this.modelStatus).sort() : [],
125
+ availableRuns: this.modelStatus?.[this.state.model] || {},
126
+ availableHours: this.state.isMRMS ? [] : this.modelStatus?.[this.state.model]?.[this.state.date]?.[this.state.run] || [],
127
+ availableVariables: this.getAvailableVariables(this.state.isMRMS ? 'mrms' : this.state.model),
128
+ // We need to confirm this line is working as expected.
129
+ availableMRMSVariables: this.getAvailableVariables('mrms'),
130
+ availableTimestamps: availableTimestamps,
131
+ isPlaying: this.isPlaying,
132
+ colormap: displayColormap,
133
+ colormapBaseUnit: toUnit
134
+ };
135
+ this.emit('state:change', eventPayload);
136
+ }
137
+ async initialize(options = {}) {
138
+ await this.fetchModelStatus(true);
139
+ await this.fetchMRMSStatus(true);
140
+ const latestRun = findLatestModelRun(this.modelStatus, this.state.model);
141
+ let initialState = this.state;
142
+ if (latestRun && !this.state.isMRMS) {
143
+ initialState = {
144
+ ...this.state,
145
+ ...latestRun,
146
+ forecastHour: 0
147
+ };
148
+ const availableVariables = this.getAvailableVariables(initialState.model);
149
+ if (availableVariables && availableVariables.length > 0) {
150
+ initialState.variable = availableVariables[0];
151
+ }
152
+ }
153
+ await this.setState(initialState);
154
+ if (options.autoRefresh ?? this.autoRefreshEnabled) {
155
+ this.startAutoRefresh(options.refreshInterval ?? this.autoRefreshIntervalSeconds);
156
+ }
157
+ }
158
+ destroy() {
159
+ this.pause();
160
+ this.stopAutoRefresh();
161
+ this.dataCache.clear();
162
+ if (this.worker) {
163
+ this.worker.terminate();
164
+ }
165
+ this.callbacks = {};
166
+ console.log(`AguaceroCore has been destroyed.`);
167
+ }
168
+
169
+ // --- Public API Methods ---
170
+
171
+ play() {
172
+ if (this.isPlaying) return;
173
+ this.isPlaying = true;
174
+ clearInterval(this.playIntervalId);
175
+ this.playIntervalId = setInterval(() => {
176
+ this.step(1);
177
+ }, this.playbackSpeed);
178
+ this.emit('playback:start', {
179
+ speed: this.playbackSpeed
180
+ });
181
+ this._emitStateChange(); // Notify UI that isPlaying is now true
182
+ }
183
+ pause() {
184
+ if (!this.isPlaying) return;
185
+ this.isPlaying = false;
186
+ clearInterval(this.playIntervalId);
187
+ this.playIntervalId = null;
188
+ this.emit('playback:stop');
189
+ this._emitStateChange(); // Notify UI that isPlaying is now false
190
+ }
191
+ togglePlay() {
192
+ this.isPlaying ? this.pause() : this.play();
193
+ }
194
+ step(direction = 1) {
195
+ // --- THIS IS THE CORRECTED MRMS LOGIC ---
196
+ if (this.state.isMRMS) {
197
+ const {
198
+ variable,
199
+ mrmsTimestamp
200
+ } = this.state;
201
+ if (!this.mrmsStatus || !this.mrmsStatus[variable]) {
202
+ console.warn('[Core.step] MRMS status or variable not available.');
203
+ return;
204
+ }
205
+
206
+ // CRITICAL FIX: The UI and state emissions use a REVERSED array (newest first).
207
+ // The step logic MUST use the same reversed array for indexes to match.
208
+ const availableTimestamps = [...(this.mrmsStatus[variable] || [])].reverse();
209
+ if (availableTimestamps.length === 0) return;
210
+ const currentIndex = availableTimestamps.indexOf(mrmsTimestamp);
211
+ if (currentIndex === -1) {
212
+ // If not found, reset to the first (newest) frame
213
+ this.setState({
214
+ mrmsTimestamp: availableTimestamps[0]
215
+ });
216
+ return;
217
+ }
218
+ const maxIndex = availableTimestamps.length - 1;
219
+ let nextIndex = currentIndex + direction;
220
+
221
+ // Loop animation
222
+ if (nextIndex > maxIndex) nextIndex = 0;
223
+ if (nextIndex < 0) nextIndex = maxIndex;
224
+ const newTimestamp = availableTimestamps[nextIndex];
225
+ this.setState({
226
+ mrmsTimestamp: newTimestamp
227
+ });
228
+ } else {
229
+ const {
230
+ model,
231
+ date,
232
+ run,
233
+ forecastHour
234
+ } = this.state;
235
+ const forecastHours = this.modelStatus?.[model]?.[date]?.[run];
236
+ if (!forecastHours || forecastHours.length === 0) return;
237
+ const currentIndex = forecastHours.indexOf(forecastHour);
238
+ if (currentIndex === -1) return;
239
+ const maxIndex = forecastHours.length - 1;
240
+ let nextIndex = currentIndex + direction;
241
+ if (nextIndex > maxIndex) nextIndex = 0;
242
+ if (nextIndex < 0) nextIndex = maxIndex;
243
+ const newHour = forecastHours[nextIndex];
244
+ this.setState({
245
+ forecastHour: newHour
246
+ });
247
+ }
248
+ }
249
+ setPlaybackSpeed(speed) {
250
+ if (speed > 0) {
251
+ this.playbackSpeed = speed;
252
+ if (this.isPlaying) this.play();
253
+ }
254
+ }
255
+ async setShaderSmoothing(enabled) {
256
+ if (typeof enabled !== 'boolean' || enabled === this.state.shaderSmoothingEnabled) return;
257
+ await this.setState({
258
+ shaderSmoothingEnabled: enabled
259
+ });
260
+ }
261
+ async setOpacity(newOpacity) {
262
+ const clampedOpacity = Math.max(0, Math.min(1, newOpacity));
263
+ if (clampedOpacity === this.state.opacity) return;
264
+ await this.setState({
265
+ opacity: clampedOpacity
266
+ });
267
+ }
268
+ async setVariable(variable) {
269
+ await this.setState({
270
+ variable
271
+ });
272
+ }
273
+ async setModel(modelName) {
274
+ if (modelName === this.state.model || !this.modelStatus?.[modelName]) return;
275
+ const latestRun = findLatestModelRun(this.modelStatus, modelName);
276
+ if (latestRun) {
277
+ await this.setState({
278
+ model: modelName,
279
+ date: latestRun.date,
280
+ run: latestRun.run,
281
+ forecastHour: 0
282
+ });
283
+ }
284
+ }
285
+ async setRun(runString) {
286
+ const [date, run] = runString.split(':');
287
+ if (date !== this.state.date || run !== this.state.run) {
288
+ await this.setState({
289
+ date,
290
+ run,
291
+ forecastHour: 0
292
+ });
293
+ }
294
+ }
295
+ async setUnits(newUnits) {
296
+ if (newUnits === this.state.units || !['metric', 'imperial'].includes(newUnits)) return;
297
+ await this.setState({
298
+ units: newUnits
299
+ });
300
+ }
301
+ async setMRMSVariable(variable) {
302
+ const sortedTimestamps = [...(this.mrmsStatus[variable] || [])].sort((a, b) => b - a);
303
+ const initialTimestamp = sortedTimestamps.length > 0 ? sortedTimestamps[0] : null;
304
+ await this.setState({
305
+ variable,
306
+ isMRMS: true,
307
+ mrmsTimestamp: initialTimestamp
308
+ });
309
+ }
310
+ async setMRMSTimestamp(timestamp) {
311
+ if (!this.state.isMRMS) return;
312
+ await this.setState({
313
+ mrmsTimestamp: timestamp
314
+ });
315
+ }
316
+ async switchMode(options) {
317
+ const {
318
+ mode,
319
+ variable,
320
+ model,
321
+ forecastHour,
322
+ mrmsTimestamp
323
+ } = options;
324
+ if (!mode || !variable) {
325
+ console.error("switchMode requires 'mode' ('mrms' | 'model') and 'variable' properties.");
326
+ return;
327
+ }
328
+ if (mode === 'model' && !model) {
329
+ console.error("switchMode with mode 'model' requires a 'model' property.");
330
+ return;
331
+ }
332
+ let targetState = {};
333
+ if (mode === 'mrms') {
334
+ let finalTimestamp = mrmsTimestamp;
335
+ if (finalTimestamp === undefined) {
336
+ const sortedTimestamps = [...(this.mrmsStatus[variable] || [])].sort((a, b) => b - a);
337
+ finalTimestamp = sortedTimestamps.length > 0 ? sortedTimestamps[0] : null;
338
+ }
339
+ targetState = {
340
+ isMRMS: true,
341
+ variable: variable,
342
+ mrmsTimestamp: finalTimestamp,
343
+ model: this.state.model,
344
+ date: null,
345
+ run: null,
346
+ forecastHour: 0
347
+ };
348
+ } else if (mode === 'model') {
349
+ const latestRun = findLatestModelRun(this.modelStatus, model);
350
+ if (!latestRun) {
351
+ console.error(`Could not find a valid run for model: ${model}`);
352
+ return;
353
+ }
354
+ targetState = {
355
+ isMRMS: false,
356
+ model: model,
357
+ variable: variable,
358
+ date: latestRun.date,
359
+ run: latestRun.run,
360
+ forecastHour: forecastHour !== undefined ? forecastHour : 0,
361
+ mrmsTimestamp: null
362
+ };
363
+ } else {
364
+ console.error(`Invalid mode specified in switchMode: '${mode}'`);
365
+ return;
366
+ }
367
+ await this.setState(targetState);
368
+ }
369
+
370
+ // --- Data and Calculation Methods ---
371
+
372
+ _reconstructData(decompressedDeltas, encoding) {
373
+ const expectedLength = encoding.length;
374
+ const reconstructedData = new Int8Array(expectedLength);
375
+ if (decompressedDeltas.length > 0 && expectedLength > 0) {
376
+ // First value is absolute
377
+ reconstructedData[0] = decompressedDeltas[0] > 127 ? decompressedDeltas[0] - 256 : decompressedDeltas[0];
378
+
379
+ // Subsequent values are deltas from the previous one
380
+ for (let i = 1; i < expectedLength; i++) {
381
+ const delta = decompressedDeltas[i] > 127 ? decompressedDeltas[i] - 256 : decompressedDeltas[i];
382
+ reconstructedData[i] = reconstructedData[i - 1] + delta;
383
+ }
384
+ }
385
+ // Return as a Uint8Array, which is what the rest of the code expects
386
+ return new Uint8Array(reconstructedData.buffer);
387
+ }
388
+ async _loadGridData(state) {
389
+ if (this.isReactNative) {
390
+ console.warn(`[AguaceroCore] _loadGridData was called in React Native. This is a bypass. Data loading is handled natively.`);
391
+ return null;
392
+ }
393
+ const {
394
+ model,
395
+ date,
396
+ run,
397
+ forecastHour,
398
+ variable,
399
+ isMRMS,
400
+ mrmsTimestamp
401
+ } = state;
402
+ let effectiveSmoothing = 0;
403
+ const customVariableSettings = this.customColormaps[variable];
404
+ if (customVariableSettings && typeof customVariableSettings.smoothing === 'number') {
405
+ effectiveSmoothing = customVariableSettings.smoothing;
406
+ }
407
+ let resourcePath;
408
+ let dataUrlIdentifier;
409
+ if (isMRMS) {
410
+ if (!mrmsTimestamp) return null;
411
+ const mrmsDate = new Date(mrmsTimestamp * 1000);
412
+ const y = mrmsDate.getUTCFullYear(),
413
+ m = (mrmsDate.getUTCMonth() + 1).toString().padStart(2, '0'),
414
+ d = mrmsDate.getUTCDate().toString().padStart(2, '0');
415
+ dataUrlIdentifier = `mrms-${mrmsTimestamp}-${variable}-${effectiveSmoothing}`;
416
+ resourcePath = `/grids/mrms/${y}${m}${d}/${mrmsTimestamp}/0/${variable}/${effectiveSmoothing}`;
417
+ } else {
418
+ dataUrlIdentifier = `${model}-${date}-${run}-${forecastHour}-${variable}-${effectiveSmoothing}`;
419
+ resourcePath = `/grids/${model}/${date}/${run}/${forecastHour}/${variable}/${effectiveSmoothing}`;
420
+ }
421
+ if (this.dataCache.has(dataUrlIdentifier)) {
422
+ return this.dataCache.get(dataUrlIdentifier);
423
+ }
424
+
425
+ // --- EDITED ---
426
+ // If we are in React Native, this function should NOT do any work.
427
+ // The native WeatherFrameProcessorModule is now responsible for all data loading.
428
+ // This function might still be called by a "cache miss" fallback, but it
429
+ // should not fetch data from JS anymore. We return null so the fallback knows
430
+ // that the native module is the only source of truth for new data.
431
+ if (this.isReactNative) {
432
+ console.warn(`_loadGridData was called in React Native for ${dataUrlIdentifier}. This should be handled by the native module. Returning null.`);
433
+ return null;
434
+ }
435
+ const abortController = new AbortController();
436
+ this.abortControllers.set(dataUrlIdentifier, abortController);
437
+ const loadPromise = (async () => {
438
+ if (!this.apiKey) {
439
+ throw new Error('API key is not configured.');
440
+ }
441
+ try {
442
+ const baseUrl = `${this.baseGridUrl}${resourcePath}`;
443
+ const urlWithApiKeyParam = `${baseUrl}?apiKey=${this.apiKey}`;
444
+ const headers = {
445
+ 'x-api-key': this.apiKey
446
+ };
447
+ if (this.bundleId && this.isReactNative) {
448
+ headers['x-app-identifier'] = this.bundleId;
449
+ }
450
+ const response = await fetch(urlWithApiKeyParam, {
451
+ headers: headers,
452
+ signal: abortController.signal
453
+ });
454
+ if (!response.ok) {
455
+ throw new Error(`Failed to fetch grid data: ${response.status} ${response.statusText}`);
456
+ }
457
+ const {
458
+ data: b64Data,
459
+ encoding
460
+ } = await response.json();
461
+ const compressedData = Uint8Array.from(atob(b64Data), c => c.charCodeAt(0));
462
+
463
+ // This path is now ONLY for the web worker
464
+ const requestId = this.workerRequestId++;
465
+ const workerPromise = new Promise((resolve, reject) => {
466
+ this.workerResolvers.set(requestId, {
467
+ resolve,
468
+ reject
469
+ });
470
+ });
471
+ this.worker.postMessage({
472
+ requestId,
473
+ compressedData,
474
+ encoding
475
+ }, [compressedData.buffer]);
476
+ const result = await workerPromise;
477
+ const finalData = result.data;
478
+ const transformedData = new Uint8Array(finalData.length);
479
+ for (let i = 0; i < finalData.length; i++) {
480
+ const signedValue = finalData[i] > 127 ? finalData[i] - 256 : finalData[i];
481
+ transformedData[i] = signedValue + 128;
482
+ }
483
+ this.abortControllers.delete(dataUrlIdentifier);
484
+ return {
485
+ data: transformedData,
486
+ encoding
487
+ };
488
+ } catch (error) {
489
+ if (error.name === 'AbortError') {
490
+ console.log(`Request cancelled for ${resourcePath}`);
491
+ } else {
492
+ console.error(`Failed to load data for path ${resourcePath}:`, error);
493
+ }
494
+ this.dataCache.delete(dataUrlIdentifier);
495
+ this.abortControllers.delete(dataUrlIdentifier);
496
+ return null;
497
+ }
498
+ })();
499
+ this.dataCache.set(dataUrlIdentifier, loadPromise);
500
+ return loadPromise;
501
+ }
502
+ cancelAllRequests() {
503
+ // Abort all in-flight requests
504
+ this.abortControllers.forEach((controller, key) => {
505
+ controller.abort();
506
+ });
507
+
508
+ // Clear both maps
509
+ this.abortControllers.clear();
510
+ this.dataCache.clear();
511
+ console.log('All pending requests cancelled');
512
+ }
513
+ async getValueAtLngLat(lng, lat) {
514
+ const {
515
+ variable,
516
+ isMRMS,
517
+ mrmsTimestamp,
518
+ model,
519
+ date,
520
+ run,
521
+ forecastHour,
522
+ units
523
+ } = this.state;
524
+ if (!variable) return null;
525
+ const gridIndices = this._getGridIndexFromLngLat(lng, lat);
526
+ if (!gridIndices) return null;
527
+ const {
528
+ i,
529
+ j
530
+ } = gridIndices;
531
+ const gridModel = isMRMS ? 'mrms' : model;
532
+ const normalizedGridModel = this._normalizeModelName(gridModel);
533
+ const {
534
+ nx
535
+ } = _coordinate_configs.COORDINATE_CONFIGS[normalizedGridModel].grid_params;
536
+ const customSettings = this.customColormaps[variable];
537
+ const effectiveSmoothing = customSettings && typeof customSettings.smoothing === 'number' ? customSettings.smoothing : 0;
538
+ const dataUrlIdentifier = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${effectiveSmoothing}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${effectiveSmoothing}`;
539
+ const gridDataPromise = this.dataCache.get(dataUrlIdentifier);
540
+ if (!gridDataPromise) return null;
541
+ try {
542
+ const gridData = await gridDataPromise;
543
+ if (!gridData || !gridData.data) return null;
544
+ const index1D = j * nx + i;
545
+ const byteValue = gridData.data[index1D];
546
+ const signedQuantizedValue = byteValue - 128;
547
+
548
+ // --- START OF FIX ---
549
+ // You were missing 'scale_type' in this destructuring assignment.
550
+ const {
551
+ scale,
552
+ offset,
553
+ missing_quantized,
554
+ scale_type
555
+ } = gridData.encoding;
556
+ // --- END OF FIX ---
557
+
558
+ if (signedQuantizedValue === missing_quantized) return null;
559
+ const intermediateValue = signedQuantizedValue * scale + offset;
560
+
561
+ // Step 2: Apply non-linear scaling if specified
562
+ let nativeValue = intermediateValue;
563
+ if (scale_type === 'sqrt') {
564
+ // Square the value while preserving its sign
565
+ nativeValue = intermediateValue < 0 ? -(intermediateValue * intermediateValue) : intermediateValue * intermediateValue;
566
+ }
567
+ const {
568
+ colormap,
569
+ baseUnit
570
+ } = this._getColormapForVariable(variable);
571
+
572
+ // If the value is outside the colormap's bounds, return null.
573
+ if (colormap && colormap.length >= 2) {
574
+ const minBound = colormap[0];
575
+ const maxBound = colormap[colormap.length - 2];
576
+ if (nativeValue < minBound || nativeValue > maxBound) {
577
+ return null;
578
+ }
579
+ }
580
+ let dataNativeUnit = baseUnit || (_dictionaries.DICTIONARIES.fld[variable] || {}).defaultUnit || 'none';
581
+ const displayUnit = this._getTargetUnit(dataNativeUnit, units);
582
+ const conversionFunc = (0, _unitConversions.getUnitConversionFunction)(dataNativeUnit, displayUnit);
583
+ const displayValue = conversionFunc ? conversionFunc(nativeValue) : nativeValue;
584
+ return {
585
+ lngLat: {
586
+ lng,
587
+ lat
588
+ },
589
+ variable: {
590
+ code: variable,
591
+ name: this.getVariableDisplayName(variable)
592
+ },
593
+ value: displayValue,
594
+ unit: displayUnit
595
+ };
596
+ } catch (error) {
597
+ return null;
598
+ }
599
+ }
600
+ getAvailableVariables(modelName = null) {
601
+ const model = modelName || this.state.model;
602
+ return _dictionaries.MODEL_CONFIGS[model]?.vars || [];
603
+ }
604
+ getVariableDisplayName(variableCode) {
605
+ const varInfo = _dictionaries.DICTIONARIES.fld[variableCode];
606
+ return varInfo?.displayName || varInfo?.name || variableCode;
607
+ }
608
+ _getColormapForVariable(variable) {
609
+ if (!variable) return {
610
+ colormap: [],
611
+ baseUnit: ''
612
+ };
613
+ if (this.customColormaps[variable] && this.customColormaps[variable].colormap) {
614
+ return {
615
+ colormap: this.customColormaps[variable].colormap,
616
+ baseUnit: this.customColormaps[variable].baseUnit || ''
617
+ };
618
+ }
619
+ const colormapKey = _dictionaries.DICTIONARIES.variable_cmap[variable] || variable;
620
+ const customColormap = this.customColormaps[colormapKey];
621
+ if (customColormap && customColormap.colormap) {
622
+ return {
623
+ colormap: customColormap.colormap,
624
+ baseUnit: customColormap.baseUnit || ''
625
+ };
626
+ }
627
+ const defaultColormapData = _defaultColormaps.DEFAULT_COLORMAPS[colormapKey];
628
+ if (defaultColormapData && defaultColormapData.units) {
629
+ // ✅ Get defaultUnit from the field dictionary
630
+ const fieldInfo = _dictionaries.DICTIONARIES.fld[variable] || {};
631
+ const baseUnit = fieldInfo.defaultUnit || Object.keys(defaultColormapData.units)[0];
632
+ const unitData = defaultColormapData.units[baseUnit];
633
+ if (unitData && unitData.colormap) {
634
+ return {
635
+ colormap: unitData.colormap,
636
+ baseUnit: baseUnit
637
+ };
638
+ }
639
+ }
640
+ return {
641
+ colormap: [],
642
+ baseUnit: ''
643
+ };
644
+ }
645
+ _convertColormapUnits(colormap, fromUnits, toUnits) {
646
+ if (fromUnits === toUnits) return colormap;
647
+ const conversionFunc = (0, _unitConversions.getUnitConversionFunction)(fromUnits, toUnits);
648
+ if (!conversionFunc) return colormap;
649
+ const newColormap = [];
650
+ for (let i = 0; i < colormap.length; i += 2) {
651
+ newColormap.push(conversionFunc(colormap[i]), colormap[i + 1]);
652
+ }
653
+ return newColormap;
654
+ }
655
+ _normalizeModelName(modelName) {
656
+ const mapping = {
657
+ 'hrrr': ['mpashn', 'mpasrt', 'mpasht', 'hrrrsub', 'rrfs', 'namnest', 'mpasrn', 'mpasrn3', 'mpasht2'],
658
+ 'arw': ['arw2', 'fv3', 'href'],
659
+ 'rtma': ['nbm'],
660
+ 'ecmwf': ['ecmwfaifs'],
661
+ 'gfs': ['arpege', 'graphcastgfs']
662
+ };
663
+ for (const [normalized, aliases] of Object.entries(mapping)) {
664
+ if (aliases.includes(modelName)) return normalized;
665
+ }
666
+ return modelName;
667
+ }
668
+ _getGridCornersAndDef(model) {
669
+ const normalizedModel = this._normalizeModelName(model);
670
+ const gridDef = {
671
+ ..._coordinate_configs.COORDINATE_CONFIGS[normalizedModel],
672
+ modelName: model
673
+ };
674
+ if (!gridDef) return null;
675
+ const {
676
+ nx,
677
+ ny
678
+ } = gridDef.grid_params;
679
+ const gridType = gridDef.type;
680
+ let corners;
681
+ if (gridType === 'latlon') {
682
+ let {
683
+ lon_first,
684
+ lat_first,
685
+ lat_last,
686
+ lon_last,
687
+ dx_degrees,
688
+ dy_degrees
689
+ } = gridDef.grid_params;
690
+ corners = {
691
+ lon_tl: lon_first,
692
+ lat_tl: lat_first,
693
+ lon_tr: lon_last !== undefined ? lon_last : lon_first + (nx - 1) * dx_degrees,
694
+ lat_tr: lat_first,
695
+ lon_bl: lon_first,
696
+ lat_bl: lat_last !== undefined ? lat_last : lat_first + (ny - 1) * dy_degrees,
697
+ lon_br: lon_last !== undefined ? lon_last : lon_first + (nx - 1) * dx_degrees,
698
+ lat_br: lat_last !== undefined ? lat_last : lat_first + (ny - 1) * dy_degrees
699
+ };
700
+ } else if (gridType === 'rotated_latlon') {
701
+ const [lon_tl, lat_tl] = hrdpsObliqueTransform(gridDef.grid_params.lon_first, gridDef.grid_params.lat_first);
702
+ const [lon_tr, lat_tr] = hrdpsObliqueTransform(gridDef.grid_params.lon_first + (nx - 1) * gridDef.grid_params.dx_degrees, gridDef.grid_params.lat_first);
703
+ const [lon_bl, lat_bl] = hrdpsObliqueTransform(gridDef.grid_params.lon_first, gridDef.grid_params.lat_first + (ny - 1) * gridDef.grid_params.dy_degrees);
704
+ const [lon_br, lat_br] = hrdpsObliqueTransform(gridDef.grid_params.lon_first + (nx - 1) * gridDef.grid_params.dx_degrees, gridDef.grid_params.lat_first + (ny - 1) * gridDef.grid_params.dy_degrees);
705
+ corners = {
706
+ lon_tl,
707
+ lat_tl,
708
+ lon_tr,
709
+ lat_tr,
710
+ lon_bl,
711
+ lat_bl,
712
+ lon_br,
713
+ lat_br
714
+ };
715
+ } else if (gridType === 'lambert_conformal_conic' || gridType === 'polar_ stereographic') {
716
+ let projString = Object.entries(gridDef.proj_params).map(([k, v]) => `+${k}=${v}`).join(' ');
717
+ if (gridType === 'polar_stereographic') projString += ' +lat_0=90';
718
+ const {
719
+ x_origin,
720
+ y_origin,
721
+ dx,
722
+ dy
723
+ } = gridDef.grid_params;
724
+ const [lon_tl, lat_tl] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin, y_origin]);
725
+ const [lon_tr, lat_tr] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin + (nx - 1) * dx, y_origin]);
726
+ const [lon_bl, lat_bl] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin, y_origin + (ny - 1) * dy]);
727
+ const [lon_br, lat_br] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin + (nx - 1) * dx, y_origin + (ny - 1) * dy]);
728
+ corners = {
729
+ lon_tl,
730
+ lat_tl,
731
+ lon_tr,
732
+ lat_tr,
733
+ lon_bl,
734
+ lat_bl,
735
+ lon_br,
736
+ lat_br
737
+ };
738
+ } else {
739
+ return null;
740
+ }
741
+ return {
742
+ corners,
743
+ gridDef
744
+ };
745
+ }
746
+ _getTargetUnit(defaultUnit, system) {
747
+ if (system === 'metric') {
748
+ if (['°F', '°C', 'fahrenheit', 'celsius'].includes(defaultUnit)) return '°C';
749
+ if (['kts', 'mph', 'm/s'].includes(defaultUnit)) return 'km/h';
750
+ if (['in', 'mm', 'cm'].includes(defaultUnit)) return 'mm';
751
+ }
752
+ if (system === 'imperial') {
753
+ if (['°F', '°C', 'fahrenheit', 'celsius'].includes(defaultUnit)) return '°F';
754
+ if (['kts', 'mph', 'm/s'].includes(defaultUnit)) return 'mph';
755
+ if (['in', 'mm', 'cm'].includes(defaultUnit)) return 'in';
756
+ }
757
+ return defaultUnit;
758
+ }
759
+ _getGridIndexFromLngLat(lng, lat) {
760
+ const gridModel = this.state.isMRMS ? 'mrms' : this.state.model;
761
+ const normalizedGridModel = this._normalizeModelName(gridModel);
762
+ const gridDef = _coordinate_configs.COORDINATE_CONFIGS[normalizedGridModel];
763
+ if (!gridDef) return null;
764
+ const {
765
+ nx,
766
+ ny
767
+ } = gridDef.grid_params;
768
+ const pixelCoords = this.latLonToGridPixel(lat, lng, gridDef, gridModel);
769
+ if (!pixelCoords || !isFinite(pixelCoords.x) || !isFinite(pixelCoords.y) || pixelCoords.x < 0 || pixelCoords.y < 0) return null;
770
+ const i = Math.round(pixelCoords.x);
771
+ const j = Math.round(pixelCoords.y);
772
+ if (i >= 0 && i < nx && j >= 0 && j < ny) return {
773
+ i,
774
+ j
775
+ };
776
+ return null;
777
+ }
778
+ latLonToProjected(lat, lon, gridDef) {
779
+ if (!isFinite(lat) || !isFinite(lon)) throw new Error(`Invalid coordinates: lat=${lat}, lon=${lon}`);
780
+ const gridType = gridDef.type;
781
+ if (gridType === 'latlon') return {
782
+ x: lon,
783
+ y: lat
784
+ };
785
+ let projString = Object.entries(gridDef.proj_params).map(([k, v]) => `+${k}=${v}`).join(' ');
786
+ if (gridType === 'polar_stereographic') projString += ' +lat_0=90';
787
+ const projected = (0, _proj.default)('EPSG:4326', projString, [lon, lat]);
788
+ return {
789
+ x: projected[0],
790
+ y: projected[1]
791
+ };
792
+ }
793
+ latLonToGridPixel(lat, lon, gridDef, modelName) {
794
+ if (!gridDef) return null;
795
+ if (modelName === 'rgem' && gridDef.type === 'polar_stereographic') return this.latLonToGridPixelPolarStereographic(lat, lon, gridDef);
796
+ const projected = this.latLonToProjected(lat, lon, gridDef);
797
+ let x, y;
798
+ const gridOrigin = {
799
+ x: gridDef.grid_params.lon_first,
800
+ y: gridDef.grid_params.lat_first
801
+ };
802
+ const gridPixelSize = {
803
+ x: gridDef.grid_params.dx_degrees,
804
+ y: gridDef.grid_params.dy_degrees
805
+ };
806
+ if (gridDef.type === 'latlon' || gridDef.type === 'rotated_latlon') {
807
+ let adjustedLon = projected.x;
808
+ if (modelName === 'mrms') {
809
+ if (adjustedLon < 0) adjustedLon += 360;
810
+ x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
811
+ y = (gridOrigin.y - projected.y) / gridPixelSize.y;
812
+ } else {
813
+ const isGFSType = gridDef.grid_params && gridDef.grid_params.lon_first === 0.0 && Math.abs(gridDef.grid_params.lat_first) === 90.0;
814
+ const isECMWFType = gridDef.grid_params && gridDef.grid_params.lon_first === 180.0 && gridDef.grid_params.lat_first === 90.0;
815
+ const isGEMType = modelName === 'gem' || gridDef.grid_params.lon_first === 180.0 && gridDef.grid_params.lat_first === -90.0 && gridDef.grid_params.lon_last === 179.85;
816
+ if (isGEMType) {
817
+ while (adjustedLon < gridOrigin.x) adjustedLon += 360;
818
+ x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
819
+ y = (projected.y - gridOrigin.y) / gridPixelSize.y;
820
+ return {
821
+ x,
822
+ y
823
+ };
824
+ }
825
+ let isFlippedGrid = isECMWFType ? true : gridDef.grid_params.lat_first < (gridDef.grid_params.lat_last || (gridDef.grid_params.ny - 1) * gridDef.grid_params.dy_degrees);
826
+ if (isGFSType) adjustedLon = projected.x + 180;else if (isECMWFType) {
827
+ if (adjustedLon < gridOrigin.x) adjustedLon += 360;
828
+ } else if (['arome1', 'arome25', 'arpegeeu', 'iconeu', 'icond2'].includes(modelName)) {
829
+ while (adjustedLon < 0) adjustedLon += 360;
830
+ while (adjustedLon >= 360) adjustedLon -= 360;
831
+ x = adjustedLon >= gridOrigin.x ? (adjustedLon - gridOrigin.x) / gridPixelSize.x : (adjustedLon + 360 - gridOrigin.x) / gridPixelSize.x;
832
+ if (['arome1', 'arome25', 'arpegeeu'].includes(modelName)) y = (gridOrigin.y - projected.y) / Math.abs(gridPixelSize.y);else if (['iconeu', 'icond2'].includes(modelName)) y = (projected.y - gridOrigin.y) / gridPixelSize.y;
833
+ return {
834
+ x,
835
+ y
836
+ };
837
+ } else {
838
+ const lonFirst = gridOrigin.x;
839
+ if (lonFirst > 180 && adjustedLon < 0) adjustedLon += 360;else if (lonFirst < 0 && adjustedLon > 180) adjustedLon -= 360;
840
+ }
841
+ x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
842
+ if (isFlippedGrid) {
843
+ if (isECMWFType) y = (gridOrigin.y - projected.y) / Math.abs(gridPixelSize.y);else {
844
+ const maxLat = gridDef.grid_params.lat_last || (gridDef.grid_params.ny - 1) * gridDef.grid_params.dy_degrees;
845
+ y = (maxLat - projected.y) / Math.abs(gridPixelSize.y);
846
+ }
847
+ } else y = (projected.y - gridOrigin.y) / gridPixelSize.y;
848
+ }
849
+ } else {
850
+ const projOrigin = {
851
+ x: gridDef.grid_params.x_origin,
852
+ y: gridDef.grid_params.y_origin
853
+ };
854
+ const projPixelSize = {
855
+ x: gridDef.grid_params.dx,
856
+ y: gridDef.grid_params.dy
857
+ };
858
+ x = (projected.x - projOrigin.x) / projPixelSize.x;
859
+ y = (projOrigin.y - projected.y) / Math.abs(projPixelSize.y);
860
+ }
861
+ return {
862
+ x,
863
+ y
864
+ };
865
+ }
866
+ latLonToGridPixelPolarStereographic(lat, lon, gridDef) {
867
+ try {
868
+ const projParams = gridDef.proj_params;
869
+ let projectionString = `+proj=${projParams.proj}`;
870
+ Object.keys(projParams).forEach(key => {
871
+ if (key !== 'proj') projectionString += ` +${key}=${projParams[key]}`;
872
+ });
873
+ projectionString += ' +lat_0=90 +no_defs';
874
+ const {
875
+ nx,
876
+ ny,
877
+ dx,
878
+ dy,
879
+ x_origin,
880
+ y_origin
881
+ } = gridDef.grid_params;
882
+ const x_min = x_origin;
883
+ const x_max = x_origin + (nx - 1) * dx;
884
+ const y_max = y_origin;
885
+ const y_min = y_origin + (ny - 1) * dy;
886
+ const [proj_x, proj_y] = (0, _proj.default)('EPSG:4326', projectionString, [lon, lat]);
887
+ if (!isFinite(proj_x) || !isFinite(proj_y)) return {
888
+ x: -1,
889
+ y: -1
890
+ };
891
+ const t_x = (proj_x - x_min) / (x_max - x_min);
892
+ const t_y = (proj_y - y_max) / (y_min - y_max);
893
+ const x = t_x * (nx - 1);
894
+ const y = t_y * (ny - 1);
895
+ return {
896
+ x,
897
+ y
898
+ };
899
+ } catch (error) {
900
+ console.warn(`[GridAccessor] RGEM polar stereographic conversion failed for ${lat}, ${lon}:`, error);
901
+ return {
902
+ x: -1,
903
+ y: -1
904
+ };
905
+ }
906
+ }
907
+
908
+ // --- Worker and Status Methods ---
909
+
910
+ createWorker() {
911
+ if (this.isReactNative) return null;
912
+ const workerCode = `
913
+ import { decompress } from 'https://cdn.skypack.dev/fzstd@0.1.1';
914
+
915
+ function _reconstructData(decompressedDeltas, encoding) {
916
+ const expectedLength = encoding.length;
917
+ const reconstructedData = new Int8Array(expectedLength);
918
+ if (decompressedDeltas.length > 0 && expectedLength > 0) {
919
+ reconstructedData[0] = decompressedDeltas[0] > 127 ? decompressedDeltas[0] - 256 : decompressedDeltas[0];
920
+ for (let i = 1; i < expectedLength; i++) {
921
+ const delta = decompressedDeltas[i] > 127 ? decompressedDeltas[i] - 256 : decompressedDeltas[i];
922
+ reconstructedData[i] = reconstructedData[i - 1] + delta;
923
+ }
924
+ }
925
+ return new Uint8Array(reconstructedData.buffer);
926
+ }
927
+
928
+ self.onmessage = async (e) => {
929
+ const { requestId, compressedData, encoding } = e.data;
930
+ try {
931
+ const decompressedDeltas = await decompress(compressedData);
932
+ const finalData = _reconstructData(decompressedDeltas, encoding);
933
+ self.postMessage({ success: true, requestId: requestId, decompressedData: finalData, encoding: encoding }, [finalData.buffer]);
934
+ } catch (error) {
935
+ self.postMessage({ success: false, requestId: requestId, error: error.message });
936
+ }
937
+ };
938
+ `;
939
+ const blob = new Blob([workerCode], {
940
+ type: 'application/javascript'
941
+ });
942
+ return new Worker(URL.createObjectURL(blob), {
943
+ type: 'module'
944
+ });
945
+ }
946
+ _processResultQueue() {
947
+ while (this.resultQueue.length > 0) {
948
+ const {
949
+ success,
950
+ requestId,
951
+ decompressedData,
952
+ encoding,
953
+ error
954
+ } = this.resultQueue.shift();
955
+ if (this.workerResolvers.has(requestId)) {
956
+ const {
957
+ resolve,
958
+ reject
959
+ } = this.workerResolvers.get(requestId);
960
+ if (success) {
961
+ resolve({
962
+ data: decompressedData
963
+ }); // Return as { data: ... }
964
+ } else {
965
+ reject(new Error(error));
966
+ }
967
+ this.workerResolvers.delete(requestId);
968
+ }
969
+ }
970
+ this.isProcessingQueue = false;
971
+ }
972
+ _handleWorkerMessage(e) {
973
+ if (this.isReactNative) return;
974
+ const {
975
+ success,
976
+ requestId,
977
+ decompressedData,
978
+ encoding,
979
+ error
980
+ } = e.data;
981
+ this.resultQueue.push({
982
+ success,
983
+ requestId,
984
+ decompressedData,
985
+ encoding,
986
+ error
987
+ });
988
+ if (!this.isProcessingQueue) {
989
+ this.isProcessingQueue = true;
990
+ requestAnimationFrame(() => this._processResultQueue());
991
+ }
992
+ }
993
+ async fetchModelStatus(force = false) {
994
+ if (!this.modelStatus || force) {
995
+ try {
996
+ const response = await fetch(this.statusUrl);
997
+ if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
998
+ this.modelStatus = (await response.json()).models;
999
+ } catch (error) {
1000
+ this.modelStatus = null;
1001
+ }
1002
+ }
1003
+ return this.modelStatus;
1004
+ }
1005
+ async fetchMRMSStatus(force = false) {
1006
+ const mrmsStatusUrl = 'https://h3dfvh5pq6euq36ymlpz4zqiha0obqju.lambda-url.us-east-2.on.aws';
1007
+ if (!this.mrmsStatus || force) {
1008
+ try {
1009
+ const response = await fetch(mrmsStatusUrl);
1010
+ if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
1011
+ this.mrmsStatus = await response.json();
1012
+ } catch (error) {
1013
+ this.mrmsStatus = null;
1014
+ }
1015
+ }
1016
+ return this.mrmsStatus;
1017
+ }
1018
+ startAutoRefresh(intervalSeconds) {
1019
+ this.stopAutoRefresh();
1020
+ this.autoRefreshIntervalId = setInterval(async () => {
1021
+ await this.fetchModelStatus(true);
1022
+ this._emitStateChange();
1023
+ }, (intervalSeconds || 60) * 1000);
1024
+ }
1025
+ stopAutoRefresh() {
1026
+ if (this.autoRefreshIntervalId) {
1027
+ clearInterval(this.autoRefreshIntervalId);
1028
+ this.autoRefreshIntervalId = null;
1029
+ }
1030
+ }
1031
+ }
1032
+ exports.AguaceroCore = AguaceroCore;
1033
+ //# sourceMappingURL=AguaceroCore.js.map