@sjvair/monitor-map 3.0.2 → 3.0.3

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 (137) hide show
  1. package/dist/lib/LoadScreen.js +14 -14
  2. package/dist/lib/{src/MapView.js → MainMapView.js} +2 -2
  3. package/dist/lib/MapLegend.js +13 -0
  4. package/dist/lib/MonitorDetailPanel.js +169 -0
  5. package/dist/lib/MonitorMapLayout.js +91 -0
  6. package/dist/lib/_virtual/_rolldown/runtime.js +11 -0
  7. package/dist/lib/assets/logos/airgradient-blue.js +4 -0
  8. package/dist/lib/assets/logos/airnow-compact.js +4 -0
  9. package/dist/lib/assets/logos/carb-compact.js +4 -0
  10. package/dist/lib/assets/logos/purpleair-compact.js +4 -0
  11. package/dist/lib/assets/logos/sjvair.js +4 -0
  12. package/dist/lib/collocation-sites/CollocationTooltip.js +1 -1
  13. package/dist/lib/collocation-sites/collocations-map-integration.svelte.js +20 -20
  14. package/dist/lib/components/DataBox.js +1 -1
  15. package/dist/lib/components/DisplayOption.js +1 -1
  16. package/dist/lib/components/MapLayersDisplayOptions.js +44 -35
  17. package/dist/lib/components/SegmentedControl.js +4 -4
  18. package/dist/lib/components/ToggleSwitch.js +1 -1
  19. package/dist/lib/components/ui/button/button.js +4 -4
  20. package/dist/lib/components/ui/range-calendar/range-calendar-caption.js +57 -54
  21. package/dist/lib/components/ui/range-calendar/range-calendar-cell.js +19 -18
  22. package/dist/lib/components/ui/range-calendar/range-calendar-day.js +19 -18
  23. package/dist/lib/components/ui/range-calendar/range-calendar-grid-body.js +17 -16
  24. package/dist/lib/components/ui/range-calendar/range-calendar-grid-head.js +17 -16
  25. package/dist/lib/components/ui/range-calendar/range-calendar-grid-row.js +19 -18
  26. package/dist/lib/components/ui/range-calendar/range-calendar-grid.js +19 -18
  27. package/dist/lib/components/ui/range-calendar/range-calendar-head-cell.js +19 -18
  28. package/dist/lib/components/ui/range-calendar/range-calendar-header.js +19 -18
  29. package/dist/lib/components/ui/range-calendar/range-calendar-month-select.js +31 -31
  30. package/dist/lib/components/ui/range-calendar/range-calendar-month.js +19 -19
  31. package/dist/lib/components/ui/range-calendar/range-calendar-months.js +19 -19
  32. package/dist/lib/components/ui/range-calendar/range-calendar-nav.js +19 -19
  33. package/dist/lib/components/ui/range-calendar/range-calendar-next-button.js +27 -26
  34. package/dist/lib/components/ui/range-calendar/range-calendar-prev-button.js +27 -26
  35. package/dist/lib/components/ui/range-calendar/range-calendar-year-select.js +29 -29
  36. package/dist/lib/components/ui/range-calendar/range-calendar.js +154 -154
  37. package/dist/lib/data-chart/DataChart.js +76 -76
  38. package/dist/lib/ev-stations/components/EvStationClusterTooltip.js +16 -0
  39. package/dist/lib/ev-stations/components/EvStationTooltip.js +120 -0
  40. package/dist/lib/ev-stations/components/EvStationsDisplayOptions.js +41 -0
  41. package/dist/lib/ev-stations/data-maps.js +4 -0
  42. package/dist/lib/ev-stations/ev-station-icons.js +32 -0
  43. package/dist/lib/ev-stations/ev-stations-cluster-renderer.js +118 -0
  44. package/dist/lib/ev-stations/ev-stations-map-integration.svelte.js +181 -0
  45. package/dist/lib/ev-stations/ev-stations.svelte.js +33 -0
  46. package/dist/lib/ev-stations/zip-codes.js +136 -0
  47. package/dist/lib/hms/components/HMSFireLegend.js +35 -0
  48. package/dist/lib/index.js +19 -17
  49. package/dist/lib/map/Map.js +1 -1
  50. package/dist/lib/map/MapStyleDisplayOptions.js +16 -16
  51. package/dist/lib/map/Menu.js +23 -24
  52. package/dist/lib/map/integrations/map-icon-manager.js +3 -0
  53. package/dist/lib/map/utils.js +16 -13
  54. package/dist/lib/monitors/components/MonitorClusterTooltip.js +4 -4
  55. package/dist/lib/monitors/components/MonitorMarkersLegend.js +35 -0
  56. package/dist/lib/monitors/components/MonitorSubscriptionManager.js +1 -1
  57. package/dist/lib/monitors/components/MonitorTooltip.js +1 -1
  58. package/dist/lib/monitors/components/MonitorWidgetModal.js +1 -1
  59. package/dist/lib/monitors/components/MonitorsDisplayOptions.js +21 -21
  60. package/dist/lib/monitors/monitors-icon-manager.svelte.js +9 -9
  61. package/dist/lib/monitors/monitors-map-integration.svelte.js +36 -36
  62. package/dist/lib/monitors/monitors.svelte.js +38 -42
  63. package/dist/lib/router-context.js +13 -0
  64. package/dist/lib/routes.js +10 -0
  65. package/dist/lib/search/Search.js +124 -0
  66. package/dist/lib/search/service.js +90 -0
  67. package/dist/lib/sjvair-sjv.avif +0 -0
  68. package/dist/lib/sjvair-sjv.webp +0 -0
  69. package/dist/lib/sjvair-sjv2.avif +0 -0
  70. package/dist/lib/sjvair-sjv2.webp +0 -0
  71. package/dist/lib/utils.js +9 -3
  72. package/package.json +37 -36
  73. package/src/lib/LoadScreen.svelte +5 -5
  74. package/src/lib/MainMapView.svelte +1 -0
  75. package/src/lib/MapLegend.svelte +15 -0
  76. package/src/lib/MonitorDetailPanel.svelte +152 -0
  77. package/src/lib/MonitorMapLayout.svelte +193 -0
  78. package/src/lib/components/MapLayersDisplayOptions.svelte +6 -2
  79. package/src/lib/hms/components/HMSFireLegend.svelte +21 -0
  80. package/src/lib/index.ts +34 -0
  81. package/src/lib/map/Map.svelte +1 -0
  82. package/src/lib/map/Menu.svelte +4 -7
  83. package/src/lib/map/integrations/map-icon-manager.ts +4 -1
  84. package/src/lib/monitors/monitors.svelte.ts +1 -3
  85. package/src/lib/router-context.ts +48 -0
  86. package/src/lib/routes.ts +8 -0
  87. package/src/lib/search/Search.svelte +189 -0
  88. package/src/lib/search/service.ts +101 -0
  89. package/src/lib/utils.ts +11 -0
  90. package/dist/lib/assets/icons/adjustment-horizontal.js +0 -4
  91. package/dist/lib/node_modules/@internationalized/date/dist/private/CalendarDate.js +0 -122
  92. package/dist/lib/node_modules/@internationalized/date/dist/private/DateFormatter.js +0 -84
  93. package/dist/lib/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +0 -91
  94. package/dist/lib/node_modules/@internationalized/date/dist/private/conversion.js +0 -104
  95. package/dist/lib/node_modules/@internationalized/date/dist/private/manipulation.js +0 -159
  96. package/dist/lib/node_modules/@internationalized/date/dist/private/queries.js +0 -32
  97. package/dist/lib/node_modules/@internationalized/date/dist/private/string.js +0 -37
  98. package/dist/lib/node_modules/@internationalized/date/dist/private/utils.js +0 -6
  99. package/dist/lib/node_modules/clsx/dist/clsx.js +0 -16
  100. package/dist/lib/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1723
  101. package/dist/lib/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js +0 -70
  102. package/dist/lib/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js +0 -166
  103. package/dist/lib/node_modules/tailwind-variants/dist/index.js +0 -19
  104. package/dist/lib/node_modules/uplot/dist/uPlot.esm.js +0 -2147
  105. package/dist/lib/src/MonitorDetailPanel.js +0 -169
  106. package/dist/lib/src/router.js +0 -9
  107. package/dist/monitor-map/MonitorDetailPanel.css +0 -1
  108. package/dist/monitor-map/assets/MonitorDetailPanel-BU_pXZjp.js +0 -15
  109. package/dist/monitor-map/assets/validate-routes-CgbRa8fT.js +0 -1
  110. package/dist/monitor-map/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  111. package/dist/monitor-map/inter-cyrillic-wght-normal.woff2 +0 -0
  112. package/dist/monitor-map/inter-greek-ext-wght-normal.woff2 +0 -0
  113. package/dist/monitor-map/inter-greek-wght-normal.woff2 +0 -0
  114. package/dist/monitor-map/inter-latin-ext-wght-normal.woff2 +0 -0
  115. package/dist/monitor-map/inter-latin-wght-normal.woff2 +0 -0
  116. package/dist/monitor-map/inter-vietnamese-wght-normal.woff2 +0 -0
  117. package/dist/monitor-map/lungs.svg +0 -99
  118. package/dist/monitor-map/sjvair-air.avif +0 -0
  119. package/dist/monitor-map/sjvair-air.png +0 -0
  120. package/dist/monitor-map/sjvair-air.webp +0 -0
  121. package/dist/monitor-map/sjvair-air2.avif +0 -0
  122. package/dist/monitor-map/sjvair-air2.png +0 -0
  123. package/dist/monitor-map/sjvair-air2.webp +0 -0
  124. package/dist/monitor-map/sjvair-icon.avif +0 -0
  125. package/dist/monitor-map/sjvair-icon.png +0 -0
  126. package/dist/monitor-map/sjvair-icon.webp +0 -0
  127. package/dist/monitor-map/sjvair-icon2.avif +0 -0
  128. package/dist/monitor-map/sjvair-icon2.png +0 -0
  129. package/dist/monitor-map/sjvair-icon2.webp +0 -0
  130. package/dist/monitor-map/sjvair-sjv.avif +0 -0
  131. package/dist/monitor-map/sjvair-sjv.png +0 -0
  132. package/dist/monitor-map/sjvair-sjv.webp +0 -0
  133. package/dist/monitor-map/sjvair-sjv2.avif +0 -0
  134. package/dist/monitor-map/sjvair-sjv2.png +0 -0
  135. package/dist/monitor-map/sjvair-sjv2.webp +0 -0
  136. package/dist/monitor-map/sjvairMonitorMap.css +0 -1
  137. package/dist/monitor-map/sjvairMonitorMap.js +0 -4042
@@ -0,0 +1,181 @@
1
+ import { mountClickPopup as e } from "../map/utils.js";
2
+ import { mapManager as t } from "../map/map.svelte.js";
3
+ import { clickManager as n } from "../map/integrations/click-manager.js";
4
+ import { MapIconLayerIntegration as r } from "../map/integrations/map-geojson-integration.svelte.js";
5
+ import { TooltipManager as i } from "../map/integrations/tooltip.svelte.js";
6
+ import { MapDisplayOption as a } from "../map/integrations/map-display-option.svelte.js";
7
+ import { evStationsManager as o } from "./ev-stations.svelte.js";
8
+ import { EvStationIconManager as s } from "./ev-station-icons.js";
9
+ import { EvStationsClusterRenderer as c } from "./ev-stations-cluster-renderer.js";
10
+ import l from "./components/EvStationTooltip.js";
11
+ import * as u from "svelte/internal/client";
12
+ import { untrack as d } from "svelte";
13
+ //#region src/lib/ev-stations/ev-stations-map-integration.svelte.ts
14
+ var f = class extends r {
15
+ referenceId = "ev-stations";
16
+ #e = u.state(!0);
17
+ get enabled() {
18
+ return u.get(this.#e);
19
+ }
20
+ set enabled(e) {
21
+ u.set(this.#e, e, !0);
22
+ }
23
+ #t = u.state(!0);
24
+ get clustered() {
25
+ return u.get(this.#t);
26
+ }
27
+ set clustered(e) {
28
+ u.set(this.#t, e, !0);
29
+ }
30
+ icons = new s();
31
+ tooltipManager = new i();
32
+ renderer = new c(this);
33
+ currentPopup = null;
34
+ #n = u.derived(() => ({
35
+ lvl2: new a("Level 2", !1, this.icons.get("ev-station-lvl2")),
36
+ lvl3: new a("Level 3", !1, this.icons.get("ev-station-lvl3"))
37
+ }));
38
+ get displayOptions() {
39
+ return u.get(this.#n);
40
+ }
41
+ set displayOptions(e) {
42
+ u.set(this.#n, e);
43
+ }
44
+ #r = u.derived(() => {
45
+ let e = [];
46
+ if (o.lvl2Stations) for (let t of o.lvl2Stations) e.push(p(t, "lvl2"));
47
+ if (o.lvl3Stations) for (let t of o.lvl3Stations) e.push(p(t, "lvl3"));
48
+ return e;
49
+ });
50
+ get features() {
51
+ return u.get(this.#r);
52
+ }
53
+ set features(e) {
54
+ u.set(this.#r, e);
55
+ }
56
+ #i = u.derived(() => {
57
+ let e = {};
58
+ for (let t of this.features) {
59
+ let n = t.properties.level;
60
+ if (n === "lvl2" && !this.displayOptions.lvl2.value || n === "lvl3" && !this.displayOptions.lvl3.value) continue;
61
+ let r = e[n] ?? [];
62
+ r.push(t), e[n] = r;
63
+ }
64
+ return e;
65
+ });
66
+ get featuresByLevel() {
67
+ return u.get(this.#i);
68
+ }
69
+ set featuresByLevel(e) {
70
+ u.set(this.#i, e);
71
+ }
72
+ #a = u.derived(() => {
73
+ let e = [];
74
+ return this.displayOptions.lvl2.value && e.push("lvl2"), this.displayOptions.lvl3.value && e.push("lvl3"), e.length === 0 ? [
75
+ "==",
76
+ ["get", "level"],
77
+ "none"
78
+ ] : e.length === 2 ? ["boolean", !0] : [
79
+ "==",
80
+ ["get", "level"],
81
+ e[0]
82
+ ];
83
+ });
84
+ get filters() {
85
+ return u.get(this.#a);
86
+ }
87
+ set filters(e) {
88
+ u.set(this.#a, e);
89
+ }
90
+ handleStationClick = (n, r) => {
91
+ this.currentPopup?.remove();
92
+ let i = n[0];
93
+ i && (this.currentPopup = e(l, { feature: i }, r.lngLat), this.currentPopup.addTo(t.map));
94
+ };
95
+ get mapLayer() {
96
+ return {
97
+ id: this.referenceId,
98
+ type: "symbol",
99
+ source: this.referenceId,
100
+ filter: this.filters,
101
+ layout: {
102
+ "icon-allow-overlap": !0,
103
+ "icon-ignore-placement": !0,
104
+ "icon-image": ["get", "icon"],
105
+ "icon-size": 1
106
+ },
107
+ paint: {}
108
+ };
109
+ }
110
+ get mapSource() {
111
+ return {
112
+ type: "geojson",
113
+ promoteId: "id",
114
+ data: {
115
+ type: "FeatureCollection",
116
+ features: this.features
117
+ }
118
+ };
119
+ }
120
+ constructor() {
121
+ super(), u.effect_root(() => {
122
+ u.user_effect(() => {
123
+ this.displayOptions.lvl2.value && o.lvl2Stations === void 0 && o.loadLvl2Stations();
124
+ }), u.user_effect(() => {
125
+ this.displayOptions.lvl3.value && o.lvl3Stations === void 0 && o.loadLvl3Stations();
126
+ }), u.user_effect(() => {
127
+ let e = this.filters;
128
+ !t.map || this.clustered || t.map.getLayer(this.referenceId) && t.map.setFilter(this.referenceId, e);
129
+ }), u.user_effect(() => {
130
+ let e = this.features;
131
+ !t.map || this.clustered || t.setDataSource(this.referenceId, e);
132
+ }), u.user_effect(() => {
133
+ this.featuresByLevel, !(!t.map || !this.clustered) && this.renderer.syncFeatures();
134
+ }), u.user_effect(() => {
135
+ this.clustered;
136
+ let e = Object.keys(this.featuresByLevel).length > 0;
137
+ !d(() => t.map) || !e || d(() => this.apply());
138
+ });
139
+ });
140
+ }
141
+ apply() {
142
+ t.map && (this.clustered ? (t.map.getLayer(this.referenceId) && t.map.removeLayer(this.referenceId), t.map.getSource(this.referenceId) && t.map.removeSource(this.referenceId), n.unregister([this.referenceId]), this.tooltipManager.disable(), this.renderer.remove(), this.icons.loadIcons().then(() => {
143
+ this.renderer.apply(this.handleStationClick), this.tooltipManager.enable();
144
+ })) : (this.renderer.remove(), this.tooltipManager.disable(), n.unregister([this.referenceId]), super.apply(), this.icons.loadIcons().then(() => {
145
+ n.register([this.referenceId], this.handleStationClick), this.tooltipManager.enable();
146
+ })));
147
+ }
148
+ remove() {
149
+ n.unregister([this.referenceId]), n.unregister(this.renderer.unclusteredLayerIds), this.renderer.remove(), this.currentPopup?.remove(), this.currentPopup = null, super.remove();
150
+ }
151
+ };
152
+ function p(e, t) {
153
+ return {
154
+ type: "Feature",
155
+ properties: {
156
+ icon: `ev-station-${t}`,
157
+ id: e.id,
158
+ level: t,
159
+ station_name: e.station_name ?? "",
160
+ facility_type: e.facility_type ?? "",
161
+ ev_network: e.ev_network ?? "",
162
+ station_phone: e.station_phone ?? "",
163
+ street_address: e.street_address ?? "",
164
+ city: e.city ?? "",
165
+ state: e.state ?? "",
166
+ zip: e.zip ?? "",
167
+ access_days_time: e.access_days_time ?? "",
168
+ access_detail_code: e.access_detail_code ?? "",
169
+ cards_accepted: e.cards_accepted ?? null,
170
+ ev_pricing: e.ev_pricing ?? "",
171
+ ev_connector_types: JSON.stringify(e.ev_connector_types ?? [])
172
+ },
173
+ geometry: {
174
+ type: "Point",
175
+ coordinates: [e.longitude, e.latitude]
176
+ }
177
+ };
178
+ }
179
+ var m = new f();
180
+ //#endregion
181
+ export { m as evStationsMapIntegration };
@@ -0,0 +1,33 @@
1
+ import { accessDetailCodeTypes as e, creditCardTypes as t, evConnectorTypes as n, evNetworkTypes as r, facilityTypes as i } from "./data-maps.js";
2
+ import { zip_codes_exports as a } from "./zip-codes.js";
3
+ import * as o from "svelte/internal/client";
4
+ //#region src/lib/ev-stations/ev-stations.svelte.ts
5
+ var s = class {
6
+ #e = o.state();
7
+ get lvl2Stations() {
8
+ return o.get(this.#e);
9
+ }
10
+ set lvl2Stations(e) {
11
+ o.set(this.#e, e, !0);
12
+ }
13
+ #t = o.state();
14
+ get lvl3Stations() {
15
+ return o.get(this.#t);
16
+ }
17
+ set lvl3Stations(e) {
18
+ o.set(this.#t, e, !0);
19
+ }
20
+ async loadLvl3Stations() {
21
+ this.lvl3Stations = await l("dc_fast");
22
+ }
23
+ async loadLvl2Stations() {
24
+ this.lvl2Stations = await l("2");
25
+ }
26
+ }, c = Object.values(a).reduce((e, t) => e.concat(t)).join(",");
27
+ async function l(a) {
28
+ let o = new URL("https://developer.nlr.gov/api/alt-fuel-stations/v1.json");
29
+ return o.searchParams.set("fuel_type", "ELEC"), o.searchParams.set("state", "CA"), o.searchParams.set("status", "E"), o.searchParams.set("access", "public"), o.searchParams.set("ev_charging_level", a), o.searchParams.set("zip", c), o.searchParams.set("api_key", "BThVJdnwHbO8hDpQkBdeqsUoeXhQuMgMRgO3hvyo"), await fetch(o).then(async (e) => await e.json()).then((a) => a.fuel_stations.map((a) => (a.access_detail_code &&= e.get(a.access_detail_code), a.cards_accepted &&= a.cards_accepted.split(" ").map((e) => t.get(e)).join(", "), a.ev_connector_types && a.ev_connector_types.length && (a.ev_connector_types = a.ev_connector_types.map((e) => n.get(e))), a.ev_network &&= r.get(a.ev_network), a.facility_type &&= i.get(a.facility_type), a)).filter((e) => e.id !== 226154));
30
+ }
31
+ var u = new s();
32
+ //#endregion
33
+ export { u as evStationsManager };
@@ -0,0 +1,136 @@
1
+ import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
2
+ //#region src/lib/ev-stations/zip-codes.ts
3
+ var t = /* @__PURE__ */ e({
4
+ Calaveras: () => u,
5
+ Fresno: () => o,
6
+ Inyo: () => m,
7
+ Kern: () => l,
8
+ Kings: () => s,
9
+ Madera: () => a,
10
+ Mariposa: () => p,
11
+ Merced: () => i,
12
+ Mono: () => f,
13
+ SanJoaquin: () => n,
14
+ Stanislaus: () => r,
15
+ Tulare: () => c,
16
+ Tuolumne: () => d
17
+ }), n = /* @__PURE__ */ "95201.95202.95203.95204.95205.95206.95207.95208.95209.95210.95211.95212.95213.95214.95215.95219.95220.95227.95230.95231.95234.95236.95237.95240.95241.95242.95253.95258.95267.95269.95296.95297.95304.95320.95330.95336.95337.95366.95376.95377.95378.95385.95391.95686".split("."), r = /* @__PURE__ */ "95355.95350.94550.95351.95307.95380.95382.95356.95361.95358.95354.95363.95367.95357.95326.95360.95386.95368.95316.95230.95328.95313.95329.95385.95387.95323.95319.95353.95352.95381.95397".split("."), i = /* @__PURE__ */ "95023.95380.93635.95301.95340.95348.95341.93610.95334.95388.95315.95322.93620.95324.95316.95365.95333.95374.95369.95303.95317.95325.93665.95342.95344.95343.93661.09534.95312".split("."), a = [
18
+ "93720",
19
+ "93638",
20
+ "93637",
21
+ "93610",
22
+ "93636",
23
+ "93622",
24
+ "93614",
25
+ "93644",
26
+ "93626",
27
+ "93601",
28
+ "93643",
29
+ "93645",
30
+ "93653",
31
+ "93669",
32
+ "93604",
33
+ "93639"
34
+ ], o = /* @__PURE__ */ "93722.93727.93720.93619.93611.93702.93726.93706.93711.93705.93245.93612.93657.93710.93618.93703.93654.93725.93662.93704.93630.93210.93631.93728.93648.93723.93622.93730.93701.93620.93721.93640.93646.93737.93625.93656.93234.93609.93660.93242.93626.93675.93616.93602.93667.93650.93651.93664.93668.93624.93621.93608.93740.93634.93641.93652.93627.93606.93665.93628.93605.93607.93613.93642.93649.93708.93707.93709.93712.93715.93714.93717.93716.93718.93724.93729.93741.93745.93744.93750.93747.93760.93755.93764.93761.93771.93765.93773.93772.93775.93774.93777.93776.93779.93778.93790.93786.93792.93791.93794.93793.93888.93844.93784.93780.93633".split("."), s = [
35
+ "93230",
36
+ "93245",
37
+ "93212",
38
+ "93631",
39
+ "93204",
40
+ "93656",
41
+ "93242",
42
+ "93249",
43
+ "93266",
44
+ "93201",
45
+ "93202",
46
+ "93246",
47
+ "93239",
48
+ "93232",
49
+ "93282"
50
+ ], c = /* @__PURE__ */ "93257.93274.93291.93215.93277.93292.93618.93212.93247.93631.93221.93647.93286.93646.93219.93223.93615.93267.93256.93270.93272.93235.93265.93271.93527.93201.93218.93238.93261.93641.93255.93603.93244.93262.93549.93628.93208.93227.93237.93258.93275.93279.93278.93290.93666.93670.93673.93260.93633.93207".split("."), l = /* @__PURE__ */ "93307.93536.93306.93309.93313.93215.93308.93312.93304.93311.93305.93314.93555.93561.93280.93263.93560.93203.93268.93250.93241.93301.93505.93240.93501.93225.93461.93516.93206.93252.93285.93249.93283.93243.93527.93523.93524.93205.93518.93251.93531.93238.93255.93224.93554.93519.93287.93226.93216.93222.93276.93303.93302.93381.93380.93383.93382.93385.93384.93387.93386.93389.93388.93390.93502.93504.93528.93556.93581.93596.93220".split("."), u = [
51
+ "95252",
52
+ "95222",
53
+ "95249",
54
+ "95247",
55
+ "95230",
56
+ "95228",
57
+ "95223",
58
+ "95245",
59
+ "95246",
60
+ "95255",
61
+ "95225",
62
+ "95226",
63
+ "95224",
64
+ "95254",
65
+ "95257",
66
+ "95232",
67
+ "95251",
68
+ "95248",
69
+ "95221",
70
+ "95233",
71
+ "95250",
72
+ "95229"
73
+ ], d = [
74
+ "95370",
75
+ "95327",
76
+ "95247",
77
+ "95383",
78
+ "95321",
79
+ "95379",
80
+ "95223",
81
+ "95311",
82
+ "95329",
83
+ "95372",
84
+ "95310",
85
+ "95346",
86
+ "95364",
87
+ "95224",
88
+ "93541",
89
+ "95305",
90
+ "95335",
91
+ "95314",
92
+ "95309",
93
+ "95347",
94
+ "95373",
95
+ "95375"
96
+ ], f = [
97
+ "93514",
98
+ "93546",
99
+ "93517",
100
+ "96107",
101
+ "93529",
102
+ "96133",
103
+ "93541",
104
+ "93512"
105
+ ], p = [
106
+ "95338",
107
+ "95333",
108
+ "93601",
109
+ "95311",
110
+ "95329",
111
+ "95369",
112
+ "93653",
113
+ "95345",
114
+ "95389",
115
+ "95306",
116
+ "95325",
117
+ "95318",
118
+ "93623"
119
+ ], m = [
120
+ "93514",
121
+ "93513",
122
+ "93527",
123
+ "93545",
124
+ "92328",
125
+ "93549",
126
+ "92389",
127
+ "93526",
128
+ "93592",
129
+ "92384",
130
+ "93515",
131
+ "93542",
132
+ "93522",
133
+ "93530"
134
+ ];
135
+ //#endregion
136
+ export { u as Calaveras, o as Fresno, m as Inyo, l as Kern, s as Kings, a as Madera, p as Mariposa, i as Merced, f as Mono, n as SanJoaquin, r as Stanislaus, c as Tulare, d as Tuolumne, t as zip_codes_exports };
@@ -0,0 +1,35 @@
1
+ import { hmsFireMapIntegration as e } from "../hms-fire-map-integration.svelte.js";
2
+ import "svelte/internal/disclose-version";
3
+ import * as t from "svelte/internal/client";
4
+ import "svelte/internal/flags/legacy";
5
+ //#region src/lib/hms/components/HMSFireLegend.svelte
6
+ var n = t.from_html("<div class=\"flex gap-1 items-center\"><div class=\"size-9 flex justify-center items-center\"><img/></div> <span> </span></div>"), r = t.from_html("<div class=\"flex flex-col bg-white rounded shadow w-fit p-1\"><p class=\"text-center whitespace-nowrap font-semibold\">Fire Points</p> <div class=\"flex flex-col\"></div></div>");
7
+ function i(i, a) {
8
+ t.push(a, !1);
9
+ let o = [
10
+ "<10",
11
+ "10-49",
12
+ "50-149",
13
+ "150-349",
14
+ "≥350"
15
+ ];
16
+ t.init();
17
+ var s = t.comment(), c = t.first_child(s), l = (i) => {
18
+ var a = r(), s = t.sibling(t.child(a), 2);
19
+ t.each(s, 5, () => e.icons.iter, t.index, (e, r, i) => {
20
+ var a = t.derived(() => t.to_array(t.get(r), 2));
21
+ let s = () => t.get(a)[1];
22
+ var c = n(), l = t.child(c), u = t.child(l);
23
+ t.reset(l);
24
+ var d = t.sibling(l, 2), f = t.child(d);
25
+ t.reset(d), t.reset(c), t.template_effect(() => {
26
+ t.set_attribute(u, "src", s().image.src), t.set_attribute(u, "alt", s().image.alt), t.set_text(f, `${o[i] ?? ""} MW`);
27
+ }), t.append(e, c);
28
+ }), t.reset(s), t.reset(a), t.append(i, a);
29
+ };
30
+ t.if(c, (t) => {
31
+ e.enabled && e.features.length > 0 && t(l);
32
+ }), t.append(i, s), t.pop();
33
+ }
34
+ //#endregion
35
+ export { i as default };
package/dist/lib/index.js CHANGED
@@ -1,19 +1,21 @@
1
- import { monitorsManager as e } from "./monitors/monitors.svelte.js";
2
- import { collocationSitesManager as t } from "./collocation-sites/collocations.svelte.js";
3
- import { DefaultMapStyle as n, initializeMap as r, mapManager as i } from "./map/map.svelte.js";
4
- import { MapIntegration as a } from "./map/integrations/map-integration.svelte.js";
5
- import { MapLayerIntegration as o } from "./map/integrations/map-layer-integration.svelte.js";
6
- import { MapIconLayerIntegration as s } from "./map/integrations/map-geojson-integration.svelte.js";
7
- import { monitorsMapIntegration as c } from "./monitors/monitors-map-integration.svelte.js";
8
- import { collocationSitesMapIntegration as l } from "./collocation-sites/collocations-map-integration.svelte.js";
9
- import { baseLayerSeperator as u } from "./map/integrations/base-layer-seperator.js";
10
- import { windMapIntegration as d } from "./wind/wind.svelte.js";
11
- import f from "./map/Map.js";
12
- import p from "./map/Menu.js";
13
- import m, { disable as h, enable as g, loadScreenState as _ } from "./LoadScreen.js";
14
- import v from "./components/SegmentedControl.js";
15
- import y from "./components/ToggleSwitch.js";
16
- import b from "./monitors/components/MonitorsDisplayOptions.js";
1
+ import e, { disable as t, enable as n, loadScreenState as r } from "./LoadScreen.js";
2
+ import { DefaultMapStyle as i, initializeMap as a, mapManager as o } from "./map/map.svelte.js";
3
+ import s from "./map/Map.js";
4
+ import c from "./map/Menu.js";
5
+ import l from "./components/SegmentedControl.js";
6
+ import u from "./components/ToggleSwitch.js";
7
+ import { monitorsManager as d } from "./monitors/monitors.svelte.js";
8
+ import { MapIntegration as f } from "./map/integrations/map-integration.svelte.js";
9
+ import { MapLayerIntegration as p } from "./map/integrations/map-layer-integration.svelte.js";
10
+ import { MapIconLayerIntegration as m } from "./map/integrations/map-geojson-integration.svelte.js";
11
+ import { monitorsMapIntegration as h } from "./monitors/monitors-map-integration.svelte.js";
12
+ import g from "./monitors/components/MonitorsDisplayOptions.js";
13
+ import { baseLayerSeperator as _ } from "./map/integrations/base-layer-seperator.js";
14
+ import { windMapIntegration as v } from "./wind/wind.svelte.js";
15
+ import { collocationSitesManager as y } from "./collocation-sites/collocations.svelte.js";
16
+ import { collocationSitesMapIntegration as b } from "./collocation-sites/collocations-map-integration.svelte.js";
17
17
  import x from "./components/MapLayersDisplayOptions.js";
18
18
  import S from "./map/MapStyleDisplayOptions.js";
19
- export { n as DefaultMapStyle, m as LoadScreen, f as Map, s as MapGeoJSONIntegration, a as MapIntegration, o as MapLayerIntegration, x as MapLayersDisplayOptions, S as MapStyleDisplayOptions, p as Menu, b as MonitorsDisplayOptions, v as SegmentedControl, y as ToggleSwitch, u as baseLayerSeperator, t as collocationSitesManager, l as collocationSitesMapIntegration, h as disableLoadScreen, g as enableLoadScreen, r as initializeMap, _ as loadScreenState, i as mapManager, e as monitorsManager, c as monitorsMapIntegration, d as windMapIntegration };
19
+ import { ROUTER_KEY as C, provideMonitorMapRouter as w, useMonitorMapRouter as T } from "./router-context.js";
20
+ import { monitorMapRoutes as E } from "./routes.js";
21
+ export { i as DefaultMapStyle, e as LoadScreen, s as Map, m as MapGeoJSONIntegration, f as MapIntegration, p as MapLayerIntegration, x as MapLayersDisplayOptions, S as MapStyleDisplayOptions, c as Menu, g as MonitorsDisplayOptions, C as ROUTER_KEY, l as SegmentedControl, u as ToggleSwitch, _ as baseLayerSeperator, y as collocationSitesManager, b as collocationSitesMapIntegration, t as disableLoadScreen, n as enableLoadScreen, a as initializeMap, r as loadScreenState, o as mapManager, E as monitorMapRoutes, d as monitorsManager, h as monitorsMapIntegration, w as provideMonitorMapRouter, T as useMonitorMapRouter, v as windMapIntegration };
@@ -1,7 +1,7 @@
1
1
  import { initializeMap as e } from "./map.svelte.js";
2
2
  import { integrationsManager as t } from "./integrations/integrations-manager.js";
3
- import * as n from "svelte/internal/client";
4
3
  import "svelte/internal/disclose-version";
4
+ import * as n from "svelte/internal/client";
5
5
  import "@maptiler/sdk/dist/maptiler-sdk.css";
6
6
  //#region src/lib/map/Map.svelte
7
7
  var r = n.from_html("<div style=\"width: 100%; height: 100%;\"></div>");
@@ -2,22 +2,22 @@ import { MAP_STYLE_OPTIONS as e } from "./utils.js";
2
2
  import { DefaultMapStyle as t, mapManager as n } from "./map.svelte.js";
3
3
  import { integrationsManager as r } from "./integrations/integrations-manager.js";
4
4
  import i from "../components/DisplayOption.js";
5
- import * as a from "svelte/internal/client";
6
5
  import "svelte/internal/disclose-version";
6
+ import * as a from "svelte/internal/client";
7
7
  import "@maptiler/sdk";
8
8
  //#region src/lib/map/MapStyleDisplayOptions.svelte
9
- var o = a.from_html("<option> </option>"), s = a.from_html("<option> </option>"), c = a.from_html("<p class=\"text-lg font-bold underline\">Map Styles</p> <label for=\"mapStyleType\">Style</label> <select id=\"mapStyleType\" name=\"selectedOption\" class=\"rounded border p-1\"></select> <label for=\"mapStyleVariant\">Variant</label> <select id=\"mapStyleType\" name=\"selectedOption\" class=\"rounded border p-1\"></select>", 1);
10
- function l(l, u) {
11
- a.push(u, !0);
12
- let d = t, f = a.state(a.proxy(t.getReferenceStyle())), p = a.state(a.proxy(t)), m = a.derived(() => a.get(f).getVariants());
9
+ var o = a.from_html("<option> </option>"), s = a.from_html("<p class=\"text-lg font-bold underline\">Map Styles</p> <label for=\"mapStyleType\">Style</label> <select id=\"mapStyleType\" name=\"selectedOption\" class=\"rounded border p-1\"></select> <label for=\"mapStyleVariant\">Variant</label> <select id=\"mapStyleType\" name=\"selectedOption\" class=\"rounded border p-1\"></select>", 1);
10
+ function c(c, l) {
11
+ a.push(l, !0);
12
+ let u = t, d = a.state(a.proxy(t.getReferenceStyle())), f = a.state(a.proxy(t)), p = a.derived(() => a.get(d).getVariants());
13
13
  a.user_effect(() => {
14
- let e = a.get(f) !== d.getReferenceStyle(), t = a.get(p) !== d;
15
- n.map !== null && (e && !t ? a.set(p, a.get(f).getDefaultVariant(), !0) : t && (n.map.once("style.load", async () => {
16
- d = a.get(p), r.refresh();
17
- }), n.map.setStyle(a.get(p))));
18
- }), i(l, {
14
+ let e = a.get(d) !== u.getReferenceStyle(), t = a.get(f) !== u;
15
+ n.map !== null && (e && !t ? a.set(f, a.get(d).getDefaultVariant(), !0) : t && (n.map.once("style.load", async () => {
16
+ u = a.get(f), r.refresh();
17
+ }), n.map.setStyle(a.get(f))));
18
+ }), i(c, {
19
19
  children: (t, n) => {
20
- var r = c(), i = a.sibling(a.first_child(r), 4);
20
+ var r = s(), i = a.sibling(a.first_child(r), 4);
21
21
  a.each(i, 21, () => e, a.index, (e, t) => {
22
22
  var n = o(), r = a.child(n, !0);
23
23
  a.reset(n);
@@ -26,18 +26,18 @@ function l(l, u) {
26
26
  a.set_text(r, e), i !== (i = a.get(t)) && (n.value = (n.__value = a.get(t)) ?? "");
27
27
  }, [() => a.get(t).getName()]), a.append(e, n);
28
28
  }), a.reset(i);
29
- var l = a.sibling(i, 4);
30
- a.each(l, 21, () => a.get(m), a.index, (e, t) => {
31
- var n = s(), r = a.child(n, !0);
29
+ var c = a.sibling(i, 4);
30
+ a.each(c, 21, () => a.get(p), a.index, (e, t) => {
31
+ var n = o(), r = a.child(n, !0);
32
32
  a.reset(n);
33
33
  var i = {};
34
34
  a.template_effect((e) => {
35
35
  a.set_text(r, e), i !== (i = a.get(t)) && (n.value = (n.__value = a.get(t)) ?? "");
36
36
  }, [() => a.get(t).getName()]), a.append(e, n);
37
- }), a.reset(l), a.bind_select_value(i, () => a.get(f), (e) => a.set(f, e)), a.bind_select_value(l, () => a.get(p), (e) => a.set(p, e)), a.append(t, r);
37
+ }), a.reset(c), a.bind_select_value(i, () => a.get(d), (e) => a.set(d, e)), a.bind_select_value(c, () => a.get(f), (e) => a.set(f, e)), a.append(t, r);
38
38
  },
39
39
  $$slots: { default: !0 }
40
40
  }), a.pop();
41
41
  }
42
42
  //#endregion
43
- export { l as default };
43
+ export { c as default };
@@ -1,15 +1,15 @@
1
- import e from "../assets/icons/adjustment-horizontal.js";
2
- import * as t from "svelte/internal/client";
3
1
  import "svelte/internal/disclose-version";
2
+ import * as e from "svelte/internal/client";
3
+ import { SlidersHorizontalIcon as t } from "@lucide/svelte";
4
4
  //#region src/lib/map/Menu.svelte
5
- var n = t.from_html("<div data-trigger=\"\"><button aria-label=\"Display Options\"><img alt=\"SJVAir Icon\" class=\"size-8\" width=\"24\" height=\"24\"/></button> <div><div data-trigger=\"\" class=\"absolute top-0 left-0 flex h-fit w-full items-start justify-between gap-4 p-2 flex-wrap\"><!></div></div></div>");
5
+ var n = e.from_html("<div data-trigger=\"\"><button aria-label=\"Display Options\"><!></button> <div><div data-trigger=\"\" class=\"absolute top-0 left-0 flex h-fit w-full items-start justify-between gap-4 p-2 flex-wrap\"><!></div></div></div>");
6
6
  function r(r, i) {
7
- let a = t.state(!1);
7
+ let a = e.state(!1);
8
8
  function o() {
9
- t.get(a) || t.set(a, !0);
9
+ e.get(a) || e.set(a, !0);
10
10
  }
11
11
  function s() {
12
- t.get(a) && t.set(a, !1);
12
+ e.get(a) && e.set(a, !1);
13
13
  }
14
14
  let c = (e) => e !== null, l = (e) => {
15
15
  function t(t) {
@@ -20,26 +20,25 @@ function r(r, i) {
20
20
  };
21
21
  var u = n();
22
22
  let d;
23
- var f = t.child(u);
23
+ var f = e.child(u);
24
24
  let p;
25
- var m = t.child(f);
26
- t.reset(f);
27
- var h = t.sibling(f, 2);
28
- let g;
29
- var _ = t.child(h), v = t.child(_);
30
- t.snippet(v, () => i.children ?? t.noop), t.reset(_), t.reset(h), t.reset(u), t.attach(u, () => l), t.template_effect(() => {
31
- d = t.set_class(u, 1, "absolute top-0 left-0 flex items-center justify-center overflow-hidden rounded bg-white p-1 shadow transition-all duration-0 select-none", null, d, {
32
- "rounded-full": !t.get(a),
33
- "delay-100": !t.get(a)
34
- }), p = t.set_class(f, 1, "relative size-8 transition-all", null, p, {
35
- "w-0": t.get(a),
36
- "h-0": t.get(a),
37
- "opacity-0": t.get(a)
38
- }), t.set_attribute(m, "src", e), g = t.set_class(h, 1, "relative flex h-0 w-0 items-center justify-center overflow-x-hidden overflow-y-scroll transition-all duration-250", null, g, {
39
- "h-55": t.get(a),
40
- "w-135": t.get(a)
25
+ t(e.child(f), { size: "24" }), e.reset(f);
26
+ var m = e.sibling(f, 2);
27
+ let h;
28
+ var g = e.child(m), _ = e.child(g);
29
+ e.snippet(_, () => i.children ?? e.noop), e.reset(g), e.reset(m), e.reset(u), e.attach(u, () => l), e.template_effect(() => {
30
+ d = e.set_class(u, 1, "relative top-0 left-0 flex items-center justify-center overflow-hidden rounded bg-white p-1 shadow transition-all duration-0 select-none", null, d, {
31
+ "rounded-full": !e.get(a),
32
+ "delay-100": !e.get(a)
33
+ }), p = e.set_class(f, 1, "relative size-10 transition-all flex justify-center items-center", null, p, {
34
+ "w-0": e.get(a),
35
+ "h-0": e.get(a),
36
+ "opacity-0": e.get(a)
37
+ }), h = e.set_class(m, 1, "relative flex h-0 w-0 items-center justify-center overflow-x-hidden overflow-y-scroll transition-all duration-250", null, h, {
38
+ "h-55": e.get(a),
39
+ "w-135": e.get(a)
41
40
  });
42
- }), t.append(r, u);
41
+ }), e.append(r, u);
43
42
  }
44
43
  //#endregion
45
44
  export { r as default };
@@ -6,6 +6,9 @@ var n = class {
6
6
  constructor(e) {
7
7
  e && (this.icons = e);
8
8
  }
9
+ get iter() {
10
+ return this.icons.entries();
11
+ }
9
12
  get(e) {
10
13
  return this.icons.get(e);
11
14
  }
@@ -1,30 +1,33 @@
1
- import { MapStyle as e, Popup as t } from "@maptiler/sdk";
2
- import { mount as n, unmount as r } from "svelte";
1
+ import { mount as e, unmount as t } from "svelte";
2
+ import { MapStyle as n, Popup as r } from "@maptiler/sdk";
3
3
  //#region src/lib/map/utils.ts
4
4
  var i = (() => {
5
- let t = /* @__PURE__ */ new Map();
6
- for (let n of Object.values(e)) {
7
- let e = n.getId(), r = e.match(/^(.+?)_V(\d+)$/i), i = r ? r[1] : e, a = r ? parseInt(r[2], 10) : 0, o = t.get(i);
8
- (!o || a > o.version) && t.set(i, {
5
+ let e = /* @__PURE__ */ new Map();
6
+ for (let t of Object.values(n)) {
7
+ let n = t.getId(), r = n.match(/^(.+?)_V(\d+)$/i), i = r ? r[1] : n, a = r ? parseInt(r[2], 10) : 0, o = e.get(i);
8
+ (!o || a > o.version) && e.set(i, {
9
9
  version: a,
10
- style: n
10
+ style: t
11
11
  });
12
12
  }
13
- return Array.from(t.values()).map((e) => e.style).sort((e, t) => e.getName().localeCompare(t.getName()));
13
+ return Array.from(e.values()).map((e) => e.style).sort((e, t) => e.getName().localeCompare(t.getName()));
14
14
  })();
15
15
  function a(e) {
16
16
  return typeof e == "object" && !!e && "type" in e && e.type === "geojson";
17
17
  }
18
- function o(e, i, a, o = !1) {
19
- let s = document.createElement("div"), c = n(e, {
18
+ function o(n, i, a, o = !1) {
19
+ let s = document.createElement("div"), c = e(n, {
20
20
  target: s,
21
21
  props: i
22
- }), l = new t({
22
+ }), l = new r({
23
23
  closeButton: o,
24
24
  closeOnClick: !1,
25
25
  maxWidth: "none"
26
26
  }).setLngLat(a).setDOMContent(s);
27
- return l.on("close", () => r(c)), l;
27
+ return l.on("close", () => t(c)), l;
28
+ }
29
+ function s(e, t, n) {
30
+ return o(e, t, n, !0);
28
31
  }
29
32
  //#endregion
30
- export { i as MAP_STYLE_OPTIONS, a as isGeoJSONSource, o as mountPopup };
33
+ export { i as MAP_STYLE_OPTIONS, a as isGeoJSONSource, s as mountClickPopup, o as mountPopup };
@@ -1,9 +1,9 @@
1
- import { monitorsManager as e } from "../monitors.svelte.js";
2
- import { mapManager as t } from "../../map/map.svelte.js";
1
+ import { mapManager as e } from "../../map/map.svelte.js";
2
+ import { monitorsManager as t } from "../monitors.svelte.js";
3
3
  import { getCurrentLevel as n } from "../monitor-utils.js";
4
4
  import r from "../../components/DataBox.js";
5
- import * as i from "svelte/internal/client";
6
5
  import "svelte/internal/disclose-version";
6
+ import * as i from "svelte/internal/client";
7
7
  import "@maptiler/sdk";
8
8
  import { area as a } from "@turf/area";
9
9
  import { convertArea as o } from "@turf/helpers";
@@ -13,7 +13,7 @@ function l(l, u) {
13
13
  i.push(u, !0);
14
14
  let d = i.state(void 0);
15
15
  i.user_effect(() => {
16
- let r = t.map.getSource(u.feature.source), s = e.latest, c = e.meta;
16
+ let r = e.map.getSource(u.feature.source), s = t.latest, c = t.meta;
17
17
  r.getClusterLeaves(u.feature.properties.cluster_id, u.feature.properties.point_count, 0).then((e) => {
18
18
  if (!e.length || !c || !s) return;
19
19
  let t = e.map((e) => s?.get(e.properties.id)), r = t[0];