meshai/work/dashboard-frontend/node_modules/react-refresh/cjs/react-refresh-runtime.development.js
malice 2c46c9104d
feat(region-routing): unified per-family routing cards + region-scoped family→channel routing (#87)
* feat(region-routing): P1 tagging + region_routes primitive + read/write API + preview launcher

- config.py: add Coverage.region_tagging (bool=False); add RegionRouteMatrix
  dataclass (enabled, cells) above NotificationsConfig; add region_routes field
  to NotificationsConfig; add explicit hydration branch for region_routes in
  _dict_to_dataclass mirroring destinations pattern.

- coverage_area.py: add MonitoringArea.name (str|None=None, frozen); update
  areas_from_config to preserve name; refactor inline geom extraction from
  classify_event_areas into shared _event_geom_json helper; add
  matching_area_names(geom_json, areas)->list[str] (additive, all named
  matches, config-order, deduped; gate unchanged); add event_region_names
  convenience wrapper.

- coverage_filter.py: add region_tagging ctor kwarg; stamp event.region/
  regions before the gate when region_tagging=True and areas non-empty and
  not event.regions (never clobbers satpass preset).

- pipeline/__init__.py: wire region_tagging into CoverageFilter construction.

- notification_routes.py: add GET /notifications/regions (named coverage area
  names, config-order, deduped); GET /notifications/region-routing (matrix as
  JSON); POST /notifications/region-routing (explicit RMW — only region_routes
  changes, toggles/rules/destinations survive).

- scripts/preview_dashboard.py: mesh-free launcher — dashboard API only, no
  mesh connector, no broadcast loop; vite runs separately.

All 87 coverage tests pass; 300 total pass; 6 pre-existing failures unchanged
(adapter config count mismatch + MeshCore EventType.NEW_CONTACT).

* feat(region-routing): manual region x family matrix editor page

Adds RegionRoutingMatrix.tsx — a plain editor over the region_routes
config primitive. Rows = families (via useFamilies()), cols = regions
(from GET /api/notifications/regions). Each cell exposes MT channel
(ChannelPicker single + includeDisabled), MC channel name (text input),
min_severity select (routine/priority/critical/immediate), and an enabled
checkbox. Only cells where MT or MC is set are included in the sparse
POST payload. Master enable toggle maps to top-level enabled. MT budget
guard warns when more than 7 distinct MT indices are in use. Sticky
family column; horizontal scroll for wide region sets.

Registers route /region-routing in App.tsx and adds "Region Routing"
nav entry (Map icon) under the Meshtastic section in Layout.tsx,
immediately after Routing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(region-routing): regions endpoint reads saved (disk) coverage so routing columns are dynamic without a bot restart; preview reloads config after writes

* feat(routing): unify MT/MC routing into per-family cards; region routing as an in-card expand; remove rules/destinations UI + standalone page

* refactor(routing): move Meshtastic Routing from /notifications to /meshtastic/routing (mirror /meshcore/routing); redirect legacy path

* feat(region-routing): dispatcher honors region_routes matrix (authoritative-on-match, per-region cooldown, per-channel dedup); non-matrix path unchanged

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(region-routing): matrix dedup key must match boot-restore 2-tuple form (prevents restart re-broadcast flood); regression test

---------

Co-authored-by: Matt Johnson <mj@k7zvx.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 16:52:03 -06:00

338 lines
12 KiB
JavaScript

/**
* @license React
* react-refresh-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function computeFullKey(signature) {
if (null !== signature.fullKey) return signature.fullKey;
var fullKey = signature.ownKey;
try {
var hooks = signature.getCustomHooks();
} catch (err) {
return (signature.forceReset = !0), (signature.fullKey = fullKey);
}
for (var i = 0; i < hooks.length; i++) {
var hook = hooks[i];
if ("function" !== typeof hook)
return (signature.forceReset = !0), (signature.fullKey = fullKey);
hook = allSignaturesByType.get(hook);
if (void 0 !== hook) {
var nestedHookKey = computeFullKey(hook);
hook.forceReset && (signature.forceReset = !0);
fullKey += "\n---\n" + nestedHookKey;
}
}
return (signature.fullKey = fullKey);
}
function resolveFamily(type) {
return updatedFamiliesByType.get(type);
}
function cloneMap(map) {
var clone = new Map();
map.forEach(function (value, key) {
clone.set(key, value);
});
return clone;
}
function cloneSet(set) {
var clone = new Set();
set.forEach(function (value) {
clone.add(value);
});
return clone;
}
function getProperty(object, property) {
try {
return object[property];
} catch (err) {}
}
function register(type, id) {
if (
!(
null === type ||
("function" !== typeof type && "object" !== typeof type) ||
allFamiliesByType.has(type)
)
) {
var family = allFamiliesByID.get(id);
void 0 === family
? ((family = { current: type }), allFamiliesByID.set(id, family))
: pendingUpdates.push([family, type]);
allFamiliesByType.set(type, family);
if ("object" === typeof type && null !== type)
switch (getProperty(type, "$$typeof")) {
case REACT_FORWARD_REF_TYPE:
register(type.render, id + "$render");
break;
case REACT_MEMO_TYPE:
register(type.type, id + "$type");
}
}
}
function setSignature(type, key) {
var forceReset =
2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !1,
getCustomHooks = 3 < arguments.length ? arguments[3] : void 0;
allSignaturesByType.has(type) ||
allSignaturesByType.set(type, {
forceReset: forceReset,
ownKey: key,
fullKey: null,
getCustomHooks:
getCustomHooks ||
function () {
return [];
}
});
if ("object" === typeof type && null !== type)
switch (getProperty(type, "$$typeof")) {
case REACT_FORWARD_REF_TYPE:
setSignature(type.render, key, forceReset, getCustomHooks);
break;
case REACT_MEMO_TYPE:
setSignature(type.type, key, forceReset, getCustomHooks);
}
}
function collectCustomHooksForSignature(type) {
type = allSignaturesByType.get(type);
void 0 !== type && computeFullKey(type);
}
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
allFamiliesByID = new Map(),
allFamiliesByType = new PossiblyWeakMap(),
allSignaturesByType = new PossiblyWeakMap(),
updatedFamiliesByType = new PossiblyWeakMap(),
pendingUpdates = [],
helpersByRendererID = new Map(),
helpersByRoot = new Map(),
mountedRoots = new Set(),
failedRoots = new Set(),
rootElements = "function" === typeof WeakMap ? new WeakMap() : null,
isPerformingRefresh = !1;
exports._getMountedRootCount = function () {
return mountedRoots.size;
};
exports.collectCustomHooksForSignature = collectCustomHooksForSignature;
exports.createSignatureFunctionForTransform = function () {
var savedType,
hasCustomHooks,
didCollectHooks = !1;
return function (type, key, forceReset, getCustomHooks) {
if ("string" === typeof key)
return (
savedType ||
((savedType = type),
(hasCustomHooks = "function" === typeof getCustomHooks)),
null == type ||
("function" !== typeof type && "object" !== typeof type) ||
setSignature(type, key, forceReset, getCustomHooks),
type
);
!didCollectHooks &&
hasCustomHooks &&
((didCollectHooks = !0), collectCustomHooksForSignature(savedType));
};
};
exports.getFamilyByID = function (id) {
return allFamiliesByID.get(id);
};
exports.getFamilyByType = function (type) {
return allFamiliesByType.get(type);
};
exports.hasUnrecoverableErrors = function () {
return !1;
};
exports.injectIntoGlobalHook = function (globalObject) {
var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;
if (void 0 === hook) {
var nextID = 0;
globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
renderers: new Map(),
supportsFiber: !0,
inject: function () {
return nextID++;
},
onScheduleFiberRoot: function () {},
onCommitFiberRoot: function () {},
onCommitFiberUnmount: function () {}
};
}
if (hook.isDisabled)
console.warn(
"Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled."
);
else {
var oldInject = hook.inject;
hook.inject = function (injected) {
var id = oldInject.apply(this, arguments);
"function" === typeof injected.scheduleRefresh &&
"function" === typeof injected.setRefreshHandler &&
helpersByRendererID.set(id, injected);
return id;
};
hook.renderers.forEach(function (injected, id) {
"function" === typeof injected.scheduleRefresh &&
"function" === typeof injected.setRefreshHandler &&
helpersByRendererID.set(id, injected);
});
var oldOnCommitFiberRoot = hook.onCommitFiberRoot,
oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};
hook.onScheduleFiberRoot = function (id, root, children) {
isPerformingRefresh ||
(failedRoots.delete(root),
null !== rootElements && rootElements.set(root, children));
return oldOnScheduleFiberRoot.apply(this, arguments);
};
hook.onCommitFiberRoot = function (
id,
root,
maybePriorityLevel,
didError
) {
var helpers = helpersByRendererID.get(id);
if (void 0 !== helpers) {
helpersByRoot.set(root, helpers);
helpers = root.current;
var alternate = helpers.alternate;
null !== alternate
? ((alternate =
null != alternate.memoizedState &&
null != alternate.memoizedState.element &&
mountedRoots.has(root)),
(helpers =
null != helpers.memoizedState &&
null != helpers.memoizedState.element),
!alternate && helpers
? (mountedRoots.add(root), failedRoots.delete(root))
: (alternate && helpers) ||
(alternate && !helpers
? (mountedRoots.delete(root),
didError
? failedRoots.add(root)
: helpersByRoot.delete(root))
: alternate ||
helpers ||
(didError && failedRoots.add(root))))
: mountedRoots.add(root);
}
return oldOnCommitFiberRoot.apply(this, arguments);
};
}
};
exports.isLikelyComponentType = function (type) {
switch (typeof type) {
case "function":
if (null != type.prototype) {
if (type.prototype.isReactComponent) return !0;
var ownNames = Object.getOwnPropertyNames(type.prototype);
if (
1 < ownNames.length ||
"constructor" !== ownNames[0] ||
type.prototype.__proto__ !== Object.prototype
)
return !1;
}
type = type.name || type.displayName;
return "string" === typeof type && /^[A-Z]/.test(type);
case "object":
if (null != type)
switch (getProperty(type, "$$typeof")) {
case REACT_FORWARD_REF_TYPE:
case REACT_MEMO_TYPE:
return !0;
}
return !1;
default:
return !1;
}
};
exports.performReactRefresh = function () {
if (0 === pendingUpdates.length || isPerformingRefresh) return null;
isPerformingRefresh = !0;
try {
var staleFamilies = new Set(),
updatedFamilies = new Set(),
updates = pendingUpdates;
pendingUpdates = [];
updates.forEach(function (_ref) {
var family = _ref[0];
_ref = _ref[1];
var prevType = family.current;
updatedFamiliesByType.set(prevType, family);
updatedFamiliesByType.set(_ref, family);
family.current = _ref;
(prevType.prototype && prevType.prototype.isReactComponent) ||
(_ref.prototype && _ref.prototype.isReactComponent)
? (_ref = !1)
: ((prevType = allSignaturesByType.get(prevType)),
(_ref = allSignaturesByType.get(_ref)),
(_ref =
(void 0 === prevType && void 0 === _ref) ||
(void 0 !== prevType &&
void 0 !== _ref &&
computeFullKey(prevType) === computeFullKey(_ref) &&
!_ref.forceReset)
? !0
: !1));
_ref ? updatedFamilies.add(family) : staleFamilies.add(family);
});
var update = {
updatedFamilies: updatedFamilies,
staleFamilies: staleFamilies
};
helpersByRendererID.forEach(function (helpers) {
helpers.setRefreshHandler(resolveFamily);
});
var didError = !1,
firstError = null,
failedRootsSnapshot = cloneSet(failedRoots),
mountedRootsSnapshot = cloneSet(mountedRoots),
helpersByRootSnapshot = cloneMap(helpersByRoot);
failedRootsSnapshot.forEach(function (root) {
var helpers = helpersByRootSnapshot.get(root);
if (void 0 === helpers)
throw Error(
"Could not find helpers for a root. This is a bug in React Refresh."
);
failedRoots.has(root);
if (null !== rootElements && rootElements.has(root)) {
var element = rootElements.get(root);
try {
helpers.scheduleRoot(root, element);
} catch (err) {
didError || ((didError = !0), (firstError = err));
}
}
});
mountedRootsSnapshot.forEach(function (root) {
var helpers = helpersByRootSnapshot.get(root);
if (void 0 === helpers)
throw Error(
"Could not find helpers for a root. This is a bug in React Refresh."
);
mountedRoots.has(root);
try {
helpers.scheduleRefresh(root, update);
} catch (err) {
didError || ((didError = !0), (firstError = err));
}
});
if (didError) throw firstError;
return update;
} finally {
isPerformingRefresh = !1;
}
};
exports.register = register;
exports.setSignature = setSignature;
})();