@aguacerowx/react-native 0.0.3 → 0.0.6

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