@atmosx/event-product-parser 3.0.51 → 3.0.53

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 (140) hide show
  1. package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +9 -9
  2. package/{CONTRIBUTING.md → .github/CONTRIBUTING.md} +29 -29
  3. package/{LICENSE → .github/LICENSE} +17 -17
  4. package/{README.md → .github/README.md} +466 -444
  5. package/{SECURITY.md → .github/SECURITY.md} +20 -20
  6. package/{SUPPORTED_EVENTS.md → .github/SUPPORTED_EVENTS.md} +369 -368
  7. package/.vscode/settings.json +3 -3
  8. package/dist/cjs/index.cjs +243 -213
  9. package/dist/esm/index.mjs +242 -212
  10. package/package.json +52 -52
  11. package/src/@building/building.attachments.ts +82 -82
  12. package/src/@building/building.clean.ts +29 -29
  13. package/src/@building/building.create.ts +55 -55
  14. package/src/@building/building.enhance.ts +59 -59
  15. package/src/@building/building.geometry.ts +47 -47
  16. package/src/@building/building.headers.ts +36 -36
  17. package/src/@building/building.office.ts +42 -42
  18. package/src/@building/building.polygon.ts +69 -69
  19. package/src/@building/building.properties.ts +95 -95
  20. package/src/@building/building.signature.ts +60 -60
  21. package/src/@building/building.tags.ts +23 -23
  22. package/src/@building/building.tracking.ts +67 -67
  23. package/src/@building/building.validate.ts +152 -151
  24. package/src/@core/core.clearEvents.ts +30 -30
  25. package/src/@core/core.createListener.ts +23 -23
  26. package/src/@core/core.getEvents.ts +23 -23
  27. package/src/@core/core.getNodes.ts +23 -23
  28. package/src/@core/core.getRandomEvent.ts +23 -23
  29. package/src/@core/core.getVersion.ts +23 -23
  30. package/src/@core/core.manualEvent.ts +38 -0
  31. package/src/@core/core.query.ts +38 -38
  32. package/src/@core/core.setNode.ts +80 -80
  33. package/src/@core/core.start.ts +60 -60
  34. package/src/@core/core.stop.ts +31 -31
  35. package/src/@dictionaries/dictionaries.actions.ts +27 -27
  36. package/src/@dictionaries/dictionaries.awips.ts +363 -363
  37. package/src/@dictionaries/dictionaries.cancellation.ts +30 -30
  38. package/src/@dictionaries/dictionaries.causes.ts +35 -35
  39. package/src/@dictionaries/dictionaries.correlations.ts +42 -42
  40. package/src/@dictionaries/dictionaries.enhanced.ts +66 -109
  41. package/src/@dictionaries/dictionaries.events.ts +82 -82
  42. package/src/@dictionaries/dictionaries.expressions.ts +28 -28
  43. package/src/@dictionaries/dictionaries.global.ts +24 -0
  44. package/src/@dictionaries/dictionaries.hail.ts +35 -35
  45. package/src/@dictionaries/dictionaries.icao.ts +258 -258
  46. package/src/@dictionaries/dictionaries.matches.ts +54 -35
  47. package/src/@dictionaries/dictionaries.products.ts +24 -24
  48. package/src/@dictionaries/dictionaries.records.ts +25 -25
  49. package/src/@dictionaries/dictionaries.severity.ts +27 -27
  50. package/src/@dictionaries/dictionaries.shapefiles.ts +35 -35
  51. package/src/@dictionaries/dictionaries.states.ts +71 -71
  52. package/src/@dictionaries/dictionaries.status.ts +30 -30
  53. package/src/@dictionaries/dictionaries.tags.ts +92 -92
  54. package/src/@dictionaries/dictionaries.testing.ts +24 -24
  55. package/src/@events/events.api.ts +116 -116
  56. package/src/@events/events.text.ts +84 -80
  57. package/src/@events/events.ugc.ts +89 -85
  58. package/src/@events/events.vtec.ts +86 -86
  59. package/src/@manager/manager.mkEvent.ts +97 -93
  60. package/src/@manager/manager.rmEvent.ts +56 -51
  61. package/src/@manager/manager.setHash.ts +35 -35
  62. package/src/@manager/manager.updateEvents.ts +32 -32
  63. package/src/@manager/manager.updateListener.ts +179 -154
  64. package/src/@manager/manager.updateNodes.ts +53 -53
  65. package/src/@modules/@database/database.broadcastify.ts +66 -66
  66. package/src/@modules/@database/database.cache.ts +49 -49
  67. package/src/@modules/@database/database.init.ts +58 -58
  68. package/src/@modules/@database/database.shapefiles.ts +92 -92
  69. package/src/@modules/@database/database.stanza.ts +46 -46
  70. package/src/@modules/@eas/eas.getCleanDescription.ts +91 -91
  71. package/src/@modules/@eas/eas.getFloatPCM16.ts +29 -29
  72. package/src/@modules/@eas/eas.getMergedPCM16.ts +32 -32
  73. package/src/@modules/@eas/eas.getPCM16.ts +52 -52
  74. package/src/@modules/@eas/eas.getPCMToFloat.ts +26 -26
  75. package/src/@modules/@eas/eas.getSampledPCM16.ts +36 -36
  76. package/src/@modules/@eas/eas.getTTS.ts +54 -54
  77. package/src/@modules/@eas/eas.getWavPCM16.ts +52 -52
  78. package/src/@modules/@eas/eas.setAFSK.ts +51 -51
  79. package/src/@modules/@eas/eas.setAsciiToBits.ts +31 -31
  80. package/src/@modules/@eas/eas.setAttentionTone.ts +40 -40
  81. package/src/@modules/@eas/eas.setEasTone.ts +151 -151
  82. package/src/@modules/@eas/eas.setNoise.ts +32 -32
  83. package/src/@modules/@eas/eas.setRadioEffect.ts +50 -50
  84. package/src/@modules/@eas/eas.setSameHeader.ts +44 -44
  85. package/src/@modules/@stanza/stanza.getAwipsType.ts +45 -45
  86. package/src/@modules/@stanza/stanza.validate.ts +49 -49
  87. package/src/@modules/@utilities/utilities.createHttp.ts +83 -70
  88. package/src/@modules/@utilities/utilities.getFormattedTime.ts +43 -43
  89. package/src/@modules/@utilities/utilities.getLatestIssuance.ts +32 -32
  90. package/src/@modules/@utilities/utilities.getMatched.ts +33 -33
  91. package/src/@modules/@utilities/utilities.getSettings.ts +25 -25
  92. package/src/@modules/@utilities/utilities.getShapeNearestPoint.ts +114 -114
  93. package/src/@modules/@utilities/utilities.setCronSchedule.ts +94 -94
  94. package/src/@modules/@utilities/utilities.setDebug.ts +38 -38
  95. package/src/@modules/@utilities/utilities.setEventEmit.ts +41 -41
  96. package/src/@modules/@utilities/utilities.setListener.ts +30 -30
  97. package/src/@modules/@utilities/utilities.setSettings.ts +42 -42
  98. package/src/@modules/@utilities/utilities.setSleep.ts +33 -33
  99. package/src/@modules/@utilities/utilities.setTimeoutAction.ts +62 -62
  100. package/src/@modules/@utilities/utilities.setWarning.ts +34 -34
  101. package/src/@modules/@xmpp/xmpp.xDeploy.ts +57 -57
  102. package/src/@modules/@xmpp/xmpp.xError.ts +26 -26
  103. package/src/@modules/@xmpp/xmpp.xOffline.ts +36 -36
  104. package/src/@modules/@xmpp/xmpp.xOnline.ts +45 -44
  105. package/src/@modules/@xmpp/xmpp.xReconnect.ts +64 -64
  106. package/src/@modules/@xmpp/xmpp.xStanza.ts +62 -62
  107. package/src/@parsers/@hvtec/hvtec.extract.ts +39 -39
  108. package/src/@parsers/@pvtec/pvtec.expires.ts +25 -25
  109. package/src/@parsers/@pvtec/pvtec.extract.ts +48 -48
  110. package/src/@parsers/@text/text.getDescriptionFromProduct.ts +52 -52
  111. package/src/@parsers/@text/text.getEmbed.ts +55 -55
  112. package/src/@parsers/@text/text.getPolygonFromProduct.ts +53 -32
  113. package/src/@parsers/@text/text.getRaw.ts +54 -0
  114. package/src/@parsers/@text/text.getTextFromProduct.ts +42 -42
  115. package/src/@parsers/@text/text.getXML.ts +60 -60
  116. package/src/@parsers/@ugc/ugc.coordinates.ts +110 -110
  117. package/src/@parsers/@ugc/ugc.expiry.ts +31 -31
  118. package/src/@parsers/@ugc/ugc.extract.ts +36 -36
  119. package/src/@parsers/@ugc/ugc.getCache.ts +23 -23
  120. package/src/@parsers/@ugc/ugc.header.ts +29 -29
  121. package/src/@parsers/@ugc/ugc.locations.ts +56 -56
  122. package/src/@parsers/@ugc/ugc.setCache.ts +27 -27
  123. package/src/@parsers/@ugc/ugc.zones.ts +51 -51
  124. package/src/@types/type.attributes.ts +28 -28
  125. package/src/@types/type.compiled.ts +34 -34
  126. package/src/@types/type.event.ts +69 -69
  127. package/src/@types/type.hash.ts +24 -24
  128. package/src/@types/type.hvtec.ts +25 -25
  129. package/src/@types/type.listener.ts +37 -32
  130. package/src/@types/type.properties.ts +77 -77
  131. package/src/@types/type.pvtec.ts +30 -30
  132. package/src/@types/type.settings.ts +93 -84
  133. package/src/@types/type.stanza.ts +37 -37
  134. package/src/@types/type.ugc.ts +24 -24
  135. package/src/bootstrap.ts +124 -115
  136. package/src/index.ts +74 -74
  137. package/{test.js → testing/init.js} +105 -92
  138. package/tsconfig.json +13 -13
  139. package/tsup.config.ts +15 -15
  140. package/src/@core/core.createEvent.ts +0 -82
@@ -1104,7 +1104,7 @@ var require_main3 = __commonJS({
1104
1104
  import path from "path";
1105
1105
  import { EventEmitter } from "events";
1106
1106
  var bootstrap = {
1107
- version: `3.0.51`,
1107
+ version: `3.0.53`,
1108
1108
  isReady: true,
1109
1109
  ratelimits: {},
1110
1110
  session_xmpp: null,
@@ -1135,7 +1135,7 @@ var bootstrap = {
1135
1135
  },
1136
1136
  settings: {
1137
1137
  Database: path.join(process.cwd(), "shapefiles.db"),
1138
- EnableWireService: true,
1138
+ EnableWireService: false,
1139
1139
  EnableDebugging: false,
1140
1140
  EnableJournal: true,
1141
1141
  NOAAWeatherWireServiceSettings: {
@@ -1168,12 +1168,21 @@ var bootstrap = {
1168
1168
  BroadcastifyDatabase: `https://scriptkitty.cafe/ftp/@atmosphericx/assets/broadcastify.json`,
1169
1169
  BroadcastifyTags: [`Ham`, `Air`, `Fire`, `Public Safety`, `Weather`, `EMS`, `Police`, `Rail`]
1170
1170
  },
1171
+ NotifyServer: {
1172
+ Enabled: false,
1173
+ Server: `https://ntfy.sh`,
1174
+ Attachments: null,
1175
+ Credentials: {
1176
+ Username: null,
1177
+ Password: null
1178
+ }
1179
+ },
1171
1180
  ListenerSettings: [],
1172
1181
  GlobalSettings: {
1173
1182
  EventManagement: true,
1174
1183
  BetterEventNames: true,
1175
1184
  DisableGeometryParsing: false,
1176
- UseShapefileCoordinates: false,
1185
+ UseShapefileCoordinates: true,
1177
1186
  SPCWatchesOnly: true,
1178
1187
  ShapefileSkipPoints: 15,
1179
1188
  NodeTTL: 60,
@@ -1305,7 +1314,7 @@ var getZonePolygon = (options) => {
1305
1314
  };
1306
1315
 
1307
1316
  // src/@building/building.geometry.ts
1308
- var getEventGeometry = (event) => __async(null, null, function* () {
1317
+ var getEventGeometry = (event) => {
1309
1318
  var _a, _b, _c, _d, _e, _f;
1310
1319
  const settings = getSettings();
1311
1320
  const generated = (_c = (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.geocode) == null ? void 0 : _b.polygon) != null ? _c : null;
@@ -1315,7 +1324,7 @@ var getEventGeometry = (event) => __async(null, null, function* () {
1315
1324
  coordinates: generated != null ? JSON.parse(Buffer.from(generated, "base64").toString("utf-8")) : null
1316
1325
  };
1317
1326
  if (settings.GlobalSettings.UseShapefileCoordinates && generated == null && ugc2 != null) {
1318
- geo = yield getZonePolygon({ zones: ugc2, isUnion: false });
1327
+ geo = getZonePolygon({ zones: ugc2, isUnion: false });
1319
1328
  if (geo == null) {
1320
1329
  geo = {
1321
1330
  type: `Polygon`,
@@ -1324,7 +1333,7 @@ var getEventGeometry = (event) => __async(null, null, function* () {
1324
1333
  }
1325
1334
  }
1326
1335
  return geo;
1327
- });
1336
+ };
1328
1337
 
1329
1338
  // src/@building/building.clean.ts
1330
1339
  var getCleanedEvent = (event) => {
@@ -4180,7 +4189,8 @@ var xOnline = () => {
4180
4189
  data: {},
4181
4190
  type: `online`,
4182
4191
  error: false
4183
- }
4192
+ },
4193
+ message: `Succesfully connected to NOAA Weather Wire Service as "${nickname}"`
4184
4194
  });
4185
4195
  }));
4186
4196
  };
@@ -4502,9 +4512,9 @@ var dict_awips = {
4502
4512
  SVR: `severe-thunderstorm-warning`,
4503
4513
  SVS: `severe-weather-statement`,
4504
4514
  SWOMCD: `mesoscale-discussion`,
4505
- SWODY1: `spc-day-1-outlook`,
4506
- SWODY2: `spc-day-2-outlook`,
4507
- SWODY3: `spc-day-3-outlook`,
4515
+ SWODY1: `storm-prediction-center-day-1-outlook`,
4516
+ SWODY2: `storm-prediction-center-day-2-outlook`,
4517
+ SWODY3: `storm-prediction-center-day-3-outlook`,
4508
4518
  SWS: `state-weather-summary`,
4509
4519
  SYN: `regional-weather-synopsis`,
4510
4520
  TAF: `terminal-aerodrome-forecast`,
@@ -4524,7 +4534,7 @@ var dict_awips = {
4524
4534
  TOE: `telephone-outage-emergency`,
4525
4535
  TOR: `tornado-warning`,
4526
4536
  TPT: `temperature-precipitation-table`,
4527
- TSU: `tsunami-watch`,
4537
+ TSU: `tsunami-information-statement`,
4528
4538
  TUV: `ultraviolet-index`,
4529
4539
  TVL: `travelers-forecast`,
4530
4540
  TWB: `transcribed-weather-broadcast`,
@@ -4620,21 +4630,39 @@ var validate = (options) => {
4620
4630
 
4621
4631
  // src/@dictionaries/dictionaries.matches.ts
4622
4632
  var dict_matches = {
4623
- "Special Weather Statement": "Special Weather Statement",
4624
- "Hurricane Warning": "Hurricane Warning",
4625
- "Hurricane Force Wind Warning": "Hurricane Force Wind Warning",
4626
- "Hurricane Watch": "Hurricane Watch",
4627
- "Tropical Storm Warning": "Tropical Storm Warning",
4628
- "Tropical Storm Watch": "Tropical Storm Watch",
4629
- "High Wind Warning": "High Wind Warning",
4630
- "Gale Warning": "Gale Warning",
4631
- "Small Craft Advisory": "Small Craft Advisory",
4632
- "Small Craft Warning": "Small Craft Warning",
4633
- "Tsunami Warning": "Tsunami Warning",
4634
- "Tsunami Watch": "Tsunami Watch",
4635
- "Tsunami Advisory": "Tsunami Advisory",
4636
- "Tsunami Information Statement": "Tsunami Information Statement",
4637
- "Subscribers:": "National Weather Service Policy"
4633
+ SPS: [
4634
+ { match: /STRONG THUNDERSTORM/i, label: "Convective Special Weather Statement", statement: false },
4635
+ { match: /SPECIAL WEATHER STATEMENT/i, label: "Special Weather Statement", statement: false }
4636
+ ],
4637
+ TSU: [
4638
+ { match: /TSUNAMI WARNING/i, label: "Tsunami Warning", statement: false },
4639
+ { match: /TSUNAMI WATCH/i, label: "Tsunami Watch", statement: false },
4640
+ { match: /TSUNAMI ADVISORY/i, label: "Tsunami Advisory", statement: false },
4641
+ { match: /TSUNAMI INFORMATION STATEMENT/i, label: "Tsunami Information Statement", statement: false },
4642
+ { match: /TSUNAMI WARNING CANCELLATION/i, label: "Tsunami Cancellation", statement: false }
4643
+ ],
4644
+ TCP: [
4645
+ { match: /HURRICANE WARNING/i, label: "Hurricane Warning", statement: false },
4646
+ { match: /HURRICANE WATCH/i, label: "Hurricane Watch", statement: false },
4647
+ { match: /TROPICAL STORM WARNING/i, label: "Tropical Storm Warning", statement: false },
4648
+ { match: /TROPICAL STORM WATCH/i, label: "Tropical Storm Watch", statement: false },
4649
+ { match: /STORM SURGE WARNING/i, label: "Storm Surge Warning", statement: false },
4650
+ { match: /STORM SURGE WATCH/i, label: "Storm Surge Watch", statement: false }
4651
+ ],
4652
+ MWW: [
4653
+ { match: /SMALL CRAFT ADVISORY/i, label: "Small Craft Advisory", statement: false },
4654
+ { match: /GALE WARNING/i, label: "Gale Warning", statement: false },
4655
+ { match: /STORM WARNING/i, label: "Storm Warning", statement: false },
4656
+ { match: /HURRICANE FORCE WIND WARNING/i, label: "Hurricane Force Wind Warning", statement: false },
4657
+ { match: /HAZARDOUS SEAS WARNING/i, label: "Hazardous Seas Warning", statement: false },
4658
+ { match: /DENSE FOG ADVISORY/i, label: "Dense Fog Advisory", statement: false },
4659
+ { match: /THUNDERSTORMS/i, label: "Convective Marine Weather Statement", statement: false },
4660
+ { match: /MARINE WEATHER STATEMENT/i, label: "Marine Weather Statement", statement: false }
4661
+ ],
4662
+ PNS: [
4663
+ { match: /NOAA WEATHER WIRE SERVICE/i, label: "NOAA Weather Wire Service Report", statement: true },
4664
+ { match: /Public Information Statement/i, label: "Public Information Statement", statement: true }
4665
+ ]
4638
4666
  };
4639
4667
 
4640
4668
  // src/@parsers/@text/text.getDescriptionFromProduct.ts
@@ -4669,18 +4697,32 @@ var getDescriptionFromProduct = (options) => {
4669
4697
  // src/@parsers/@text/text.getPolygonFromProduct.ts
4670
4698
  var getPolygonFromProduct = (message) => {
4671
4699
  const coordinates = [];
4672
- const match = message.match(/LAT\.{3}LON\s+([\d\s]+)/i);
4673
- if (!match || !match[1]) return coordinates;
4674
- const coordStrings = match[1].replace(/\n/g, " ").trim().split(/\s+/);
4675
- for (let i = 0; i < coordStrings.length - 1; i += 2) {
4676
- const lat = parseFloat(coordStrings[i]) / 100;
4677
- const lon = -parseFloat(coordStrings[i + 1]) / 100;
4678
- if (!isNaN(lat) && !isNaN(lon)) {
4679
- coordinates.push([lon, lat]);
4700
+ const match = message.match(
4701
+ /LAT\.\.\.LON\s+([\s\S]*?)(?=\n[A-Z]{2,}(?:\.\.\.|:)|\$\$|&&|$)/i
4702
+ );
4703
+ if (!match) return coordinates;
4704
+ const text2 = match[1];
4705
+ const values = text2.match(/\d{4,8}/g);
4706
+ if (!values) return coordinates;
4707
+ if (values.every((v) => v.length === 8)) {
4708
+ for (const value of values) {
4709
+ const lat = parseInt(value.slice(0, 4), 10) / 100;
4710
+ const lon = -parseInt(value.slice(4, 8), 10) / 100;
4711
+ if (Number.isFinite(lat) && Number.isFinite(lon)) {
4712
+ coordinates.push([lon, lat]);
4713
+ }
4714
+ }
4715
+ } else {
4716
+ for (let i = 0; i + 1 < values.length; i += 2) {
4717
+ const lat = parseInt(values[i], 10) / 100;
4718
+ const lon = -parseInt(values[i + 1], 10) / 100;
4719
+ if (Number.isFinite(lat) && Number.isFinite(lon)) {
4720
+ coordinates.push([lon, lat]);
4721
+ }
4680
4722
  }
4681
4723
  }
4682
4724
  if (coordinates.length > 2) {
4683
- coordinates.push(coordinates[0]);
4725
+ coordinates.push([...coordinates[0]]);
4684
4726
  }
4685
4727
  return coordinates;
4686
4728
  };
@@ -5156,7 +5198,7 @@ var setDebug = (options) => {
5156
5198
 
5157
5199
  // src/@events/events.text.ts
5158
5200
  var text = (stanza) => __async(null, null, function* () {
5159
- var _a, _b, _c;
5201
+ var _a, _b, _c, _d, _e;
5160
5202
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5161
5203
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5162
5204
  for (const message of getMessages) {
@@ -5166,8 +5208,9 @@ var text = (stanza) => __async(null, null, function* () {
5166
5208
  const header = getEventHeader({ properties: props, getType: stanza.getType });
5167
5209
  const issued = new Date(attributes.issue);
5168
5210
  const expires = new Date(issued.getTime() + 12 * 60 * 60 * 1e3);
5169
- let event = Object.keys(dict_matches).find((event2) => message.toLowerCase().includes(event2.toLowerCase()));
5170
- let isStatement = false;
5211
+ const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5212
+ let event = matches == null ? void 0 : matches.label;
5213
+ let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5171
5214
  if (!event) {
5172
5215
  event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5173
5216
  isStatement = true;
@@ -5325,7 +5368,7 @@ var ugcExtract = (message) => __async(null, null, function* () {
5325
5368
 
5326
5369
  // src/@events/events.ugc.ts
5327
5370
  var ugc = (stanza) => __async(null, null, function* () {
5328
- var _a, _b, _c;
5371
+ var _a, _b, _c, _d, _e;
5329
5372
  const getMessages = (_c = (_b = (_a = stanza == null ? void 0 : stanza.message) == null ? void 0 : _a.split(/(?=\$\$)/g)) == null ? void 0 : _b.map((message) => message.trim())) == null ? void 0 : _c.filter((message) => message && message !== "$$");
5330
5373
  if (!getMessages || (getMessages == null ? void 0 : getMessages.length) == 0) return;
5331
5374
  for (const message of getMessages) {
@@ -5337,8 +5380,9 @@ var ugc = (stanza) => __async(null, null, function* () {
5337
5380
  const issued = new Date(attributes.issue);
5338
5381
  const expires = new Date(ugc2.expires);
5339
5382
  const header = getEventHeader({ properties: props, getType: stanza.getType });
5340
- let event = Object.keys(dict_matches).find((event2) => message.toLowerCase().includes(event2.toLowerCase()));
5341
- let isStatement = false;
5383
+ const matches = (_d = dict_matches[stanza.getType.prefix]) == null ? void 0 : _d.find((match) => match.match.test(message.toUpperCase()));
5384
+ let event = matches == null ? void 0 : matches.label;
5385
+ let isStatement = (_e = matches == null ? void 0 : matches.statement) != null ? _e : false;
5342
5386
  if (!event) {
5343
5387
  event = stanza.getType.type.split(`-`).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(` `);
5344
5388
  isStatement = true;
@@ -5715,85 +5759,42 @@ var api = (stanza) => __async(null, null, function* () {
5715
5759
  // src/@dictionaries/dictionaries.enhanced.ts
5716
5760
  var dict_enhanced = {
5717
5761
  "Tornado Warning": {
5718
- "Tornado Emergency": {
5719
- description: "tornado emergency"
5720
- },
5721
- "PDS Tornado Warning": {
5722
- description: "particularly dangerous situation",
5723
- damage: `CONSIDERABLE`
5724
- },
5725
- "Radar Confirmed Tornado Warning": {
5726
- description: "source...radar confirmed tornado.",
5727
- tornado: `OBSERVED`
5728
- },
5729
- "Confirmed Tornado Warning": {
5730
- tornado: `OBSERVED`
5731
- },
5762
+ "Tornado Emergency": { description: "tornado emergency" },
5763
+ "PDS Tornado Warning": { description: "particularly dangerous situation", damage: `CONSIDERABLE` },
5764
+ "Radar Confirmed Tornado Warning": { description: "source...radar confirmed tornado.", tornado: `OBSERVED` },
5765
+ "Confirmed Tornado Warning": { tornado: `OBSERVED` },
5732
5766
  "Radar Indicated Tornado Warning": {}
5733
5767
  },
5734
5768
  "Fire Weather Warning": {
5735
- "PDS Fire Weather Warning": {
5736
- description: "particularly dangerous situation"
5737
- }
5769
+ "PDS Fire Weather Warning": { description: "particularly dangerous situation" }
5738
5770
  },
5739
5771
  "Blizzard Warning": {
5740
- "PDS Blizzard Warning": {
5741
- description: "particularly dangerous situation"
5742
- }
5772
+ "PDS Blizzard Warning": { description: "particularly dangerous situation" }
5743
5773
  },
5744
5774
  "Ice Storm Warning": {
5745
- "PDS Ice Storm Warning": {
5746
- description: "particularly dangerous situation"
5747
- }
5775
+ "PDS Ice Storm Warning": { description: "particularly dangerous situation" }
5748
5776
  },
5749
5777
  "Special Marine Warning": {
5750
- "Special Marine Warning (TPROB)": {
5751
- tornado: `POSSIBLE`
5752
- }
5778
+ "Special Marine Warning (TPROB)": { tornado: `POSSIBLE` }
5753
5779
  },
5754
5780
  "Tornado Watch": {
5755
- "PDS Tornado Watch": {
5756
- pdswatch: true
5757
- }
5781
+ "PDS Tornado Watch": { pdswatch: true }
5758
5782
  },
5759
5783
  "Severe Thunderstorm Watch": {
5760
- "PDS Severe Thunderstorm Watch": {
5761
- pdswatch: true
5762
- }
5784
+ "PDS Severe Thunderstorm Watch": { pdswatch: true }
5763
5785
  },
5764
5786
  "Flash Flood Warning": {
5765
- "Flash Flood Emergency": {
5766
- description: "flash flood emergency"
5767
- },
5768
- "Considerable Flash Flood Warning": {
5769
- damage: `CONSIDERABLE`
5770
- }
5787
+ "Flash Flood Emergency": { description: "flash flood emergency" },
5788
+ "Considerable Flash Flood Warning": { damage: `CONSIDERABLE` }
5771
5789
  },
5772
5790
  "Severe Thunderstorm Warning": {
5773
- "EDS Severe Thunderstorm Warning (TPROB)": {
5774
- description: "extremely dangerous situation",
5775
- tornado: "POSSIBLE"
5776
- },
5777
- "EDS Severe Thunderstorm Warning": {
5778
- description: "extremely dangerous situation"
5779
- },
5780
- "Destructive Severe Thunderstorm Warning (TPROB)": {
5781
- damage: `DESTRUCTIVE`,
5782
- tornado: `POSSIBLE`
5783
- },
5784
- "Destructive Severe Thunderstorm Warning": {
5785
- damage: `DESTRUCTIVE`
5786
- },
5787
- "Considerable Severe Thunderstorm Warning (TPROB)": {
5788
- damage: `CONSIDERABLE`,
5789
- tornado: `POSSIBLE`
5790
- },
5791
- "Considerable Severe Thunderstorm Warning": {
5792
- damage: `CONSIDERABLE`
5793
- },
5794
- "Severe Thunderstorm Warning (TPROB)": {
5795
- tornado: `POSSIBLE`
5796
- }
5791
+ "EDS Severe Thunderstorm Warning (TPROB)": { description: "extremely dangerous situation", tornado: "POSSIBLE" },
5792
+ "EDS Severe Thunderstorm Warning": { description: "extremely dangerous situation" },
5793
+ "Destructive Severe Thunderstorm Warning (TPROB)": { damage: `DESTRUCTIVE`, tornado: `POSSIBLE` },
5794
+ "Destructive Severe Thunderstorm Warning": { damage: `DESTRUCTIVE` },
5795
+ "Considerable Severe Thunderstorm Warning (TPROB)": { damage: `CONSIDERABLE`, tornado: `POSSIBLE` },
5796
+ "Considerable Severe Thunderstorm Warning": { damage: `CONSIDERABLE` },
5797
+ "Severe Thunderstorm Warning (TPROB)": { tornado: `POSSIBLE` }
5797
5798
  }
5798
5799
  };
5799
5800
 
@@ -5924,6 +5925,13 @@ var getEventSignature = (event) => {
5924
5925
  return event;
5925
5926
  };
5926
5927
 
5928
+ // src/@dictionaries/dictionaries.global.ts
5929
+ var dict_global = [
5930
+ "spc day 1 outlook",
5931
+ "spc day 2 outlook",
5932
+ "spc day 3 outlook"
5933
+ ];
5934
+
5927
5935
  // src/@manager/manager.setHash.ts
5928
5936
  var setHash = (event, entry) => {
5929
5937
  if (entry) {
@@ -6434,6 +6442,42 @@ var getEmebed = (event) => {
6434
6442
  ].filter(Boolean).join("\n");
6435
6443
  };
6436
6444
 
6445
+ // src/@parsers/@text/text.getRaw.ts
6446
+ var getRaw = (event) => {
6447
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da;
6448
+ const line = (label, value, condition = true) => condition && value ? `${label} ${value}` : null;
6449
+ const isStatement = event.properties.status_metadata.is_statement;
6450
+ const isExpired = event.properties.status_metadata.is_expired;
6451
+ return [
6452
+ line(`Locations:`, (_b = (_a = event == null ? void 0 : event.properties) == null ? void 0 : _a.locations) == null ? void 0 : _b.slice(0, 100)),
6453
+ line(`Issued:`, new Date(event.properties.issued).toUTCString(), !isExpired),
6454
+ line(`Expires:`, new Date(event.properties.expires).toUTCString(), !isStatement),
6455
+ line(`Damage Threat:`, (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.parameters) == null ? void 0 : _d.damage_threat, !isExpired),
6456
+ line(`Flood Threat:`, (_f = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.parameters) == null ? void 0 : _f.flood_threat, !isExpired),
6457
+ line(`Tornado Threat:`, (_h = (_g = event == null ? void 0 : event.properties) == null ? void 0 : _g.parameters) == null ? void 0 : _h.tornado_threat, !isExpired),
6458
+ line(`Estimated Wind Gusts:`, `${(_j = (_i = event == null ? void 0 : event.properties) == null ? void 0 : _i.parameters) == null ? void 0 : _j.estimated_wind_gusts} ${((_l = (_k = event == null ? void 0 : event.properties) == null ? void 0 : _k.parameters) == null ? void 0 : _l.wind_threat) ? ` (${(_n = (_m = event == null ? void 0 : event.properties) == null ? void 0 : _m.parameters) == null ? void 0 : _n.wind_threat})` : ""}`, !isExpired && ((_p = (_o = event == null ? void 0 : event.properties) == null ? void 0 : _o.parameters) == null ? void 0 : _p.estimated_wind_gusts) != null),
6459
+ line(`Estimated Hail Size:`, `${(_r = (_q = event == null ? void 0 : event.properties) == null ? void 0 : _q.parameters) == null ? void 0 : _r.estimated_hail_size} ${((_t = (_s = event == null ? void 0 : event.properties) == null ? void 0 : _s.parameters) == null ? void 0 : _t.hail_threat) ? ` (${(_v = (_u = event == null ? void 0 : event.properties) == null ? void 0 : _u.parameters) == null ? void 0 : _v.hail_threat})` : ""}`, !isExpired && ((_x = (_w = event == null ? void 0 : event.properties) == null ? void 0 : _w.parameters) == null ? void 0 : _x.estimated_hail_size) != null),
6460
+ line(`Discussion:`, (_z = (_y = event == null ? void 0 : event.properties) == null ? void 0 : _y.discussion_parameters) == null ? void 0 : _z.discussion_number, !isExpired),
6461
+ line(`Concern:`, (_B = (_A = event == null ? void 0 : event.properties) == null ? void 0 : _A.discussion_parameters) == null ? void 0 : _B.discussion_concerning, !isExpired),
6462
+ line(`SPC Max Tornado Threat:`, (_D = (_C = event == null ? void 0 : event.properties) == null ? void 0 : _C.discussion_parameters) == null ? void 0 : _D.discussion_max_tornado, !isExpired),
6463
+ line(`SPC Max Hail Threat:`, (_F = (_E = event == null ? void 0 : event.properties) == null ? void 0 : _E.discussion_parameters) == null ? void 0 : _F.discussion_max_hail, !isExpired),
6464
+ line(`SPC Max Wind Threat:`, (_H = (_G = event == null ? void 0 : event.properties) == null ? void 0 : _G.discussion_parameters) == null ? void 0 : _H.discussion_max_wind, !isExpired),
6465
+ line(`SPC Watch Issuance Probability:`, ((_J = (_I = event == null ? void 0 : event.properties) == null ? void 0 : _I.discussion_parameters) == null ? void 0 : _J.discussion_watch_issuance) ? `${(_L = (_K = event == null ? void 0 : event.properties) == null ? void 0 : _K.discussion_parameters) == null ? void 0 : _L.discussion_watch_issuance}%` : null, !isExpired),
6466
+ line(`Watch Number:`, (_N = (_M = event == null ? void 0 : event.properties) == null ? void 0 : _M.watch_parameters) == null ? void 0 : _N.watch_number, !isExpired),
6467
+ line(`Strong Tornadoes Probability:`, ((_P = (_O = event == null ? void 0 : event.properties) == null ? void 0 : _O.watch_parameters) == null ? void 0 : _P.strong_tornadoes_probability) ? `${(_R = (_Q = event == null ? void 0 : event.properties) == null ? void 0 : _Q.watch_parameters) == null ? void 0 : _R.strong_tornadoes_probability}%` : null, !isExpired),
6468
+ line(`Additional Tornadoes Probability:`, ((_T = (_S = event == null ? void 0 : event.properties) == null ? void 0 : _S.watch_parameters) == null ? void 0 : _T.additional_tornadoes_probability) ? `${(_V = (_U = event == null ? void 0 : event.properties) == null ? void 0 : _U.watch_parameters) == null ? void 0 : _V.additional_tornadoes_probability}%` : null, !isExpired),
6469
+ line(`Combined Hail/Wind Probability:`, ((_X = (_W = event == null ? void 0 : event.properties) == null ? void 0 : _W.watch_parameters) == null ? void 0 : _X.combined_hail_wind_probability) ? `${(_Z = (_Y = event == null ? void 0 : event.properties) == null ? void 0 : _Y.watch_parameters) == null ? void 0 : _Z.combined_hail_wind_probability}%` : null, !isExpired),
6470
+ line(`Severe Hail Probability:`, ((_$ = (__ = event == null ? void 0 : event.properties) == null ? void 0 : __.watch_parameters) == null ? void 0 : _$.severe_hail_probability) ? `${(_ba = (_aa = event == null ? void 0 : event.properties) == null ? void 0 : _aa.watch_parameters) == null ? void 0 : _ba.severe_hail_probability}%` : null, !isExpired),
6471
+ line(`Hail >2in Probability:`, ((_da = (_ca = event == null ? void 0 : event.properties) == null ? void 0 : _ca.watch_parameters) == null ? void 0 : _da.hail_2in_probability) ? `${(_fa = (_ea = event == null ? void 0 : event.properties) == null ? void 0 : _ea.watch_parameters) == null ? void 0 : _fa.hail_2in_probability}%` : null, !isExpired),
6472
+ line(`Max Hail Inches:`, (_ha = (_ga = event == null ? void 0 : event.properties) == null ? void 0 : _ga.watch_parameters) == null ? void 0 : _ha.max_hail_in, !isExpired),
6473
+ line(`Severe Wind Probability:`, ((_ja = (_ia = event == null ? void 0 : event.properties) == null ? void 0 : _ia.watch_parameters) == null ? void 0 : _ja.severe_wind_probability) ? `${(_la = (_ka = event == null ? void 0 : event.properties) == null ? void 0 : _ka.watch_parameters) == null ? void 0 : _la.severe_wind_probability}%` : null, !isExpired),
6474
+ line(`Max Surface Wind:`, (_na = (_ma = event == null ? void 0 : event.properties) == null ? void 0 : _ma.watch_parameters) == null ? void 0 : _na.max_wind_surface, !isExpired),
6475
+ line(`Max Tops (x100 feet):`, (_pa = (_oa = event == null ? void 0 : event.properties) == null ? void 0 : _oa.watch_parameters) == null ? void 0 : _pa.max_tops_x100feet, !isExpired),
6476
+ line(`Sender:`, ((_sa = (_ra = (_qa = event == null ? void 0 : event.properties) == null ? void 0 : _qa.geocode) == null ? void 0 : _ra.office) == null ? void 0 : _sa.name) ? `${(_va = (_ua = (_ta = event == null ? void 0 : event.properties) == null ? void 0 : _ta.geocode) == null ? void 0 : _ua.office) == null ? void 0 : _va.name} (${(_ya = (_xa = (_wa = event == null ? void 0 : event.properties) == null ? void 0 : _wa.geocode) == null ? void 0 : _xa.office) == null ? void 0 : _ya.office})` : (_Ba = (_Aa = (_za = event == null ? void 0 : event.properties) == null ? void 0 : _za.geocode) == null ? void 0 : _Aa.office) == null ? void 0 : _Ba.office),
6477
+ line(`Tracking:`, (_Da = (_Ca = event == null ? void 0 : event.properties) == null ? void 0 : _Ca.metadata) == null ? void 0 : _Da.tracking)
6478
+ ].filter(Boolean).join("\n");
6479
+ };
6480
+
6437
6481
  // src/@modules/@utilities/utilities.createHttp.ts
6438
6482
  var createHttp = (options) => __async(null, null, function* () {
6439
6483
  var _a, _b, _c, _d;
@@ -6450,6 +6494,13 @@ var createHttp = (options) => __async(null, null, function* () {
6450
6494
  const returnHttp = function(error, status, message) {
6451
6495
  return { error, options: requestOptions, status, message };
6452
6496
  };
6497
+ if (options == null ? void 0 : options.auth) {
6498
+ const authString = `${options.auth.username}:${options.auth.password}`;
6499
+ const encodedAuth = Buffer.from(authString).toString("base64");
6500
+ requestOptions.headers = __spreadProps(__spreadValues({}, requestOptions.headers), {
6501
+ "Authorization": `Basic ${encodedAuth}`
6502
+ });
6503
+ }
6453
6504
  if (options == null ? void 0 : options.formData) {
6454
6505
  requestOptions.body = options.formData;
6455
6506
  } else if ((options == null ? void 0 : options.body) != void 0) {
@@ -6489,7 +6540,7 @@ var getMatched = (strings, string) => {
6489
6540
  // src/@manager/manager.updateListener.ts
6490
6541
  import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3, readFileSync as readFileSync2, appendFileSync } from "fs";
6491
6542
  var updateListener = (event) => __async(null, null, function* () {
6492
- var _a, _b, _c, _d, _e, _f;
6543
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
6493
6544
  const tick = performance.now();
6494
6545
  const settings = bootstrap.settings;
6495
6546
  const listeners2 = settings.ListenerSettings;
@@ -6546,8 +6597,29 @@ var updateListener = (event) => __async(null, null, function* () {
6546
6597
  }
6547
6598
  metadata.json = JSON.stringify(getCleanedEvent(event), null, 2);
6548
6599
  }
6600
+ if (settings.NotifyServer.Enabled && ((_a = listener2 == null ? void 0 : listener2.notify) == null ? void 0 : _a.enabled) && ((_b = listener2 == null ? void 0 : listener2.notify) == null ? void 0 : _b.topic)) {
6601
+ const auth = ((_c = settings.NotifyServer.Credentials) == null ? void 0 : _c.Username) && ((_d = settings.NotifyServer.Credentials) == null ? void 0 : _d.Password) ? {
6602
+ username: settings.NotifyServer.Credentials.Username,
6603
+ password: settings.NotifyServer.Credentials.Password
6604
+ } : void 0;
6605
+ const attachment = metadata.eas && settings.NotifyServer.Attachments ? `${settings.NotifyServer.Attachments}/${metadata.name}_${metadata.status}_${metadata.tracking}.wav` : null;
6606
+ yield createHttp(__spreadProps(__spreadValues({
6607
+ url: `${settings.NotifyServer.Server.replace(/\/$/, "")}/${(_e = listener2 == null ? void 0 : listener2.notify) == null ? void 0 : _e.topic}`,
6608
+ timeout: 15e3,
6609
+ method: "POST"
6610
+ }, auth && { auth }), {
6611
+ headers: __spreadProps(__spreadValues({
6612
+ "Title": `${metadata.name} (${metadata.status})`,
6613
+ "Tags": (_g = (_f = properties2.parameters.tags) == null ? void 0 : _f.join(",")) != null ? _g : "N/A"
6614
+ }, attachment && { "Attach": attachment }), {
6615
+ "Priority": "max",
6616
+ "Sound": "siren"
6617
+ }),
6618
+ body: getRaw(event)
6619
+ }));
6620
+ }
6549
6621
  if ((webhook == null ? void 0 : webhook.enabled) && (webhook == null ? void 0 : webhook.destination)) {
6550
- const isRatelimited = setTimeoutAction({ identifier: webhook.destination, interval: ((_a = webhook.ratelimit) != null ? _a : 2) * 2, max: (_b = webhook.ratelimit) != null ? _b : 2, addTime: true });
6622
+ const isRatelimited = setTimeoutAction({ identifier: webhook.destination, interval: ((_h = webhook.ratelimit) != null ? _h : 2) * 2, max: (_i = webhook.ratelimit) != null ? _i : 2, addTime: true });
6551
6623
  const form = new FormData();
6552
6624
  const embed = {
6553
6625
  title: `${metadata.name} (${metadata.status})`,
@@ -6555,7 +6627,7 @@ var updateListener = (event) => __async(null, null, function* () {
6555
6627
  fields: [],
6556
6628
  color: 16711680,
6557
6629
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
6558
- footer: { text: (_c = webhook.title) != null ? _c : `AtmosphericX` }
6630
+ footer: { text: (_j = webhook.title) != null ? _j : `AtmosphericX` }
6559
6631
  };
6560
6632
  if (isRatelimited.limited) {
6561
6633
  return;
@@ -6569,7 +6641,7 @@ var updateListener = (event) => __async(null, null, function* () {
6569
6641
  value: metadata.description ? "```\n" + metadata.description.split("\n").map((l) => l.trim()).filter(Boolean).join("\n") + "\n```" : ""
6570
6642
  });
6571
6643
  }
6572
- if (((_d = metadata.attachments) == null ? void 0 : _d.length) > 0) {
6644
+ if (((_k = metadata.attachments) == null ? void 0 : _k.length) > 0) {
6573
6645
  metadata.attachments = metadata.attachments.slice(0, 5);
6574
6646
  embed.fields.push({
6575
6647
  name: "Attachments",
@@ -6589,8 +6661,8 @@ var updateListener = (event) => __async(null, null, function* () {
6589
6661
  }
6590
6662
  }
6591
6663
  form.append("payload_json", JSON.stringify({
6592
- username: (_e = webhook.title) != null ? _e : "AtmosphericX",
6593
- content: (_f = webhook.message) != null ? _f : "",
6664
+ username: (_l = webhook.title) != null ? _l : "AtmosphericX",
6665
+ content: (_m = webhook.message) != null ? _m : "",
6594
6666
  embeds: [embed]
6595
6667
  }));
6596
6668
  yield createHttp({
@@ -6784,7 +6856,7 @@ var mkEvent = (event) => __async(null, null, function* () {
6784
6856
  if (isHashed || event.properties.status_metadata.is_expired) return;
6785
6857
  setHash(event, isEntry);
6786
6858
  const isFilteredLocation = yield updateNode(event).then(() => event.properties.metadata.filtered_proximity);
6787
- if (!isFilteredLocation && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6859
+ if (!isFilteredLocation && !dict_global.includes(event.properties.event.toLowerCase()) && settings.GlobalSettings.EventFiltering.NodeLocationFiltering) {
6788
6860
  return;
6789
6861
  }
6790
6862
  const isRatelimited = setTimeoutAction({ identifier: getTracking, interval: 1, max: 1, addTime: true });
@@ -6842,15 +6914,17 @@ var rmEvent = (event) => __async(null, null, function* () {
6842
6914
  event.properties.status = `Expired`;
6843
6915
  event.properties.status_metadata.is_expired = true;
6844
6916
  if (getEvent) {
6845
- setEventEmit({
6846
- event: `onEventStatus`,
6847
- metadata: {
6848
- type: `Removed`,
6849
- event
6850
- },
6851
- message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6852
- });
6853
- setEventEmit({ event: `onExpiredProduct`, metadata: event });
6917
+ if (!event.properties.status_metadata.is_statement) {
6918
+ setEventEmit({
6919
+ event: `onEventStatus`,
6920
+ metadata: {
6921
+ type: `Removed`,
6922
+ event
6923
+ },
6924
+ message: `[Removed] ${event.properties.event} (${event.properties.status}) (${event.properties.metadata.tracking})`
6925
+ });
6926
+ setEventEmit({ event: `onExpiredProduct`, metadata: event });
6927
+ }
6854
6928
  if (cachedStatus != `Statement`) yield updateListener(event);
6855
6929
  bootstrap.cache.events.features.splice(bootstrap.cache.events.features.indexOf(getEvent), 1);
6856
6930
  bootstrap.cache.hashes = bootstrap.cache.hashes.filter((hash) => hash.tracking !== event.properties.metadata.tracking);
@@ -6941,9 +7015,9 @@ var getEventAttachments = (event) => {
6941
7015
  const watchNumber = (_d = (_c = event == null ? void 0 : event.properties) == null ? void 0 : _c.watch_parameters) == null ? void 0 : _d.watch_number;
6942
7016
  const locations = (_e = event == null ? void 0 : event.properties) == null ? void 0 : _e.locations_array;
6943
7017
  const events = [
6944
- { target: "SPC Day 1 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day1otlk_${issuanceTime}.png` },
6945
- { target: "SPC Day 2 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day2otlk.png` },
6946
- { target: "SPC Day 3 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day3otlk.png` },
7018
+ { target: "Storm Prediction Center Day 1 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day1otlk_${issuanceTime}.png` },
7019
+ { target: "Storm Prediction Center Day 2 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day2otlk.png` },
7020
+ { target: "Storm Prediction Center Day 3 Outlook", attachment: `https://www.spc.noaa.gov/products/outlook/day3otlk.png` },
6947
7021
  { target: "Mesoscale Discussion", attachment: `https://www.spc.noaa.gov/products/md/mcd${spcNumber}.png` },
6948
7022
  { target: "Tornado Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
6949
7023
  { target: "PDS Tornado Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` },
@@ -6951,7 +7025,7 @@ var getEventAttachments = (event) => {
6951
7025
  { target: "PDS Severe Thunderstorm Watch", attachment: `https://www.spc.noaa.gov/products/watch/ww${watchNumber}_radar_big.gif` }
6952
7026
  ];
6953
7027
  if (events.find((e) => e.target === event.properties.event)) {
6954
- attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target === event.properties.event).attachment });
7028
+ attachments.push({ name: `Image: Graphic`, link: events.find((e) => e.target.toLowerCase() === event.properties.event.toLowerCase()).attachment });
6955
7029
  }
6956
7030
  for (const location of locations) {
6957
7031
  if (dict_expressions.location.test(location)) {
@@ -6981,7 +7055,6 @@ var getEventAttachments = (event) => {
6981
7055
  // src/@building/building.validate.ts
6982
7056
  import { createHash } from "crypto";
6983
7057
  var validateEvents = (events) => __async(null, null, function* () {
6984
- var _a;
6985
7058
  const tick = performance.now();
6986
7059
  if (events.length === 0) return;
6987
7060
  const configurations = bootstrap.settings;
@@ -6997,39 +7070,28 @@ var validateEvents = (events) => __async(null, null, function* () {
6997
7070
  bools[key] = setting;
6998
7071
  }
6999
7072
  }
7000
- const filterd = events.filter((event) => {
7001
- var _a2, _b, _c, _d, _e;
7002
- bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7003
- const define2 = getEventSignature(event);
7073
+ const isFiltered = (define2) => {
7074
+ var _a, _b, _c, _d;
7004
7075
  const properties2 = define2.properties;
7005
7076
  const zones = properties2.geocode.ugc;
7006
7077
  const icao = properties2.geocode.office.office;
7007
- const enhancedEventName = properties2.event = getEventEnhancedName(event);
7008
- const filteredProperties = JSON.parse(JSON.stringify(properties2));
7009
- if ((filteredProperties == null ? void 0 : filteredProperties.metadata) && "ms" in filteredProperties.metadata) {
7010
- delete filteredProperties.metadata.ms;
7011
- }
7012
- filteredProperties.metadata = (_a2 = filteredProperties.metadata) != null ? _a2 : {};
7013
- properties2.metadata.hash = createHash("sha256").update(JSON.stringify(filteredProperties)).digest("hex");
7014
- properties2.metadata.attachments = getEventAttachments(event);
7015
- setEventEmit({ event: `onProductType${enhancedEventName.replace(/\s+/g, "")}`, metadata: define2 });
7016
7078
  if (properties2.status_metadata.is_test) {
7017
7079
  setEventEmit({ event: `onTestProduct`, metadata: define2 });
7018
- if (bools == null ? void 0 : bools.IgnoreTestProducts) return false;
7080
+ if (bools == null ? void 0 : bools.IgnoreTestProducts) return true;
7019
7081
  }
7020
7082
  if (properties2.status_metadata.is_expired) {
7021
7083
  setEventEmit({ event: `onExpiredProduct`, metadata: define2 });
7022
7084
  rmEvent(define2);
7023
- return false;
7085
+ return true;
7024
7086
  }
7025
- if (((_c = (_b = properties2.metadata) == null ? void 0 : _b.vtec) == null ? void 0 : _c.is_watch) && properties2.metadata.source != `events.api`) {
7026
- const isSPC = (_e = (_d = properties2.metadata) == null ? void 0 : _d.vtec) == null ? void 0 : _e.prediction_center;
7087
+ if (((_b = (_a = properties2.metadata) == null ? void 0 : _a.vtec) == null ? void 0 : _b.is_watch) && properties2.metadata.source != `events.api`) {
7088
+ const isSPC = (_d = (_c = properties2.metadata) == null ? void 0 : _c.vtec) == null ? void 0 : _d.prediction_center;
7027
7089
  setEventEmit({ event: isSPC ? `onStormPredictionWatch` : `onNonStormPredictionWatch`, metadata: define2 });
7028
7090
  if ((bools == null ? void 0 : bools.SPCWatchesOnly) && !isSPC) {
7029
- return false;
7091
+ return true;
7030
7092
  }
7031
7093
  if (!(bools == null ? void 0 : bools.SPCWatchesOnly) && isSPC) {
7032
- return false;
7094
+ return true;
7033
7095
  }
7034
7096
  }
7035
7097
  for (const key in sets) {
@@ -7040,53 +7102,64 @@ var validateEvents = (events) => __async(null, null, function* () {
7040
7102
  event: `onFilteredEvent`,
7041
7103
  metadata: define2
7042
7104
  });
7043
- return false;
7105
+ return true;
7044
7106
  }
7045
7107
  if (key === "IgnoredEvents" && setting.size > 0 && getMatched(values, define2.properties.event)) {
7046
7108
  setEventEmit({
7047
7109
  event: `onIgnoredEvent`,
7048
7110
  metadata: define2
7049
7111
  });
7050
- return false;
7112
+ return true;
7051
7113
  }
7052
7114
  if (key === "ListeningICAO" && setting.size > 0 && icao != null && !setting.has(icao.toLowerCase())) {
7053
7115
  setEventEmit({
7054
7116
  event: `onFilteredICAO`,
7055
7117
  metadata: define2
7056
7118
  });
7057
- return false;
7119
+ return true;
7058
7120
  }
7059
7121
  if (key === "IgnoredICAO" && setting.size > 0 && icao != null && setting.has(icao.toLowerCase())) {
7060
7122
  setEventEmit({
7061
7123
  event: `onIgnoredICAO`,
7062
7124
  metadata: define2
7063
7125
  });
7064
- return false;
7126
+ return true;
7065
7127
  }
7066
7128
  if (key === "ListeningUGC" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.toLowerCase()))) {
7067
7129
  setEventEmit({
7068
7130
  event: `onFilteredUGC`,
7069
7131
  metadata: define2
7070
7132
  });
7071
- return false;
7133
+ return true;
7072
7134
  }
7073
7135
  if (key === "ListeningStates" && setting.size > 0 && zones.length > 0 && !zones.some((ugc2) => setting.has(ugc2.substring(0, 2).toLowerCase()))) {
7074
7136
  setEventEmit({
7075
7137
  event: `onFilteredState`,
7076
7138
  metadata: define2
7077
7139
  });
7078
- return false;
7140
+ return true;
7079
7141
  }
7080
7142
  }
7081
- return true;
7143
+ return false;
7144
+ };
7145
+ const filtering = events.filter((event) => {
7146
+ var _a;
7147
+ bootstrap.cache.processed = bootstrap.cache.processed.filter((e) => e !== event);
7148
+ const define2 = getEventSignature(event);
7149
+ const properties2 = define2.properties;
7150
+ (_a = properties2 == null ? void 0 : properties2.metadata) == null ? true : delete _a.ms;
7151
+ const enhanced = properties2.event = getEventEnhancedName(event);
7152
+ const filtered = isFiltered(define2);
7153
+ if (!filtered) {
7154
+ event.geometry = !(bools == null ? void 0 : bools.DisableGeometryParsing) ? getEventGeometry(event) : null;
7155
+ properties2.metadata.attachments = getEventAttachments(event);
7156
+ }
7157
+ properties2.metadata.hash = createHash("sha256").update(JSON.stringify(properties2)).digest("hex");
7158
+ setEventEmit({ event: `onProductType${enhanced.replace(/\s+/g, "")}`, metadata: define2 });
7159
+ return !filtered;
7082
7160
  });
7083
- if (!((_a = configurations == null ? void 0 : configurations.GlobalSettings) == null ? void 0 : _a.DisableGeometryParsing)) {
7084
- for (const event of filterd) {
7085
- event.geometry = yield getEventGeometry(event);
7086
- }
7087
- }
7088
- if (filterd.length > 0) {
7089
- for (const event of filterd) {
7161
+ if (filtering.length > 0) {
7162
+ for (const event of filtering) {
7090
7163
  yield mkEvent(event);
7091
7164
  }
7092
7165
  }
@@ -7096,7 +7169,7 @@ var validateEvents = (events) => __async(null, null, function* () {
7096
7169
  metadata: bootstrap.cache.events,
7097
7170
  limited: true
7098
7171
  });
7099
- setDebug({ title: `@building.validate`, message: `Filtered ${filterd.length} events which took ${performance.now() - tick} ms` });
7172
+ setDebug({ title: `@building.validate`, message: `Filtered ${filtering.length} events which took ${performance.now() - tick} ms` });
7100
7173
  });
7101
7174
 
7102
7175
  // src/@building/building.create.ts
@@ -7646,59 +7719,16 @@ var getNodes = () => {
7646
7719
  return bootstrap.cache.nodes;
7647
7720
  };
7648
7721
 
7649
- // src/@core/core.createEvent.ts
7650
- var createEvent2 = (options) => {
7651
- var _a;
7652
- const tick = performance.now();
7653
- validateEvents([{
7654
- type: `Feature`,
7655
- geometry: {
7656
- type: `Point`,
7657
- coordinates: options.coordinates
7658
- },
7659
- properties: {
7660
- event: options.event,
7661
- parent: options.event,
7662
- status: options.status,
7663
- issued: options.issued.toISOString(),
7664
- expires: options.expires.toISOString(),
7665
- locations: options.locations,
7666
- locations_array: options.locations ? options.locations.split(";") : [],
7667
- description: options.description,
7668
- geocode: {
7669
- office: {
7670
- office: `ATMX`,
7671
- name: `AtmosphericX Manual Event`
7672
- },
7673
- organization: `AtmosphericX`,
7674
- ugc: [],
7675
- polygon: options.coordinates.length > 0 ? Buffer.from(JSON.stringify([options.coordinates[0]])).toString("base64") : null,
7676
- polygon_generated: options.coordinates.length > 0 ? true : false
7677
- },
7678
- status_metadata: {
7679
- is_issued: options.status == `Issued`,
7680
- is_updated: options.status == `Updated`,
7681
- is_expired: options.status == `Expired`,
7682
- is_test: options.status == `Test`,
7683
- is_statement: options.status == `Statement`
7684
- },
7685
- metadata: {
7686
- ms: performance.now() - tick,
7687
- source: `events.manual`,
7688
- tracking: `ATMX-M-W-01`,
7689
- header: `ZCZC-ATMOSX-ATMX-M-W-01`,
7690
- raw: options.description,
7691
- history: [
7692
- {
7693
- description: options.description,
7694
- issued: options.issued.toISOString(),
7695
- status: (_a = options.status) != null ? _a : null
7696
- }
7697
- ]
7698
- }
7699
- }
7700
- }]);
7701
- };
7722
+ // src/@core/core.manualEvent.ts
7723
+ var manualEvent = (options) => __async(null, null, function* () {
7724
+ const isCapEvent = options.message.includes(`<?xml`);
7725
+ const isCapAreaDescription = options.message.includes(`<areaDesc>`);
7726
+ const isVTEC = options.message.match(dict_expressions.pvtec) != null;
7727
+ const isUGC = options.message.match(dict_expressions.ugc1) != null;
7728
+ const getType = getAwipsType({ attributes: options.attributes });
7729
+ const result = { message: options.message, attributes: options.attributes, isCapEvent, isVTEC, isUGC, isCapAreaDescription, isIgnored: false, isNWWS: true, getType };
7730
+ yield createEvent(result);
7731
+ });
7702
7732
 
7703
7733
  // src/@core/core.getRandomEvent.ts
7704
7734
  var getRandomEvent = () => {
@@ -7759,13 +7789,13 @@ var index_default = Manager;
7759
7789
  export {
7760
7790
  Manager,
7761
7791
  clearEvents,
7762
- createEvent2 as createEvent,
7763
7792
  index_default as default,
7764
7793
  getCleanedEvent,
7765
7794
  getEventGeometry,
7766
7795
  getEvents,
7767
7796
  getNodes,
7768
7797
  getRandomEvent,
7798
+ manualEvent,
7769
7799
  query,
7770
7800
  setEasTone,
7771
7801
  setNode,