Harden remote-ML routing + add address test suite
Browse filesWires up the regressions surfaced by a real PS 188 / Lower East Side
run on the AMD MI300X stack. Five fixes + one new probe:
1. Lift the `RIPRAP_HEAVY_SPECIALISTS` gate when remote ML is
reachable. The heavy specialists' GPU work (TerraMind LULC +
Buildings, Prithvi-live, register joins) runs on the droplet, so
the local wall-clock cost drops from ~60 s to ~5 s β gate the
default to ON so the public demo never silently disables them.
2. TTM specialists never crash with the
`ModuleNotFoundError("Could not import module 'PreTrainedModel'")`
that surfaced on local-fallback paths. Force-import
`PreTrainedModel` + `TinyTimeMixerForPrediction` before
`get_model()` so the transformers lazy-registry resolves the
class strings under FSM worker threads.
3. When remote ML is configured but returns non-ok, surface the
remote error rather than fall through to a brittle local model
load (`ttm_forecast`, `ttm_battery_surge`, `prithvi_live`). Local
fallback is reserved for transport-level `RemoteUnreachable`,
which is what a degraded droplet actually looks like.
4. Capstone meta-card reads the correct Mellea field names. The FSM
emits `requirements_passed` / `n_attempts` / `rerolls`; the card
adapter was reading `passed` / `attempts`, so the meta card
always rendered "0/0 0 rerolls" regardless of the real state.
Accepts both shapes for forward-compat.
5. New `scripts/probe_addresses.py` end-to-end test suite β drives
`/api/agent/stream` against a curated NYC address set
(442 E Houston / 80 Pioneer / 100 Gold / Hollis / Coney Island),
asserts every Stone fires (or fails to fire with a deterministic
reason) per intent, the briefing prose contains the four
sections (Policy context optional when no RAG hits land), Mellea
passes within attempt budget, and no specialist crashes with the
PreTrainedModel ModuleNotFoundError category. Writes
`outputs/probe_addresses.csv` + optional JSON dump. Exit 0 only
when 5/5 pass.
Local run with `RIPRAP_LLM_PRIMARY=vllm`,
`RIPRAP_ML_BACKEND=remote`, `RIPRAP_MELLEA_MAX_ATTEMPTS=3`:
5/5 pass, 5.8β13.1 s end-to-end, Mellea 4/4 grounding checks
passed on every address.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- app/flood_layers/prithvi_live.py +18 -4
- app/fsm.py +19 -2
- app/live/ttm_battery_surge.py +22 -1
- app/live/ttm_forecast.py +43 -6
- scripts/probe_addresses.py +417 -0
- web/sveltekit/build/200.html +8 -8
- web/sveltekit/build/_app/immutable/chunks/D9Zf6nF7.js +1 -0
- web/sveltekit/build/_app/immutable/chunks/{BHheE8H_.js β DP_9AkkW.js} +1 -1
- web/sveltekit/build/_app/immutable/chunks/DXzi87nJ.js +0 -1
- web/sveltekit/build/_app/immutable/entry/{app.DbHmO7Py.js β app.qmZS3WSP.js} +2 -2
- web/sveltekit/build/_app/immutable/entry/start.DcfT94lp.js +1 -0
- web/sveltekit/build/_app/immutable/entry/start.DhVcDgd2.js +0 -1
- web/sveltekit/build/_app/immutable/nodes/{0.BkCp5U8o.js β 0.IL53jLg5.js} +1 -1
- web/sveltekit/build/_app/immutable/nodes/{1.CQ4nY8y7.js β 1.4zkFLEZX.js} +1 -1
- web/sveltekit/build/_app/immutable/nodes/{2.4m0D4KZ3.js β 2.C4OcOHhN.js} +1 -1
- web/sveltekit/build/_app/immutable/nodes/{3.lw_k4mrs.js β 3.D22Sj2nj.js} +1 -1
- web/sveltekit/build/_app/immutable/nodes/{4.BqX_4uwR.js β 4.BFj07o33.js} +1 -1
- web/sveltekit/build/_app/version.json +1 -1
- web/sveltekit/build/index.html +9 -9
- web/sveltekit/build/q/sample.html +8 -8
- web/sveltekit/src/lib/client/cardAdapter.ts +21 -10
|
@@ -353,11 +353,16 @@ def fetch(lat: float, lon: float, timeout_s: float = 60.0) -> dict[str, Any]:
|
|
| 353 |
|
| 354 |
# v0.4.5 β try the MI300X inference service first if configured.
|
| 355 |
# On RemoteUnreachable (service down / not configured / 5xx) fall
|
| 356 |
-
# through to the local terratorch path.
|
| 357 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
try:
|
| 359 |
from app import inference as _inf
|
| 360 |
if _inf.remote_enabled():
|
|
|
|
| 361 |
remote = _inf.prithvi_pluvial(
|
| 362 |
img, scene_id=item.id,
|
| 363 |
scene_datetime=str(item.datetime),
|
|
@@ -381,10 +386,19 @@ def fetch(lat: float, lon: float, timeout_s: float = 60.0) -> dict[str, Any]:
|
|
| 381 |
"compute": f"remote Β· {remote.get('device', 'gpu')}",
|
| 382 |
"elapsed_s": round(time.time() - t0, 2),
|
| 383 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
except _inf.RemoteUnreachable as e:
|
| 385 |
log.info("prithvi_live: remote unreachable (%s); falling back to local", e)
|
| 386 |
-
except Exception:
|
| 387 |
-
log.exception("prithvi_live: remote call failed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
|
| 389 |
# Local fallback β the path that's been live since v0.4.4.
|
| 390 |
model, run_model = _ensure_model()
|
|
|
|
| 353 |
|
| 354 |
# v0.4.5 β try the MI300X inference service first if configured.
|
| 355 |
# On RemoteUnreachable (service down / not configured / 5xx) fall
|
| 356 |
+
# through to the local terratorch path. When remote is configured
|
| 357 |
+
# but returns non-ok we surface that signal directly: the local
|
| 358 |
+
# path on this machine has been brittle (v2 datamodule
|
| 359 |
+
# `test_transform=None` race), so a configured remote is more
|
| 360 |
+
# reliable than the fallback.
|
| 361 |
+
remote_attempted = False
|
| 362 |
try:
|
| 363 |
from app import inference as _inf
|
| 364 |
if _inf.remote_enabled():
|
| 365 |
+
remote_attempted = True
|
| 366 |
remote = _inf.prithvi_pluvial(
|
| 367 |
img, scene_id=item.id,
|
| 368 |
scene_datetime=str(item.datetime),
|
|
|
|
| 386 |
"compute": f"remote Β· {remote.get('device', 'gpu')}",
|
| 387 |
"elapsed_s": round(time.time() - t0, 2),
|
| 388 |
}
|
| 389 |
+
return {"ok": False,
|
| 390 |
+
"skipped": f"remote prithvi-pluvial non-ok: "
|
| 391 |
+
f"{remote.get('error') or 'unknown'}",
|
| 392 |
+
"elapsed_s": round(time.time() - t0, 2)}
|
| 393 |
except _inf.RemoteUnreachable as e:
|
| 394 |
log.info("prithvi_live: remote unreachable (%s); falling back to local", e)
|
| 395 |
+
except Exception as e:
|
| 396 |
+
log.exception("prithvi_live: remote call failed")
|
| 397 |
+
if remote_attempted:
|
| 398 |
+
return {"ok": False,
|
| 399 |
+
"skipped": f"remote prithvi-pluvial error: "
|
| 400 |
+
f"{type(e).__name__}: {e}",
|
| 401 |
+
"elapsed_s": round(time.time() - t0, 2)}
|
| 402 |
|
| 403 |
# Local fallback β the path that's been live since v0.4.4.
|
| 404 |
model, run_model = _ensure_model()
|
|
@@ -1035,9 +1035,26 @@ import os as _os # noqa: E402
|
|
| 1035 |
# Default OFF on local-Ollama so the demo briefing returns in well under
|
| 1036 |
# 90 s. Enable explicitly with RIPRAP_HEAVY_SPECIALISTS=1 (e.g. on the
|
| 1037 |
# AMD-vLLM path, where the reconciler's ~5 s leaves room for the joins).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1038 |
_HEAVY_SPECIALISTS_ENABLED = _os.environ.get(
|
| 1039 |
-
"RIPRAP_HEAVY_SPECIALISTS",
|
| 1040 |
-
"0" if _os.environ.get("RIPRAP_LLM_PRIMARY", "ollama").lower() == "ollama" else "1",
|
| 1041 |
).lower() in ("1", "true", "yes")
|
| 1042 |
|
| 1043 |
|
|
|
|
| 1035 |
# Default OFF on local-Ollama so the demo briefing returns in well under
|
| 1036 |
# 90 s. Enable explicitly with RIPRAP_HEAVY_SPECIALISTS=1 (e.g. on the
|
| 1037 |
# AMD-vLLM path, where the reconciler's ~5 s leaves room for the joins).
|
| 1038 |
+
#
|
| 1039 |
+
# Remote ML lift: when RIPRAP_ML_BACKEND=remote (or auto with a base URL
|
| 1040 |
+
# set) the heavy specialists' GPU work runs on the droplet, so the local
|
| 1041 |
+
# wall-clock cost drops from ~60 s to ~5 s. Default ON in that case so
|
| 1042 |
+
# the public demo never silently disables them.
|
| 1043 |
+
def _remote_ml_configured() -> bool:
|
| 1044 |
+
backend = _os.environ.get("RIPRAP_ML_BACKEND", "auto").lower()
|
| 1045 |
+
if backend == "local":
|
| 1046 |
+
return False
|
| 1047 |
+
return bool(_os.environ.get("RIPRAP_ML_BASE_URL", "").strip())
|
| 1048 |
+
|
| 1049 |
+
|
| 1050 |
+
_HEAVY_DEFAULT = (
|
| 1051 |
+
"1" if (
|
| 1052 |
+
_os.environ.get("RIPRAP_LLM_PRIMARY", "ollama").lower() != "ollama"
|
| 1053 |
+
or _remote_ml_configured()
|
| 1054 |
+
) else "0"
|
| 1055 |
+
)
|
| 1056 |
_HEAVY_SPECIALISTS_ENABLED = _os.environ.get(
|
| 1057 |
+
"RIPRAP_HEAVY_SPECIALISTS", _HEAVY_DEFAULT,
|
|
|
|
| 1058 |
).lower() in ("1", "true", "yes")
|
| 1059 |
|
| 1060 |
|
|
@@ -92,6 +92,10 @@ def _ensure_model():
|
|
| 92 |
if _MODEL is not None:
|
| 93 |
return _MODEL
|
| 94 |
from huggingface_hub import snapshot_download
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
from tsfm_public import TinyTimeMixerForPrediction
|
| 96 |
log.info("ttm_battery_surge: downloading %s", REPO)
|
| 97 |
local_dir = snapshot_download(REPO)
|
|
@@ -247,12 +251,17 @@ def fetch(timeout_s: float = 60.0) -> dict[str, Any]:
|
|
| 247 |
# v0.4.5 β try the MI300X service first. The remote handles its
|
| 248 |
# own model loading; if it's reachable we never need local
|
| 249 |
# tsfm_public, which lets the HF Space drop the granite-tsfm
|
| 250 |
-
# bake from the image.
|
|
|
|
|
|
|
|
|
|
| 251 |
forecast = None
|
| 252 |
compute = "local"
|
|
|
|
| 253 |
try:
|
| 254 |
from app import inference as _inf
|
| 255 |
if _inf.remote_enabled():
|
|
|
|
| 256 |
remote = _inf.ttm_forecast(
|
| 257 |
"fine_tune_battery", residuals.tolist(),
|
| 258 |
context_length=CONTEXT_LENGTH,
|
|
@@ -264,8 +273,20 @@ def fetch(timeout_s: float = 60.0) -> dict[str, Any]:
|
|
| 264 |
import numpy as np
|
| 265 |
forecast = np.asarray(remote["forecast"], dtype="float32")
|
| 266 |
compute = f"remote Β· {remote.get('device', 'gpu')}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
except _inf.RemoteUnreachable as e:
|
| 268 |
log.info("ttm_battery_surge: remote unreachable (%s); local", e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
|
| 270 |
if forecast is None:
|
| 271 |
if not _DEPS_OK:
|
|
|
|
| 92 |
if _MODEL is not None:
|
| 93 |
return _MODEL
|
| 94 |
from huggingface_hub import snapshot_download
|
| 95 |
+
# Force-import dispatched class names so the transformers lazy
|
| 96 |
+
# registry can resolve `PreTrainedModel` / `TinyTimeMixerForPrediction`
|
| 97 |
+
# under FSM worker threads. Same pattern as ttm_forecast._load_model.
|
| 98 |
+
from transformers import PreTrainedModel # noqa: F401
|
| 99 |
from tsfm_public import TinyTimeMixerForPrediction
|
| 100 |
log.info("ttm_battery_surge: downloading %s", REPO)
|
| 101 |
local_dir = snapshot_download(REPO)
|
|
|
|
| 251 |
# v0.4.5 β try the MI300X service first. The remote handles its
|
| 252 |
# own model loading; if it's reachable we never need local
|
| 253 |
# tsfm_public, which lets the HF Space drop the granite-tsfm
|
| 254 |
+
# bake from the image. When the remote is configured but returns
|
| 255 |
+
# non-ok we surface the remote error rather than try a local
|
| 256 |
+
# load β the local code path can ModuleNotFoundError on transient
|
| 257 |
+
# transformers-registry races and that's a worse user signal.
|
| 258 |
forecast = None
|
| 259 |
compute = "local"
|
| 260 |
+
remote_attempted = False
|
| 261 |
try:
|
| 262 |
from app import inference as _inf
|
| 263 |
if _inf.remote_enabled():
|
| 264 |
+
remote_attempted = True
|
| 265 |
remote = _inf.ttm_forecast(
|
| 266 |
"fine_tune_battery", residuals.tolist(),
|
| 267 |
context_length=CONTEXT_LENGTH,
|
|
|
|
| 273 |
import numpy as np
|
| 274 |
forecast = np.asarray(remote["forecast"], dtype="float32")
|
| 275 |
compute = f"remote Β· {remote.get('device', 'gpu')}"
|
| 276 |
+
else:
|
| 277 |
+
return {"available": False,
|
| 278 |
+
"reason": f"remote ttm-forecast non-ok: "
|
| 279 |
+
f"{remote.get('error') or 'unknown'}",
|
| 280 |
+
"elapsed_s": round(time.time() - t0, 2)}
|
| 281 |
except _inf.RemoteUnreachable as e:
|
| 282 |
log.info("ttm_battery_surge: remote unreachable (%s); local", e)
|
| 283 |
+
except Exception as e:
|
| 284 |
+
log.exception("ttm_battery_surge: remote call failed")
|
| 285 |
+
if remote_attempted:
|
| 286 |
+
return {"available": False,
|
| 287 |
+
"reason": f"remote ttm-forecast error: "
|
| 288 |
+
f"{type(e).__name__}: {e}",
|
| 289 |
+
"elapsed_s": round(time.time() - t0, 2)}
|
| 290 |
|
| 291 |
if forecast is None:
|
| 292 |
if not _DEPS_OK:
|
|
@@ -92,6 +92,15 @@ def _load_model(context_length: int = CONTEXT_LENGTH,
|
|
| 92 |
return None
|
| 93 |
try:
|
| 94 |
import torch # noqa: F401
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
from tsfm_public.toolkit.get_model import get_model
|
| 96 |
m = get_model(
|
| 97 |
"ibm-granite/granite-timeseries-ttm-r2",
|
|
@@ -191,14 +200,23 @@ def _run_ttm(history: np.ndarray,
|
|
| 191 |
remote service stays a thin "given a series, give me a forecast"
|
| 192 |
contract.
|
| 193 |
"""
|
|
|
|
| 194 |
mu = float(history.mean())
|
| 195 |
sigma = float(history.std() + 1e-6)
|
| 196 |
normed = (history - mu) / sigma
|
| 197 |
|
| 198 |
-
# Try remote first
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
try:
|
| 200 |
from app import inference as _inf
|
| 201 |
if _inf.remote_enabled():
|
|
|
|
| 202 |
remote = _inf.ttm_forecast(
|
| 203 |
"zero_shot_battery", normed.tolist(),
|
| 204 |
context_length=context_length,
|
|
@@ -208,21 +226,40 @@ def _run_ttm(history: np.ndarray,
|
|
| 208 |
if remote.get("ok"):
|
| 209 |
pred = np.asarray(remote["forecast"], dtype=np.float32)
|
| 210 |
return pred * sigma + mu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
except _inf.RemoteUnreachable as e:
|
| 212 |
log.info("TTM zero-shot: remote unreachable (%s); local fallback", e)
|
| 213 |
-
except Exception:
|
| 214 |
-
log.exception("TTM zero-shot remote call failed
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
-
# Local fallback
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
if model is None:
|
| 219 |
return None
|
| 220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
x = torch.from_numpy(normed.astype(np.float32))[None, :, None]
|
| 222 |
try:
|
| 223 |
with torch.no_grad():
|
| 224 |
out = model(past_values=x)
|
| 225 |
except Exception as e:
|
|
|
|
| 226 |
log.exception("TTM inference failed: %r", e)
|
| 227 |
return None
|
| 228 |
pred = out.prediction_outputs[0, :, 0].cpu().numpy()
|
|
|
|
| 92 |
return None
|
| 93 |
try:
|
| 94 |
import torch # noqa: F401
|
| 95 |
+
# Force-import the registered class names BEFORE get_model so that
|
| 96 |
+
# transformers' lazy registry can resolve them by string. Without
|
| 97 |
+
# this, AutoModel-style dispatch raises
|
| 98 |
+
# ModuleNotFoundError("Could not import module 'PreTrainedModel'")
|
| 99 |
+
# under the FSM worker thread (the lazy import path races with
|
| 100 |
+
# other model loads). See web/main.py startup for the same
|
| 101 |
+
# pre-import on the main thread.
|
| 102 |
+
from transformers import PreTrainedModel # noqa: F401
|
| 103 |
+
from tsfm_public import TinyTimeMixerForPrediction # noqa: F401
|
| 104 |
from tsfm_public.toolkit.get_model import get_model
|
| 105 |
m = get_model(
|
| 106 |
"ibm-granite/granite-timeseries-ttm-r2",
|
|
|
|
| 200 |
remote service stays a thin "given a series, give me a forecast"
|
| 201 |
contract.
|
| 202 |
"""
|
| 203 |
+
global _MODEL_LOAD_ERROR
|
| 204 |
mu = float(history.mean())
|
| 205 |
sigma = float(history.std() + 1e-6)
|
| 206 |
normed = (history - mu) / sigma
|
| 207 |
|
| 208 |
+
# Try remote first. When remote is configured we bias HARD toward it:
|
| 209 |
+
# if the remote returns non-ok we surface that error rather than
|
| 210 |
+
# silently falling through to a local model load (which on cpu-basic
|
| 211 |
+
# surfaces would 502 with a cryptic transformers-internal
|
| 212 |
+
# ModuleNotFoundError). Local fallback is only used when the remote
|
| 213 |
+
# is unreachable (transport-level), which is what a degraded droplet
|
| 214 |
+
# actually looks like.
|
| 215 |
+
remote_attempted = False
|
| 216 |
try:
|
| 217 |
from app import inference as _inf
|
| 218 |
if _inf.remote_enabled():
|
| 219 |
+
remote_attempted = True
|
| 220 |
remote = _inf.ttm_forecast(
|
| 221 |
"zero_shot_battery", normed.tolist(),
|
| 222 |
context_length=context_length,
|
|
|
|
| 226 |
if remote.get("ok"):
|
| 227 |
pred = np.asarray(remote["forecast"], dtype=np.float32)
|
| 228 |
return pred * sigma + mu
|
| 229 |
+
_MODEL_LOAD_ERROR = (
|
| 230 |
+
f"remote ttm-forecast returned non-ok: {remote.get('error') or remote}"
|
| 231 |
+
)
|
| 232 |
+
log.warning("TTM zero-shot: remote returned non-ok: %s", remote)
|
| 233 |
+
return None
|
| 234 |
except _inf.RemoteUnreachable as e:
|
| 235 |
log.info("TTM zero-shot: remote unreachable (%s); local fallback", e)
|
| 236 |
+
except Exception as e:
|
| 237 |
+
log.exception("TTM zero-shot remote call failed: %r", e)
|
| 238 |
+
if remote_attempted:
|
| 239 |
+
_MODEL_LOAD_ERROR = f"remote ttm-forecast errored: {type(e).__name__}: {e}"
|
| 240 |
+
return None
|
| 241 |
|
| 242 |
+
# Local fallback (only reached when remote isn't configured or is
|
| 243 |
+
# unreachable at the transport level).
|
| 244 |
+
try:
|
| 245 |
+
model = _load_model(context_length, prediction_length)
|
| 246 |
+
except Exception as e:
|
| 247 |
+
_MODEL_LOAD_ERROR = f"{type(e).__name__}: {e}"
|
| 248 |
+
log.exception("TTM model load raised: %r", e)
|
| 249 |
+
return None
|
| 250 |
if model is None:
|
| 251 |
return None
|
| 252 |
+
try:
|
| 253 |
+
import torch
|
| 254 |
+
except ImportError:
|
| 255 |
+
_MODEL_LOAD_ERROR = "torch not available on this deployment"
|
| 256 |
+
return None
|
| 257 |
x = torch.from_numpy(normed.astype(np.float32))[None, :, None]
|
| 258 |
try:
|
| 259 |
with torch.no_grad():
|
| 260 |
out = model(past_values=x)
|
| 261 |
except Exception as e:
|
| 262 |
+
_MODEL_LOAD_ERROR = f"{type(e).__name__}: {e}"
|
| 263 |
log.exception("TTM inference failed: %r", e)
|
| 264 |
return None
|
| 265 |
pred = out.prediction_outputs[0, :, 0].cpu().numpy()
|
|
@@ -0,0 +1,417 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Riprap end-to-end address test suite.
|
| 2 |
+
|
| 3 |
+
Drives `/api/agent/stream` against a curated set of NYC addresses and
|
| 4 |
+
asserts that every Stone fires (or fails to fire with a deterministic
|
| 5 |
+
reason), the briefing prose contains all four sections, Mellea
|
| 6 |
+
grounding passes within attempt budget, and no specialist crashes with
|
| 7 |
+
an internal-API error (PreTrainedModel ModuleNotFoundError, etc).
|
| 8 |
+
|
| 9 |
+
Designed to be runnable both locally (M3 β laptop) and against the
|
| 10 |
+
deployed HF Space. The remote ML stack on the AMD MI300X is the same in
|
| 11 |
+
both cases when the env is configured, so an address that passes here
|
| 12 |
+
is the same address the hackathon judges will see.
|
| 13 |
+
|
| 14 |
+
Usage:
|
| 15 |
+
.venv/bin/python scripts/probe_addresses.py
|
| 16 |
+
.venv/bin/python scripts/probe_addresses.py --base http://127.0.0.1:7860
|
| 17 |
+
.venv/bin/python scripts/probe_addresses.py \\
|
| 18 |
+
--base https://lablab-ai-amd-developer-hackathon-riprap-nyc.hf.space \\
|
| 19 |
+
--addresses "PS 188, Lower East Side"
|
| 20 |
+
.venv/bin/python scripts/probe_addresses.py --json outputs/probe_addresses.json
|
| 21 |
+
|
| 22 |
+
Exit code 0 if every address passes every assertion; 1 otherwise. CSV
|
| 23 |
+
goes to outputs/probe_addresses.csv; JSON dump (full payloads, useful
|
| 24 |
+
for the UI dev loop) optionally to --json.
|
| 25 |
+
"""
|
| 26 |
+
from __future__ import annotations
|
| 27 |
+
|
| 28 |
+
import argparse
|
| 29 |
+
import csv
|
| 30 |
+
import json
|
| 31 |
+
import sys
|
| 32 |
+
import time
|
| 33 |
+
from collections import defaultdict
|
| 34 |
+
from dataclasses import dataclass, field
|
| 35 |
+
from pathlib import Path
|
| 36 |
+
from typing import Any
|
| 37 |
+
from urllib.parse import quote
|
| 38 |
+
|
| 39 |
+
import httpx
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
# Curated probe set. Each entry exercises a different surface of the
|
| 43 |
+
# system; together they cover every Stone's specialists at least once.
|
| 44 |
+
DEFAULT_ADDRESSES: list[dict[str, Any]] = [
|
| 45 |
+
# Anchor each entry on a fully-qualified street address so the
|
| 46 |
+
# geocoder doesn't drift to a same-named landmark in another borough
|
| 47 |
+
# (e.g. there are several "PS 188" schools city-wide).
|
| 48 |
+
{
|
| 49 |
+
"query": "442 East Houston Street, Manhattan", # PS 188 LES
|
| 50 |
+
"intent": "single_address",
|
| 51 |
+
"expect_sandy": True, # in the empirical 2012 extent
|
| 52 |
+
"expect_311_ge": 1,
|
| 53 |
+
"borough": "Manhattan",
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"query": "80 Pioneer Street, Brooklyn",
|
| 57 |
+
"intent": "single_address",
|
| 58 |
+
"expect_sandy": True, # Red Hook β canonical Sandy turf
|
| 59 |
+
"expect_311_ge": 1,
|
| 60 |
+
"borough": "Brooklyn",
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"query": "100 Gold Street, Manhattan",
|
| 64 |
+
"intent": "single_address",
|
| 65 |
+
# Outside Sandy 2012; this is the negative-control address.
|
| 66 |
+
"expect_sandy": False,
|
| 67 |
+
"borough": "Manhattan",
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"query": "Hollis, Queens",
|
| 71 |
+
"intent": "neighborhood",
|
| 72 |
+
"borough": "Queens",
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"query": "Coney Island, Brooklyn",
|
| 76 |
+
"intent": "neighborhood",
|
| 77 |
+
# neighborhood intent doesn't surface a per-address sandy field
|
| 78 |
+
# in the final state β the briefing prose names the Sandy
|
| 79 |
+
# exposure narratively from RAG + DEP layers.
|
| 80 |
+
"borough": "Brooklyn",
|
| 81 |
+
},
|
| 82 |
+
]
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
@dataclass
|
| 86 |
+
class StoneSummary:
|
| 87 |
+
fired: int = 0
|
| 88 |
+
errored: int = 0
|
| 89 |
+
silent: int = 0
|
| 90 |
+
total_seen: int = 0
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
@dataclass
|
| 94 |
+
class RunResult:
|
| 95 |
+
query: str
|
| 96 |
+
elapsed_s: float = 0.0
|
| 97 |
+
intent: str | None = None
|
| 98 |
+
paragraph: str = ""
|
| 99 |
+
n_steps: int = 0
|
| 100 |
+
steps: list[dict[str, Any]] = field(default_factory=list)
|
| 101 |
+
final: dict[str, Any] = field(default_factory=dict)
|
| 102 |
+
attempts: list[dict[str, Any]] = field(default_factory=list)
|
| 103 |
+
stones: dict[str, StoneSummary] = field(default_factory=lambda: defaultdict(StoneSummary))
|
| 104 |
+
errors: list[str] = field(default_factory=list)
|
| 105 |
+
error_steps: list[str] = field(default_factory=list)
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
# Mapping mirrors web/sveltekit/src/lib/client/cardAdapter.ts:stoneForStep.
|
| 109 |
+
# Kept here so the probe doesn't need to read the bundled JS.
|
| 110 |
+
def _stone_for_step(step: str) -> str | None:
|
| 111 |
+
n = (step or "").lower()
|
| 112 |
+
if n in {"sandy_inundation", "dep_stormwater", "ida_hwm_2021",
|
| 113 |
+
"prithvi_eo_v2", "microtopo_lidar"}:
|
| 114 |
+
return "cornerstone"
|
| 115 |
+
if n in {"mta_entrance_exposure", "nycha_development_exposure",
|
| 116 |
+
"doe_school_exposure", "doh_hospital_exposure",
|
| 117 |
+
"terramind_synthesis", "terramind_buildings", "eo_chip_fetch"}:
|
| 118 |
+
return "keystone"
|
| 119 |
+
if n in {"floodnet", "nyc311", "nws_obs", "noaa_tides",
|
| 120 |
+
"prithvi_eo_live", "terramind_lulc"}:
|
| 121 |
+
return "touchstone"
|
| 122 |
+
if n in {"nws_alerts", "ttm_forecast", "ttm_311_forecast",
|
| 123 |
+
"floodnet_forecast", "ttm_battery_surge"}:
|
| 124 |
+
return "lodestone"
|
| 125 |
+
if n.startswith("reconcile") or n.startswith("mellea") or \
|
| 126 |
+
n in {"rag_granite_embedding", "gliner_extract"}:
|
| 127 |
+
return "capstone"
|
| 128 |
+
return None
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
def stream_one(query: str, base: str, timeout_s: float) -> RunResult:
|
| 132 |
+
"""Drive one SSE run, accumulate every event into a RunResult."""
|
| 133 |
+
url = f"{base}/api/agent/stream?q={quote(query)}"
|
| 134 |
+
res = RunResult(query=query)
|
| 135 |
+
t0 = time.time()
|
| 136 |
+
paragraph = ""
|
| 137 |
+
|
| 138 |
+
with httpx.stream("GET", url, timeout=timeout_s) as r:
|
| 139 |
+
r.raise_for_status()
|
| 140 |
+
ev = None
|
| 141 |
+
buf: list[str] = []
|
| 142 |
+
for line in r.iter_lines():
|
| 143 |
+
if line.startswith("event:"):
|
| 144 |
+
ev = line.split(":", 1)[1].strip()
|
| 145 |
+
elif line.startswith("data:"):
|
| 146 |
+
buf.append(line[5:].lstrip())
|
| 147 |
+
elif line == "":
|
| 148 |
+
if not (ev and buf):
|
| 149 |
+
ev = None
|
| 150 |
+
buf = []
|
| 151 |
+
continue
|
| 152 |
+
data = "\n".join(buf)
|
| 153 |
+
buf = []
|
| 154 |
+
try:
|
| 155 |
+
payload = json.loads(data)
|
| 156 |
+
except json.JSONDecodeError:
|
| 157 |
+
payload = {"_raw": data}
|
| 158 |
+
if ev == "plan":
|
| 159 |
+
res.intent = payload.get("intent")
|
| 160 |
+
elif ev == "step":
|
| 161 |
+
res.n_steps += 1
|
| 162 |
+
res.steps.append(payload)
|
| 163 |
+
stone = _stone_for_step(payload.get("step", ""))
|
| 164 |
+
if stone:
|
| 165 |
+
s = res.stones[stone]
|
| 166 |
+
s.total_seen += 1
|
| 167 |
+
if not payload.get("ok"):
|
| 168 |
+
s.errored += 1
|
| 169 |
+
res.error_steps.append(payload.get("step", ""))
|
| 170 |
+
elif payload.get("result") is None and payload.get("err") is None:
|
| 171 |
+
s.silent += 1
|
| 172 |
+
else:
|
| 173 |
+
s.fired += 1
|
| 174 |
+
elif ev == "token":
|
| 175 |
+
paragraph += payload.get("delta") or ""
|
| 176 |
+
elif ev == "mellea_attempt":
|
| 177 |
+
res.attempts.append(payload)
|
| 178 |
+
elif ev == "final":
|
| 179 |
+
res.final = payload
|
| 180 |
+
if isinstance(payload.get("paragraph"), str):
|
| 181 |
+
paragraph = payload["paragraph"]
|
| 182 |
+
elif ev == "error":
|
| 183 |
+
res.errors.append(str(payload.get("err") or payload))
|
| 184 |
+
ev = None
|
| 185 |
+
res.elapsed_s = round(time.time() - t0, 2)
|
| 186 |
+
res.paragraph = paragraph
|
| 187 |
+
return res
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
# ---- Assertions ----------------------------------------------------------
|
| 191 |
+
|
| 192 |
+
# Flag step-result errors that look like the local-fallback ModuleNotFoundError
|
| 193 |
+
# we just hardened against. If any address surfaces this string, the
|
| 194 |
+
# guard-rail regressed.
|
| 195 |
+
_ERROR_REGRESSIONS = (
|
| 196 |
+
"ModuleNotFoundError",
|
| 197 |
+
"Could not import module 'PreTrainedModel'",
|
| 198 |
+
)
|
| 199 |
+
|
| 200 |
+
# Briefing section headings the system prompt teaches Granite to emit.
|
| 201 |
+
# Granite's exact rendering varies per attempt β sometimes
|
| 202 |
+
# `**Status.**` on its own line, sometimes inline. We treat each section
|
| 203 |
+
# as present if its label appears at all (case-insensitive).
|
| 204 |
+
#
|
| 205 |
+
# The system prompt says "Omit any section whose supporting facts are
|
| 206 |
+
# absent from the documents" β so on a query with no RAG hits the
|
| 207 |
+
# Policy-context section is correctly skipped. We require Status +
|
| 208 |
+
# Empirical evidence + Modeled scenarios always; Policy context is
|
| 209 |
+
# best-effort.
|
| 210 |
+
_REQUIRED_HEADINGS = (
|
| 211 |
+
"Status",
|
| 212 |
+
"Empirical evidence",
|
| 213 |
+
"Modeled scenarios",
|
| 214 |
+
)
|
| 215 |
+
_OPTIONAL_HEADINGS = ("Policy context",)
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
def assert_run(spec: dict[str, Any], r: RunResult) -> list[str]:
|
| 219 |
+
"""Return a list of failures (empty list if the run passes)."""
|
| 220 |
+
fails: list[str] = []
|
| 221 |
+
if r.errors:
|
| 222 |
+
fails.append(f"stream errors: {r.errors}")
|
| 223 |
+
|
| 224 |
+
# Specialist regressions β the LOD-002/003/004 ModuleNotFoundError
|
| 225 |
+
# category. If any step result string contains those keywords we
|
| 226 |
+
# treat it as a hard regression of the pre-import hardening.
|
| 227 |
+
for step in r.steps:
|
| 228 |
+
err = step.get("err") or ""
|
| 229 |
+
for marker in _ERROR_REGRESSIONS:
|
| 230 |
+
if marker in str(err):
|
| 231 |
+
fails.append(
|
| 232 |
+
f"{step.get('step')}: {marker} regressed in step error"
|
| 233 |
+
)
|
| 234 |
+
|
| 235 |
+
# Intent classification.
|
| 236 |
+
expected_intent = spec.get("intent")
|
| 237 |
+
if expected_intent and r.intent and r.intent != expected_intent:
|
| 238 |
+
fails.append(f"intent={r.intent} expected {expected_intent}")
|
| 239 |
+
|
| 240 |
+
# Briefing presence.
|
| 241 |
+
if not r.paragraph or len(r.paragraph) < 200:
|
| 242 |
+
fails.append(f"briefing too short: {len(r.paragraph)} chars")
|
| 243 |
+
else:
|
| 244 |
+
para_lower = r.paragraph.lower()
|
| 245 |
+
for heading in _REQUIRED_HEADINGS:
|
| 246 |
+
if heading.lower() not in para_lower:
|
| 247 |
+
fails.append(f"briefing missing heading {heading!r}")
|
| 248 |
+
|
| 249 |
+
# Mellea grounding.
|
| 250 |
+
final = r.final or {}
|
| 251 |
+
m = final.get("mellea") or {}
|
| 252 |
+
passed = m.get("requirements_passed") or []
|
| 253 |
+
total = m.get("requirements_total") or 0
|
| 254 |
+
if total:
|
| 255 |
+
if len(passed) < total:
|
| 256 |
+
failed_names = ",".join(m.get("requirements_failed") or []) or "?"
|
| 257 |
+
fails.append(
|
| 258 |
+
f"mellea: only {len(passed)}/{total} grounding checks passed "
|
| 259 |
+
f"(failed: {failed_names})"
|
| 260 |
+
)
|
| 261 |
+
elif r.attempts:
|
| 262 |
+
last = r.attempts[-1]
|
| 263 |
+
if last.get("failed"):
|
| 264 |
+
fails.append(f"mellea: last attempt failed {last['failed']}")
|
| 265 |
+
|
| 266 |
+
# Stones β the per-stone requirement is intent-dependent. The
|
| 267 |
+
# single_address FSM fires every stone's specialists (Cornerstone /
|
| 268 |
+
# Keystone / Touchstone / Lodestone). The neighborhood and
|
| 269 |
+
# development_check intents have a smaller fixed surface that does
|
| 270 |
+
# not exercise the address-level register / live-now stones β they
|
| 271 |
+
# rely on RAG + a smaller set of specialists. So we only enforce
|
| 272 |
+
# the full Stone roster for single_address; for the others we just
|
| 273 |
+
# check Capstone fires (RAG / GLiNER / reconcile are universal).
|
| 274 |
+
intent = (r.intent or expected_intent or "single_address").lower()
|
| 275 |
+
if intent == "single_address":
|
| 276 |
+
for stone in ("cornerstone", "touchstone", "lodestone"):
|
| 277 |
+
s = r.stones.get(stone)
|
| 278 |
+
if not s or s.fired == 0:
|
| 279 |
+
fails.append(
|
| 280 |
+
f"{stone}: 0 specialists fired "
|
| 281 |
+
f"(saw {s.total_seen if s else 0})"
|
| 282 |
+
)
|
| 283 |
+
s = r.stones.get("keystone")
|
| 284 |
+
if not s or s.total_seen == 0:
|
| 285 |
+
fails.append("keystone: no specialists attempted")
|
| 286 |
+
s = r.stones.get("capstone")
|
| 287 |
+
if not s or s.fired == 0:
|
| 288 |
+
fails.append(
|
| 289 |
+
f"capstone: 0 fired β reconcile/rag/gliner step events missing "
|
| 290 |
+
f"(saw {s.total_seen if s else 0})"
|
| 291 |
+
)
|
| 292 |
+
|
| 293 |
+
# Spec-driven asserts (only meaningful for single_address β the
|
| 294 |
+
# neighborhood / development_check intents have no per-address
|
| 295 |
+
# sandy / 311 fields in the final state).
|
| 296 |
+
if intent == "single_address":
|
| 297 |
+
sandy_state = (final.get("sandy") is True)
|
| 298 |
+
if "expect_sandy" in spec:
|
| 299 |
+
want = spec["expect_sandy"]
|
| 300 |
+
if sandy_state is not want:
|
| 301 |
+
fails.append(f"sandy={sandy_state} expected {want}")
|
| 302 |
+
n311 = (final.get("nyc311") or {}).get("n") or 0
|
| 303 |
+
if "expect_311_ge" in spec and n311 < spec["expect_311_ge"]:
|
| 304 |
+
fails.append(f"nyc311={n311} expected >= {spec['expect_311_ge']}")
|
| 305 |
+
|
| 306 |
+
return fails
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
# ---- Entry point ---------------------------------------------------------
|
| 310 |
+
|
| 311 |
+
def main() -> int:
|
| 312 |
+
ap = argparse.ArgumentParser()
|
| 313 |
+
ap.add_argument("--base", default="http://127.0.0.1:7860",
|
| 314 |
+
help="Riprap server base URL")
|
| 315 |
+
ap.add_argument("--addresses", default="",
|
| 316 |
+
help="Pipe-separated subset of queries to run "
|
| 317 |
+
"(addresses themselves contain commas, so pipe is "
|
| 318 |
+
"the separator); default runs the full curated set")
|
| 319 |
+
ap.add_argument("--timeout", type=float, default=600.0)
|
| 320 |
+
ap.add_argument("--out", default="outputs/probe_addresses.csv")
|
| 321 |
+
ap.add_argument("--json", default="",
|
| 322 |
+
help="Optional path to dump full per-address JSON payload")
|
| 323 |
+
args = ap.parse_args()
|
| 324 |
+
|
| 325 |
+
if args.addresses:
|
| 326 |
+
wanted = {a.strip() for a in args.addresses.split("|") if a.strip()}
|
| 327 |
+
specs = [s for s in DEFAULT_ADDRESSES if s["query"] in wanted]
|
| 328 |
+
if not specs:
|
| 329 |
+
specs = [{"query": q} for q in wanted]
|
| 330 |
+
else:
|
| 331 |
+
specs = list(DEFAULT_ADDRESSES)
|
| 332 |
+
|
| 333 |
+
Path(args.out).parent.mkdir(parents=True, exist_ok=True)
|
| 334 |
+
|
| 335 |
+
summary_rows: list[dict[str, Any]] = []
|
| 336 |
+
full: list[dict[str, Any]] = []
|
| 337 |
+
all_pass = True
|
| 338 |
+
|
| 339 |
+
print(f"Probing {len(specs)} addresses against {args.base}")
|
| 340 |
+
print()
|
| 341 |
+
|
| 342 |
+
for i, spec in enumerate(specs, 1):
|
| 343 |
+
q = spec["query"]
|
| 344 |
+
print(f"[{i}/{len(specs)}] {q!r:50s}", end=" ", flush=True)
|
| 345 |
+
try:
|
| 346 |
+
r = stream_one(q, args.base, args.timeout)
|
| 347 |
+
except Exception as e:
|
| 348 |
+
print(f"STREAM ERROR: {type(e).__name__}: {e}")
|
| 349 |
+
summary_rows.append({"query": q, "ok": False,
|
| 350 |
+
"fails": f"stream raised: {e}"})
|
| 351 |
+
all_pass = False
|
| 352 |
+
continue
|
| 353 |
+
fails = assert_run(spec, r)
|
| 354 |
+
ok = not fails
|
| 355 |
+
all_pass &= ok
|
| 356 |
+
m = (r.final or {}).get("mellea") or {}
|
| 357 |
+
passed = m.get("requirements_passed") or []
|
| 358 |
+
rerolls = m.get("rerolls") if m.get("rerolls") is not None else \
|
| 359 |
+
(max(0, (m.get("n_attempts") or 1) - 1))
|
| 360 |
+
verdict = "PASS" if ok else "FAIL"
|
| 361 |
+
print(f"{verdict} {r.elapsed_s:6.1f}s "
|
| 362 |
+
f"steps={r.n_steps} prose={len(r.paragraph)}c "
|
| 363 |
+
f"mellea={len(passed)}/{m.get('requirements_total') or '?'} "
|
| 364 |
+
f"rerolls={rerolls}")
|
| 365 |
+
for f in fails:
|
| 366 |
+
print(f" - {f}")
|
| 367 |
+
|
| 368 |
+
summary_rows.append({
|
| 369 |
+
"query": q, "ok": ok, "elapsed_s": r.elapsed_s, "intent": r.intent,
|
| 370 |
+
"n_steps": r.n_steps,
|
| 371 |
+
"para_chars": len(r.paragraph),
|
| 372 |
+
"mellea_passed": len(passed),
|
| 373 |
+
"mellea_total": m.get("requirements_total") or 0,
|
| 374 |
+
"rerolls": rerolls,
|
| 375 |
+
"stones_fired": ",".join(
|
| 376 |
+
f"{k}={v.fired}" for k, v in sorted(r.stones.items())),
|
| 377 |
+
"stones_errored": ",".join(
|
| 378 |
+
f"{k}={v.errored}" for k, v in sorted(r.stones.items())
|
| 379 |
+
if v.errored),
|
| 380 |
+
"errored_steps": ",".join(r.error_steps),
|
| 381 |
+
"fails": " | ".join(fails),
|
| 382 |
+
})
|
| 383 |
+
full.append({
|
| 384 |
+
"spec": spec,
|
| 385 |
+
"elapsed_s": r.elapsed_s,
|
| 386 |
+
"intent": r.intent,
|
| 387 |
+
"paragraph": r.paragraph,
|
| 388 |
+
"stones": {k: vars(v) for k, v in r.stones.items()},
|
| 389 |
+
"mellea": m,
|
| 390 |
+
"attempts": r.attempts,
|
| 391 |
+
"errors": r.errors,
|
| 392 |
+
"error_steps": r.error_steps,
|
| 393 |
+
"fails": fails,
|
| 394 |
+
})
|
| 395 |
+
|
| 396 |
+
out_path = Path(args.out)
|
| 397 |
+
if summary_rows:
|
| 398 |
+
with out_path.open("w", newline="") as f:
|
| 399 |
+
w = csv.DictWriter(f, fieldnames=list(summary_rows[0].keys()))
|
| 400 |
+
w.writeheader()
|
| 401 |
+
w.writerows(summary_rows)
|
| 402 |
+
print(f"\nWrote {out_path}")
|
| 403 |
+
if args.json:
|
| 404 |
+
json_path = Path(args.json)
|
| 405 |
+
json_path.parent.mkdir(parents=True, exist_ok=True)
|
| 406 |
+
json_path.write_text(json.dumps(full, indent=2, default=str))
|
| 407 |
+
print(f"Wrote {json_path}")
|
| 408 |
+
|
| 409 |
+
print()
|
| 410 |
+
print("=" * 70)
|
| 411 |
+
print(f" {sum(1 for r in summary_rows if r.get('ok'))}/{len(summary_rows)} addresses passed")
|
| 412 |
+
print("=" * 70)
|
| 413 |
+
return 0 if all_pass else 1
|
| 414 |
+
|
| 415 |
+
|
| 416 |
+
if __name__ == "__main__":
|
| 417 |
+
sys.exit(main())
|
|
@@ -6,16 +6,16 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<meta name="description" content="Riprap β citation-grounded NYC flood-exposure briefings." />
|
| 8 |
<title>Riprap β flood-exposure briefing</title>
|
| 9 |
-
<link href="/_app/immutable/entry/start.
|
| 10 |
-
<link href="/_app/immutable/chunks/
|
| 11 |
<link href="/_app/immutable/chunks/R1l3q-hJ.js" rel="modulepreload">
|
| 12 |
-
<link href="/_app/immutable/entry/app.
|
| 13 |
<link href="/_app/immutable/chunks/DZRTzx66.js" rel="modulepreload">
|
| 14 |
<link href="/_app/immutable/chunks/CzfSRAFS.js" rel="modulepreload">
|
| 15 |
<link href="/_app/immutable/chunks/C6-4B-da.js" rel="modulepreload">
|
| 16 |
-
<link href="/_app/immutable/nodes/0.
|
| 17 |
<link href="/_app/immutable/chunks/Bu_bEyoS.js" rel="modulepreload">
|
| 18 |
-
<link href="/_app/immutable/chunks/
|
| 19 |
<link href="/_app/immutable/chunks/a4L4UsYq.js" rel="modulepreload">
|
| 20 |
<link href="/_app/immutable/chunks/B_9mIQpm.js" rel="modulepreload">
|
| 21 |
|
|
@@ -25,15 +25,15 @@
|
|
| 25 |
<div style="display: contents">
|
| 26 |
<script>
|
| 27 |
{
|
| 28 |
-
|
| 29 |
base: ""
|
| 30 |
};
|
| 31 |
|
| 32 |
const element = document.currentScript.parentElement;
|
| 33 |
|
| 34 |
Promise.all([
|
| 35 |
-
import("/_app/immutable/entry/start.
|
| 36 |
-
import("/_app/immutable/entry/app.
|
| 37 |
]).then(([kit, app]) => {
|
| 38 |
kit.start(app, element);
|
| 39 |
});
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<meta name="description" content="Riprap β citation-grounded NYC flood-exposure briefings." />
|
| 8 |
<title>Riprap β flood-exposure briefing</title>
|
| 9 |
+
<link href="/_app/immutable/entry/start.DcfT94lp.js" rel="modulepreload">
|
| 10 |
+
<link href="/_app/immutable/chunks/D9Zf6nF7.js" rel="modulepreload">
|
| 11 |
<link href="/_app/immutable/chunks/R1l3q-hJ.js" rel="modulepreload">
|
| 12 |
+
<link href="/_app/immutable/entry/app.qmZS3WSP.js" rel="modulepreload">
|
| 13 |
<link href="/_app/immutable/chunks/DZRTzx66.js" rel="modulepreload">
|
| 14 |
<link href="/_app/immutable/chunks/CzfSRAFS.js" rel="modulepreload">
|
| 15 |
<link href="/_app/immutable/chunks/C6-4B-da.js" rel="modulepreload">
|
| 16 |
+
<link href="/_app/immutable/nodes/0.IL53jLg5.js" rel="modulepreload">
|
| 17 |
<link href="/_app/immutable/chunks/Bu_bEyoS.js" rel="modulepreload">
|
| 18 |
+
<link href="/_app/immutable/chunks/DP_9AkkW.js" rel="modulepreload">
|
| 19 |
<link href="/_app/immutable/chunks/a4L4UsYq.js" rel="modulepreload">
|
| 20 |
<link href="/_app/immutable/chunks/B_9mIQpm.js" rel="modulepreload">
|
| 21 |
|
|
|
|
| 25 |
<div style="display: contents">
|
| 26 |
<script>
|
| 27 |
{
|
| 28 |
+
__sveltekit_186n2ot = {
|
| 29 |
base: ""
|
| 30 |
};
|
| 31 |
|
| 32 |
const element = document.currentScript.parentElement;
|
| 33 |
|
| 34 |
Promise.all([
|
| 35 |
+
import("/_app/immutable/entry/start.DcfT94lp.js"),
|
| 36 |
+
import("/_app/immutable/entry/app.qmZS3WSP.js")
|
| 37 |
]).then(([kit, app]) => {
|
| 38 |
kit.start(app, element);
|
| 39 |
});
|
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
var rt=e=>{throw TypeError(e)};var Dt=(e,t,n)=>t.has(e)||rt("Cannot "+n);var y=(e,t,n)=>(Dt(e,t,"read from private field"),n?n.call(e):t.get(e)),A=(e,t,n)=>t.has(e)?rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import{bf as Pe,bg as Vt,a6 as at,a4 as T,o as I,a5 as O,ar as we,bh as Bt}from"./R1l3q-hJ.js";const M=[];function Ke(e,t=Pe){let n=null;const a=new Set;function r(o){if(Vt(e,o)&&(e=o,n)){const l=!M.length;for(const c of a)c[1](),M.push(c,e);if(l){for(let c=0;c<M.length;c+=2)M[c][0](M[c+1]);M.length=0}}}function i(o){r(o(e))}function s(o,l=Pe){const c=[o,l];return a.add(c),a.size===1&&(n=t(r,i)||Pe),o(e),()=>{a.delete(c),a.size===0&&n&&(n(),n=null)}}return{set:r,update:i,subscribe:s}}class Me{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class ze{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Fe extends Error{constructor(t,n,a){super(a),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Mt(e){return e.split("%25").map(decodeURI).join("%25")}function zt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function $e({href:e}){return e.split("#")[0]}function C(){}function Ft(...e){let t=5381;for(const n of e)if(typeof n=="string"){let a=n.length;for(;a;)t=t*33^n.charCodeAt(--a)}else if(ArrayBuffer.isView(n)){const a=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=a.length;for(;r;)t=t*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function Gt(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}const Ht=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&X.delete(Ge(e)),Ht(e,t));const X=new Map;function Wt(e,t){const n=Ge(e,t),a=document.querySelector(n);if(a!=null&&a.textContent){a.remove();let{body:r,...i}=JSON.parse(a.textContent);const s=a.getAttribute("data-ttl");return s&&X.set(n,{body:r,init:i,ttl:1e3*Number(s)}),a.getAttribute("data-b64")!==null&&(r=Gt(r)),Promise.resolve(new Response(r,i))}return window.fetch(e,t)}function Jt(e,t,n){if(X.size>0){const a=Ge(e,n),r=X.get(a);if(r){if(performance.now()<r.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(r.body,r.init);X.delete(a)}}return window.fetch(t,n)}function Ge(e,t){let a=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const r=[];t.headers&&r.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&r.push(t.body),a+=`[data-hash="${Ft(...r)}"]`}return a}const Yt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Xt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Zt(e).map(a=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const s=a.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Ce(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Ce(String.fromCharCode(...l.slice(2).split("-").map(m=>parseInt(m,16))));const d=Yt.exec(l),[,u,w,p,f]=d;return t.push({name:p,matcher:f,optional:!!u,rest:!!w,chained:w?c===1&&s[0]==="":!1}),w?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Ce(l)}).join("")}).join("")}/?$`),params:t}}function Qt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Zt(e){return e.slice(1).split("/").filter(Qt)}function en(e,t,n){const a={},r=e.slice(1),i=r.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=r[o-s];if(l.chained&&l.rest&&s&&(c=r.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){a[l.name]=c;const d=t[o+1],u=r[o+1];d&&!d.rest&&d.optional&&u&&l.chained&&(s=0),!d&&!u&&Object.keys(a).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return a}function Ce(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function tn({nodes:e,server_loads:t,dictionary:n,matchers:a}){const r=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:u,params:w}=Xt(o),p={id:o,exec:f=>{const m=u.exec(f);if(m)return en(m,w,a)},errors:[1,...d||[]].map(f=>e[f]),layouts:[0,...c||[]].map(s),leaf:i(l)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[r.has(o),e[o]]}}function wt(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ot(e,t,n=JSON.stringify){const a=n(t);try{sessionStorage[e]=a}catch{}}var ht;const U=((ht=globalThis.__sveltekit_186n2ot)==null?void 0:ht.base)??"";var pt;const nn=((pt=globalThis.__sveltekit_186n2ot)==null?void 0:pt.assets)??U??"",rn="1778031470202",vt="sveltekit:snapshot",yt="sveltekit:scroll",bt="sveltekit:states",an="sveltekit:pageurl",F="sveltekit:history",Z="sveltekit:navigation",D={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Ue=location.origin;function He(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function B(){return{x:pageXOffset,y:pageYOffset}}function z(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const st={...D,"":D.hover};function kt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function St(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=kt(e)}}function qe(e,t,n){let a;try{if(a=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&a.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";a.hash=`#${o}${a.hash}`}}catch{}const r=e instanceof SVGAElement?e.target.baseVal:e.target,i=!a||!!r||Ae(a,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=(a==null?void 0:a.origin)===Ue&&e.hasAttribute("download");return{url:a,external:i,target:r,download:s}}function ve(e){let t=null,n=null,a=null,r=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)a===null&&(a=z(o,"preload-code")),r===null&&(r=z(o,"preload-data")),t===null&&(t=z(o,"keepfocus")),n===null&&(n=z(o,"noscroll")),i===null&&(i=z(o,"reload")),s===null&&(s=z(o,"replacestate")),o=kt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:st[a??"off"],preload_data:st[r??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function it(e){const t=Ke(e);let n=!0;function a(){n=!0,t.update(s=>s)}function r(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:a,set:r,subscribe:i}}const Et={v:C};function on(){const{set:e,subscribe:t}=Ke(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${nn}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const s=(await r.json()).version!==rn;return s&&(e(!0),Et.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:a}}function Ae(e,t,n){return e.origin!==Ue||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Pn(e){}const Rt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Rt];const sn=new Set([...Rt]);[...sn];function ln(e){return e.filter(t=>t!=null)}function me(e,t){return e+"/"+t}function We(e){return e instanceof Me||e instanceof Fe?e.status:500}function cn(e){return e instanceof Fe?e.text:"Internal Error"}let R,ee,je;const fn=at.toString().includes("$$")||/function \w+\(\) \{\}/.test(at.toString()),lt="a:";var oe,se,ie,le,ce,fe,ue,de,gt,he,mt,pe,_t;fn?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(lt)},ee={current:null},je={current:!1}):(R=new(gt=class{constructor(){A(this,oe,T({}));A(this,se,T(null));A(this,ie,T(null));A(this,le,T({}));A(this,ce,T({id:null}));A(this,fe,T({}));A(this,ue,T(-1));A(this,de,T(new URL(lt)))}get data(){return I(y(this,oe))}set data(t){O(y(this,oe),t)}get form(){return I(y(this,se))}set form(t){O(y(this,se),t)}get error(){return I(y(this,ie))}set error(t){O(y(this,ie),t)}get params(){return I(y(this,le))}set params(t){O(y(this,le),t)}get route(){return I(y(this,ce))}set route(t){O(y(this,ce),t)}get state(){return I(y(this,fe))}set state(t){O(y(this,fe),t)}get status(){return I(y(this,ue))}set status(t){O(y(this,ue),t)}get url(){return I(y(this,de))}set url(t){O(y(this,de),t)}},oe=new WeakMap,se=new WeakMap,ie=new WeakMap,le=new WeakMap,ce=new WeakMap,fe=new WeakMap,ue=new WeakMap,de=new WeakMap,gt),ee=new(mt=class{constructor(){A(this,he,T(null))}get current(){return I(y(this,he))}set current(t){O(y(this,he),t)}},he=new WeakMap,mt),je=new(_t=class{constructor(){A(this,pe,T(!1))}get current(){return I(y(this,pe))}set current(t){O(y(this,pe),t)}},pe=new WeakMap,_t),Et.v=()=>je.current=!0);function un(e){Object.assign(R,e)}const dn=new Set(["icon","shortcut icon","apple-touch-icon"]);let J=null;const N=wt(yt)??{},te=wt(vt)??{},j={url:it({}),page:it({}),navigating:Ke(null),updated:on()};function Je(e){N[e]=B()}function hn(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;te[n];)delete te[n],n+=1}function ne(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(C)}async function xt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(U||"/");e&&await e.update()}}let Ye,De,ye,P,Ve,S;const be=[],ke=[];let v=null;function Se(){var e;(e=v==null?void 0:v.fork)==null||e.then(t=>t==null?void 0:t.discard()),v=null}const _e=new Map,Lt=new Set,pn=new Set,Q=new Set;let _={branch:[],error:null,url:null},Ut=!1,Ee=!1,ct=!0,re=!1,Y=!1,At=!1,Xe=!1,Tt,k,L,V;const Re=new Set,ft=new Map,ut=new Map;async function Nn(e,t,n){var i,s,o,l;globalThis.__sveltekit_186n2ot&&(globalThis.__sveltekit_186n2ot.query,globalThis.__sveltekit_186n2ot.prerender),document.URL!==location.href&&(location.href=location.href),S=e,await((s=(i=e.hooks).init)==null?void 0:s.call(i)),Ye=tn(e),P=document.documentElement,Ve=t,De=e.nodes[0],ye=e.nodes[1],De(),ye(),k=(o=history.state)==null?void 0:o[F],L=(l=history.state)==null?void 0:l[Z],k||(k=L=Date.now(),history.replaceState({...history.state,[F]:k,[Z]:L},""));const a=N[k];function r(){a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y))}n?(r(),await Ln(Ve,n)):(await G({type:"enter",url:He(S.hash?Tn(new URL(location.href)):location.href),replace_state:!0}),r()),xn()}function gn(){be.length=0,Xe=!1}function It(e){ke.some(t=>t==null?void 0:t.snapshot)&&(te[e]=ke.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function Ot(e){var t;(t=te[e])==null||t.forEach((n,a)=>{var r,i;(i=(r=ke[a])==null?void 0:r.snapshot)==null||i.restore(n)})}function dt(){Je(k),ot(yt,N),It(L),ot(vt,te)}async function Pt(e,t,n,a){let r,i;t.invalidateAll&&Se(),await G({type:"goto",url:He(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:a,accept:()=>{if(t.invalidateAll){Xe=!0,r=new Set;for(const[s,o]of ft)for(const l of o.keys())r.add(me(s,l));i=new Set;for(const[s,o]of ut)for(const l of o.keys())i.add(me(s,l))}t.invalidate&&t.invalidate.forEach(Rn)}}),t.invalidateAll&&we().then(we).then(()=>{for(const[s,o]of ft)for(const[l,{resource:c}]of o)r!=null&&r.has(me(s,l))&&c.refresh();for(const[s,o]of ut)for(const[l,{resource:c}]of o)i!=null&&i.has(me(s,l))&&c.reconnect()})}async function mn(e){if(e.id!==(v==null?void 0:v.id)){Se();const t={};Re.add(t),v={id:e.id,token:t,promise:Ct({...e,preload:t}).then(n=>(Re.delete(t),n.type==="loaded"&&n.state.error&&Se(),n)),fork:null}}return v.promise}async function Ne(e){var n;const t=(n=await Te(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(a=>a[1]()))}async function $t(e,t,n){var i;const a={params:_.params,route:{id:((i=_.route)==null?void 0:i.id)??null},url:new URL(location.href)};_={...e.state,nav:a};const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,e.props.page),Tt=new S.root({target:t,props:{...e.props,stores:j,components:ke},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),Ot(L),n){const s={from:null,to:{...a,scroll:N[k]??B()},willUnload:!1,type:"enter",complete:Promise.resolve()};Q.forEach(o=>o(s))}Ee=!0}async function xe({url:e,params:t,branch:n,errors:a,status:r,error:i,route:s,form:o}){let l="never";if(U&&(e.pathname===U||e.pathname===U+"/"))l="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(l=f.slash);e.pathname=Kt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:s},props:{constructors:ln(n).map(f=>f.node.component),page:nt(R)}};o!==void 0&&(c.props.form=o);let d={},u=!R,w=0;for(let f=0;f<Math.max(n.length,_.branch.length);f+=1){const m=n[f],h=_.branch[f];(m==null?void 0:m.data)!==(h==null?void 0:h.data)&&(u=!0),m&&(d={...d,...m.data},u&&(c.props[`data_${w}`]=d),w+=1)}return(!_.url||e.href!==_.url.href||_.error!==i||o!==void 0&&o!==R.form||u)&&(c.props.page={error:i,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:o??null,data:u?d:R.data}),c}async function Qe({loader:e,parent:t,url:n,params:a,route:r,server_data_node:i}){var c,d;let s=null;const o={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();return{node:l,loader:e,server:i,universal:(c=l.universal)!=null&&c.load?{type:"data",data:s,uses:o}:null,data:s??(i==null?void 0:i.data)??null,slash:((d=l.universal)==null?void 0:d.trailingSlash)??(i==null?void 0:i.slash)}}function _n(e,t,n){let a=e instanceof Request?e.url:e;const r=new URL(a,n);r.origin===n.origin&&(a=r.href.slice(n.origin.length));const i=Ee?Jt(a,r.href,t):Wt(a,t);return{resolved:r,promise:i}}function wn(e,t,n,a,r,i){if(Xe)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&n)return!0;for(const s of r.search_params)if(a.has(s))return!0;for(const s of r.params)if(i[s]!==_.params[s])return!0;for(const s of r.dependencies)if(be.some(o=>o(new URL(s))))return!0;return!1}function Ze(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function vn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const a of n){const r=e.searchParams.getAll(a),i=t.searchParams.getAll(a);r.every(s=>i.includes(s))&&i.every(s=>r.includes(s))&&n.delete(a)}return n}function yn({error:e,url:t,route:n,params:a}){return{type:"loaded",state:{error:e,url:t,route:n,params:a,branch:[]},props:{page:nt(R),constructors:[]}}}async function Ct({id:e,invalidating:t,url:n,params:a,route:r,preload:i}){if((v==null?void 0:v.id)===e)return Re.delete(v.token),v.promise;const{errors:s,layouts:o,leaf:l}=r,c=[...o,l];s.forEach(h=>h==null?void 0:h().catch(C)),c.forEach(h=>h==null?void 0:h[1]().catch(C));const d=_.url?e!==Le(_.url):!1,u=_.route?r.id!==_.route.id:!1,w=vn(_.url,n);let p=!1;const f=c.map(async(h,g)=>{var $;if(!h)return;const b=_.branch[g];return h[1]===(b==null?void 0:b.loader)&&!wn(p,u,d,w,($=b.universal)==null?void 0:$.uses,a)?b:(p=!0,Qe({loader:h[1],url:n,params:a,route:r,parent:async()=>{var ge;const q={};for(let K=0;K<g;K+=1)Object.assign(q,(ge=await f[K])==null?void 0:ge.data);return q},server_data_node:Ze(h[0]?{type:"skip"}:null,h[0]?b==null?void 0:b.server:void 0)}))});for(const h of f)h.catch(C);const m=[];for(let h=0;h<c.length;h+=1)if(c[h])try{m.push(await f[h])}catch(g){if(g instanceof ze)return{type:"redirect",location:g.location};if(Re.has(i))return yn({error:await ae(g,{params:a,url:n,route:{id:r.id}}),url:n,params:a,route:r});let b=We(g),x;if(g instanceof Me)x=g.body;else{if(await j.updated.check())return await xt(),await ne(n);x=await ae(g,{params:a,url:n,route:{id:r.id}})}const $=await bn(h,m,s);return $?xe({url:n,params:a,branch:m.slice(0,$.idx).concat($.node),errors:s,status:b,error:x,route:r}):await Nt(n,{id:r.id},x,b)}else m.push(void 0);return xe({url:n,params:a,branch:m,errors:s,status:200,error:null,route:r,form:t?void 0:null})}async function bn(e,t,n){for(;e--;)if(n[e]){let a=e;for(;!t[a];)a-=1;try{return{idx:a+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function et({status:e,error:t,url:n,route:a}){const r={};let i=null;try{const s=await Qe({loader:De,url:n,params:r,route:a,parent:()=>Promise.resolve({}),server_data_node:Ze(i)}),o={node:await ye(),loader:ye,universal:null,server:null,data:null};return xe({url:n,params:r,branch:[s,o],status:e,error:t,errors:[],route:null})}catch(s){if(s instanceof ze)return Pt(new URL(s.location,location.href),{},0);throw s}}async function kn(e){const t=e.href;if(_e.has(t))return _e.get(t);let n;try{const a=(async()=>{let r=await S.hooks.reroute({url:new URL(e),fetch:async(i,s)=>_n(i,s,e).promise})??e;if(typeof r=="string"){const i=new URL(e);S.hash?i.hash=r:i.pathname=r,r=i}return r})();_e.set(t,a),n=await a}catch{_e.delete(t);return}return n}async function Te(e,t){if(e&&!Ae(e,U,S.hash)){const n=await kn(e);if(!n)return;const a=Sn(n);for(const r of Ye){const i=r.exec(a);if(i)return{id:Le(e),invalidating:t,route:r,params:zt(i),url:e}}}}function Sn(e){return Mt(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(U.length))||"/"}function Le(e){return(S.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function jt({url:e,type:t,intent:n,delta:a,event:r,scroll:i}){let s=!1;const o=tt(_,n,e,t,i??null);a!==void 0&&(o.navigation.delta=a),r!==void 0&&(o.navigation.event=r);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return re||Lt.forEach(c=>c(l)),s?null:o}async function G({type:e,url:t,popped:n,keepfocus:a,noscroll:r,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=C,block:d=C,event:u}){var K;const w=V;V=l;const p=await Te(t,!1),f=e==="enter"?tt(_,p,t,e):jt({url:t,type:e,delta:n==null?void 0:n.delta,intent:p,scroll:n==null?void 0:n.scroll,event:u});if(!f){d(),V===l&&(V=w);return}const m=k,h=L;c(),re=!0,Ee&&f.navigation.type!=="enter"&&j.navigating.set(ee.current=f.navigation);let g=p&&await Ct(p);if(!g){if(Ae(t,U,S.hash))return await ne(t,i);g=await Nt(t,{id:null},await ae(new Fe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=(p==null?void 0:p.url)||t,V!==l)return f.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await G({type:e,url:new URL(g.location,t),popped:n,keepfocus:a,noscroll:r,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),f.fulfil(void 0);return}g=await et({status:500,error:await ae(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await j.updated.check()&&(await xt(),await ne(t,i));if(gn(),Je(m),It(h),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const E=i?0:1,H={[F]:k+=E,[Z]:L+=E,[bt]:s};(i?history.replaceState:history.pushState).call(history,H,"",t),i||hn(k,L)}const b=p&&(v==null?void 0:v.id)===p.id?v.fork:null;v!=null&&v.fork&&!b&&Se(),v=null,g.props.page.state=s;let x;if(Ee){const E=(await Promise.all(Array.from(pn,W=>W(f.navigation)))).filter(W=>typeof W=="function");if(E.length>0){let W=function(){E.forEach(Oe=>{Q.delete(Oe)})};E.push(W),E.forEach(Oe=>{Q.add(Oe)})}const H=f.navigation.to;_={...g.state,nav:{params:H.params,route:H.route,url:H.url}},g.props.page&&(g.props.page.url=t);const Ie=b&&await b;Ie?x=Ie.commit():(J=null,Tt.$set(g.props),J&&Object.assign(g.props.page,J),un(g.props.page),x=(K=Bt)==null?void 0:K()),At=!0}else await $t(g,Ve,!1);const{activeElement:$}=document;await x,await we(),await we();let q=null;if(ct){const E=n?n.scroll:r?B():null;E?scrollTo(E.x,E.y):(q=t.hash&&document.getElementById(qt(t)))?q.scrollIntoView():scrollTo(0,0)}const ge=document.activeElement!==$&&document.activeElement!==document.body;!a&&!ge&&An(t,!q),ct=!0,g.props.page&&(J&&Object.assign(g.props.page,J),Object.assign(R,g.props.page)),re=!1,e==="popstate"&&Ot(L),f.fulfil(void 0),f.navigation.to&&(f.navigation.to.scroll=B()),Q.forEach(E=>E(f.navigation)),j.navigating.set(ee.current=null)}async function Nt(e,t,n,a,r){return e.origin===Ue&&e.pathname===location.pathname&&!Ut?await et({status:a,error:n,url:e,route:t}):await ne(e,r)}function En(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,D.hover)},20)});function a(o){o.defaultPrevented||i(o.composedPath()[0],D.tap)}P.addEventListener("mousedown",a),P.addEventListener("touchstart",a,{passive:!0});const r=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(Ne(new URL(l.target.href)),r.unobserve(l.target))},{threshold:0});async function i(o,l){const c=St(o,P),d=c===t.element&&(c==null?void 0:c.href)===t.href&&l>=n;if(!c||d)return;const{url:u,external:w,download:p}=qe(c,U,S.hash);if(w||p)return;const f=ve(c),m=u&&Le(_.url)===Le(u);if(!(f.reload||m))if(l<=f.preload_data){t={element:c,href:c.href},n=D.tap;const h=await Te(u,!1);if(!h)return;mn(h)}else l<=f.preload_code&&(t={element:c,href:c.href},n=l,Ne(u))}function s(){r.disconnect();for(const o of P.querySelectorAll("a")){const{url:l,external:c,download:d}=qe(o,U,S.hash);if(c||d)continue;const u=ve(o);u.reload||(u.preload_code===D.viewport&&r.observe(o),u.preload_code===D.eager&&Ne(l))}}Q.add(s),s()}function ae(e,t){if(e instanceof Me)return e.body;const n=We(e),a=cn(e);return S.hooks.handleError({error:e,event:t,status:n,message:a})??{message:a}}function qn(e,t={}){return e=new URL(He(e)),e.origin!==Ue?Promise.reject(new Error("goto: invalid URL")):Pt(e,t,0)}function Rn(e){if(typeof e=="function")be.push(e);else{const{href:t}=new URL(e,location.href);be.push(n=>n.href===t)}}function xn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let a=!1;if(dt(),!re){const r=tt(_,void 0,null,"leave"),i={...r.navigation,cancel:()=>{a=!0,r.reject(new Error("navigation cancelled"))}};Lt.forEach(s=>s(i))}a?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&dt()}),(t=navigator.connection)!=null&&t.saveData||En(),P.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const a=St(n.composedPath()[0],P);if(!a)return;const{url:r,external:i,target:s,download:o}=qe(a,U,S.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const l=ve(a);if(!(a instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[d,u]=(S.hash?r.hash.replace(/^#/,""):r.href).split("#"),w=d===$e(location);if(i||l.reload&&(!w||!u)){jt({url:r,type:"link",event:n})?re=!0:n.preventDefault();return}if(u!==void 0&&w){const[,p]=_.url.href.split("#");if(p===u){if(n.preventDefault(),u===""||u==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const f=a.ownerDocument.getElementById(decodeURIComponent(u));f&&(f.scrollIntoView(),f.focus())}return}if(Y=!0,Je(k),e(r),!l.replace_state)return;Y=!1}n.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),await G({type:"link",url:r,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??r.href===location.href,event:n})}),P.addEventListener("submit",n=>{if(n.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(n.target),r=n.submitter;if(((r==null?void 0:r.formTarget)||a.target)==="_blank"||((r==null?void 0:r.formMethod)||a.method)!=="get")return;const o=new URL((r==null?void 0:r.hasAttribute("formaction"))&&(r==null?void 0:r.formAction)||a.action);if(Ae(o,U,!1))return;const l=n.target,c=ve(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(l,r);o.search=new URLSearchParams(d).toString(),G({type:"form",url:o,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var a;if(!Be){if((a=n.state)!=null&&a[F]){const r=n.state[F];if(V={},r===k)return;const i=N[r],s=n.state[bt]??{},o=new URL(n.state[an]??location.href),l=n.state[Z],c=_.url?$e(location)===$e(_.url):!1;if(l===L&&(At||c)){s!==R.state&&(R.state=s),e(o),N[k]=B(),i&&scrollTo(i.x,i.y),k=r;return}const u=r-k;await G({type:"popstate",url:o,popped:{state:s,scroll:i,delta:u},accept:()=>{k=r,L=l},block:()=>{history.go(-u)},nav_token:V,event:n})}else if(!Y){const r=new URL(location.href);e(r),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{Y&&(Y=!1,history.replaceState({...history.state,[F]:++k,[Z]:L},"",location.href))});for(const n of document.querySelectorAll("link"))dn.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&j.navigating.set(ee.current=null)});function e(n){_.url=R.url=n,j.page.set(nt(R)),j.page.notify()}}async function Ln(e,{status:t=200,error:n,node_ids:a,params:r,route:i,server_route:s,data:o,form:l}){Ut=!0;const c=new URL(location.href);let d;({params:r={},route:i={id:null}}=await Te(c,!1)||{}),d=Ye.find(({id:p})=>p===i.id);let u,w=!0;try{const p=a.map(async(m,h)=>{const g=o[h];return g!=null&&g.uses&&(g.uses=Un(g.uses)),Qe({loader:S.nodes[m],url:c,params:r,route:i,parent:async()=>{const b={};for(let x=0;x<h;x+=1)Object.assign(b,(await p[x]).data);return b},server_data_node:Ze(g)})}),f=await Promise.all(p);if(d){const m=d.layouts;for(let h=0;h<m.length;h++)m[h]||f.splice(h,0,void 0)}u=await xe({url:c,params:r,branch:f,status:t,error:n,errors:d==null?void 0:d.errors,form:l,route:d??null})}catch(p){if(p instanceof ze){await ne(new URL(p.location,location.href));return}u=await et({status:We(p),error:await ae(p,{url:c,params:r,route:i}),url:c,route:i}),e.textContent="",w=!1}finally{}u.props.page&&(u.props.page.state={}),await $t(u,e,w)}function Un(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Be=!1;function An(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const a=qt(e);if(a&&document.getElementById(a)){const{x:i,y:s}=B();setTimeout(()=>{const o=history.state;Be=!0,location.replace(new URL(`#${a}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Be=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const i=[];for(let s=0;s<r.rangeCount;s+=1)i.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===i.length){for(let s=0;s<r.rangeCount;s+=1){const o=i[s],l=r.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}r.removeAllRanges()}})}}}function tt(e,t,n,a,r=null){var c,d;let i,s;const o=new Promise((u,w)=>{i=u,s=w});return o.catch(C),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url,scroll:B()},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((d=t==null?void 0:t.route)==null?void 0:d.id)??null},url:n,scroll:r},willUnload:!t,type:a,complete:o},fulfil:i,reject:s}}function nt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Tn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function qt(e){let t;if(S.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Nn as a,qn as g,Pn as l,R as p,j as s};
|
|
@@ -1 +1 @@
|
|
| 1 |
-
import{s as e,p as r}from"./
|
|
|
|
| 1 |
+
import{s as e,p as r}from"./D9Zf6nF7.js";const t={get error(){return r.error},get params(){return r.params},get status(){return r.status},get url(){return r.url}};e.updated.check;const a=t;export{a as p};
|
|
@@ -1 +0,0 @@
|
|
| 1 |
-
var rt=e=>{throw TypeError(e)};var Dt=(e,t,n)=>t.has(e)||rt("Cannot "+n);var v=(e,t,n)=>(Dt(e,t,"read from private field"),n?n.call(e):t.get(e)),A=(e,t,n)=>t.has(e)?rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import{bf as Pe,bg as Vt,a6 as at,a4 as T,o as I,a5 as O,ar as we,bh as Bt}from"./R1l3q-hJ.js";const M=[];function Ke(e,t=Pe){let n=null;const a=new Set;function r(o){if(Vt(e,o)&&(e=o,n)){const l=!M.length;for(const c of a)c[1](),M.push(c,e);if(l){for(let c=0;c<M.length;c+=2)M[c][0](M[c+1]);M.length=0}}}function i(o){r(o(e))}function s(o,l=Pe){const c=[o,l];return a.add(c),a.size===1&&(n=t(r,i)||Pe),o(e),()=>{a.delete(c),a.size===0&&n&&(n(),n=null)}}return{set:r,update:i,subscribe:s}}class Me{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class ze{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Fe extends Error{constructor(t,n,a){super(a),this.status=t,this.text=n}}new URL("sveltekit-internal://");function Kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function Mt(e){return e.split("%25").map(decodeURI).join("%25")}function zt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function $e({href:e}){return e.split("#")[0]}function C(){}function Ft(...e){let t=5381;for(const n of e)if(typeof n=="string"){let a=n.length;for(;a;)t=t*33^n.charCodeAt(--a)}else if(ArrayBuffer.isView(n)){const a=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=a.length;for(;r;)t=t*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function Gt(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}const Ht=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:(t==null?void 0:t.method)||"GET")!=="GET"&&X.delete(Ge(e)),Ht(e,t));const X=new Map;function Wt(e,t){const n=Ge(e,t),a=document.querySelector(n);if(a!=null&&a.textContent){a.remove();let{body:r,...i}=JSON.parse(a.textContent);const s=a.getAttribute("data-ttl");return s&&X.set(n,{body:r,init:i,ttl:1e3*Number(s)}),a.getAttribute("data-b64")!==null&&(r=Gt(r)),Promise.resolve(new Response(r,i))}return window.fetch(e,t)}function Jt(e,t,n){if(X.size>0){const a=Ge(e,n),r=X.get(a);if(r){if(performance.now()<r.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(r.body,r.init);X.delete(a)}}return window.fetch(t,n)}function Ge(e,t){let a=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t!=null&&t.headers||t!=null&&t.body){const r=[];t.headers&&r.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&r.push(t.body),a+=`[data-hash="${Ft(...r)}"]`}return a}const Yt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Xt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Zt(e).map(a=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(a);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(a);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!a)return;const s=a.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Ce(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Ce(String.fromCharCode(...l.slice(2).split("-").map(m=>parseInt(m,16))));const d=Yt.exec(l),[,u,w,p,f]=d;return t.push({name:p,matcher:f,optional:!!u,rest:!!w,chained:w?c===1&&s[0]==="":!1}),w?"([^]*?)":u?"([^/]*)?":"([^/]+?)"}return Ce(l)}).join("")}).join("")}/?$`),params:t}}function Qt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Zt(e){return e.slice(1).split("/").filter(Qt)}function en(e,t,n){const a={},r=e.slice(1),i=r.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=r[o-s];if(l.chained&&l.rest&&s&&(c=r.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){a[l.name]=c;const d=t[o+1],u=r[o+1];d&&!d.rest&&d.optional&&u&&l.chained&&(s=0),!d&&!u&&Object.keys(a).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return a}function Ce(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function tn({nodes:e,server_loads:t,dictionary:n,matchers:a}){const r=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:u,params:w}=Xt(o),p={id:o,exec:f=>{const m=u.exec(f);if(m)return en(m,w,a)},errors:[1,...d||[]].map(f=>e[f]),layouts:[0,...c||[]].map(s),leaf:i(l)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[r.has(o),e[o]]}}function wt(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ot(e,t,n=JSON.stringify){const a=n(t);try{sessionStorage[e]=a}catch{}}var ht;const U=((ht=globalThis.__sveltekit_7ykx85)==null?void 0:ht.base)??"";var pt;const nn=((pt=globalThis.__sveltekit_7ykx85)==null?void 0:pt.assets)??U??"",rn="1778028543661",yt="sveltekit:snapshot",vt="sveltekit:scroll",bt="sveltekit:states",an="sveltekit:pageurl",F="sveltekit:history",Z="sveltekit:navigation",D={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Ue=location.origin;function He(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function B(){return{x:pageXOffset,y:pageYOffset}}function z(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const st={...D,"":D.hover};function kt(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function St(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=kt(e)}}function qe(e,t,n){let a;try{if(a=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&a.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";a.hash=`#${o}${a.hash}`}}catch{}const r=e instanceof SVGAElement?e.target.baseVal:e.target,i=!a||!!r||Ae(a,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=(a==null?void 0:a.origin)===Ue&&e.hasAttribute("download");return{url:a,external:i,target:r,download:s}}function ye(e){let t=null,n=null,a=null,r=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)a===null&&(a=z(o,"preload-code")),r===null&&(r=z(o,"preload-data")),t===null&&(t=z(o,"keepfocus")),n===null&&(n=z(o,"noscroll")),i===null&&(i=z(o,"reload")),s===null&&(s=z(o,"replacestate")),o=kt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:st[a??"off"],preload_data:st[r??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function it(e){const t=Ke(e);let n=!0;function a(){n=!0,t.update(s=>s)}function r(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:a,set:r,subscribe:i}}const Et={v:C};function on(){const{set:e,subscribe:t}=Ke(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${nn}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const s=(await r.json()).version!==rn;return s&&(e(!0),Et.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:a}}function Ae(e,t,n){return e.origin!==Ue||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Pn(e){}const Rt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Rt];const sn=new Set([...Rt]);[...sn];function ln(e){return e.filter(t=>t!=null)}function me(e,t){return e+"/"+t}function We(e){return e instanceof Me||e instanceof Fe?e.status:500}function cn(e){return e instanceof Fe?e.text:"Internal Error"}let R,ee,je;const fn=at.toString().includes("$$")||/function \w+\(\) \{\}/.test(at.toString()),lt="a:";var oe,se,ie,le,ce,fe,ue,de,gt,he,mt,pe,_t;fn?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(lt)},ee={current:null},je={current:!1}):(R=new(gt=class{constructor(){A(this,oe,T({}));A(this,se,T(null));A(this,ie,T(null));A(this,le,T({}));A(this,ce,T({id:null}));A(this,fe,T({}));A(this,ue,T(-1));A(this,de,T(new URL(lt)))}get data(){return I(v(this,oe))}set data(t){O(v(this,oe),t)}get form(){return I(v(this,se))}set form(t){O(v(this,se),t)}get error(){return I(v(this,ie))}set error(t){O(v(this,ie),t)}get params(){return I(v(this,le))}set params(t){O(v(this,le),t)}get route(){return I(v(this,ce))}set route(t){O(v(this,ce),t)}get state(){return I(v(this,fe))}set state(t){O(v(this,fe),t)}get status(){return I(v(this,ue))}set status(t){O(v(this,ue),t)}get url(){return I(v(this,de))}set url(t){O(v(this,de),t)}},oe=new WeakMap,se=new WeakMap,ie=new WeakMap,le=new WeakMap,ce=new WeakMap,fe=new WeakMap,ue=new WeakMap,de=new WeakMap,gt),ee=new(mt=class{constructor(){A(this,he,T(null))}get current(){return I(v(this,he))}set current(t){O(v(this,he),t)}},he=new WeakMap,mt),je=new(_t=class{constructor(){A(this,pe,T(!1))}get current(){return I(v(this,pe))}set current(t){O(v(this,pe),t)}},pe=new WeakMap,_t),Et.v=()=>je.current=!0);function un(e){Object.assign(R,e)}const dn=new Set(["icon","shortcut icon","apple-touch-icon"]);let J=null;const N=wt(vt)??{},te=wt(yt)??{},j={url:it({}),page:it({}),navigating:Ke(null),updated:on()};function Je(e){N[e]=B()}function hn(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;te[n];)delete te[n],n+=1}function ne(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(C)}async function xt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(U||"/");e&&await e.update()}}let Ye,De,ve,P,Ve,S;const be=[],ke=[];let y=null;function Se(){var e;(e=y==null?void 0:y.fork)==null||e.then(t=>t==null?void 0:t.discard()),y=null}const _e=new Map,Lt=new Set,pn=new Set,Q=new Set;let _={branch:[],error:null,url:null},Ut=!1,Ee=!1,ct=!0,re=!1,Y=!1,At=!1,Xe=!1,Tt,k,L,V;const Re=new Set,ft=new Map,ut=new Map;async function Nn(e,t,n){var i,s,o,l;globalThis.__sveltekit_7ykx85&&(globalThis.__sveltekit_7ykx85.query,globalThis.__sveltekit_7ykx85.prerender),document.URL!==location.href&&(location.href=location.href),S=e,await((s=(i=e.hooks).init)==null?void 0:s.call(i)),Ye=tn(e),P=document.documentElement,Ve=t,De=e.nodes[0],ve=e.nodes[1],De(),ve(),k=(o=history.state)==null?void 0:o[F],L=(l=history.state)==null?void 0:l[Z],k||(k=L=Date.now(),history.replaceState({...history.state,[F]:k,[Z]:L},""));const a=N[k];function r(){a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y))}n?(r(),await Ln(Ve,n)):(await G({type:"enter",url:He(S.hash?Tn(new URL(location.href)):location.href),replace_state:!0}),r()),xn()}function gn(){be.length=0,Xe=!1}function It(e){ke.some(t=>t==null?void 0:t.snapshot)&&(te[e]=ke.map(t=>{var n;return(n=t==null?void 0:t.snapshot)==null?void 0:n.capture()}))}function Ot(e){var t;(t=te[e])==null||t.forEach((n,a)=>{var r,i;(i=(r=ke[a])==null?void 0:r.snapshot)==null||i.restore(n)})}function dt(){Je(k),ot(vt,N),It(L),ot(yt,te)}async function Pt(e,t,n,a){let r,i;t.invalidateAll&&Se(),await G({type:"goto",url:He(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:a,accept:()=>{if(t.invalidateAll){Xe=!0,r=new Set;for(const[s,o]of ft)for(const l of o.keys())r.add(me(s,l));i=new Set;for(const[s,o]of ut)for(const l of o.keys())i.add(me(s,l))}t.invalidate&&t.invalidate.forEach(Rn)}}),t.invalidateAll&&we().then(we).then(()=>{for(const[s,o]of ft)for(const[l,{resource:c}]of o)r!=null&&r.has(me(s,l))&&c.refresh();for(const[s,o]of ut)for(const[l,{resource:c}]of o)i!=null&&i.has(me(s,l))&&c.reconnect()})}async function mn(e){if(e.id!==(y==null?void 0:y.id)){Se();const t={};Re.add(t),y={id:e.id,token:t,promise:Ct({...e,preload:t}).then(n=>(Re.delete(t),n.type==="loaded"&&n.state.error&&Se(),n)),fork:null}}return y.promise}async function Ne(e){var n;const t=(n=await Te(e,!1))==null?void 0:n.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(a=>a[1]()))}async function $t(e,t,n){var i;const a={params:_.params,route:{id:((i=_.route)==null?void 0:i.id)??null},url:new URL(location.href)};_={...e.state,nav:a};const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,e.props.page),Tt=new S.root({target:t,props:{...e.props,stores:j,components:ke},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),Ot(L),n){const s={from:null,to:{...a,scroll:N[k]??B()},willUnload:!1,type:"enter",complete:Promise.resolve()};Q.forEach(o=>o(s))}Ee=!0}async function xe({url:e,params:t,branch:n,errors:a,status:r,error:i,route:s,form:o}){let l="never";if(U&&(e.pathname===U||e.pathname===U+"/"))l="always";else for(const f of n)(f==null?void 0:f.slash)!==void 0&&(l=f.slash);e.pathname=Kt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:s},props:{constructors:ln(n).map(f=>f.node.component),page:nt(R)}};o!==void 0&&(c.props.form=o);let d={},u=!R,w=0;for(let f=0;f<Math.max(n.length,_.branch.length);f+=1){const m=n[f],h=_.branch[f];(m==null?void 0:m.data)!==(h==null?void 0:h.data)&&(u=!0),m&&(d={...d,...m.data},u&&(c.props[`data_${w}`]=d),w+=1)}return(!_.url||e.href!==_.url.href||_.error!==i||o!==void 0&&o!==R.form||u)&&(c.props.page={error:i,params:t,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:o??null,data:u?d:R.data}),c}async function Qe({loader:e,parent:t,url:n,params:a,route:r,server_data_node:i}){var c,d;let s=null;const o={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();return{node:l,loader:e,server:i,universal:(c=l.universal)!=null&&c.load?{type:"data",data:s,uses:o}:null,data:s??(i==null?void 0:i.data)??null,slash:((d=l.universal)==null?void 0:d.trailingSlash)??(i==null?void 0:i.slash)}}function _n(e,t,n){let a=e instanceof Request?e.url:e;const r=new URL(a,n);r.origin===n.origin&&(a=r.href.slice(n.origin.length));const i=Ee?Jt(a,r.href,t):Wt(a,t);return{resolved:r,promise:i}}function wn(e,t,n,a,r,i){if(Xe)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&n)return!0;for(const s of r.search_params)if(a.has(s))return!0;for(const s of r.params)if(i[s]!==_.params[s])return!0;for(const s of r.dependencies)if(be.some(o=>o(new URL(s))))return!0;return!1}function Ze(e,t){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?t??null:null}function yn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const a of n){const r=e.searchParams.getAll(a),i=t.searchParams.getAll(a);r.every(s=>i.includes(s))&&i.every(s=>r.includes(s))&&n.delete(a)}return n}function vn({error:e,url:t,route:n,params:a}){return{type:"loaded",state:{error:e,url:t,route:n,params:a,branch:[]},props:{page:nt(R),constructors:[]}}}async function Ct({id:e,invalidating:t,url:n,params:a,route:r,preload:i}){if((y==null?void 0:y.id)===e)return Re.delete(y.token),y.promise;const{errors:s,layouts:o,leaf:l}=r,c=[...o,l];s.forEach(h=>h==null?void 0:h().catch(C)),c.forEach(h=>h==null?void 0:h[1]().catch(C));const d=_.url?e!==Le(_.url):!1,u=_.route?r.id!==_.route.id:!1,w=yn(_.url,n);let p=!1;const f=c.map(async(h,g)=>{var $;if(!h)return;const b=_.branch[g];return h[1]===(b==null?void 0:b.loader)&&!wn(p,u,d,w,($=b.universal)==null?void 0:$.uses,a)?b:(p=!0,Qe({loader:h[1],url:n,params:a,route:r,parent:async()=>{var ge;const q={};for(let K=0;K<g;K+=1)Object.assign(q,(ge=await f[K])==null?void 0:ge.data);return q},server_data_node:Ze(h[0]?{type:"skip"}:null,h[0]?b==null?void 0:b.server:void 0)}))});for(const h of f)h.catch(C);const m=[];for(let h=0;h<c.length;h+=1)if(c[h])try{m.push(await f[h])}catch(g){if(g instanceof ze)return{type:"redirect",location:g.location};if(Re.has(i))return vn({error:await ae(g,{params:a,url:n,route:{id:r.id}}),url:n,params:a,route:r});let b=We(g),x;if(g instanceof Me)x=g.body;else{if(await j.updated.check())return await xt(),await ne(n);x=await ae(g,{params:a,url:n,route:{id:r.id}})}const $=await bn(h,m,s);return $?xe({url:n,params:a,branch:m.slice(0,$.idx).concat($.node),errors:s,status:b,error:x,route:r}):await Nt(n,{id:r.id},x,b)}else m.push(void 0);return xe({url:n,params:a,branch:m,errors:s,status:200,error:null,route:r,form:t?void 0:null})}async function bn(e,t,n){for(;e--;)if(n[e]){let a=e;for(;!t[a];)a-=1;try{return{idx:a+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function et({status:e,error:t,url:n,route:a}){const r={};let i=null;try{const s=await Qe({loader:De,url:n,params:r,route:a,parent:()=>Promise.resolve({}),server_data_node:Ze(i)}),o={node:await ve(),loader:ve,universal:null,server:null,data:null};return xe({url:n,params:r,branch:[s,o],status:e,error:t,errors:[],route:null})}catch(s){if(s instanceof ze)return Pt(new URL(s.location,location.href),{},0);throw s}}async function kn(e){const t=e.href;if(_e.has(t))return _e.get(t);let n;try{const a=(async()=>{let r=await S.hooks.reroute({url:new URL(e),fetch:async(i,s)=>_n(i,s,e).promise})??e;if(typeof r=="string"){const i=new URL(e);S.hash?i.hash=r:i.pathname=r,r=i}return r})();_e.set(t,a),n=await a}catch{_e.delete(t);return}return n}async function Te(e,t){if(e&&!Ae(e,U,S.hash)){const n=await kn(e);if(!n)return;const a=Sn(n);for(const r of Ye){const i=r.exec(a);if(i)return{id:Le(e),invalidating:t,route:r,params:zt(i),url:e}}}}function Sn(e){return Mt(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(U.length))||"/"}function Le(e){return(S.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function jt({url:e,type:t,intent:n,delta:a,event:r,scroll:i}){let s=!1;const o=tt(_,n,e,t,i??null);a!==void 0&&(o.navigation.delta=a),r!==void 0&&(o.navigation.event=r);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return re||Lt.forEach(c=>c(l)),s?null:o}async function G({type:e,url:t,popped:n,keepfocus:a,noscroll:r,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=C,block:d=C,event:u}){var K;const w=V;V=l;const p=await Te(t,!1),f=e==="enter"?tt(_,p,t,e):jt({url:t,type:e,delta:n==null?void 0:n.delta,intent:p,scroll:n==null?void 0:n.scroll,event:u});if(!f){d(),V===l&&(V=w);return}const m=k,h=L;c(),re=!0,Ee&&f.navigation.type!=="enter"&&j.navigating.set(ee.current=f.navigation);let g=p&&await Ct(p);if(!g){if(Ae(t,U,S.hash))return await ne(t,i);g=await Nt(t,{id:null},await ae(new Fe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=(p==null?void 0:p.url)||t,V!==l)return f.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await G({type:e,url:new URL(g.location,t),popped:n,keepfocus:a,noscroll:r,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),f.fulfil(void 0);return}g=await et({status:500,error:await ae(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await j.updated.check()&&(await xt(),await ne(t,i));if(gn(),Je(m),It(h),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const E=i?0:1,H={[F]:k+=E,[Z]:L+=E,[bt]:s};(i?history.replaceState:history.pushState).call(history,H,"",t),i||hn(k,L)}const b=p&&(y==null?void 0:y.id)===p.id?y.fork:null;y!=null&&y.fork&&!b&&Se(),y=null,g.props.page.state=s;let x;if(Ee){const E=(await Promise.all(Array.from(pn,W=>W(f.navigation)))).filter(W=>typeof W=="function");if(E.length>0){let W=function(){E.forEach(Oe=>{Q.delete(Oe)})};E.push(W),E.forEach(Oe=>{Q.add(Oe)})}const H=f.navigation.to;_={...g.state,nav:{params:H.params,route:H.route,url:H.url}},g.props.page&&(g.props.page.url=t);const Ie=b&&await b;Ie?x=Ie.commit():(J=null,Tt.$set(g.props),J&&Object.assign(g.props.page,J),un(g.props.page),x=(K=Bt)==null?void 0:K()),At=!0}else await $t(g,Ve,!1);const{activeElement:$}=document;await x,await we(),await we();let q=null;if(ct){const E=n?n.scroll:r?B():null;E?scrollTo(E.x,E.y):(q=t.hash&&document.getElementById(qt(t)))?q.scrollIntoView():scrollTo(0,0)}const ge=document.activeElement!==$&&document.activeElement!==document.body;!a&&!ge&&An(t,!q),ct=!0,g.props.page&&(J&&Object.assign(g.props.page,J),Object.assign(R,g.props.page)),re=!1,e==="popstate"&&Ot(L),f.fulfil(void 0),f.navigation.to&&(f.navigation.to.scroll=B()),Q.forEach(E=>E(f.navigation)),j.navigating.set(ee.current=null)}async function Nt(e,t,n,a,r){return e.origin===Ue&&e.pathname===location.pathname&&!Ut?await et({status:a,error:n,url:e,route:t}):await ne(e,r)}function En(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,D.hover)},20)});function a(o){o.defaultPrevented||i(o.composedPath()[0],D.tap)}P.addEventListener("mousedown",a),P.addEventListener("touchstart",a,{passive:!0});const r=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(Ne(new URL(l.target.href)),r.unobserve(l.target))},{threshold:0});async function i(o,l){const c=St(o,P),d=c===t.element&&(c==null?void 0:c.href)===t.href&&l>=n;if(!c||d)return;const{url:u,external:w,download:p}=qe(c,U,S.hash);if(w||p)return;const f=ye(c),m=u&&Le(_.url)===Le(u);if(!(f.reload||m))if(l<=f.preload_data){t={element:c,href:c.href},n=D.tap;const h=await Te(u,!1);if(!h)return;mn(h)}else l<=f.preload_code&&(t={element:c,href:c.href},n=l,Ne(u))}function s(){r.disconnect();for(const o of P.querySelectorAll("a")){const{url:l,external:c,download:d}=qe(o,U,S.hash);if(c||d)continue;const u=ye(o);u.reload||(u.preload_code===D.viewport&&r.observe(o),u.preload_code===D.eager&&Ne(l))}}Q.add(s),s()}function ae(e,t){if(e instanceof Me)return e.body;const n=We(e),a=cn(e);return S.hooks.handleError({error:e,event:t,status:n,message:a})??{message:a}}function qn(e,t={}){return e=new URL(He(e)),e.origin!==Ue?Promise.reject(new Error("goto: invalid URL")):Pt(e,t,0)}function Rn(e){if(typeof e=="function")be.push(e);else{const{href:t}=new URL(e,location.href);be.push(n=>n.href===t)}}function xn(){var t;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let a=!1;if(dt(),!re){const r=tt(_,void 0,null,"leave"),i={...r.navigation,cancel:()=>{a=!0,r.reject(new Error("navigation cancelled"))}};Lt.forEach(s=>s(i))}a?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&dt()}),(t=navigator.connection)!=null&&t.saveData||En(),P.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const a=St(n.composedPath()[0],P);if(!a)return;const{url:r,external:i,target:s,download:o}=qe(a,U,S.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const l=ye(a);if(!(a instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[d,u]=(S.hash?r.hash.replace(/^#/,""):r.href).split("#"),w=d===$e(location);if(i||l.reload&&(!w||!u)){jt({url:r,type:"link",event:n})?re=!0:n.preventDefault();return}if(u!==void 0&&w){const[,p]=_.url.href.split("#");if(p===u){if(n.preventDefault(),u===""||u==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const f=a.ownerDocument.getElementById(decodeURIComponent(u));f&&(f.scrollIntoView(),f.focus())}return}if(Y=!0,Je(k),e(r),!l.replace_state)return;Y=!1}n.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),await G({type:"link",url:r,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??r.href===location.href,event:n})}),P.addEventListener("submit",n=>{if(n.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(n.target),r=n.submitter;if(((r==null?void 0:r.formTarget)||a.target)==="_blank"||((r==null?void 0:r.formMethod)||a.method)!=="get")return;const o=new URL((r==null?void 0:r.hasAttribute("formaction"))&&(r==null?void 0:r.formAction)||a.action);if(Ae(o,U,!1))return;const l=n.target,c=ye(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const d=new FormData(l,r);o.search=new URLSearchParams(d).toString(),G({type:"form",url:o,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??o.href===location.href,event:n})}),addEventListener("popstate",async n=>{var a;if(!Be){if((a=n.state)!=null&&a[F]){const r=n.state[F];if(V={},r===k)return;const i=N[r],s=n.state[bt]??{},o=new URL(n.state[an]??location.href),l=n.state[Z],c=_.url?$e(location)===$e(_.url):!1;if(l===L&&(At||c)){s!==R.state&&(R.state=s),e(o),N[k]=B(),i&&scrollTo(i.x,i.y),k=r;return}const u=r-k;await G({type:"popstate",url:o,popped:{state:s,scroll:i,delta:u},accept:()=>{k=r,L=l},block:()=>{history.go(-u)},nav_token:V,event:n})}else if(!Y){const r=new URL(location.href);e(r),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{Y&&(Y=!1,history.replaceState({...history.state,[F]:++k,[Z]:L},"",location.href))});for(const n of document.querySelectorAll("link"))dn.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&j.navigating.set(ee.current=null)});function e(n){_.url=R.url=n,j.page.set(nt(R)),j.page.notify()}}async function Ln(e,{status:t=200,error:n,node_ids:a,params:r,route:i,server_route:s,data:o,form:l}){Ut=!0;const c=new URL(location.href);let d;({params:r={},route:i={id:null}}=await Te(c,!1)||{}),d=Ye.find(({id:p})=>p===i.id);let u,w=!0;try{const p=a.map(async(m,h)=>{const g=o[h];return g!=null&&g.uses&&(g.uses=Un(g.uses)),Qe({loader:S.nodes[m],url:c,params:r,route:i,parent:async()=>{const b={};for(let x=0;x<h;x+=1)Object.assign(b,(await p[x]).data);return b},server_data_node:Ze(g)})}),f=await Promise.all(p);if(d){const m=d.layouts;for(let h=0;h<m.length;h++)m[h]||f.splice(h,0,void 0)}u=await xe({url:c,params:r,branch:f,status:t,error:n,errors:d==null?void 0:d.errors,form:l,route:d??null})}catch(p){if(p instanceof ze){await ne(new URL(p.location,location.href));return}u=await et({status:We(p),error:await ae(p,{url:c,params:r,route:i}),url:c,route:i}),e.textContent="",w=!1}finally{}u.props.page&&(u.props.page.state={}),await $t(u,e,w)}function Un(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}let Be=!1;function An(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const a=qt(e);if(a&&document.getElementById(a)){const{x:i,y:s}=B();setTimeout(()=>{const o=history.state;Be=!0,location.replace(new URL(`#${a}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Be=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const i=[];for(let s=0;s<r.rangeCount;s+=1)i.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===i.length){for(let s=0;s<r.rangeCount;s+=1){const o=i[s],l=r.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}r.removeAllRanges()}})}}}function tt(e,t,n,a,r=null){var c,d;let i,s;const o=new Promise((u,w)=>{i=u,s=w});return o.catch(C),{navigation:{from:{params:e.params,route:{id:((c=e.route)==null?void 0:c.id)??null},url:e.url,scroll:B()},to:n&&{params:(t==null?void 0:t.params)??null,route:{id:((d=t==null?void 0:t.route)==null?void 0:d.id)??null},url:n,scroll:r},willUnload:!t,type:a,complete:o},fulfil:i,reject:s}}function nt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Tn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function qt(e){let t;if(S.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Nn as a,qn as g,Pn as l,R as p,j as s};
|
|
|
|
|
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
| 2 |
-
var S=e=>{throw TypeError(e)};var M=(e,t,r)=>t.has(e)||S("Cannot "+r);var c=(e,t,r)=>(M(e,t,"read from private field"),r?r.call(e):t.get(e)),I=(e,t,r)=>t.has(e)?S("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),p=(e,t,r,n)=>(M(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{b as L,_ as b}from"../chunks/DZRTzx66.js";import{h as N,n as W,d as X,a3 as Z,q as $,v as tt,i as et,e as B,an as rt,j as at,a5 as A,am as st,o as l,ao as nt,ap as ot,L as it,p as ct,aq as ut,aa as dt,a6 as mt,ar as _t,f as x,s as lt,a as ft,a4 as j,c as ht,r as vt,t as gt,a9 as k}from"../chunks/R1l3q-hJ.js";import{h as yt,m as Et,u as bt,a as R,c as w,f as F,t as Rt,s as Pt}from"../chunks/CzfSRAFS.js";import{B as Ot,p as D,i as q}from"../chunks/C6-4B-da.js";function V(e,t,r){var n;N&&(n=at,W());var o=new Ot(e);X(()=>{var i=t()??null;if(N){var a=$(n),s=a===rt,_=i!==null;if(s!==_){var P=tt();et(P),o.anchor=P,B(!1),o.ensure(i,i&&(y=>r(y,i))),B(!0);return}}o.ensure(i,i&&(y=>r(y,i)))},Z)}function Tt(e){return class extends xt{constructor(t){super({component:e,...t})}}}var f,d;class xt{constructor(t){I(this,f);I(this,d);var i;var r=new Map,n=(a,s)=>{var _=it(s,!1,!1);return r.set(a,_),_};const o=new Proxy({...t.props||{},$$events:{}},{get(a,s){return l(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===st?!0:(l(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,_){return A(r.get(s)??n(s,_),_),Reflect.set(a,s,_)}});p(this,d,(t.hydrate?yt:Et)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((i=t==null?void 0:t.props)!=null&&i.$$host)||t.sync===!1)&&nt(),p(this,f,o.$$events);for(const a of Object.keys(c(this,d)))a==="$set"||a==="$destroy"||a==="$on"||ot(this,a,{get(){return c(this,d)[a]},set(s){c(this,d)[a]=s},enumerable:!0});c(this,d).$set=a=>{Object.assign(o,a)},c(this,d).$destroy=()=>{bt(c(this,d))}}$set(t){c(this,d).$set(t)}$on(t,r){c(this,f)[t]=c(this,f)[t]||[];const n=(...o)=>r.call(this,...o);return c(this,f)[t].push(n),()=>{c(this,f)[t]=c(this,f)[t].filter(o=>o!==n)}}$destroy(){c(this,d).$destroy()}}f=new WeakMap,d=new WeakMap;const Ct={};var At=F('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),It=F("<!> <!>",1);function pt(e,t){ct(t,!0);let r=D(t,"components",23,()=>[]),n=D(t,"data_0",3,null),o=D(t,"data_1",3,null);ut(()=>t.stores.page.set(t.page)),dt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),o(),t.stores.page.notify()});let i=j(!1),a=j(!1),s=j(null);mt(()=>{const u=t.stores.page.subscribe(()=>{l(i)&&(A(a,!0),_t().then(()=>{A(s,document.title||"untitled page",!0)}))});return A(i,!0),u});const _=k(()=>t.constructors[1]);var P=It(),y=x(P);{var G=u=>{const h=k(()=>t.constructors[0]);var v=w(),O=x(v);V(O,()=>l(h),(g,E)=>{L(E(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(m,jt)=>{var C=w(),K=x(C);V(K,()=>l(_),(Q,U)=>{L(U(Q,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),T=>r()[1]=T,()=>{var T;return(T=r())==null?void 0:T[1]})}),R(m,C)},$$slots:{default:!0}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),R(u,v)},H=u=>{const h=k(()=>t.constructors[0]);var v=w(),O=x(v);V(O,()=>l(h),(g,E)=>{L(E(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),R(u,v)};q(y,u=>{t.constructors[1]?u(G):u(H,-1)})}var z=lt(y,2);{var J=u=>{var h=At(),v=ht(h);{var O=g=>{var E=Rt();gt(()=>Pt(E,l(s))),R(g,E)};q(v,g=>{l(a)&&g(O)})}vt(h),R(u,h)};q(z,u=>{l(i)&&u(J)})}R(e,P),ft()}const St=Tt(pt),Mt=[()=>b(()=>import("../nodes/0.
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.IL53jLg5.js","../chunks/CzfSRAFS.js","../chunks/R1l3q-hJ.js","../chunks/Bu_bEyoS.js","../chunks/C6-4B-da.js","../chunks/DP_9AkkW.js","../chunks/D9Zf6nF7.js","../chunks/a4L4UsYq.js","../chunks/B_9mIQpm.js","../assets/0.mgbkK27i.css","../nodes/1.4zkFLEZX.js","../nodes/2.C4OcOHhN.js","../chunks/L2xkwLPH.js","../chunks/CGe8VjDs.js","../chunks/DZRTzx66.js","../chunks/D907np-5.js","../assets/2.BD53GLFY.css","../nodes/3.D22Sj2nj.js","../chunks/DmCsJHgl.js","../assets/Briefing.Dmn9LgiV.css","../assets/3.BZfqQRM0.css","../nodes/4.BFj07o33.js","../chunks/a5rSUn-N.js","../assets/stoneRegistry.bHiraU77.css","../assets/4.BIuIAgmk.css","../nodes/5.Bw01bLNz.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
var S=e=>{throw TypeError(e)};var M=(e,t,r)=>t.has(e)||S("Cannot "+r);var c=(e,t,r)=>(M(e,t,"read from private field"),r?r.call(e):t.get(e)),I=(e,t,r)=>t.has(e)?S("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),p=(e,t,r,n)=>(M(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{b as L,_ as b}from"../chunks/DZRTzx66.js";import{h as N,n as W,d as X,a3 as Z,q as $,v as tt,i as et,e as B,an as rt,j as at,a5 as A,am as st,o as l,ao as nt,ap as ot,L as it,p as ct,aq as ut,aa as dt,a6 as mt,ar as _t,f as x,s as lt,a as ft,a4 as j,c as ht,r as vt,t as gt,a9 as k}from"../chunks/R1l3q-hJ.js";import{h as yt,m as Et,u as bt,a as R,c as w,f as F,t as Rt,s as Pt}from"../chunks/CzfSRAFS.js";import{B as Ot,p as D,i as q}from"../chunks/C6-4B-da.js";function V(e,t,r){var n;N&&(n=at,W());var o=new Ot(e);X(()=>{var i=t()??null;if(N){var a=$(n),s=a===rt,_=i!==null;if(s!==_){var P=tt();et(P),o.anchor=P,B(!1),o.ensure(i,i&&(y=>r(y,i))),B(!0);return}}o.ensure(i,i&&(y=>r(y,i)))},Z)}function Tt(e){return class extends xt{constructor(t){super({component:e,...t})}}}var f,d;class xt{constructor(t){I(this,f);I(this,d);var i;var r=new Map,n=(a,s)=>{var _=it(s,!1,!1);return r.set(a,_),_};const o=new Proxy({...t.props||{},$$events:{}},{get(a,s){return l(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===st?!0:(l(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,_){return A(r.get(s)??n(s,_),_),Reflect.set(a,s,_)}});p(this,d,(t.hydrate?yt:Et)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((i=t==null?void 0:t.props)!=null&&i.$$host)||t.sync===!1)&&nt(),p(this,f,o.$$events);for(const a of Object.keys(c(this,d)))a==="$set"||a==="$destroy"||a==="$on"||ot(this,a,{get(){return c(this,d)[a]},set(s){c(this,d)[a]=s},enumerable:!0});c(this,d).$set=a=>{Object.assign(o,a)},c(this,d).$destroy=()=>{bt(c(this,d))}}$set(t){c(this,d).$set(t)}$on(t,r){c(this,f)[t]=c(this,f)[t]||[];const n=(...o)=>r.call(this,...o);return c(this,f)[t].push(n),()=>{c(this,f)[t]=c(this,f)[t].filter(o=>o!==n)}}$destroy(){c(this,d).$destroy()}}f=new WeakMap,d=new WeakMap;const Ct={};var At=F('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),It=F("<!> <!>",1);function pt(e,t){ct(t,!0);let r=D(t,"components",23,()=>[]),n=D(t,"data_0",3,null),o=D(t,"data_1",3,null);ut(()=>t.stores.page.set(t.page)),dt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),o(),t.stores.page.notify()});let i=j(!1),a=j(!1),s=j(null);mt(()=>{const u=t.stores.page.subscribe(()=>{l(i)&&(A(a,!0),_t().then(()=>{A(s,document.title||"untitled page",!0)}))});return A(i,!0),u});const _=k(()=>t.constructors[1]);var P=It(),y=x(P);{var G=u=>{const h=k(()=>t.constructors[0]);var v=w(),O=x(v);V(O,()=>l(h),(g,E)=>{L(E(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(m,jt)=>{var C=w(),K=x(C);V(K,()=>l(_),(Q,U)=>{L(U(Q,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),T=>r()[1]=T,()=>{var T;return(T=r())==null?void 0:T[1]})}),R(m,C)},$$slots:{default:!0}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),R(u,v)},H=u=>{const h=k(()=>t.constructors[0]);var v=w(),O=x(v);V(O,()=>l(h),(g,E)=>{L(E(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),R(u,v)};q(y,u=>{t.constructors[1]?u(G):u(H,-1)})}var z=lt(y,2);{var J=u=>{var h=At(),v=ht(h);{var O=g=>{var E=Rt();gt(()=>Pt(E,l(s))),R(g,E)};q(v,g=>{l(a)&&g(O)})}vt(h),R(u,h)};q(z,u=>{l(i)&&u(J)})}R(e,P),ft()}const St=Tt(pt),Mt=[()=>b(()=>import("../nodes/0.IL53jLg5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>b(()=>import("../nodes/1.4zkFLEZX.js"),__vite__mapDeps([10,1,2,5,6]),import.meta.url),()=>b(()=>import("../nodes/2.C4OcOHhN.js"),__vite__mapDeps([11,1,2,8,12,13,7,6,14,15,16]),import.meta.url),()=>b(()=>import("../nodes/3.D22Sj2nj.js"),__vite__mapDeps([17,1,2,4,13,12,5,6,18,3,7,19,20]),import.meta.url),()=>b(()=>import("../nodes/4.BFj07o33.js"),__vite__mapDeps([21,1,2,4,5,6,18,13,3,7,19,22,14,15,23,8,24]),import.meta.url),()=>b(()=>import("../nodes/5.Bw01bLNz.js"),__vite__mapDeps([25,1,2,18,4,13,3,7,19,22,14,15,23]),import.meta.url)],Nt=[],Bt={"/":[2],"/print/[queryId]":[3],"/q/sample":[5],"/q/[queryId]":[4]},Y={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Lt=Object.fromEntries(Object.entries(Y.transport).map(([e,t])=>[e,t.decode])),Ft=Object.fromEntries(Object.entries(Y.transport).map(([e,t])=>[e,t.encode])),Yt=!1,Gt=(e,t)=>Lt[e](t);export{Gt as decode,Lt as decoders,Bt as dictionary,Ft as encoders,Yt as hash,Y as hooks,Ct as matchers,Mt as nodes,St as root,Nt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{l as o,a as r}from"../chunks/D9Zf6nF7.js";export{o as load_css,r as start};
|
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{l as o,a as r}from"../chunks/DXzi87nJ.js";export{o as load_css,r as start};
|
|
|
|
|
|
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{c as E,a as l,s as C,f as u,d as W,b as O}from"../chunks/CzfSRAFS.js";import{p as D,f as q,o as s,a as I,a9 as v,s as t,c as i,r as p,t as P,aR as Y}from"../chunks/R1l3q-hJ.js";import{b as r,s as U}from"../chunks/Bu_bEyoS.js";import{i as x,p as z}from"../chunks/C6-4B-da.js";import{p as F}from"../chunks/
|
| 2 |
For residents, see <a href="https://www.floodhelpny.org">FloodHelpNY</a> Β· <a href="https://www.floodnet.nyc">FloodNet NYC</a>.</p> <p class="app-footer-build">All foundation models Apache-2.0 Β· All data from public-record federal, state, and city sources Β· No commercial APIs contacted at runtime Β· Riprap v0.4.5 οΏ½οΏ½ build 2026-05-05</p></div></footer>`);function oe(f){var n=ne();l(f,n)}var ie=u('<a href="#region-briefing" class="skip-link">Skip to briefing</a> <a href="#region-map" class="skip-link" style="left: -9999px;">Skip to map</a> <a href="#region-trace" class="skip-link" style="left: -9999px;">Skip to trace</a>',1);function pe(f){var n=ie();Y(4),l(f,n)}var le=u("<!> <!>",1),de=u('<!> <main class="svelte-12qhfyh"><!></main> <!>',1);function be(f,n){D(n,!0);let w=v(()=>()=>{const e=F.params.queryId;if(!e)return null;try{return decodeURIComponent(e)}catch{return e}}),M=v(()=>F.url.pathname.startsWith("/print/")),k=v(()=>F.url.pathname==="/"),_=v(()=>s(M)||s(k));var h=de(),S=q(h);{var N=e=>{var o=le(),g=q(o);pe(g);var R=t(g,2);{let T=v(()=>s(w)());se(R,{get query(){return s(T)},onResetCold:()=>window.location.href="/"})}l(e,o)};x(S,e=>{s(_)||e(N)})}var m=t(S,2),A=i(m);U(A,()=>n.children),p(m);var a=t(m,2);{var d=e=>{oe(e)};x(a,e=>{s(_)||e(d)})}l(f,h),I()}export{be as component,ge as universal};
|
|
|
|
| 1 |
+
import{c as E,a as l,s as C,f as u,d as W,b as O}from"../chunks/CzfSRAFS.js";import{p as D,f as q,o as s,a as I,a9 as v,s as t,c as i,r as p,t as P,aR as Y}from"../chunks/R1l3q-hJ.js";import{b as r,s as U}from"../chunks/Bu_bEyoS.js";import{i as x,p as z}from"../chunks/C6-4B-da.js";import{p as F}from"../chunks/DP_9AkkW.js";import{s as B}from"../chunks/a4L4UsYq.js";import"../chunks/B_9mIQpm.js";const G=!0,V=!0,J="never",ge=Object.freeze(Object.defineProperty({__proto__:null,prerender:G,ssr:V,trailingSlash:J},Symbol.toStringTag,{value:"Module"}));var K=u('<span class="status-sep svelte-1bjixce">Β·</span> <span class="status-step svelte-1bjixce"> </span>',1),Q=u('<span class="status-sep svelte-1bjixce">Β·</span> <span class="status-progress svelte-1bjixce"> </span>',1),X=u('<span class="status-sep svelte-1bjixce">Β·</span> <span class="status-err svelte-1bjixce"> </span>',1),Z=u('<span class="status svelte-1bjixce" aria-live="polite" aria-atomic="true"><span class="status-dot svelte-1bjixce" aria-hidden="true"></span> <span class="status-phase svelte-1bjixce"> </span> <!> <!> <!></span>');function ee(f,n){D(n,!0);const w={geocode:"geocoding",nta_resolve:"resolving NTA",sandy_inundation:"Sandy 2012",dep_stormwater:"DEP scenarios",floodnet:"FloodNet sensors",nyc311:"NYC 311 history",noaa_tides:"NOAA tides",nws_alerts:"NWS alerts",nws_obs:"NWS hourly obs",ttm_forecast:"TTM r2 surge (zero-shot)",ttm_311_forecast:"TTM r2 weekly 311",ttm_battery_surge:"TTM Battery (NYC fine-tune)",floodnet_forecast:"FloodNet recurrence forecast",ida_hwm_2021:"Ida 2021 HWMs",prithvi_eo_v2:"Ida 2021 polygons (baked lookup)",prithvi_eo_live:"Prithvi-NYC-Pluvial v2 segmentation",microtopo_lidar:"LiDAR microtopo",mta_entrance_exposure:"MTA entrances",nycha_development_exposure:"NYCHA developments",doe_school_exposure:"DOE schools",doh_hospital_exposure:"NYS DOH hospitals",terramind_synthesis:"TerraMind v1 synthesis",terramind_lulc:"TerraMind LULC",terramind_buildings:"TerraMind Buildings",eo_chip_fetch:"fetching S2/S1/DEM chip",rag_granite_embedding:"RAG retrieval",gliner_extract:"GLiNER typed extraction"};let M=v(()=>r.phase!=="idle"&&r.phase!=="done"),k=v(()=>{switch(r.phase){case"planning":return"planning intent";case"specialists":return"gathering evidence";case"reconciling":return"reconciling";case"streaming":return r.attempt>1?`writing (reroll ${r.attempt-1})`:"writing briefing";case"error":return"error";default:return""}}),_=v(()=>{const a=r.activeStep;return a?w[a]??a:null}),h=v(()=>{if(r.phase!=="specialists"&&r.phase!=="reconciling")return null;const a=r.firedCount,d=r.totalSpecialists;return d?`${a}/${d}`:a>0?`${a}`:null}),S=v(()=>r.phase==="error"?"err":"live");var N=E(),m=q(N);{var A=a=>{var d=Z(),e=t(i(d),2),o=i(e,!0);p(e);var g=t(e,2);{var R=c=>{var b=K(),y=t(q(b),2),j=i(y,!0);p(y),P(()=>C(j,s(_))),l(c,b)};x(g,c=>{s(_)&&c(R)})}var T=t(g,2);{var L=c=>{var b=Q(),y=t(q(b),2),j=i(y,!0);p(y),P(()=>C(j,s(h))),l(c,b)};x(T,c=>{s(h)&&c(L)})}var $=t(T,2);{var H=c=>{var b=X(),y=t(q(b),2),j=i(y,!0);p(y),P(()=>C(j,r.errorMessage)),l(c,b)};x($,c=>{r.phase==="error"&&r.errorMessage&&c(H)})}p(d),P(()=>{B(d,"data-kind",s(S)),C(o,s(k))}),l(a,d)};x(m,a=>{s(M)&&a(A)})}l(f,N),I()}var ae=u('<button type="button" class="app-header-query" aria-label="Edit query"><span class="app-header-query-icon" aria-hidden="true">β</span> <span class="app-header-query-text"> </span> <span class="app-header-query-edit">edit</span></button>'),re=u('<button type="button" class="app-header-link app-header-link-button svelte-f1belb" aria-label="Open curated PDF view of completed briefing in new tab">export PDF</button>'),te=u('<header class="app-header no-print" data-screen-label="App header"><div class="app-header-inner"><div class="app-header-left"><a href="/" class="riprap-wordmark" aria-label="Riprap β home">riprap</a> <span class="app-header-sep">/</span> <span class="app-header-context">flood-exposure briefing</span></div> <div class="app-header-mid"><!></div> <div class="app-header-right"><a class="app-header-link" href="#methodology">methodology</a> <!> <!></div></div></header>');function se(f,n){D(n,!0);let w=z(n,"query",3,null);function M(){if(typeof window>"u")return;const e=F.params.queryId??(F.url.pathname==="/q/sample"?"sample":"");e&&window.open(`/print/${encodeURIComponent(e)}`,"_blank","noopener")}var k=te(),_=i(k),h=t(i(_),2),S=i(h);{var N=e=>{var o=ae(),g=t(i(o),2),R=i(g,!0);p(g),Y(2),p(o),P(()=>C(R,w())),O("click",o,function(...T){var L;(L=n.onResetCold)==null||L.apply(this,T)}),l(e,o)};x(S,e=>{w()&&e(N)})}p(h);var m=t(h,2),A=t(i(m),2);{var a=e=>{var o=re();O("click",o,M),l(e,o)};x(A,e=>{r.ready&&e(a)})}var d=t(A,2);ee(d,{}),p(m),p(_),p(k),l(f,k),I()}W(["click"]);var ne=u(`<footer class="app-footer no-print"><div class="app-footer-inner"><p class="app-footer-guard"><strong>Riprap does not predict damage.</strong> This tool is for professional analytical work, not personal property decisions.
|
| 2 |
For residents, see <a href="https://www.floodhelpny.org">FloodHelpNY</a> Β· <a href="https://www.floodnet.nyc">FloodNet NYC</a>.</p> <p class="app-footer-build">All foundation models Apache-2.0 Β· All data from public-record federal, state, and city sources Β· No commercial APIs contacted at runtime Β· Riprap v0.4.5 οΏ½οΏ½ build 2026-05-05</p></div></footer>`);function oe(f){var n=ne();l(f,n)}var ie=u('<a href="#region-briefing" class="skip-link">Skip to briefing</a> <a href="#region-map" class="skip-link" style="left: -9999px;">Skip to map</a> <a href="#region-trace" class="skip-link" style="left: -9999px;">Skip to trace</a>',1);function pe(f){var n=ie();Y(4),l(f,n)}var le=u("<!> <!>",1),de=u('<!> <main class="svelte-12qhfyh"><!></main> <!>',1);function be(f,n){D(n,!0);let w=v(()=>()=>{const e=F.params.queryId;if(!e)return null;try{return decodeURIComponent(e)}catch{return e}}),M=v(()=>F.url.pathname.startsWith("/print/")),k=v(()=>F.url.pathname==="/"),_=v(()=>s(M)||s(k));var h=de(),S=q(h);{var N=e=>{var o=le(),g=q(o);pe(g);var R=t(g,2);{let T=v(()=>s(w)());se(R,{get query(){return s(T)},onResetCold:()=>window.location.href="/"})}l(e,o)};x(S,e=>{s(_)||e(N)})}var m=t(S,2),A=i(m);U(A,()=>n.children),p(m);var a=t(m,2);{var d=e=>{oe(e)};x(a,e=>{s(_)||e(d)})}l(f,h),I()}export{be as component,ge as universal};
|
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as c,f as u,s as e}from"../chunks/CzfSRAFS.js";import{p as v,f as l,t as _,a as g,c as p,r as o,s as x}from"../chunks/R1l3q-hJ.js";import{p as m}from"../chunks/
|
|
|
|
| 1 |
+
import{a as c,f as u,s as e}from"../chunks/CzfSRAFS.js";import{p as v,f as l,t as _,a as g,c as p,r as o,s as x}from"../chunks/R1l3q-hJ.js";import{p as m}from"../chunks/DP_9AkkW.js";var d=u("<h1> </h1> <p> </p>",1);function k(f,i){v(i,!0);var t=d(),r=l(t),h=p(r,!0);o(r);var a=x(r,2),n=p(a,!0);o(a),_(()=>{var s;e(h,m.status),e(n,(s=m.error)==null?void 0:s.message)}),c(f,t),g()}export{k as component};
|
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{a as m,f as w,d as Y,l as D,b as G,s as g}from"../chunks/CzfSRAFS.js";import"../chunks/B_9mIQpm.js";import{b9 as U,y as S,ar as K,$ as R,_ as V,h as Q,Y as Z,aq as J,aa as A,ba as z,bb as X,o as d,bc as ee,ak as ae,p as C,a5 as E,a as P,a4 as N,s as f,c,aR as M,r as o,t as T,a6 as se,Z as te,a8 as re}from"../chunks/R1l3q-hJ.js";import{h as ne}from"../chunks/L2xkwLPH.js";import{e as $}from"../chunks/CGe8VjDs.js";import{r as le,a as ie,s as oe,b as de}from"../chunks/a4L4UsYq.js";import{g as B}from"../chunks/
|
| 2 |
with Sandy high-water marks recorded <span class="land-preview-cite svelte-1anw2jf">4.7 ft above grade <sup class="svelte-1anw2jf">[c1]</sup></span>.
|
| 3 |
FloodNet FN-BK-018 has logged <span class="land-preview-cite svelte-1anw2jf">14 nuisance floods since 2023 <sup class="svelte-1anw2jf">[c2]</sup></span>.</p> <div class="land-preview-cites svelte-1anw2jf"><div class="land-preview-cite-row svelte-1anw2jf"><span class="land-preview-cite-pin svelte-1anw2jf">[c1]</span> <span class="land-preview-cite-src svelte-1anw2jf">USGS HWM Β· Sandy 2012</span> <span class="land-preview-cite-tier svelte-1anw2jf">empirical</span></div> <div class="land-preview-cite-row svelte-1anw2jf"><span class="land-preview-cite-pin svelte-1anw2jf">[c2]</span> <span class="land-preview-cite-src svelte-1anw2jf">FloodNet FN-BK-018</span> <span class="land-preview-cite-tier svelte-1anw2jf">empirical</span></div> <div class="land-preview-cite-row svelte-1anw2jf"><span class="land-preview-cite-pin svelte-1anw2jf">[c3]</span> <span class="land-preview-cite-src svelte-1anw2jf">FEMA NFHL Β· 36047C0207</span> <span class="land-preview-cite-tier svelte-1anw2jf">modeled</span></div></div></div> <div class="land-preview-pane land-preview-pane-cards svelte-1anw2jf"><div class="land-preview-eyebrow svelte-1anw2jf">Evidence cards</div> <div class="land-evcard-grid svelte-1anw2jf"><article class="land-evcard land-evcard-empirical svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">empirical</span> <span class="land-evcard-id svelte-1anw2jf">e1</span></header> <div class="land-evcard-claim svelte-1anw2jf">4.7 ft Sandy storm-surge HWM at address</div> <div class="land-evcard-source svelte-1anw2jf">USGS High-Water Mark database Β· 2012</div></article> <article class="land-evcard land-evcard-empirical svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">empirical</span> <span class="land-evcard-id svelte-1anw2jf">e2</span></header> <div class="land-evcard-claim svelte-1anw2jf">14 nuisance-flood events, 2023β2026</div> <div class="land-evcard-source svelte-1anw2jf">FloodNet FN-BK-018 Β· 2 blocks north</div></article> <article class="land-evcard land-evcard-modeled svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">modeled</span> <span class="land-evcard-id svelte-1anw2jf">e3</span></header> <div class="land-evcard-claim svelte-1anw2jf">FEMA 1% annual-chance (AE) flood zone</div> <div class="land-evcard-source svelte-1anw2jf">FEMA NFHL Β· panel 36047C0207</div></article> <article class="land-evcard land-evcard-modeled svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">modeled</span> <span class="land-evcard-id svelte-1anw2jf">e5</span></header> <div class="land-evcard-claim svelte-1anw2jf">+30 in MSL by 2070 (NPCC4 high)</div> <div class="land-evcard-source svelte-1anw2jf">NPCC4 SLR projection Β· 2024</div></article></div></div> <div class="land-preview-pane land-preview-pane-map svelte-1anw2jf"><div class="land-preview-eyebrow svelte-1anw2jf">Map</div> <!> <div class="land-preview-mapmeta svelte-1anw2jf">80 Pioneer St, Red Hook Β· z14.5 Β· Carto Positron</div></div></div></section>`);function Se(e){var s=_e(),r=f(c(s),2),t=f(c(r),4),a=f(c(t),2);be(a,{}),M(2),o(t),o(r),o(s),m(e,s)}var ke=w('<article class="land-stones-detail-cell svelte-1v6nt1t"><div class="land-stones-detail-num svelte-1v6nt1t"> </div> <h3 class="land-stones-detail-name svelte-1v6nt1t"> </h3> <div class="land-stones-detail-role svelte-1v6nt1t"> </div> <p class="land-stones-detail-tag svelte-1v6nt1t"> </p> <div class="land-stones-detail-sources svelte-1v6nt1t"> </div></article>'),Fe=w(`<section class="land-section-stones-detail svelte-1v6nt1t" id="methodology"><div class="land-page svelte-1v6nt1t"><div class="land-section-head svelte-1v6nt1t"><span class="section-label">How Riprap reads a place</span> <span class="land-section-meta svelte-1v6nt1t">Five Stones Β· one taxonomy Β· every briefing</span></div> <p class="land-stones-deck svelte-1v6nt1t">Each briefing routes through a fixed taxonomy of public-record specialists. Each Stone is a class of evidence.
|
| 4 |
Together they form the briefing, and every claim in the output traces back to the Stone that produced it.</p> <div class="land-stones-detail svelte-1v6nt1t"></div></div></section>`);function xe(e,s){C(s,!1);const r=[{name:"Cornerstone",role:"the hazard reader",tag:"what NYC's ground remembers",sources:"USGS HWMs Β· FEMA NFHL Β· DEP stormwater Β· Prithvi historical",tint:"var(--stone-cornerstone)"},{name:"Keystone",role:"the asset register",tag:"what's exposed",sources:"MTA Β· NYCHA Β· DOE Β· DOH Β· PLUTO",tint:"var(--stone-keystone)"},{name:"Touchstone",role:"the live observer",tag:"what's happening now",sources:"FloodNet sensors Β· 311 complaints Β· NWS Β· NOAA tide gauges",tint:"var(--stone-touchstone)"},{name:"Lodestone",role:"the projector",tag:"what's coming",sources:"NPCC4 Β· Granite TTM (zero-shot + NYC fine-tune) Β· NWS alerts",tint:"var(--stone-lodestone)"},{name:"Capstone",role:"the synthesizer",tag:"writes it all down",sources:"Granite 4.1 composer Β· Mellea grounding-check Β· WeasyPrint",tint:"var(--stone-capstone)"}];ue();var t=Fe(),a=c(t),n=f(c(a),4);$(n,7,()=>r,u=>u.name,(u,l,v)=>{var i=ke();let j;var y=c(i),p=c(y,!0);o(y);var b=f(y,2),k=c(b,!0);o(b);var h=f(b,2),F=c(h,!0);o(h);var _=f(h,2),O=c(_,!0);o(_);var q=f(_,2),W=c(q,!0);o(q),o(i),T(I=>{j=de(i,"",j,{"--stone-tint":d(l).tint}),g(p,I),g(k,d(l).name),g(F,d(l).role),g(O,d(l).tag),g(W,d(l).sources)},[()=>String(d(v)+1).padStart(2,"0")]),m(u,i)}),o(n),o(a),o(t),m(e,t),P()}var Le=w('<footer class="land-footer svelte-1dcj612"><span class="land-footer-tiers svelte-1dcj612"><span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-emp svelte-1dcj612"></span>empirical</span> <span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-mod svelte-1dcj612"></span>modeled</span> <span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-prx svelte-1dcj612"></span>proxy</span> <span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-syn svelte-1dcj612"></span>synthetic</span></span> <span class="land-footer-build">Riprap v0.4.5 Β· NYC OpenData Β· FEMA NFHL Β· USGS Β· NPCC4</span></footer>');function Ae(e){var s=Le();m(e,s)}var Ee=w('<meta name="description" content="A citation-grounded flood-exposure briefing tool for any address, neighborhood, or BBL in New York City."/>'),Ne=w('<div class="land svelte-1uha8ag"><!> <div class="land-page svelte-1uha8ag"><!> <!></div> <!> <!></div>');function $e(e){var s=Ne();ne("1uha8ag",v=>{var i=Ee();te(()=>{re.title="Riprap β Flood Exposure Briefing for NYC"}),m(v,i)});var r=c(s);we(r);var t=f(r,2),a=c(t);ge(a,{});var n=f(a,2);Se(n),o(t);var u=f(t,2);xe(u,{});var l=f(u,2);Ae(l),o(s),m(e,s)}export{$e as component};
|
|
|
|
| 1 |
+
import{a as m,f as w,d as Y,l as D,b as G,s as g}from"../chunks/CzfSRAFS.js";import"../chunks/B_9mIQpm.js";import{b9 as U,y as S,ar as K,$ as R,_ as V,h as Q,Y as Z,aq as J,aa as A,ba as z,bb as X,o as d,bc as ee,ak as ae,p as C,a5 as E,a as P,a4 as N,s as f,c,aR as M,r as o,t as T,a6 as se,Z as te,a8 as re}from"../chunks/R1l3q-hJ.js";import{h as ne}from"../chunks/L2xkwLPH.js";import{e as $}from"../chunks/CGe8VjDs.js";import{r as le,a as ie,s as oe,b as de}from"../chunks/a4L4UsYq.js";import{g as B}from"../chunks/D9Zf6nF7.js";import{b as ce,_ as ve}from"../chunks/DZRTzx66.js";import{P as pe}from"../chunks/D907np-5.js";function fe(e,s,r=s){var t=new WeakSet;U(e,"input",async a=>{var n=a?e.defaultValue:e.value;if(n=x(e)?L(n):n,r(n),S!==null&&t.add(S),await K(),n!==(n=s())){var u=e.selectionStart,l=e.selectionEnd,v=e.value.length;if(e.value=n??"",l!==null){var i=e.value.length;u===l&&l===v&&i>v?(e.selectionStart=i,e.selectionEnd=i):(e.selectionStart=u,e.selectionEnd=Math.min(l,i))}}}),(Q&&e.defaultValue!==e.value||R(s)==null&&e.value)&&(r(x(e)?L(e.value):e.value),S!==null&&t.add(S)),V(()=>{var a=s();if(e===document.activeElement){var n=S;if(t.has(n))return}x(e)&&a===L(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function x(e){var s=e.type;return s==="number"||s==="range"}function L(e){return e===""?null:+e}function ue(e=!1){const s=Z,r=s.l.u;if(!r)return;let t=()=>ee(s.s);if(e){let a=0,n={};const u=ae(()=>{let l=!1;const v=s.s;for(const i in v)v[i]!==n[i]&&(n[i]=v[i],l=!0);return l&&a++,a});t=()=>d(u)}r.b.length&&J(()=>{H(s,t),z(r.b)}),A(()=>{const a=R(()=>r.m.map(X));return()=>{for(const n of a)typeof n=="function"&&n()}}),r.a.length&&A(()=>{H(s,t),z(r.a)})}function H(e,s){if(e.l.s)for(const r of e.l.s)d(r);s()}var me=w('<header class="land-header svelte-1ct2rgk"><span class="riprap-wordmark">riprap</span> <span class="land-header-sep svelte-1ct2rgk">/</span> <span class="land-header-context svelte-1ct2rgk">Flood Exposure Briefing Β· NYC</span> <nav class="land-header-nav svelte-1ct2rgk"><a href="#methodology" class="svelte-1ct2rgk">Methodology</a> <a href="#sources" class="svelte-1ct2rgk">Sources</a></nav></header>');function we(e){var s=me();m(e,s)}var he=w("<span> </span>"),ye=w('<main class="land-hero svelte-drzq4r"><h1 class="land-hero-h1 svelte-drzq4r"><span class="land-hero-headline svelte-drzq4r">A flood exposure briefing<br/> for <em class="svelte-drzq4r">any place</em> in New York City.</span> <span class="land-hero-deck svelte-drzq4r">Type an address. Get a written briefing where every numeric claim links to its primary public-record source.</span></h1> <form class="land-query svelte-drzq4r" role="search"><span class="land-query-prompt svelte-drzq4r" aria-hidden="true">βΊ</span> <input type="text" placeholder="Address, neighborhood, or BBL. e.g. 80 Pioneer Street, Red Hook" class="land-query-input svelte-drzq4r" aria-label="Query an address, neighborhood, or BBL"/> <button type="submit" class="land-query-submit svelte-drzq4r">Brief this place β</button></form> <div class="land-cycling svelte-drzq4r" aria-live="polite"><span class="land-cycling-label svelte-drzq4r">Try:</span> <button type="button" class="land-cycling-rail svelte-drzq4r" title="Run this example"></button></div></main>');function ge(e,s){C(s,!0);const r=["80 Pioneer Street, Red Hook","Coney Island Hospital","PS 188, Lower East Side","Hammels Houses, Rockaway","Bowling Green station","555 W 57th Street"];let t=N(""),a=N(0);A(()=>{if(typeof window>"u")return;const p=setInterval(()=>{E(a,(d(a)+1)%r.length)},2200);return()=>clearInterval(p)});function n(){const p=d(t).trim();p&&B(`/q/${encodeURIComponent(p)}`)}function u(){const p=r[d(a)];B(`/q/${encodeURIComponent(p)}`)}var l=ye(),v=f(c(l),2),i=f(c(v),2);le(i),M(2),o(v);var j=f(v,2),y=f(c(j),2);$(y,22,()=>r,p=>p,(p,b,k)=>{var h=he();let F;var _=c(h,!0);o(h),T(()=>{F=ie(h,1,"land-cycling-item svelte-drzq4r",null,F,{"is-active":d(k)===d(a)}),oe(h,"aria-hidden",d(k)!==d(a)),g(_,b)}),m(p,h)}),o(y),o(j),o(l),D("submit",v,p=>{p.preventDefault(),n()}),fe(i,()=>d(t),p=>E(t,p)),G("click",y,u),m(e,l),P()}Y(["click"]);var je=w('<div class="land-mapmini svelte-1g1r73s" role="img" aria-label="Live mini-map preview of Red Hook flood exposure layers"><div class="land-mapmini-canvas svelte-1g1r73s"></div> <div class="land-mapmini-legend svelte-1g1r73s"><span class="svelte-1g1r73s"><span class="lm-sw lm-sw-emp svelte-1g1r73s"></span>empirical</span> <span class="svelte-1g1r73s"><span class="lm-sw lm-sw-mod svelte-1g1r73s"></span>modeled</span> <span class="svelte-1g1r73s"><span class="lm-sw lm-sw-prx svelte-1g1r73s"></span>proxy</span></div></div>');function be(e,s){C(s,!0);const r=[-74.0096,40.6776];let t=N(null),a=null;se(()=>{let l=!1;return(async()=>{if(!d(t)||l)return;const v=await ve(()=>import("../chunks/D4L2lGt1.js").then(i=>i.m),[],import.meta.url);l||!d(t)||(a=new v.Map({container:d(t),style:pe,center:r,zoom:14.5,interactive:!1,attributionControl:!1}),a.on("load",()=>{a&&(a.addSource("fema-ae",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[-74.014,40.679],[-74.007,40.68],[-74.005,40.677],[-74.009,40.6755],[-74.014,40.679]]]}}]}}),a.addLayer({id:"fema-ae-fill",type:"fill",source:"fema-ae",paint:{"fill-color":"#2A6FA8","fill-opacity":.22}}),a.addLayer({id:"fema-ae-line",type:"line",source:"fema-ae",paint:{"line-color":"#2A6FA8","line-width":1,"line-dasharray":[3,2]}}),a.addSource("hwm-contour",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[[-74.0125,40.679],[-74.0105,40.6792],[-74.008,40.679],[-74.006,40.6786]]}}}),a.addLayer({id:"hwm-contour-line",type:"line",source:"hwm-contour",paint:{"line-color":"#0B5394","line-width":1.4}}),a.addSource("proxy-311",{type:"geojson",data:{type:"FeatureCollection",features:[[-74.0118,40.677],[-74.0114,40.6767],[-74.0121,40.6772]].map(i=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}}))}}),a.addLayer({id:"proxy-311-circle",type:"circle",source:"proxy-311",paint:{"circle-radius":3,"circle-color":"transparent","circle-stroke-color":"#6B6B6B","circle-stroke-width":1}}),a.addSource("floodnet",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[-74.0103,40.6788]}}}),a.addLayer({id:"floodnet-pin",type:"circle",source:"floodnet",paint:{"circle-radius":4,"circle-color":"#0B5394","circle-stroke-color":"#FFFFFF","circle-stroke-width":1}}),a.addSource("addr",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Point",coordinates:r}}}),a.addLayer({id:"addr-ring",type:"circle",source:"addr",paint:{"circle-radius":9,"circle-color":"transparent","circle-stroke-color":"#1A1A1A","circle-stroke-width":1.4}}),a.addLayer({id:"addr-dot",type:"circle",source:"addr",paint:{"circle-radius":3,"circle-color":"#1A1A1A"}}))}))})(),()=>{l=!0,a&&(a.remove(),a=null)}});var n=je(),u=c(n);ce(u,l=>E(t,l),()=>d(t)),M(2),o(n),m(e,n),P()}var _e=w(`<section class="land-section svelte-1anw2jf"><div class="land-section-head svelte-1anw2jf"><span class="section-label">What you'll get back</span> <span class="land-section-meta svelte-1anw2jf">A grounded paragraph with citations, not a chatbot answer.</span></div> <div class="land-preview-grid svelte-1anw2jf"><div class="land-preview-pane land-preview-pane-excerpt svelte-1anw2jf"><div class="land-preview-eyebrow svelte-1anw2jf">Briefing excerpt</div> <p class="land-preview-body svelte-1anw2jf">The lot sits inside the FEMA <span class="land-preview-cite svelte-1anw2jf">1% AE flood zone <sup class="svelte-1anw2jf">[c3]</sup></span>,
|
| 2 |
with Sandy high-water marks recorded <span class="land-preview-cite svelte-1anw2jf">4.7 ft above grade <sup class="svelte-1anw2jf">[c1]</sup></span>.
|
| 3 |
FloodNet FN-BK-018 has logged <span class="land-preview-cite svelte-1anw2jf">14 nuisance floods since 2023 <sup class="svelte-1anw2jf">[c2]</sup></span>.</p> <div class="land-preview-cites svelte-1anw2jf"><div class="land-preview-cite-row svelte-1anw2jf"><span class="land-preview-cite-pin svelte-1anw2jf">[c1]</span> <span class="land-preview-cite-src svelte-1anw2jf">USGS HWM Β· Sandy 2012</span> <span class="land-preview-cite-tier svelte-1anw2jf">empirical</span></div> <div class="land-preview-cite-row svelte-1anw2jf"><span class="land-preview-cite-pin svelte-1anw2jf">[c2]</span> <span class="land-preview-cite-src svelte-1anw2jf">FloodNet FN-BK-018</span> <span class="land-preview-cite-tier svelte-1anw2jf">empirical</span></div> <div class="land-preview-cite-row svelte-1anw2jf"><span class="land-preview-cite-pin svelte-1anw2jf">[c3]</span> <span class="land-preview-cite-src svelte-1anw2jf">FEMA NFHL Β· 36047C0207</span> <span class="land-preview-cite-tier svelte-1anw2jf">modeled</span></div></div></div> <div class="land-preview-pane land-preview-pane-cards svelte-1anw2jf"><div class="land-preview-eyebrow svelte-1anw2jf">Evidence cards</div> <div class="land-evcard-grid svelte-1anw2jf"><article class="land-evcard land-evcard-empirical svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">empirical</span> <span class="land-evcard-id svelte-1anw2jf">e1</span></header> <div class="land-evcard-claim svelte-1anw2jf">4.7 ft Sandy storm-surge HWM at address</div> <div class="land-evcard-source svelte-1anw2jf">USGS High-Water Mark database Β· 2012</div></article> <article class="land-evcard land-evcard-empirical svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">empirical</span> <span class="land-evcard-id svelte-1anw2jf">e2</span></header> <div class="land-evcard-claim svelte-1anw2jf">14 nuisance-flood events, 2023β2026</div> <div class="land-evcard-source svelte-1anw2jf">FloodNet FN-BK-018 Β· 2 blocks north</div></article> <article class="land-evcard land-evcard-modeled svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">modeled</span> <span class="land-evcard-id svelte-1anw2jf">e3</span></header> <div class="land-evcard-claim svelte-1anw2jf">FEMA 1% annual-chance (AE) flood zone</div> <div class="land-evcard-source svelte-1anw2jf">FEMA NFHL Β· panel 36047C0207</div></article> <article class="land-evcard land-evcard-modeled svelte-1anw2jf"><header class="land-evcard-head svelte-1anw2jf"><span class="land-evcard-tier svelte-1anw2jf">modeled</span> <span class="land-evcard-id svelte-1anw2jf">e5</span></header> <div class="land-evcard-claim svelte-1anw2jf">+30 in MSL by 2070 (NPCC4 high)</div> <div class="land-evcard-source svelte-1anw2jf">NPCC4 SLR projection Β· 2024</div></article></div></div> <div class="land-preview-pane land-preview-pane-map svelte-1anw2jf"><div class="land-preview-eyebrow svelte-1anw2jf">Map</div> <!> <div class="land-preview-mapmeta svelte-1anw2jf">80 Pioneer St, Red Hook Β· z14.5 Β· Carto Positron</div></div></div></section>`);function Se(e){var s=_e(),r=f(c(s),2),t=f(c(r),4),a=f(c(t),2);be(a,{}),M(2),o(t),o(r),o(s),m(e,s)}var ke=w('<article class="land-stones-detail-cell svelte-1v6nt1t"><div class="land-stones-detail-num svelte-1v6nt1t"> </div> <h3 class="land-stones-detail-name svelte-1v6nt1t"> </h3> <div class="land-stones-detail-role svelte-1v6nt1t"> </div> <p class="land-stones-detail-tag svelte-1v6nt1t"> </p> <div class="land-stones-detail-sources svelte-1v6nt1t"> </div></article>'),Fe=w(`<section class="land-section-stones-detail svelte-1v6nt1t" id="methodology"><div class="land-page svelte-1v6nt1t"><div class="land-section-head svelte-1v6nt1t"><span class="section-label">How Riprap reads a place</span> <span class="land-section-meta svelte-1v6nt1t">Five Stones Β· one taxonomy Β· every briefing</span></div> <p class="land-stones-deck svelte-1v6nt1t">Each briefing routes through a fixed taxonomy of public-record specialists. Each Stone is a class of evidence.
|
| 4 |
Together they form the briefing, and every claim in the output traces back to the Stone that produced it.</p> <div class="land-stones-detail svelte-1v6nt1t"></div></div></section>`);function xe(e,s){C(s,!1);const r=[{name:"Cornerstone",role:"the hazard reader",tag:"what NYC's ground remembers",sources:"USGS HWMs Β· FEMA NFHL Β· DEP stormwater Β· Prithvi historical",tint:"var(--stone-cornerstone)"},{name:"Keystone",role:"the asset register",tag:"what's exposed",sources:"MTA Β· NYCHA Β· DOE Β· DOH Β· PLUTO",tint:"var(--stone-keystone)"},{name:"Touchstone",role:"the live observer",tag:"what's happening now",sources:"FloodNet sensors Β· 311 complaints Β· NWS Β· NOAA tide gauges",tint:"var(--stone-touchstone)"},{name:"Lodestone",role:"the projector",tag:"what's coming",sources:"NPCC4 Β· Granite TTM (zero-shot + NYC fine-tune) Β· NWS alerts",tint:"var(--stone-lodestone)"},{name:"Capstone",role:"the synthesizer",tag:"writes it all down",sources:"Granite 4.1 composer Β· Mellea grounding-check Β· WeasyPrint",tint:"var(--stone-capstone)"}];ue();var t=Fe(),a=c(t),n=f(c(a),4);$(n,7,()=>r,u=>u.name,(u,l,v)=>{var i=ke();let j;var y=c(i),p=c(y,!0);o(y);var b=f(y,2),k=c(b,!0);o(b);var h=f(b,2),F=c(h,!0);o(h);var _=f(h,2),O=c(_,!0);o(_);var q=f(_,2),W=c(q,!0);o(q),o(i),T(I=>{j=de(i,"",j,{"--stone-tint":d(l).tint}),g(p,I),g(k,d(l).name),g(F,d(l).role),g(O,d(l).tag),g(W,d(l).sources)},[()=>String(d(v)+1).padStart(2,"0")]),m(u,i)}),o(n),o(a),o(t),m(e,t),P()}var Le=w('<footer class="land-footer svelte-1dcj612"><span class="land-footer-tiers svelte-1dcj612"><span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-emp svelte-1dcj612"></span>empirical</span> <span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-mod svelte-1dcj612"></span>modeled</span> <span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-prx svelte-1dcj612"></span>proxy</span> <span class="land-footer-tier svelte-1dcj612"><span class="lm-sw lm-sw-syn svelte-1dcj612"></span>synthetic</span></span> <span class="land-footer-build">Riprap v0.4.5 Β· NYC OpenData Β· FEMA NFHL Β· USGS Β· NPCC4</span></footer>');function Ae(e){var s=Le();m(e,s)}var Ee=w('<meta name="description" content="A citation-grounded flood-exposure briefing tool for any address, neighborhood, or BBL in New York City."/>'),Ne=w('<div class="land svelte-1uha8ag"><!> <div class="land-page svelte-1uha8ag"><!> <!></div> <!> <!></div>');function $e(e){var s=Ne();ne("1uha8ag",v=>{var i=Ee();te(()=>{re.title="Riprap β Flood Exposure Briefing for NYC"}),m(v,i)});var r=c(s);we(r);var t=f(r,2),a=c(t);ge(a,{});var n=f(a,2);Se(n),o(t);var u=f(t,2);xe(u,{});var l=f(u,2);Ae(l),o(s),m(e,s)}export{$e as component};
|
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as ge,c as he,a as v,s as l,b as xe,f as p}from"../chunks/CzfSRAFS.js";import{p as ye,a6 as we,f as $e,a as ke,a7 as qe,o as e,a5 as F,a8 as Se,a9 as d,a4 as I,c as a,s,r as t,t as M}from"../chunks/R1l3q-hJ.js";import{i as O}from"../chunks/C6-4B-da.js";import{e as je}from"../chunks/CGe8VjDs.js";import{h as Fe}from"../chunks/L2xkwLPH.js";import{p as Ie}from"../chunks/
|
| 2 |
use <strong>export PDF</strong> from the header to open this view.
|
| 3 |
Snapshots are stored per-browser and persist between runs of the same query.</p></div>`),Be=p('<div class="curl svelte-uialbm"> </div>'),De=p('<li class="svelte-uialbm"><span class="cn svelte-uialbm"> </span> <span class="cglyph svelte-uialbm"><!></span> <span class="csrc svelte-uialbm"> </span> <span class="cvint svelte-uialbm"> </span> <div class="ctitle svelte-uialbm"> </div> <!> <div class="cdocid svelte-uialbm">doc_id <code> </code></div></li>'),Ge=p('<section class="print-citations svelte-uialbm"><h2 class="svelte-uialbm">Citations</h2> <ol class="svelte-uialbm"></ol></section>'),ze=p('<article class="print-doc svelte-uialbm"><header class="print-head svelte-uialbm"><div class="print-head-top svelte-uialbm"><span class="wordmark svelte-uialbm">riprap</span> <span class="meta"> </span></div> <h1 class="print-title svelte-uialbm"> </h1> <div class="print-sub svelte-uialbm">intent <strong> </strong> </div></header> <div class="print-controls no-print svelte-uialbm"><button type="button" class="svelte-uialbm">print / save as PDF</button> <span class="hint svelte-uialbm"> </span></div> <!> <!> <footer class="print-foot svelte-uialbm"> </footer></article>'),Le=p('<div class="empty svelte-uialbm"><p>Loadingβ¦</p></div>');function Ve(Q,U){ye(U,!0);let V=d(()=>Ie.params.queryId??""),i=I(null),T=I(!1),P=I(!1);we(()=>{const r=Te(e(V));if(!r){F(T,!0);return}F(i,r,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{typeof window<"u"&&(window.print(),F(P,!0))})})});function X(){typeof window<"u"&&window.print()}let R=d(()=>e(i)?Object.values(e(i).citations).sort((r,n)=>r.n-n.n):[]),A=d(()=>e(i)?new Date(e(i).generatedAt).toISOString().slice(0,10):"");var B=he();Fe("uialbm",r=>{qe(()=>{var n;Se.title=`Riprap briefing β ${((n=e(i))==null?void 0:n.queryText)??"export"??""}`})});var Y=$e(B);{var Z=r=>{var n=Ae();v(r,n)},ee=r=>{var n=ze(),c=a(n),u=a(c),D=s(a(u),2),ae=a(D);t(D),t(u);var m=s(u,2),se=a(m,!0);t(m);var G=s(m,2),f=s(a(G)),re=a(f,!0);t(f);var ie=s(f);t(G),t(c);var b=s(c,2),z=a(b),L=s(z,2),ne=a(L,!0);t(L),t(b);var N=s(b,2);Me(N,{get blocks(){return e(i).blocks},get citations(){return e(i).citations},streaming:!1});var C=s(N,2);{var le=_=>{var g=Ge(),W=s(a(g),2);je(W,21,()=>e(R),h=>h.id,(h,o)=>{var x=De(),y=a(x),ve=a(y);t(y);var w=s(y,2),pe=a(w);Oe(pe,{get tier(){return e(o).tier},size:9,get color(){return`var(--tier-${e(o).tier??""})`}}),t(w);var $=s(w,2),de=a($,!0);t($);var k=s($,2),ce=a(k);t(k);var q=s(k,2),ue=a(q,!0);t(q);var H=s(q,2);{var me=S=>{var j=Be(),_e=a(j,!0);t(j),M(()=>l(_e,e(o).url)),v(S,j)},fe=d(()=>e(o).url&&e(o).url.startsWith("http"));O(H,S=>{e(fe)&&S(me)})}var J=s(H,2),K=s(a(J)),be=a(K,!0);t(K),t(J),t(x),M(()=>{l(ve,`[${e(o).n??""}]`),l(de,e(o).source),l(ce,`v. ${e(o).vintage??""}`),l(ue,e(o).title),l(be,e(o).docId)}),v(h,x)}),t(W),t(g),v(_,g)};O(C,_=>{e(R).length&&_(le)})}var E=s(C,2),oe=a(E);t(E),t(n),M(()=>{l(ae,`flood-exposure briefing Β· v0.4.2 Β· ${e(A)??""}`),l(se,e(i).queryText),l(re,e(i).intent??"briefing"),l(ie,` Β· ${e(i).specialists??""} specialists
|
| 4 |
Β· ${e(i).attempts??1??""} reconcile${(e(i).attempts??1)===1?"":"s"}
|
|
|
|
| 1 |
+
import{d as ge,c as he,a as v,s as l,b as xe,f as p}from"../chunks/CzfSRAFS.js";import{p as ye,a6 as we,f as $e,a as ke,a7 as qe,o as e,a5 as F,a8 as Se,a9 as d,a4 as I,c as a,s,r as t,t as M}from"../chunks/R1l3q-hJ.js";import{i as O}from"../chunks/C6-4B-da.js";import{e as je}from"../chunks/CGe8VjDs.js";import{h as Fe}from"../chunks/L2xkwLPH.js";import{p as Ie}from"../chunks/DP_9AkkW.js";import{B as Me,T as Oe}from"../chunks/DmCsJHgl.js";import{l as Te}from"../chunks/Bu_bEyoS.js";const Pe=!1,Re=!1,Ue=Object.freeze(Object.defineProperty({__proto__:null,prerender:Pe,ssr:Re},Symbol.toStringTag,{value:"Module"}));var Ae=p(`<div class="empty svelte-uialbm"><h1 class="svelte-uialbm">No briefing snapshot found</h1> <p>Run a briefing first at <a href="/" class="svelte-uialbm">riprap home</a>; once it finishes,
|
| 2 |
use <strong>export PDF</strong> from the header to open this view.
|
| 3 |
Snapshots are stored per-browser and persist between runs of the same query.</p></div>`),Be=p('<div class="curl svelte-uialbm"> </div>'),De=p('<li class="svelte-uialbm"><span class="cn svelte-uialbm"> </span> <span class="cglyph svelte-uialbm"><!></span> <span class="csrc svelte-uialbm"> </span> <span class="cvint svelte-uialbm"> </span> <div class="ctitle svelte-uialbm"> </div> <!> <div class="cdocid svelte-uialbm">doc_id <code> </code></div></li>'),Ge=p('<section class="print-citations svelte-uialbm"><h2 class="svelte-uialbm">Citations</h2> <ol class="svelte-uialbm"></ol></section>'),ze=p('<article class="print-doc svelte-uialbm"><header class="print-head svelte-uialbm"><div class="print-head-top svelte-uialbm"><span class="wordmark svelte-uialbm">riprap</span> <span class="meta"> </span></div> <h1 class="print-title svelte-uialbm"> </h1> <div class="print-sub svelte-uialbm">intent <strong> </strong> </div></header> <div class="print-controls no-print svelte-uialbm"><button type="button" class="svelte-uialbm">print / save as PDF</button> <span class="hint svelte-uialbm"> </span></div> <!> <!> <footer class="print-foot svelte-uialbm"> </footer></article>'),Le=p('<div class="empty svelte-uialbm"><p>Loadingβ¦</p></div>');function Ve(Q,U){ye(U,!0);let V=d(()=>Ie.params.queryId??""),i=I(null),T=I(!1),P=I(!1);we(()=>{const r=Te(e(V));if(!r){F(T,!0);return}F(i,r,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{typeof window<"u"&&(window.print(),F(P,!0))})})});function X(){typeof window<"u"&&window.print()}let R=d(()=>e(i)?Object.values(e(i).citations).sort((r,n)=>r.n-n.n):[]),A=d(()=>e(i)?new Date(e(i).generatedAt).toISOString().slice(0,10):"");var B=he();Fe("uialbm",r=>{qe(()=>{var n;Se.title=`Riprap briefing β ${((n=e(i))==null?void 0:n.queryText)??"export"??""}`})});var Y=$e(B);{var Z=r=>{var n=Ae();v(r,n)},ee=r=>{var n=ze(),c=a(n),u=a(c),D=s(a(u),2),ae=a(D);t(D),t(u);var m=s(u,2),se=a(m,!0);t(m);var G=s(m,2),f=s(a(G)),re=a(f,!0);t(f);var ie=s(f);t(G),t(c);var b=s(c,2),z=a(b),L=s(z,2),ne=a(L,!0);t(L),t(b);var N=s(b,2);Me(N,{get blocks(){return e(i).blocks},get citations(){return e(i).citations},streaming:!1});var C=s(N,2);{var le=_=>{var g=Ge(),W=s(a(g),2);je(W,21,()=>e(R),h=>h.id,(h,o)=>{var x=De(),y=a(x),ve=a(y);t(y);var w=s(y,2),pe=a(w);Oe(pe,{get tier(){return e(o).tier},size:9,get color(){return`var(--tier-${e(o).tier??""})`}}),t(w);var $=s(w,2),de=a($,!0);t($);var k=s($,2),ce=a(k);t(k);var q=s(k,2),ue=a(q,!0);t(q);var H=s(q,2);{var me=S=>{var j=Be(),_e=a(j,!0);t(j),M(()=>l(_e,e(o).url)),v(S,j)},fe=d(()=>e(o).url&&e(o).url.startsWith("http"));O(H,S=>{e(fe)&&S(me)})}var J=s(H,2),K=s(a(J)),be=a(K,!0);t(K),t(J),t(x),M(()=>{l(ve,`[${e(o).n??""}]`),l(de,e(o).source),l(ce,`v. ${e(o).vintage??""}`),l(ue,e(o).title),l(be,e(o).docId)}),v(h,x)}),t(W),t(g),v(_,g)};O(C,_=>{e(R).length&&_(le)})}var E=s(C,2),oe=a(E);t(E),t(n),M(()=>{l(ae,`flood-exposure briefing Β· v0.4.2 Β· ${e(A)??""}`),l(se,e(i).queryText),l(re,e(i).intent??"briefing"),l(ie,` Β· ${e(i).specialists??""} specialists
|
| 4 |
Β· ${e(i).attempts??1??""} reconcile${(e(i).attempts??1)===1?"":"s"}
|
|
@@ -1 +1 @@
|
|
| 1 |
-
import{d as De,s as Y,a as q,f as L,c as Ft,b as Et,t as Lt}from"../chunks/CzfSRAFS.js";import{c as w,s as $,r as y,aR as Re,t as Z,o as a,f as be,a9 as re,p as Pt,a4 as N,ab as ne,aa as Oe,a5 as v,a6 as jt,a as Ot}from"../chunks/R1l3q-hJ.js";import{p as Qe,i as W}from"../chunks/C6-4B-da.js";import{p as zt}from"../chunks/BHheE8H_.js";import{T as ot,t as lt,a as Dt,B as Rt}from"../chunks/DmCsJHgl.js";import{f as Yt,C as Bt,F as Ht,R as Ut,M as Gt}from"../chunks/a5rSUn-N.js";import"../chunks/B_9mIQpm.js";import{e as ct,i as Wt}from"../chunks/CGe8VjDs.js";import{b as oe,a as ze,s as Kt}from"../chunks/a4L4UsYq.js";import{b as z,p as Vt}from"../chunks/Bu_bEyoS.js";const Zt=!1,Jt=!1,mr=Object.freeze(Object.defineProperty({__proto__:null,prerender:Zt,ssr:Jt},Symbol.toStringTag,{value:"Module"}));De(["click"]);De(["click"]);var Xt=L('<div class="skeleton-section"><div class="skeleton-head"><span class="skeleton-num"> </span> <span class="skeleton-label"> </span> <span class="skeleton-spinner" aria-hidden="true">β</span></div> <span class="skeleton-pulse"></span> <span class="skeleton-pulse"></span> <span class="skeleton-pulse"></span></div>'),Qt=L('<div class="skeleton-brief" role="status" aria-live="polite" aria-label="Loading briefing β geocode complete, dispatching specialists"><div class="skeleton-status"><span class="skeleton-pulse"></span> <span class="skeleton-pulse skeleton-pulse-meta"></span></div> <!></div>');function en(n){const e=[{n:"01",label:"Status"},{n:"02",label:"Empirical evidence"},{n:"03",label:"Modeled scenarios"},{n:"04",label:"Policy context"}];var t=Qt(),r=w(t),s=w(r);oe(s,"",{},{width:"62%"});var d=$(s,2);oe(d,"",{},{width:"40%"}),y(r);var o=$(r,2);ct(o,1,()=>e,p=>p.n,(p,f)=>{var l=Xt(),c=w(l),h=w(c),P=w(h,!0);y(h);var B=$(h,2),j=w(B,!0);y(B),Re(2),y(c);var K=$(c,2);oe(K,"",{},{width:"92%"});var F=$(K,2);oe(F,"",{},{width:"78%"});var R=$(F,2);oe(R,"",{},{width:"85%"}),y(l),Z(()=>{Y(P,a(f).n),Y(j,a(f).label)}),q(p,l)}),y(t),q(n,t)}var tn=L('<div class="reroll-banner" role="status" aria-live="polite"><!> <div class="reroll-body"><span class="reroll-head">Regenerating to satisfy citation grounding</span> <span class="reroll-sub"> </span></div> <span class="reroll-spinner" aria-hidden="true">β»</span></div>');function nn(n,e){let t=Qe(e,"attempt",3,2),r=Qe(e,"max",3,3);var s=tn(),d=w(s);ot(d,{tier:"modeled",size:11,color:"var(--tier-modeled)"});var o=$(d,2),p=$(w(o),2),f=w(p);y(p),y(o),Re(2),y(s),Z(()=>Y(f,`Mellea reconciler Β· attempt ${t()??""} of ${r()??""} Β· previous draft dimmed below`)),q(n,s)}var rn=L("<a> </a>"),an=L('<button type="button"> </button>'),sn=L('<article role="alert" aria-live="assertive"><header class="error-card-head"><!> <span class="error-card-eyebrow"> </span></header> <h3 class="error-card-headline"> </h3> <p class="error-card-body"> </p> <div class="error-card-actions"></div> <footer class="error-card-foot"><span class="section-label">Trust signals Β· still on</span> <span class="error-card-foot-copy">All foundation models Apache-2.0 Β· No commercial APIs at runtime</span></footer></article>');function on(n,e){const t={geocoder:{eyebrow:"Address not resolved",headline:"We couldn't resolve that to a NYC address.",body:`Try a more specific street address β for example, "80 Pioneer Street, Brooklyn." Riprap covers the five boroughs only; international addresses, NJ addresses, and points outside NYC aren't supported.`,tier:"proxy",defaultActions:["Use a sample query","Edit query"]},"all-silent":{eyebrow:"Outside evidence coverage",headline:"No specialists found evidence at this point.",body:"The address resolved, but every flood-evidence specialist returned silent. This is rare and usually means parkland, water, or a point with no nearby 311, no FloodNet sensor, and no Sandy overlap. Try a nearby street address or expand to neighborhood-mode.",tier:"proxy",defaultActions:["Try nearby address","Switch to neighborhood-mode"]},grounding:{eyebrow:"Grounding failure",headline:"Briefing prose couldn't be composed within citation constraints.",body:"Mellea rejected all reroll attempts. The underlying evidence is fine β only the prose composition failed. Download the structured evidence below, or contact support.",tier:"modeled",defaultActions:["Download evidence (JSON)","Contact support","Try again"]},backend:{eyebrow:"Backend unavailable",headline:"All routing targets exhausted.",body:"LiteLLM tried Local Ollama β HF Space T4 β AMD MI300X and didn't reach a healthy backend. This usually clears within 5 minutes during a deploy window. The hardware-pill in the header is currently red.",tier:"proxy",defaultActions:["Retry now","Switch backend"]}};let r=re(()=>t[e.state]),s=re(()=>e.actions??a(r).defaultActions.map(K=>({label:K})));var d=sn(),o=w(d),p=w(o);ot(p,{get tier(){return a(r).tier},size:11,get color(){return`var(--tier-${a(r).tier??""})`}});var f=$(p,2),l=w(f,!0);y(f),y(o);var c=$(o,2),h=w(c,!0);y(c);var P=$(c,2),B=w(P,!0);y(P);var j=$(P,2);ct(j,21,()=>a(s),Wt,(K,F,R)=>{var ee=Ft(),Ae=be(ee);{var Te=V=>{var D=rn();ze(D,1,"error-card-action",null,{},{"is-primary":R===0});var Q=w(D,!0);y(D),Z(()=>{Kt(D,"href",a(F).href),Y(Q,a(F).label)}),q(V,D)},de=V=>{var D=an();ze(D,1,"error-card-action",null,{},{"is-primary":R===0});var Q=w(D,!0);y(D),Z(()=>Y(Q,a(F).label)),Et("click",D,function(...ie){var ue;(ue=a(F).onClick)==null||ue.apply(this,ie)}),q(V,D)};W(Ae,V=>{a(F).href?V(Te):V(de,-1)})}q(K,ee)}),y(j),Re(2),y(d),Z(()=>{ze(d,1,`error-card error-card-${e.state??""}`),Y(l,e.eyebrowOverride??a(r).eyebrow),Y(h,e.headlineOverride??a(r).headline),Y(B,e.bodyOverride??a(r).body)}),q(n,d)}De(["click"]);const X="2026-05";function ln(n){return n==="fan"||n==="merge"?"fired":n==="silent"?"silent_by_design":n==="error"?"errored":"fired"}function dt(n){return[n,...(n.children??[]).flatMap(dt)]}function cn(n){const e=n.toLowerCase();return e==="sandy_inundation"||e==="sandy"||e==="dep_stormwater"||e==="dep"||e==="ida_hwm_2021"||e==="ida_hwm"||e==="prithvi_eo_v2"||e==="prithvi_water"||e==="microtopo_lidar"||e==="microtopo"?"cornerstone":e==="mta_entrance_exposure"||e==="mta_entrances"||e==="nycha_development_exposure"||e==="nycha_developments"||e==="doe_school_exposure"||e==="doe_schools"||e==="doh_hospital_exposure"||e==="doh_hospitals"||e==="terramind_synthesis"||e==="terramind"||e==="terramind_buildings"||e==="eo_chip_fetch"?"keystone":e==="floodnet"||e==="nyc311"||e==="nws_obs"||e==="noaa_tides"||e==="prithvi_eo_live"||e==="prithvi_live"||e==="terramind_lulc"?"touchstone":e==="nws_alerts"||e==="ttm_forecast"||e==="ttm_311_forecast"||e==="floodnet_forecast"||e==="ttm_battery_surge"?"lodestone":e.startsWith("reconcile")||e.startsWith("mellea")||e==="rag_granite_embedding"||e==="gliner_extract"?"capstone":null}function dn(n){const e={cornerstone:[],keystone:[],touchstone:[],lodestone:[],capstone:[]};if(n)for(const t of dt(n)){const r=cn(t.name);r&&e[r].push({id:t.id||t.name,name:t.name,status:ln(t.status),tier:t.tier,ms:t.ms,note:t.note??t.error??void 0})}return Object.keys(e).map(t=>({key:t,members:Yt(t,e[t])}))}function b(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function T(n){return typeof n=="string"?n:null}function I(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function un(n,e){return n.sandy!==!0?null:{id:"fsm-sandy",stone:"cornerstone",tier:"empirical",variant:"headline",source:"NYC OEM",agency:"NYC OpenData 5xsi-dfpx Β· Sandy 2012 inundation",vintage:"2012-10-29",title:"Hurricane Sandy 2012 inundation",headline:"Inside zone",subhead:(e&&T(e.address))??"address inside the empirical 2012 extent",body:"Address sits within the empirical Hurricane Sandy 2012 inundation extent. This is a historical fact, not a model prediction.",docId:"sandy",citeId:"sandy",mapLayer:"sandy"}}function pn(n){const e=I(n.dep);if(!e)return null;const t=[];for(const[r,s]of Object.entries(e)){const d=I(s);if(!d)continue;const o=b(d.depth_class)??0;o<=0||t.push([r.replace("dep_",""),T(d.depth_label)??"β",`class ${o}`])}return t.length?{id:"fsm-dep",stone:"cornerstone",tier:"modeled",variant:"tabular",source:"NYC DEP",agency:"NYC Department of Environmental Protection Β· Stormwater Flood Maps",vintage:"2021",title:"Stormwater flood scenarios at this address",columns:["scenario","depth label","class"],rows:t,sub:`${t.length} scenario${t.length===1?"":"s"} place this lot in modeled flooding`,docId:"dep_stormwater",citeId:"dep",mapLayer:"stormwater"}:null}function mn(n){const e=I(n.ida_hwm);if(!e)return null;const t=b(e.n_within_radius);if(!t||t<=0)return null;const r=[];return r.push(["count",`${t}`,`${b(e.radius_m)??800} m radius`]),b(e.max_height_above_gnd_ft)!=null&&r.push(["max above gnd",`${e.max_height_above_gnd_ft} ft`,"β"]),b(e.nearest_dist_m)!=null&&r.push(["nearest",T(e.nearest_site)??"HWM",`${e.nearest_dist_m} m`]),{id:"fsm-ida-hwm",stone:"cornerstone",tier:"empirical",variant:"tabular",source:"USGS",agency:"USGS STN Hurricane Ida 2021 high-water marks (Event 312)",vintage:"2021-09",title:"Hurricane Ida 2021 high-water marks nearby",columns:["field","value","context"],rows:r,docId:"ida_hwm",citeId:"ida_hwm",mapLayer:"hwm"}}function fn(n){const e=I(n.prithvi_water);if(!e)return null;const t=b(e.nearest_distance_m);return t==null?null:{id:"fsm-prithvi-water",stone:"cornerstone",tier:"modeled",variant:"raster",source:"Prithvi-EO 2.0",agency:"IBM/NASA Prithvi-EO 2.0 Β· baked Hurricane Ida 2021 polygons",vintage:"2021-09-02",title:"Hurricane Ida 2021 β satellite-attributable inundation",rasterKind:"prithvi",headline:e.inside_water_polygon?"Inside polygon":`${t} m away`,subhead:"pre/post HLS Sentinel-2 segmentation",sub:`${b(e.n_polygons_within_500m)??0} distinct polygons within 500 m`,docId:"prithvi_water",citeId:"prithvi_water",mapLayer:"prithvi"}}function _n(n){const e=I(n.microtopo);if(!e)return null;const t=b(e.point_elev_m);if(t==null)return null;const r=[{value:`${t.toFixed(1)} m`,label:"elevation"}];return b(e.hand_m)!=null&&r.push({value:`${e.hand_m.toFixed(1)} m`,label:"HAND"}),b(e.twi)!=null&&r.push({value:`${e.twi.toFixed(1)}`,label:"TWI"}),b(e.rel_elev_pct_200m)!=null&&r.push({value:`${e.rel_elev_pct_200m}%`,label:"pct lower 200m"}),{id:"fsm-microtopo",stone:"cornerstone",tier:"proxy",variant:"scalars",source:"USGS 3DEP",agency:"USGS 3DEP DEM (LiDAR-derived) + whitebox-workflows hydrology",vintage:"2018",title:"Microtopography at this point",scalars:r,sub:"Lower percentile = topographic low point; runoff routes here.",docId:"microtopo",citeId:"microtopo"}}function hn(n){const e=[],t=I(n.mta_entrances);if(t!=null&&t.available&&Array.isArray(t.entrances))for(const o of t.entrances.slice(0,4))e.push({reg:"MTA",tier:"empirical",label:T(o.station_name)??T(o.entrance_id)??"entrance",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.daytime_routes)??""}`.trim(),sourceId:T(o.station_id)??"MTA",note:null});else t&&t.available===!1&&e.push({reg:"MTA",tier:"empirical",label:null,detail:null,sourceId:null,note:"no subway entrances within 1.0 mi (silent)"});const r=I(n.nycha_developments);if(r!=null&&r.available&&Array.isArray(r.developments))for(const o of r.developments.slice(0,3))e.push({reg:"NYCHA",tier:"empirical",label:T(o.development)??"development",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.borough)??""}`.trim(),sourceId:T(o.tds_num)??null,note:null});else r&&r.available===!1&&e.push({reg:"NYCHA",tier:"empirical",label:null,detail:null,sourceId:null,note:"no NYCHA developments within 1.0 mi (silent)"});const s=I(n.doe_schools);if(s!=null&&s.available&&Array.isArray(s.schools))for(const o of s.schools.slice(0,3))e.push({reg:"DOE",tier:"empirical",label:T(o.loc_name)??"school",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.borough)??""}`.trim(),sourceId:T(o.loc_code)??null,note:null});else s&&s.available===!1&&e.push({reg:"DOE",tier:"empirical",label:null,detail:null,sourceId:null,note:"no schools within 1.0 mi (silent)"});const d=I(n.doh_hospitals);if(d!=null&&d.available&&Array.isArray(d.hospitals))for(const o of d.hospitals.slice(0,3))e.push({reg:"DOH",tier:"empirical",label:T(o.facility_name)??"hospital",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.borough)??""}`.trim(),sourceId:T(o.fac_id)??null,note:null});else d&&d.available===!1&&e.push({reg:"DOH",tier:"empirical",label:null,detail:null,sourceId:null,note:"no acute-care hospital within 1.0 mi (silent)"});return e.length?{id:"fsm-registers",stone:"keystone",tier:"empirical",variant:"register",source:"NYC OpenData",agency:"NYC OpenData Β· multi-agency join",vintage:X,title:"Nearby exposed assets",registers:e,sub:`${e.filter(o=>o.label).length} of ${e.length} registers fired Β· joined within 1.0 mi`,docId:"registers",citeId:"registers",mapLayer:"registers"}:null}function vn(n){const e=I(n.terramind_buildings);return e!=null&&e.ok?{id:"fsm-tm-buildings",stone:"keystone",tier:"modeled",variant:"raster-pred",source:"TerraMind-NYC",agency:"msradam/TerraMind-NYC-Adapters Β· Buildings LoRA",vintage:"2026",title:"NYC building footprints β TerraMind LoRA",rasterKind:"buildings",headline:`${b(e.pct_buildings)??0}%`,subhead:"building-footprint coverage in chip",sub:`${b(e.n_building_components)??0} distinct components Β· test mIoU 0.5511`,illustrative:!0,docId:"tm_buildings",citeId:"tm_buildings",mapLayer:"buildings"}:null}function gn(n){const e=I(n.floodnet);if(!e||(b(e.n_sensors)??0)<=0)return null;const t=b(e.n_flood_events_3y)??0;return{id:"fsm-floodnet",stone:"touchstone",tier:"empirical",variant:"spark",source:"FloodNet",agency:"FloodNet NYC ultrasonic depth sensor network",vintage:"2026",title:"FloodNet sensors near this address",headline:`${t} events`,subhead:`${b(e.n_sensors)??0} sensors Β· last 3 y`,spark:Array.from({length:24},(r,s)=>Math.max(0,Math.round(t/24*1.4*Math.exp(-Math.pow((s-14)/4,2))+t/24))),sparkSub:"Above-curb depth events β₯ 2 cm. Synthetic monthly distribution; raw deployment-id history is in the audit panel.",docId:"floodnet",citeId:"floodnet",mapLayer:"floodnet"}}function yn(n){var p;const e=I(n.nyc311);if(!e)return null;const t=b(e.n)??0;if(t<=0)return null;const r=I(e.by_year),s=I(e.by_descriptor),d=r?Object.values(r).map(f=>b(f)??0):Array.from({length:12},()=>Math.round(t/12)),o=s?(p=Object.entries(s).sort((f,l)=>(b(l[1])??0)-(b(f[1])??0))[0])==null?void 0:p[0]:null;return{id:"fsm-311",stone:"touchstone",tier:"proxy",variant:"histogram",source:"NYC 311",agency:"NYC 311 service requests (Socrata erm2-nwe9)",vintage:X,title:"Recent 311 flood complaints",headline:`${t} calls`,subhead:o?`top descriptor: ${o}`:"all flood-related descriptors",histogram:d,sparkSub:`Within ${b(e.radius_m)??200} m Β· ${b(e.years)??5} y window. Filtered to flood-relevant descriptors.`,docId:"nyc311",citeId:"nyc311",mapLayer:"complaints"}}function bn(n){var r;const e=I(n.nws_obs);if(!e||e.error||e.station_id==null)return null;const t=[];return b(e.precip_last_hour_mm)!=null&&t.push({value:`${e.precip_last_hour_mm} mm`,label:"precip Β· 1h"}),b(e.precip_last_6h_mm)!=null&&t.push({value:`${e.precip_last_6h_mm} mm`,label:"precip Β· 6h"}),t.length?{id:"fsm-nws-obs",stone:"touchstone",tier:"empirical",variant:"scalars",source:"NWS",agency:`NWS ASOS station ${T(e.station_id)??"?"}`,vintage:((r=T(e.obs_time))==null?void 0:r.slice(0,10))??X,title:"Recent precipitation",scalars:t,sub:`Nearest hourly METAR: ${T(e.station_name)??"?"} (${b(e.distance_km)??"?"} km).`,docId:"nws_obs",citeId:"nws_obs",mapLayer:"nws"}:null}function wn(n){var r;const e=I(n.noaa_tides);if(!e||e.error||b(e.observed_ft_mllw)==null)return null;const t=[{value:`${e.observed_ft_mllw} ft`,label:"observed (MLLW)"}];return b(e.predicted_ft_mllw)!=null&&t.push({value:`${e.predicted_ft_mllw} ft`,label:"predicted"}),b(e.residual_ft)!=null&&t.push({value:`${e.residual_ft} ft`,label:"residual"}),{id:"fsm-noaa",stone:"touchstone",tier:"empirical",variant:"scalars",source:"NOAA CO-OPS",agency:`NOAA tide gauge ${T(e.station_name)??T(e.station_id)??"?"}`,vintage:((r=T(e.obs_time))==null?void 0:r.slice(0,10))??X,title:"Live water level (nearest tide gauge)",scalars:t,sub:"Residual = observed β astronomical tide; positive residual is wind / surge component.",docId:"noaa_tides",citeId:"noaa_tides",mapLayer:"noaa"}}function Sn(n){var r;const e=I(n.prithvi_live);if(!(e!=null&&e.ok))return null;const t=(r=T(e.item_datetime))==null?void 0:r.slice(0,10);return{id:"fsm-prithvi-live",stone:"touchstone",tier:"modeled",variant:"raster-pred",source:"Prithvi-NYC-Pluvial",agency:"NASA-IBM Prithvi v2 Β· NYC fine-tune",vintage:t?`${t} Β· Sentinel-2`:"Sentinel-2",title:"Pluvial flood prediction Β· Prithvi-NYC-Pluvial",rasterKind:"prithvi",headline:`${b(e.pct_water_within_500m)??0}% flooded`,subhead:`water within 500 m Β· cloud ${b(e.cloud_cover)??"?"}%`,sub:"Test flood IoU 0.5979 on held-out NYC chips. Model interpretation, not a measurement.",illustrative:!0,docId:"prithvi_live",citeId:"prithvi_live",mapLayer:"prithvi-pluvial"}}const xn={urban:"#C66",water:"#5B7FB4",vegetation:"#5B8A4A",barren:"#A89A78",wetland:"#D9C75A"};function kn(n){const e=I(n.terramind_lulc);if(!(e!=null&&e.ok))return null;const t=I(e.class_fractions)??{},r={urban:0,water:0,vegetation:0,barren:0,wetland:0};for(const[d,o]of Object.entries(t)){const p=d.toLowerCase();p.includes("urban")||p.includes("built")||p.includes("impervious")?r.urban+=o:p.includes("water")?r.water+=o:p.includes("tree")||p.includes("vegetation")||p.includes("crop")||p.includes("grass")?r.vegetation+=o:p.includes("bare")||p.includes("barren")||p.includes("soil")?r.barren+=o:p.includes("wet")||p.includes("marsh")?r.wetland+=o:r.barren+=o}const s=Object.entries(r).filter(([,d])=>d>0).map(([d,o])=>({k:d,pct:Math.round(o),color:xn[d]}));return{id:"fsm-tm-lulc",stone:"touchstone",tier:"synthetic",variant:"lulc",source:"TerraMind v1.2",agency:"IBM TerraMind v1.2 Β· Sentinel-2 inputs",vintage:"Sentinel-2",title:"Land use / land cover Β· TerraMind v1.2",rasterKind:"lulc",classMix:s.length?s:void 0,sub:"Synthetic prior. LULC palette is a layer convention, not a tier signal.",illustrative:!0,docId:"tm_lulc",citeId:"tm_lulc",mapLayer:"terramind-lulc"}}function Nn(n){const e=I(n.ttm_forecast);if(!(e!=null&&e.available)||!e.interesting)return null;const t=b(e.forecast_peak_ft),r=b(e.forecast_peak_minutes_ahead);return t==null||r==null?null:{id:"fsm-ttm-fc",stone:"lodestone",tier:"modeled",variant:"timeseries",source:"Granite TTM r2 (zero-shot)",agency:"IBM Granite-TimeSeries Β· regional",vintage:X,title:"Storm surge nowcast at The Battery β 9.6 h horizon (regional)",timeseries:{hours:96,peak:{x:38,y:47},peakLabel:`${t} ft @ +${Math.round(r/60)}h`},headline:`${t} ft`,subhead:"peak surge residual Β· 9.6h horizon Β· 6-min cadence",sub:"Regional disclosure. Distinct from the fine-tuned Battery surge nowcast.",spatialNote:"regional Β· Battery, not point-of-query",docId:"ttm_forecast",citeId:"ttm_forecast"}}function $n(n){const e=I(n.ttm_battery_surge);if(!(e!=null&&e.available)||!e.interesting)return null;const t=b(e.forecast_peak_m),r=b(e.forecast_peak_hours_ahead);return t==null||r==null?null:{id:"fsm-ttm-batt",stone:"lodestone",tier:"modeled",variant:"timeseries-ft",source:"msradam/Granite-TTM-r2-Battery-Surge",agency:"Granite TTM r2 Β· NYC-specialized fine-tune",vintage:X,title:"Storm surge nowcast at The Battery β 96 h horizon (NYC-specialized fine-tune)",timeseries:{hours:96,peak:{x:r,y:Math.round(t*100)},peakLabel:`${(t*100).toFixed(0)} cm @ +${r}h`},headline:`${(t*100).toFixed(0)} cm`,subhead:"peak surge Β· 96h horizon Β· hourly cadence",sub:"Fine-tuned on NYC tide-gauge history. Hourly cadence; applies city-wide via NOAA station 8518750.",spatialNote:"regional Β· The Battery, not point-of-query",docId:"ttm_battery",citeId:"ttm_battery",hfModelCard:"huggingface.co/msradam/Granite-TTM-r2-Battery-Surge",rmse:"0.157 m",skillVsPersistence:"β35% vs persistence",hardwareBadge:"MI300X"}}function An(n){const e=I(n.nws_alerts);if(!e)return null;const t=b(e.n_active)??0;if(t<=0)return null;const r=Array.isArray(e.alerts)?e.alerts:[];return{id:"fsm-nws-alerts",stone:"lodestone",tier:"modeled",variant:"tabular",source:"NWS",agency:"NWS Public Alerts API Β· flood-relevant filter",vintage:X,title:`${t} active flood-relevant alert${t===1?"":"s"}`,columns:["event","severity","expires"],rows:r.slice(0,4).map(s=>[T(s.event)??"?",T(s.severity)??"?",(T(s.expires)??"").slice(0,16)]),sub:"Live NWS feed. If a FLOOD or FLASH FLOOD WARNING is in this list, foreground it.",docId:"nws_alerts",citeId:"nws_alerts"}}function Tn(n,e){var l,c,h;const t=n.mellea,r=((l=t==null?void 0:t.passed)==null?void 0:l.length)??0,s=((c=t==null?void 0:t.failed)==null?void 0:c.length)??0,d=r+s>0?r+s:4,o=(t==null?void 0:t.attempts)??0,p=Math.max(0,o-1),f=((h=n.citations)==null?void 0:h.length)??0;return{id:"fsm-capstone-meta",stone:"capstone",tier:"modeled",variant:"meta",source:"Mellea",agency:"Capstone synthesis Β· Granite 4.1 + Mellea grounding check",vintage:X,title:"Briefing reconciliation",metaRows:[{k:"mellea reroll",v:`${p} reroll${p===1?"":"s"}`},{k:"grounding checks",v:`${r}/${d} passed`},{k:"citations resolved",v:`${f}`},{k:"wall-clock",v:e!=null?`${e.toFixed(1)} s`:"β"}],sub:"Capstone produces prose, not cards. This meta-card is the integrity-narration UI for the entire pipeline.",docId:"capstone"}}function et(n,e,t,r=!0){const s=n??{},d=I(s.geocode);return{cards:[un(s,d),pn(s),mn(s),fn(s),_n(s),hn(s),vn(s),gn(s),yn(s),bn(s),wn(s),Sn(s),kn(s),An(s),Nn(s),$n(s),r?Tn(n??{},t):null].filter(p=>p!=null),stones:dn(e),wallSeconds:t}}function Cn(n,e,t,r){const d={sandy_inundation:"sandy",dep_stormwater:"dep",floodnet:"floodnet",nyc311:"nyc311",noaa_tides:"noaa_tides",nws_alerts:"nws_alerts",nws_obs:"nws_obs",ttm_forecast:"ttm_forecast",ttm_311_forecast:"ttm_311_forecast",ttm_battery_surge:"ttm_battery_surge",floodnet_forecast:"floodnet_forecast",ida_hwm_2021:"ida_hwm",prithvi_eo_v2:"prithvi_water",prithvi_eo_live:"prithvi_live",microtopo_lidar:"microtopo",mta_entrance_exposure:"mta_entrances",nycha_development_exposure:"nycha_developments",doe_school_exposure:"doe_schools",doh_hospital_exposure:"doh_hospitals",terramind_synthesis:"terramind",terramind_lulc:"terramind_lulc",terramind_buildings:"terramind_buildings",eo_chip_fetch:"eo_chip",geocode:"geocode"}[e];if(!d)return[];if(e==="sandy_inundation"){const o=t;n[d]=r&&(o==null?void 0:o.inside)===!0?!0:r?!1:null}else if(e==="dep_stormwater"){const o=t??{},p={};for(const[f,l]of Object.entries(o)){const c=typeof l=="string"?l:"";c&&(p[f]={depth_class:1,depth_label:c})}n[d]=Object.keys(p).length?p:null}else r&&t!=null?n[d]=t:n[d]=null;return[d]}const we={subway:"MTA Β· USGS Β· FEMA Β· NYC OEM Β· NYC DEP",nycha:"NYC HA Β· USGS Β· NYC OEM Β· NYC DEP",school:"NYC DOE Β· USGS Β· NYC OEM Β· NYC DEP",hospital:"NYS DOH Β· USGS Β· NYC OEM Β· NYC DEP"},Se={subway:"subway entrances",nycha:"NYCHA developments",school:"public schools",hospital:"hospitals"};function xe(n){return!n||!Number.isFinite(n)?"β":`${Math.round(n)}m`}function ke(n){return n==null||!Number.isFinite(n)?"β":`${(n*3.28084).toFixed(1)} ft`}function Ne(n,e){return typeof e=="number"?e>=.5?`Inundated 2012 (${Math.round(e*100)}%)`:e>0?`Edge (${Math.round(e*100)}%)`:"β":n?"Inundated 2012":"β"}function $e(n,e,t){return typeof t=="number"?t>=.5?`β₯${Math.round(t*100)}% in scenario`:t>0?`${Math.round(t*100)}% edge`:"minimal":n&&n.length?n:e&&e>0?`class ${e}`:"minimal"}function In(n){return n?/elevator|easement|stair.*ramp/i.test(n):!1}function Mn(n){if(!n.available)return null;const t=(n.entrances??[]).map(r=>{const s=In(r.entrance_type);return{name:`${r.station_name??"?"}${r.daytime_routes?` (${String(r.daytime_routes).split(/\s+/).slice(0,3).join("/")})`:""}`,elev:ke(r.elev_m),ada:s,fema:"Zone X",sandy:Ne(r.inside_sandy_2012),dep:$e(r.dep_extreme_2080_label,r.dep_extreme_2080_class),asset:"subway",primaryTier:r.inside_sandy_2012?"empirical":"modeled"}});return{type:Se.subway,radius:xe(n.radius_m),count:n.n_entrances??t.length,rows:t,sourceLabel:we.subway}}function qn(n){if(!n.available)return null;const t=(n.developments??[]).map(r=>{const s=r.pct_inside_sandy_2012,d=r.pct_in_dep_extreme_2080;return{name:`${r.development??"?"}${r.borough?` Β· ${r.borough}`:""}`,elev:ke(r.rep_elevation_m),ada:!1,fema:"β",sandy:Ne(void 0,s),dep:$e(void 0,void 0,d),asset:"nycha",primaryTier:s&&s>0?"empirical":"modeled"}});return{type:Se.nycha,radius:xe(n.radius_m),count:n.n_developments??t.length,rows:t,sourceLabel:we.nycha}}function Fn(n){if(!n.available)return null;const t=(n.schools??[]).map(r=>({name:`${r.school_name??r.name??"?"}${r.borough?` Β· ${r.borough}`:""}`,elev:ke(r.elev_m),ada:!1,fema:"β",sandy:Ne(r.inside_sandy_2012),dep:$e(r.dep_extreme_2080_label,r.dep_extreme_2080_class),asset:"school",primaryTier:r.inside_sandy_2012?"empirical":"modeled"}));return{type:Se.school,radius:xe(n.radius_m),count:n.n_schools??t.length,rows:t,sourceLabel:we.school}}function En(n){if(!n.available)return null;const t=(n.hospitals??[]).map(r=>({name:`${r.facility_name??r.name??"?"}${r.borough?` Β· ${r.borough}`:""}`,elev:ke(r.elev_m),ada:!0,fema:"β",sandy:Ne(r.inside_sandy_2012),dep:$e(r.dep_extreme_2080_label,r.dep_extreme_2080_class),asset:"hospital",primaryTier:r.inside_sandy_2012?"empirical":"modeled"}));return{type:Se.hospital,radius:xe(n.radius_m),count:n.n_hospitals??t.length,rows:t,sourceLabel:we.hospital}}function Ln(n){if(!n)return[];const e=[],t=Mn(n.mta_entrances??{});t&&t.rows.length&&e.push(t);const r=qn(n.nycha_developments??{});r&&r.rows.length&&e.push(r);const s=Fn(n.doe_schools??{});s&&s.rows.length&&e.push(s);const d=En(n.doh_hospitals??{});return d&&d.rows.length&&e.push(d),e}function Pn(n,e){const t=`/api/agent/stream?q=${encodeURIComponent(n)}`,r=new EventSource(t);let s="",d;const o=/([.?!])(\s|$)/;function p(l=!1){var h,P;let c;for(;c=o.exec(s);){const B=c.index+c[1].length+(c[2]?c[2].length:0),j=s.slice(0,B).trim();s=s.slice(B),j&&((h=e.onSentence)==null||h.call(e,j,d))}l&&s.trim()&&((P=e.onSentence)==null||P.call(e,s.trim(),d),s="")}function f(l,c){r.addEventListener(l,h=>{try{c(JSON.parse(h.data))}catch{}})}return f("hello",l=>{var c;return(c=e.onHello)==null?void 0:c.call(e,l.query)}),f("plan_token",l=>{var c;return(c=e.onPlanToken)==null?void 0:c.call(e,l.delta)}),f("plan",l=>{var c;return(c=e.onPlan)==null?void 0:c.call(e,l)}),f("step",l=>{var c;return(c=e.onStep)==null?void 0:c.call(e,l)}),f("token",l=>{var c,h;l.attempt!==d&&(d=l.attempt,s="",(c=e.onAttemptStart)==null||c.call(e,l.attempt??1)),(h=e.onToken)==null||h.call(e,l.delta,l.attempt),s+=l.delta,p(!1)}),f("mellea_attempt",l=>{var c;return(c=e.onMelleaAttempt)==null?void 0:c.call(e,l)}),f("final",l=>{var c;p(!0),(c=e.onFinal)==null||c.call(e,l)}),f("error",l=>{var c;return(c=e.onError)==null?void 0:c.call(e,l.err)}),r.addEventListener("done",()=>{var l;p(!0),(l=e.onDone)==null||l.call(e),r.close()}),r.addEventListener("error",()=>{var l;p(!0),(l=e.onError)==null||l.call(e,"SSE connection error"),r.close()}),{close:()=>r.close()}}const ut=[{key:"status",label:"Status",n:"01",aliases:["status"]},{key:"empirical",label:"Empirical evidence",n:"02",tier:"empirical",aliases:["empirical evidence","empirical"]},{key:"modeled",label:"Modeled scenarios",n:"03",tier:"modeled",aliases:["modeled scenarios","modeled"]},{key:"policy",label:"Policy context",n:"04",aliases:["policy context","policy"]}];function tt(n){const e=n.toLowerCase().replace(/[.:]+\s*$/,"").trim();return ut.find(t=>t.aliases.includes(e))}const nt=/(^|\n)\s*(?:\*\*([A-Z][A-Za-z\s/]+?)\.\s*\*\*|#{1,3}\s*(0[1-4])\s*[:\-β.]?\s*([^\n]+))/g;function pt(n,e,t){return{id:e,n,tier:lt(e),source:(t==null?void 0:t.source)??e.split(/[_-]/)[0].toUpperCase(),title:(t==null?void 0:t.title)??e,docId:e,url:(t==null?void 0:t.url)??"",vintage:(t==null?void 0:t.vintage)??"",retrieved:(t==null?void 0:t.retrieved)??""}}const jn=/\[([a-z][a-z0-9_]*(?:\s*,\s*[a-z][a-z0-9_]*)*)\]/gi;function rt(n){return n.split(new RegExp("(?<=[.!?])\\s+(?=[A-Z(])","g")).filter(t=>t.trim().length>0)}function it(n,e,t){let r=0;const s=[],d=[...n.matchAll(jn)];if(d.length===0)return[{text:n}];for(const o of d){const p=n.slice(r,o.index??0),f=o[1].split(/\s*,\s*/).filter(Boolean);r=(o.index??0)+o[0].length;const l=lt(f[0]);s.push({text:p,tier:l,cite:f[0]});for(const c of f)e[c]||(e[c]=t(c))}if(r<n.length){const o=n.slice(r);o.trim()&&s.push({text:o})}return s}function On(n,e={}){const t={...e};let r=Object.values(t).reduce((l,c)=>Math.max(l,c.n),0)+1;const s=new Set,d=l=>(e[l]||s.add(l),pt(r++,l)),o=[],p=[];let f;for(nt.lastIndex=0;f=nt.exec(n);)if(f[2]!==void 0){const l=tt(f[2]);if(!l)continue;p.push({num:l.n,label:l.label,tier:l.tier,start:f.index+f[1].length,bodyStart:f.index+f[0].length})}else if(f[3]!==void 0){const l=f[3],c=(f[4]??"").trim(),h=ut.find(P=>P.n===l)??tt(c);p.push({num:l,label:(h==null?void 0:h.label)??c,tier:h==null?void 0:h.tier,titleExtra:h&&c.toLowerCase()!==h.label.toLowerCase()?c:void 0,start:f.index+f[1].length,bodyStart:f.index+f[0].length})}for(let l=0;l<p.length;l++){const c=p[l],h=p[l+1],P=n.slice(c.bodyStart,h?h.start:n.length).trim();if(P){o.push({kind:"head",n:c.num,label:c.label,tier:c.tier,title:c.titleExtra});for(const B of P.split(/\n\s*\n/)){const j=B.replace(/\s+/g," ").trim();if(!j)continue;const K=rt(j),F=[];for(const R of K)F.push(...it(R,t,d)),F.push({text:" "});for(;F.length&&F[F.length-1].text.trim()===""&&!F[F.length-1].tier;)F.pop();F.length&&o.push({kind:"prose",parts:F})}}}if(o.length===0&&n.trim()){o.push({kind:"head",n:"01",label:"Status"});const l=n.replace(/\s+/g," ").trim(),c=rt(l),h=[];for(const P of c)h.push(...it(P,t,d)),h.push({text:" "});for(;h.length&&h[h.length-1].text.trim()===""&&!h[h.length-1].tier;)h.pop();h.length&&o.push({kind:"prose",parts:h})}return{blocks:o,citations:t,unresolvedDocIds:[...s]}}const le={type:"FeatureCollection",features:[]};async function ce(n){try{const e=await fetch(n);if(!e.ok)return le;const t=await e.json();return!t||t.type!=="FeatureCollection"?le:t}catch{return le}}async function zn(n,e,t=1500){return ce(`/api/layers/sandy?lat=${n}&lon=${e}&r=${t}`)}async function Dn(n,e,t=1500){return ce(`/api/layers/dep_extreme_2080?lat=${n}&lon=${e}&r=${t}`)}async function at(n,e,t=1500){return ce(`/api/layers/prithvi_water?lat=${n}&lon=${e}&r=${t}`)}async function Rn(n){return ce(`/api/layers/sandy_clipped?code=${encodeURIComponent(n)}`)}async function Yn(n,e="dep_extreme_2080"){return ce(`/api/layers/dep_clipped?code=${encodeURIComponent(n)}&scenario=${e}`)}async function st(n,e,t=1500){try{const r=await fetch(`/api/floodnet_near?lat=${n}&lon=${e}&r=${t}`);return r.ok?{type:"FeatureCollection",features:(await r.json()).features.map(o=>{const p=o.properties??{};return{...o,properties:{...p,count:typeof p.n_events_3y=="number"?p.n_events_3y:1}}})}:le}catch{return le}}var Bn=L('<span class="region-head-meta svelte-1q8jizq"> <!></span>'),Hn=L('<span class="region-head-meta svelte-1q8jizq">planningβ¦</span>'),Un=L('<div class="reroll-prev svelte-1q8jizq" aria-hidden="true"><p class="reroll-prev-line svelte-1q8jizq"> </p></div>'),Gn=L("<!> <!>",1),Wn=L('<span class="streaming-caret svelte-1q8jizq" aria-hidden="true">β</span>'),Kn=L("<!> <!>",1),Vn=L('<details class="plan-details svelte-1q8jizq"><summary class="svelte-1q8jizq"> </summary> <pre class="plan-stream svelte-1q8jizq"> </pre></details>'),Zn=L('<div class="generating-status svelte-1q8jizq" aria-live="polite"><span class="pulse svelte-1q8jizq"></span> Planning intentβ¦ <!></div>'),Jn=L('<div class="generating-status svelte-1q8jizq" aria-live="polite"><span class="pulse svelte-1q8jizq"></span> Resolving addressβ¦</div>'),Xn=L("<!> <!>",1),Qn=L('<span class="region-head-meta svelte-1q8jizq"> </span>'),er=L('<span class="region-head-meta svelte-1q8jizq">awaiting geocodeβ¦</span>'),tr=L('<div style="position: relative; flex: 1; min-height: 0;" class="svelte-1q8jizq"><!> <!></div>'),nr=L('<section class="hero-band svelte-1q8jizq"><div class="hero-band-inner svelte-1q8jizq"><div class="app-shell-top is-desktop svelte-1q8jizq"><main id="region-briefing" class="app-region app-region-brief svelte-1q8jizq" aria-labelledby="brief-h1"><header class="region-head svelte-1q8jizq"><span class="section-label svelte-1q8jizq">Briefing</span> <!></header> <h1 id="brief-h1" class="brief-h1 svelte-1q8jizq">Flood-exposure briefing <span class="brief-h1-addr svelte-1q8jizq"> </span></h1> <!></main> <div class="app-region-side svelte-1q8jizq" style="grid-area: side;"><aside id="region-map" class="app-region app-region-map svelte-1q8jizq" aria-label="Map region"><header class="region-head svelte-1q8jizq"><span class="section-label svelte-1q8jizq">Map</span> <!></header> <!></aside> <aside id="region-cites" class="app-region app-region-cites svelte-1q8jizq" aria-label="Citations"><!></aside></div></div> <div class="app-shell-bottom svelte-1q8jizq"><section class="app-region app-region-findings svelte-1q8jizq" aria-label="Findings"><!></section></div></div></section>');function fr(n,e){Pt(e,!0);let t=re(()=>zt.params.queryId??""),r=re(()=>()=>{try{return decodeURIComponent(a(t))}catch{return a(t)}}),s=N(null),d=N(""),o=N(""),p=N(null),f=N(!1),l=N(0),c=2,h=N(!1),P=N(!1),B=N(""),j=N(null),K=N(ne([])),F=re(()=>{var u,i,_,m;return{empirical:((u=a(me))==null?void 0:u.features.length)??0,modeled:((i=a(fe))==null?void 0:i.features.length)??0,synthetic:((_=a(_e))==null?void 0:_.features.length)??0,proxy:((m=a(he))==null?void 0:m.features.length)??0}}),R=N(ne({id:"root",name:"briefing.run",status:"ok",ms:0,tier:null,children:[]})),ee=N(null),Ae="comfortable",Te="smart",de=N(!1);Oe(()=>{typeof window<"u"&&v(de,new URL(window.location.href).searchParams.get("grammar")==="1")});let V=N(null),D=N(void 0),Q=ne({}),ie=N(0),ue=re(()=>{if(a(ie),a(p)){const u={...Q,...a(p)};return et(u,a(R),a(D),!0)}return et(Q,a(R),a(D),!1)});function mt(u){v(ee,u,!0)}function ft(u){const i=document.getElementById("region-cites");i&&i.scrollIntoView({behavior:"smooth",block:"start"})}const Ye=new Set(["ttm_forecast","ttm_311_forecast","floodnet_forecast"]),Ce="group-ttm-r2";function _t(u,i,_,m){if(m==="error")return _??void 0;if(m==="silent")return _??"no data";if(i==null||typeof i!="object")return;const A=i,g={sandy_inundation:["inside"],dep_stormwater:["dep_extreme_2080","dep_moderate_2050"],floodnet:["n_sensors","n_events_3y"],nyc311:["n"],noaa_tides:["observed_ft_mllw","residual_ft","station"],nws_alerts:["n_active"],nws_obs:["p1h_mm","p6h_mm","station"],ttm_forecast:["forecast_peak_ft","forecast_peak_min_ahead"],ttm_311_forecast:["forecast_mean","forecast_peak","accelerating"],ida_hwm_2021:["n_within_800m","max_height_above_gnd_ft"],prithvi_eo_v2:["inside_water_polygon","nearest_distance_m"],prithvi_eo_live:["scene_date","pct_water_500m"],microtopo_lidar:["elev_m","pct_200m","relief_m"],mta_entrance_exposure:["n_entrances","n_inside_sandy_2012","n_in_dep_extreme_2080"],nycha_development_exposure:["n_developments","n_majority_inside_sandy_2012"],doe_school_exposure:["n_schools","n_inside_sandy_2012"],doh_hospital_exposure:["n_hospitals","n_inside_sandy_2012"],floodnet_forecast:["sensor_id","distance_m","forecast_28d","accelerating"],terramind_synthesis:["tim_chain","dem_mean_m"],rag_granite_embedding:["hits"],gliner_extract:["sources"]}[u],E=[];if(g){for(const M of g)if(A[M]!==void 0&&E.push(He(M,A[M])),E.length>=3)break}else for(const[M,k]of Object.entries(A))if(k!==null&&typeof k!="object"&&(E.push(He(M,k)),E.length>=2))break;return E.join(" Β· ")||void 0}function ht(u){const i=[],_=u.mta_entrances;if(_&&Array.isArray(_.entrances))for(const g of _.entrances){const E=Number(g.entrance_lat),M=Number(g.entrance_lon);!Number.isFinite(E)||!Number.isFinite(M)||i.push({type:"Feature",geometry:{type:"Point",coordinates:[M,E]},properties:{kind:"subway",name:`${g.station_name??"?"} (${g.daytime_routes??"?"})`,doc_id:`mta_entrance_${g.station_id??""}`,inside_sandy_2012:g.inside_sandy_2012===!0}})}const m=u.doe_schools;if(m&&Array.isArray(m.schools))for(const g of m.schools){const E=Number(g.school_lat),M=Number(g.school_lon);!Number.isFinite(E)||!Number.isFinite(M)||i.push({type:"Feature",geometry:{type:"Point",coordinates:[M,E]},properties:{kind:"school",name:String(g.loc_name??g.school_name??"?"),doc_id:`doe_school_${g.loc_code??""}`,inside_sandy_2012:g.inside_sandy_2012===!0}})}const A=u.nycha_developments;if(A&&Array.isArray(A.developments))for(const g of A.developments){const E=Number(g.centroid_lat),M=Number(g.centroid_lon);if(!Number.isFinite(E)||!Number.isFinite(M))continue;const k=Number(g.pct_inside_sandy_2012??0);i.push({type:"Feature",geometry:{type:"Point",coordinates:[M,E]},properties:{kind:"nycha",name:String(g.development??"?"),doc_id:`nycha_dev_${g.tds_num??""}`,inside_sandy_2012:k>=50,pct_inside_sandy:k}})}const S=u.doh_hospitals;if(S&&Array.isArray(S.hospitals))for(const g of S.hospitals){const E=Number(g.hospital_lat),M=Number(g.hospital_lon);!Number.isFinite(E)||!Number.isFinite(M)||i.push({type:"Feature",geometry:{type:"Point",coordinates:[M,E]},properties:{kind:"hospital",name:String(g.facility_name??"?"),doc_id:`nyc_hospital_${g.fac_id??""}`,inside_sandy_2012:g.inside_sandy_2012===!0}})}return{type:"FeatureCollection",features:i}}function vt(u){return{type:"FeatureCollection",features:[]}}function Be(u){return 1+(u.children??[]).reduce((_,m)=>_+Be(m),0)}function He(u,i){if(typeof i=="number"){const _=Number.isInteger(i)?`${i}`:i.toFixed(2);return`${u}=${_}`}if(typeof i=="boolean")return`${u}=${i}`;if(typeof i=="string"){const _=i.length>24?i.slice(0,22)+"β¦":i;return`${u}=${_}`}return u}let ae=N(ne({empirical:!0,modeled:!0,synthetic:!0,proxy:!0})),J=N(null),pe=N(null),Ue=N(void 0),Ge=N(void 0),me=N(void 0),fe=N(void 0),_e=N(void 0),he=N(void 0),te=N(ne([])),se=N(ne({})),ve=[];function gt(){var A;if(!a(o)){v(te,[],!0),v(se,{},!0),ve=[];return}const u={};(A=a(p))!=null&&A.citations&&a(p).citations.forEach((S,g)=>{u[S.doc_id]=pt(g+1,S.doc_id,{source:S.source,title:S.title,url:S.url,vintage:S.vintage})});const i=On(a(o),u),_={};let m=1;for(const S of ve){const g=i.citations[S];g&&(_[S]={...g,n:m++})}for(const[S,g]of Object.entries(i.citations))_[S]||(_[S]={...g,n:m++},ve.push(S));v(te,i.blocks,!0),v(se,_,!0)}Oe(()=>{a(o),a(p),gt()}),Oe(()=>{if(!a(J))return;const{lat:u,lon:i,source:_}=a(J);_==="nta"&&a(pe)?(Rn(a(pe)).then(m=>v(me,m,!0)),Yn(a(pe)).then(m=>v(fe,m,!0)),at(u,i,2500).then(m=>v(_e,m,!0)),st(u,i,3e3).then(m=>v(he,m,!0))):(zn(u,i).then(m=>v(me,m,!0)),Dn(u,i).then(m=>v(fe,m,!0)),at(u,i).then(m=>v(_e,m,!0)),st(u,i).then(m=>v(he,m,!0)))}),jt(()=>{if(z.reset(),!a(r)())return;v(V,Date.now(),!0),z.phase="planning";const u=Pn(a(r)(),{onPlanToken:i=>v(d,a(d)+i),onPlan:i=>{var _;v(s,i,!0),z.phase="specialists",z.totalSpecialists=((_=i.specialists)==null?void 0:_.length)??0},onStep:i=>{if(new Set(["reconcile_granite41","mellea_reconcile_address","reconcile_neighborhood","reconcile_development","reconcile_live_now"]).has(i.step)||(z.activeStep=i.step,i.ok&&(z.firedCount=z.firedCount+1)),Cn(Q,i.step,i.result,i.ok),v(ie,a(ie)+1),i.step==="geocode")if(i.ok&&i.result&&typeof i.result=="object"){const x=i.result;if(typeof x.lat=="number"&&typeof x.lon=="number"){const C=typeof x.address=="string"?x.address:a(r)();v(J,{label:C,lat:x.lat,lon:x.lon,source:"geocode"},!0),v(P,!0)}}else v(j,"geocoder");if(i.step==="nta_resolve"&&i.ok&&i.result&&typeof i.result=="object"){const x=i.result,C=Array.isArray(x.bbox)?x.bbox:null,H=typeof x.nta_code=="string"?x.nta_code:null;if(C&&C.length===4&&H){v(pe,H,!0);const U=(C[0]+C[2])/2,O=(C[1]+C[3])/2,G=typeof x.nta_name=="string"?x.nta_name:a(r)();v(J,{label:G,lat:O,lon:U,source:"nta"},!0)}}const m=Dt(i.step),A=i.ok?i.result==null&&i.err==null?"silent":"ok":"error",S=Math.round((i.elapsed_s??0)*1e3),g=i.result!=null?i.result:i.err??null,E=_t(i.step,i.result,i.err,A),M={id:`step-${Be(a(R))}`,name:i.step,status:A,ms:S,tier:m,note:E,output:g,error:A==="error"?i.err??"unknown error":void 0,model:Ye.has(i.step)?"granite-timeseries-ttm-r2":void 0},k={...a(R),ms:(a(R).ms??0)+S};if(Ye.has(i.step)){const x=[...k.children??[]];let C=x.find(O=>O.id===Ce);C||(C={id:Ce,name:"forecasting.granite-timeseries-ttm-r2",status:"fan",ms:0,tier:"modeled",note:"1 instance",model:"granite-timeseries-ttm-r2",children:[]},x.push(C));const H=[...C.children??[],M],U={...C,ms:(C.ms??0)+S,note:`${H.length} instance${H.length===1?"":"s"}`,children:H};v(R,{...k,children:x.map(O=>O.id===Ce?U:O)},!0)}else v(R,{...k,children:[...k.children??[],M]},!0)},onAttemptStart:i=>{v(l,i,!0),z.phase="reconciling",z.attempt=i,z.activeStep="granite4.1 + mellea",i>1&&(v(B,a(o),!0),v(o,""),ve=[])},onToken:i=>{a(h)||(v(h,!0),a(l)===0&&v(l,1),z.phase="streaming",z.attempt=Math.max(1,z.attempt)),v(o,a(o)+i)},onMelleaAttempt:i=>{i.attempt>0&&(v(l,i.attempt,!0),z.attempt=i.attempt)},onFinal:i=>{v(p,i,!0),i.paragraph&&v(o,i.paragraph,!0),v(K,Ln(i),!0),v(Ue,ht(i),!0),v(Ge,vt(),!0);const m=i.mellea;m&&m.failed&&m.failed.length>0&&m.attempts&&m.attempts>=c&&v(j,"grounding")},onError:i=>{const _=i.toLowerCase();(_.includes("connection")||_.includes("502")||_.includes("503")||_.includes("timeout")||_.includes("routing"))&&v(j,"backend"),z.markError(i)},onDone:()=>{var i,_,m,A,S;v(f,!0),a(V)!=null&&v(D,(Date.now()-a(V))/1e3),!a(h)&&!a(j)&&a(P)&&v(j,"all-silent"),!a(j)&&a(te).length>0&&(Vt({queryId:a(t),queryText:a(r)(),intent:((i=a(s))==null?void 0:i.intent)??null,specialists:((m=(_=a(s))==null?void 0:_.specialists)==null?void 0:m.length)??0,blocks:a(te),citations:a(se),generatedAt:new Date().toISOString(),attempts:((S=(A=a(p))==null?void 0:A.mellea)==null?void 0:S.attempts)??a(l)}),z.markReady())}});return()=>u.close()});var Ie=nr(),We=w(Ie),Me=w(We),qe=w(Me),Fe=w(qe),yt=$(w(Fe),2);{var bt=u=>{var i=Bn(),_=w(i),m=$(_);{var A=S=>{var g=Lt("Β· β done");q(S,g)};W(m,S=>{a(f)&&S(A)})}y(i),Z(()=>{var S;return Y(_,`intent: ${a(s).intent??""} Β· ${((S=a(s).specialists)==null?void 0:S.length)??0??""} specialists Β· attempt ${a(l)??""} `)}),q(u,i)},wt=u=>{var i=Hn();q(u,i)};W(yt,u=>{a(s)?u(bt):u(wt,-1)})}y(Fe);var Ee=$(Fe,2),Ke=$(w(Ee)),St=w(Ke,!0);y(Ke),y(Ee);var xt=$(Ee,2);{var kt=u=>{on(u,{get state(){return a(j)}})},Nt=u=>{var i=Xn(),_=be(i);{var m=k=>{var x=Gn(),C=be(x);nn(C,{get attempt(){return a(l)},max:c});var H=$(C,2);{var U=O=>{var G=Un(),ge=w(G),ye=w(ge);y(ge),y(G),Z(je=>Y(ye,`${je??""}β¦`),[()=>a(B).slice(0,360)]),q(O,G)};W(H,O=>{a(B)&&O(U)})}q(k,x)};W(_,k=>{a(l)>1&&k(m)})}var A=$(_,2);{var S=k=>{var x=Kn(),C=be(x);Rt(C,{get blocks(){return a(te)},get citations(){return a(se)},streaming:!1});var H=$(C,2);{var U=O=>{var G=Wn();q(O,G)};W(H,O=>{a(f)||O(U)})}q(k,x)},g=k=>{en(k)},E=k=>{var x=Zn(),C=$(w(x),2);{var H=U=>{var O=Vn(),G=w(O),ge=w(G);y(G);var ye=$(G,2),je=w(ye,!0);y(ye),y(O),Z(()=>{Y(ge,`Planner streaming (${a(d).length??""} chars)`),Y(je,a(d))}),q(U,O)};W(C,U=>{a(d)&&U(H)})}y(x),q(k,x)},M=k=>{var x=Jn();q(k,x)};W(A,k=>{a(te).length?k(S):a(P)&&!a(h)?k(g,1):a(s)?k(M,-1):k(E,2)})}q(u,i)};W(xt,u=>{a(j)?u(kt):u(Nt,-1)})}y(qe);var Ve=$(qe,2),Le=w(Ve),Pe=w(Le),$t=$(w(Pe),2);{var At=u=>{var i=Qn(),_=w(i);y(i),Z((m,A)=>Y(_,`Carto Positron Β· z15 Β· ${m??""}Β°N ${A??""}Β°W`),[()=>a(J).lat.toFixed(4),()=>Math.abs(a(J).lon).toFixed(4)]),q(u,i)},Tt=u=>{var i=er();q(u,i)};W($t,u=>{a(J)?u(At):u(Tt,-1)})}y(Pe);var Ct=$(Pe,2);{var It=u=>{var i=tr(),_=w(i);Ut(_,{get address(){return a(J)},get activeLayers(){return a(ae)},get sandyEmpirical(){return a(me)},get depModeled(){return a(fe)},get syntheticPrior(){return a(_e)},get proxy311(){return a(he)},get registerPoints(){return a(Ue)},get registerPolygons(){return a(Ge)},get linkedKey(){return a(ee)}});var m=$(_,2);Gt(m,{get active(){return a(ae)},get featureCounts(){return a(F)},onToggle:A=>v(ae,{...a(ae),[A]:!a(ae)[A]},!0)}),y(i),q(u,i)};W(Ct,u=>{a(J)&&u(It)})}y(Le);var Ze=$(Le,2),Mt=w(Ze);Bt(Mt,{get citations(){return a(se)}}),y(Ze),y(Ve),y(Me);var Je=$(Me,2),Xe=w(Je),qt=w(Xe);Ht(qt,{get data(){return a(ue)},density:Ae,provenanceMode:Te,get showGrammar(){return a(de)},get linkedKey(){return a(ee)},onLink:mt,onCite:ft}),y(Xe),y(Je),y(We),y(Ie),Z(u=>Y(St,u),[()=>a(r)()]),q(n,Ie),Ot()}export{fr as component,mr as universal};
|
|
|
|
| 1 |
+
import{d as De,s as Y,a as F,f as P,c as Ft,b as Et,t as Lt}from"../chunks/CzfSRAFS.js";import{c as w,s as N,r as y,aR as Re,t as Z,o as a,f as be,a9 as re,p as Pt,a4 as A,ab as ne,aa as Oe,a5 as v,a6 as jt,a as Ot}from"../chunks/R1l3q-hJ.js";import{p as Qe,i as W}from"../chunks/C6-4B-da.js";import{p as zt}from"../chunks/DP_9AkkW.js";import{T as ot,t as lt,a as Dt,B as Rt}from"../chunks/DmCsJHgl.js";import{f as Yt,C as Bt,F as Ht,R as Ut,M as Gt}from"../chunks/a5rSUn-N.js";import"../chunks/B_9mIQpm.js";import{e as ct,i as Wt}from"../chunks/CGe8VjDs.js";import{b as oe,a as ze,s as Kt}from"../chunks/a4L4UsYq.js";import{b as z,p as Vt}from"../chunks/Bu_bEyoS.js";const Zt=!1,Jt=!1,mr=Object.freeze(Object.defineProperty({__proto__:null,prerender:Zt,ssr:Jt},Symbol.toStringTag,{value:"Module"}));De(["click"]);De(["click"]);var Xt=P('<div class="skeleton-section"><div class="skeleton-head"><span class="skeleton-num"> </span> <span class="skeleton-label"> </span> <span class="skeleton-spinner" aria-hidden="true">β</span></div> <span class="skeleton-pulse"></span> <span class="skeleton-pulse"></span> <span class="skeleton-pulse"></span></div>'),Qt=P('<div class="skeleton-brief" role="status" aria-live="polite" aria-label="Loading briefing β geocode complete, dispatching specialists"><div class="skeleton-status"><span class="skeleton-pulse"></span> <span class="skeleton-pulse skeleton-pulse-meta"></span></div> <!></div>');function en(n){const e=[{n:"01",label:"Status"},{n:"02",label:"Empirical evidence"},{n:"03",label:"Modeled scenarios"},{n:"04",label:"Policy context"}];var t=Qt(),r=w(t),s=w(r);oe(s,"",{},{width:"62%"});var d=N(s,2);oe(d,"",{},{width:"40%"}),y(r);var o=N(r,2);ct(o,1,()=>e,p=>p.n,(p,f)=>{var l=Xt(),c=w(l),h=w(c),M=w(h,!0);y(h);var B=N(h,2),j=w(B,!0);y(B),Re(2),y(c);var K=N(c,2);oe(K,"",{},{width:"92%"});var E=N(K,2);oe(E,"",{},{width:"78%"});var R=N(E,2);oe(R,"",{},{width:"85%"}),y(l),Z(()=>{Y(M,a(f).n),Y(j,a(f).label)}),F(p,l)}),y(t),F(n,t)}var tn=P('<div class="reroll-banner" role="status" aria-live="polite"><!> <div class="reroll-body"><span class="reroll-head">Regenerating to satisfy citation grounding</span> <span class="reroll-sub"> </span></div> <span class="reroll-spinner" aria-hidden="true">β»</span></div>');function nn(n,e){let t=Qe(e,"attempt",3,2),r=Qe(e,"max",3,3);var s=tn(),d=w(s);ot(d,{tier:"modeled",size:11,color:"var(--tier-modeled)"});var o=N(d,2),p=N(w(o),2),f=w(p);y(p),y(o),Re(2),y(s),Z(()=>Y(f,`Mellea reconciler Β· attempt ${t()??""} of ${r()??""} Β· previous draft dimmed below`)),F(n,s)}var rn=P("<a> </a>"),an=P('<button type="button"> </button>'),sn=P('<article role="alert" aria-live="assertive"><header class="error-card-head"><!> <span class="error-card-eyebrow"> </span></header> <h3 class="error-card-headline"> </h3> <p class="error-card-body"> </p> <div class="error-card-actions"></div> <footer class="error-card-foot"><span class="section-label">Trust signals Β· still on</span> <span class="error-card-foot-copy">All foundation models Apache-2.0 Β· No commercial APIs at runtime</span></footer></article>');function on(n,e){const t={geocoder:{eyebrow:"Address not resolved",headline:"We couldn't resolve that to a NYC address.",body:`Try a more specific street address β for example, "80 Pioneer Street, Brooklyn." Riprap covers the five boroughs only; international addresses, NJ addresses, and points outside NYC aren't supported.`,tier:"proxy",defaultActions:["Use a sample query","Edit query"]},"all-silent":{eyebrow:"Outside evidence coverage",headline:"No specialists found evidence at this point.",body:"The address resolved, but every flood-evidence specialist returned silent. This is rare and usually means parkland, water, or a point with no nearby 311, no FloodNet sensor, and no Sandy overlap. Try a nearby street address or expand to neighborhood-mode.",tier:"proxy",defaultActions:["Try nearby address","Switch to neighborhood-mode"]},grounding:{eyebrow:"Grounding failure",headline:"Briefing prose couldn't be composed within citation constraints.",body:"Mellea rejected all reroll attempts. The underlying evidence is fine β only the prose composition failed. Download the structured evidence below, or contact support.",tier:"modeled",defaultActions:["Download evidence (JSON)","Contact support","Try again"]},backend:{eyebrow:"Backend unavailable",headline:"All routing targets exhausted.",body:"LiteLLM tried Local Ollama β HF Space T4 β AMD MI300X and didn't reach a healthy backend. This usually clears within 5 minutes during a deploy window. The hardware-pill in the header is currently red.",tier:"proxy",defaultActions:["Retry now","Switch backend"]}};let r=re(()=>t[e.state]),s=re(()=>e.actions??a(r).defaultActions.map(K=>({label:K})));var d=sn(),o=w(d),p=w(o);ot(p,{get tier(){return a(r).tier},size:11,get color(){return`var(--tier-${a(r).tier??""})`}});var f=N(p,2),l=w(f,!0);y(f),y(o);var c=N(o,2),h=w(c,!0);y(c);var M=N(c,2),B=w(M,!0);y(M);var j=N(M,2);ct(j,21,()=>a(s),Wt,(K,E,R)=>{var ee=Ft(),$e=be(ee);{var Te=V=>{var D=rn();ze(D,1,"error-card-action",null,{},{"is-primary":R===0});var Q=w(D,!0);y(D),Z(()=>{Kt(D,"href",a(E).href),Y(Q,a(E).label)}),F(V,D)},de=V=>{var D=an();ze(D,1,"error-card-action",null,{},{"is-primary":R===0});var Q=w(D,!0);y(D),Z(()=>Y(Q,a(E).label)),Et("click",D,function(...ie){var ue;(ue=a(E).onClick)==null||ue.apply(this,ie)}),F(V,D)};W($e,V=>{a(E).href?V(Te):V(de,-1)})}F(K,ee)}),y(j),Re(2),y(d),Z(()=>{ze(d,1,`error-card error-card-${e.state??""}`),Y(l,e.eyebrowOverride??a(r).eyebrow),Y(h,e.headlineOverride??a(r).headline),Y(B,e.bodyOverride??a(r).body)}),F(n,d)}De(["click"]);const X="2026-05";function ln(n){return n==="fan"||n==="merge"?"fired":n==="silent"?"silent_by_design":n==="error"?"errored":"fired"}function dt(n){return[n,...(n.children??[]).flatMap(dt)]}function cn(n){const e=n.toLowerCase();return e==="sandy_inundation"||e==="sandy"||e==="dep_stormwater"||e==="dep"||e==="ida_hwm_2021"||e==="ida_hwm"||e==="prithvi_eo_v2"||e==="prithvi_water"||e==="microtopo_lidar"||e==="microtopo"?"cornerstone":e==="mta_entrance_exposure"||e==="mta_entrances"||e==="nycha_development_exposure"||e==="nycha_developments"||e==="doe_school_exposure"||e==="doe_schools"||e==="doh_hospital_exposure"||e==="doh_hospitals"||e==="terramind_synthesis"||e==="terramind"||e==="terramind_buildings"||e==="eo_chip_fetch"?"keystone":e==="floodnet"||e==="nyc311"||e==="nws_obs"||e==="noaa_tides"||e==="prithvi_eo_live"||e==="prithvi_live"||e==="terramind_lulc"?"touchstone":e==="nws_alerts"||e==="ttm_forecast"||e==="ttm_311_forecast"||e==="floodnet_forecast"||e==="ttm_battery_surge"?"lodestone":e.startsWith("reconcile")||e.startsWith("mellea")||e==="rag_granite_embedding"||e==="gliner_extract"?"capstone":null}function dn(n){const e={cornerstone:[],keystone:[],touchstone:[],lodestone:[],capstone:[]};if(n)for(const t of dt(n)){const r=cn(t.name);r&&e[r].push({id:t.id||t.name,name:t.name,status:ln(t.status),tier:t.tier,ms:t.ms,note:t.note??t.error??void 0})}return Object.keys(e).map(t=>({key:t,members:Yt(t,e[t])}))}function b(n){return typeof n=="number"&&Number.isFinite(n)?n:null}function T(n){return typeof n=="string"?n:null}function I(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function un(n,e){return n.sandy!==!0?null:{id:"fsm-sandy",stone:"cornerstone",tier:"empirical",variant:"headline",source:"NYC OEM",agency:"NYC OpenData 5xsi-dfpx Β· Sandy 2012 inundation",vintage:"2012-10-29",title:"Hurricane Sandy 2012 inundation",headline:"Inside zone",subhead:(e&&T(e.address))??"address inside the empirical 2012 extent",body:"Address sits within the empirical Hurricane Sandy 2012 inundation extent. This is a historical fact, not a model prediction.",docId:"sandy",citeId:"sandy",mapLayer:"sandy"}}function pn(n){const e=I(n.dep);if(!e)return null;const t=[];for(const[r,s]of Object.entries(e)){const d=I(s);if(!d)continue;const o=b(d.depth_class)??0;o<=0||t.push([r.replace("dep_",""),T(d.depth_label)??"β",`class ${o}`])}return t.length?{id:"fsm-dep",stone:"cornerstone",tier:"modeled",variant:"tabular",source:"NYC DEP",agency:"NYC Department of Environmental Protection Β· Stormwater Flood Maps",vintage:"2021",title:"Stormwater flood scenarios at this address",columns:["scenario","depth label","class"],rows:t,sub:`${t.length} scenario${t.length===1?"":"s"} place this lot in modeled flooding`,docId:"dep_stormwater",citeId:"dep",mapLayer:"stormwater"}:null}function mn(n){const e=I(n.ida_hwm);if(!e)return null;const t=b(e.n_within_radius);if(!t||t<=0)return null;const r=[];return r.push(["count",`${t}`,`${b(e.radius_m)??800} m radius`]),b(e.max_height_above_gnd_ft)!=null&&r.push(["max above gnd",`${e.max_height_above_gnd_ft} ft`,"β"]),b(e.nearest_dist_m)!=null&&r.push(["nearest",T(e.nearest_site)??"HWM",`${e.nearest_dist_m} m`]),{id:"fsm-ida-hwm",stone:"cornerstone",tier:"empirical",variant:"tabular",source:"USGS",agency:"USGS STN Hurricane Ida 2021 high-water marks (Event 312)",vintage:"2021-09",title:"Hurricane Ida 2021 high-water marks nearby",columns:["field","value","context"],rows:r,docId:"ida_hwm",citeId:"ida_hwm",mapLayer:"hwm"}}function fn(n){const e=I(n.prithvi_water);if(!e)return null;const t=b(e.nearest_distance_m);return t==null?null:{id:"fsm-prithvi-water",stone:"cornerstone",tier:"modeled",variant:"raster",source:"Prithvi-EO 2.0",agency:"IBM/NASA Prithvi-EO 2.0 Β· baked Hurricane Ida 2021 polygons",vintage:"2021-09-02",title:"Hurricane Ida 2021 β satellite-attributable inundation",rasterKind:"prithvi",headline:e.inside_water_polygon?"Inside polygon":`${t} m away`,subhead:"pre/post HLS Sentinel-2 segmentation",sub:`${b(e.n_polygons_within_500m)??0} distinct polygons within 500 m`,docId:"prithvi_water",citeId:"prithvi_water",mapLayer:"prithvi"}}function _n(n){const e=I(n.microtopo);if(!e)return null;const t=b(e.point_elev_m);if(t==null)return null;const r=[{value:`${t.toFixed(1)} m`,label:"elevation"}];return b(e.hand_m)!=null&&r.push({value:`${e.hand_m.toFixed(1)} m`,label:"HAND"}),b(e.twi)!=null&&r.push({value:`${e.twi.toFixed(1)}`,label:"TWI"}),b(e.rel_elev_pct_200m)!=null&&r.push({value:`${e.rel_elev_pct_200m}%`,label:"pct lower 200m"}),{id:"fsm-microtopo",stone:"cornerstone",tier:"proxy",variant:"scalars",source:"USGS 3DEP",agency:"USGS 3DEP DEM (LiDAR-derived) + whitebox-workflows hydrology",vintage:"2018",title:"Microtopography at this point",scalars:r,sub:"Lower percentile = topographic low point; runoff routes here.",docId:"microtopo",citeId:"microtopo"}}function hn(n){const e=[],t=I(n.mta_entrances);if(t!=null&&t.available&&Array.isArray(t.entrances))for(const o of t.entrances.slice(0,4))e.push({reg:"MTA",tier:"empirical",label:T(o.station_name)??T(o.entrance_id)??"entrance",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.daytime_routes)??""}`.trim(),sourceId:T(o.station_id)??"MTA",note:null});else t&&t.available===!1&&e.push({reg:"MTA",tier:"empirical",label:null,detail:null,sourceId:null,note:"no subway entrances within 1.0 mi (silent)"});const r=I(n.nycha_developments);if(r!=null&&r.available&&Array.isArray(r.developments))for(const o of r.developments.slice(0,3))e.push({reg:"NYCHA",tier:"empirical",label:T(o.development)??"development",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.borough)??""}`.trim(),sourceId:T(o.tds_num)??null,note:null});else r&&r.available===!1&&e.push({reg:"NYCHA",tier:"empirical",label:null,detail:null,sourceId:null,note:"no NYCHA developments within 1.0 mi (silent)"});const s=I(n.doe_schools);if(s!=null&&s.available&&Array.isArray(s.schools))for(const o of s.schools.slice(0,3))e.push({reg:"DOE",tier:"empirical",label:T(o.loc_name)??"school",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.borough)??""}`.trim(),sourceId:T(o.loc_code)??null,note:null});else s&&s.available===!1&&e.push({reg:"DOE",tier:"empirical",label:null,detail:null,sourceId:null,note:"no schools within 1.0 mi (silent)"});const d=I(n.doh_hospitals);if(d!=null&&d.available&&Array.isArray(d.hospitals))for(const o of d.hospitals.slice(0,3))e.push({reg:"DOH",tier:"empirical",label:T(o.facility_name)??"hospital",detail:`${b(o.distance_m)??"β"} m Β· ${T(o.borough)??""}`.trim(),sourceId:T(o.fac_id)??null,note:null});else d&&d.available===!1&&e.push({reg:"DOH",tier:"empirical",label:null,detail:null,sourceId:null,note:"no acute-care hospital within 1.0 mi (silent)"});return e.length?{id:"fsm-registers",stone:"keystone",tier:"empirical",variant:"register",source:"NYC OpenData",agency:"NYC OpenData Β· multi-agency join",vintage:X,title:"Nearby exposed assets",registers:e,sub:`${e.filter(o=>o.label).length} of ${e.length} registers fired Β· joined within 1.0 mi`,docId:"registers",citeId:"registers",mapLayer:"registers"}:null}function vn(n){const e=I(n.terramind_buildings);return e!=null&&e.ok?{id:"fsm-tm-buildings",stone:"keystone",tier:"modeled",variant:"raster-pred",source:"TerraMind-NYC",agency:"msradam/TerraMind-NYC-Adapters Β· Buildings LoRA",vintage:"2026",title:"NYC building footprints β TerraMind LoRA",rasterKind:"buildings",headline:`${b(e.pct_buildings)??0}%`,subhead:"building-footprint coverage in chip",sub:`${b(e.n_building_components)??0} distinct components Β· test mIoU 0.5511`,illustrative:!0,docId:"tm_buildings",citeId:"tm_buildings",mapLayer:"buildings"}:null}function gn(n){const e=I(n.floodnet);if(!e||(b(e.n_sensors)??0)<=0)return null;const t=b(e.n_flood_events_3y)??0;return{id:"fsm-floodnet",stone:"touchstone",tier:"empirical",variant:"spark",source:"FloodNet",agency:"FloodNet NYC ultrasonic depth sensor network",vintage:"2026",title:"FloodNet sensors near this address",headline:`${t} events`,subhead:`${b(e.n_sensors)??0} sensors Β· last 3 y`,spark:Array.from({length:24},(r,s)=>Math.max(0,Math.round(t/24*1.4*Math.exp(-Math.pow((s-14)/4,2))+t/24))),sparkSub:"Above-curb depth events β₯ 2 cm. Synthetic monthly distribution; raw deployment-id history is in the audit panel.",docId:"floodnet",citeId:"floodnet",mapLayer:"floodnet"}}function yn(n){var p;const e=I(n.nyc311);if(!e)return null;const t=b(e.n)??0;if(t<=0)return null;const r=I(e.by_year),s=I(e.by_descriptor),d=r?Object.values(r).map(f=>b(f)??0):Array.from({length:12},()=>Math.round(t/12)),o=s?(p=Object.entries(s).sort((f,l)=>(b(l[1])??0)-(b(f[1])??0))[0])==null?void 0:p[0]:null;return{id:"fsm-311",stone:"touchstone",tier:"proxy",variant:"histogram",source:"NYC 311",agency:"NYC 311 service requests (Socrata erm2-nwe9)",vintage:X,title:"Recent 311 flood complaints",headline:`${t} calls`,subhead:o?`top descriptor: ${o}`:"all flood-related descriptors",histogram:d,sparkSub:`Within ${b(e.radius_m)??200} m Β· ${b(e.years)??5} y window. Filtered to flood-relevant descriptors.`,docId:"nyc311",citeId:"nyc311",mapLayer:"complaints"}}function bn(n){var r;const e=I(n.nws_obs);if(!e||e.error||e.station_id==null)return null;const t=[];return b(e.precip_last_hour_mm)!=null&&t.push({value:`${e.precip_last_hour_mm} mm`,label:"precip Β· 1h"}),b(e.precip_last_6h_mm)!=null&&t.push({value:`${e.precip_last_6h_mm} mm`,label:"precip Β· 6h"}),t.length?{id:"fsm-nws-obs",stone:"touchstone",tier:"empirical",variant:"scalars",source:"NWS",agency:`NWS ASOS station ${T(e.station_id)??"?"}`,vintage:((r=T(e.obs_time))==null?void 0:r.slice(0,10))??X,title:"Recent precipitation",scalars:t,sub:`Nearest hourly METAR: ${T(e.station_name)??"?"} (${b(e.distance_km)??"?"} km).`,docId:"nws_obs",citeId:"nws_obs",mapLayer:"nws"}:null}function wn(n){var r;const e=I(n.noaa_tides);if(!e||e.error||b(e.observed_ft_mllw)==null)return null;const t=[{value:`${e.observed_ft_mllw} ft`,label:"observed (MLLW)"}];return b(e.predicted_ft_mllw)!=null&&t.push({value:`${e.predicted_ft_mllw} ft`,label:"predicted"}),b(e.residual_ft)!=null&&t.push({value:`${e.residual_ft} ft`,label:"residual"}),{id:"fsm-noaa",stone:"touchstone",tier:"empirical",variant:"scalars",source:"NOAA CO-OPS",agency:`NOAA tide gauge ${T(e.station_name)??T(e.station_id)??"?"}`,vintage:((r=T(e.obs_time))==null?void 0:r.slice(0,10))??X,title:"Live water level (nearest tide gauge)",scalars:t,sub:"Residual = observed β astronomical tide; positive residual is wind / surge component.",docId:"noaa_tides",citeId:"noaa_tides",mapLayer:"noaa"}}function Sn(n){var r;const e=I(n.prithvi_live);if(!(e!=null&&e.ok))return null;const t=(r=T(e.item_datetime))==null?void 0:r.slice(0,10);return{id:"fsm-prithvi-live",stone:"touchstone",tier:"modeled",variant:"raster-pred",source:"Prithvi-NYC-Pluvial",agency:"NASA-IBM Prithvi v2 Β· NYC fine-tune",vintage:t?`${t} Β· Sentinel-2`:"Sentinel-2",title:"Pluvial flood prediction Β· Prithvi-NYC-Pluvial",rasterKind:"prithvi",headline:`${b(e.pct_water_within_500m)??0}% flooded`,subhead:`water within 500 m Β· cloud ${b(e.cloud_cover)??"?"}%`,sub:"Test flood IoU 0.5979 on held-out NYC chips. Model interpretation, not a measurement.",illustrative:!0,docId:"prithvi_live",citeId:"prithvi_live",mapLayer:"prithvi-pluvial"}}const xn={urban:"#C66",water:"#5B7FB4",vegetation:"#5B8A4A",barren:"#A89A78",wetland:"#D9C75A"};function kn(n){const e=I(n.terramind_lulc);if(!(e!=null&&e.ok))return null;const t=I(e.class_fractions)??{},r={urban:0,water:0,vegetation:0,barren:0,wetland:0};for(const[d,o]of Object.entries(t)){const p=d.toLowerCase();p.includes("urban")||p.includes("built")||p.includes("impervious")?r.urban+=o:p.includes("water")?r.water+=o:p.includes("tree")||p.includes("vegetation")||p.includes("crop")||p.includes("grass")?r.vegetation+=o:p.includes("bare")||p.includes("barren")||p.includes("soil")?r.barren+=o:p.includes("wet")||p.includes("marsh")?r.wetland+=o:r.barren+=o}const s=Object.entries(r).filter(([,d])=>d>0).map(([d,o])=>({k:d,pct:Math.round(o),color:xn[d]}));return{id:"fsm-tm-lulc",stone:"touchstone",tier:"synthetic",variant:"lulc",source:"TerraMind v1.2",agency:"IBM TerraMind v1.2 Β· Sentinel-2 inputs",vintage:"Sentinel-2",title:"Land use / land cover Β· TerraMind v1.2",rasterKind:"lulc",classMix:s.length?s:void 0,sub:"Synthetic prior. LULC palette is a layer convention, not a tier signal.",illustrative:!0,docId:"tm_lulc",citeId:"tm_lulc",mapLayer:"terramind-lulc"}}function An(n){const e=I(n.ttm_forecast);if(!(e!=null&&e.available)||!e.interesting)return null;const t=b(e.forecast_peak_ft),r=b(e.forecast_peak_minutes_ahead);return t==null||r==null?null:{id:"fsm-ttm-fc",stone:"lodestone",tier:"modeled",variant:"timeseries",source:"Granite TTM r2 (zero-shot)",agency:"IBM Granite-TimeSeries Β· regional",vintage:X,title:"Storm surge nowcast at The Battery β 9.6 h horizon (regional)",timeseries:{hours:96,peak:{x:38,y:47},peakLabel:`${t} ft @ +${Math.round(r/60)}h`},headline:`${t} ft`,subhead:"peak surge residual Β· 9.6h horizon Β· 6-min cadence",sub:"Regional disclosure. Distinct from the fine-tuned Battery surge nowcast.",spatialNote:"regional Β· Battery, not point-of-query",docId:"ttm_forecast",citeId:"ttm_forecast"}}function Nn(n){const e=I(n.ttm_battery_surge);if(!(e!=null&&e.available)||!e.interesting)return null;const t=b(e.forecast_peak_m),r=b(e.forecast_peak_hours_ahead);return t==null||r==null?null:{id:"fsm-ttm-batt",stone:"lodestone",tier:"modeled",variant:"timeseries-ft",source:"msradam/Granite-TTM-r2-Battery-Surge",agency:"Granite TTM r2 Β· NYC-specialized fine-tune",vintage:X,title:"Storm surge nowcast at The Battery β 96 h horizon (NYC-specialized fine-tune)",timeseries:{hours:96,peak:{x:r,y:Math.round(t*100)},peakLabel:`${(t*100).toFixed(0)} cm @ +${r}h`},headline:`${(t*100).toFixed(0)} cm`,subhead:"peak surge Β· 96h horizon Β· hourly cadence",sub:"Fine-tuned on NYC tide-gauge history. Hourly cadence; applies city-wide via NOAA station 8518750.",spatialNote:"regional Β· The Battery, not point-of-query",docId:"ttm_battery",citeId:"ttm_battery",hfModelCard:"huggingface.co/msradam/Granite-TTM-r2-Battery-Surge",rmse:"0.157 m",skillVsPersistence:"β35% vs persistence",hardwareBadge:"MI300X"}}function $n(n){const e=I(n.nws_alerts);if(!e)return null;const t=b(e.n_active)??0;if(t<=0)return null;const r=Array.isArray(e.alerts)?e.alerts:[];return{id:"fsm-nws-alerts",stone:"lodestone",tier:"modeled",variant:"tabular",source:"NWS",agency:"NWS Public Alerts API Β· flood-relevant filter",vintage:X,title:`${t} active flood-relevant alert${t===1?"":"s"}`,columns:["event","severity","expires"],rows:r.slice(0,4).map(s=>[T(s.event)??"?",T(s.severity)??"?",(T(s.expires)??"").slice(0,16)]),sub:"Live NWS feed. If a FLOOD or FLASH FLOOD WARNING is in this list, foreground it.",docId:"nws_alerts",citeId:"nws_alerts"}}function Tn(n,e){var M;const t=n.mellea??{},r=Array.isArray(t.requirements_passed)?t.requirements_passed:Array.isArray(t.passed)?t.passed:[],s=Array.isArray(t.requirements_failed)?t.requirements_failed:Array.isArray(t.failed)?t.failed:[],d=r.length,o=s.length,p=(typeof t.requirements_total=="number"?t.requirements_total:d+o)||4,f=typeof t.n_attempts=="number"?t.n_attempts:typeof t.attempts=="number"?t.attempts:0,c=(typeof t.rerolls=="number"?t.rerolls:null)??Math.max(0,f-1),h=((M=n.citations)==null?void 0:M.length)??0;return{id:"fsm-capstone-meta",stone:"capstone",tier:"modeled",variant:"meta",source:"Mellea",agency:"Capstone synthesis Β· Granite 4.1 + Mellea grounding check",vintage:X,title:"Briefing reconciliation",metaRows:[{k:"mellea reroll",v:`${c} reroll${c===1?"":"s"}`},{k:"grounding checks",v:`${d}/${p} passed`},{k:"citations resolved",v:`${h}`},{k:"wall-clock",v:e!=null?`${e.toFixed(1)} s`:"β"}],sub:"Capstone produces prose, not cards. This meta-card is the integrity-narration UI for the entire pipeline.",docId:"capstone"}}function et(n,e,t,r=!0){const s=n??{},d=I(s.geocode);return{cards:[un(s,d),pn(s),mn(s),fn(s),_n(s),hn(s),vn(s),gn(s),yn(s),bn(s),wn(s),Sn(s),kn(s),$n(s),An(s),Nn(s),r?Tn(n??{},t):null].filter(p=>p!=null),stones:dn(e),wallSeconds:t}}function Cn(n,e,t,r){const d={sandy_inundation:"sandy",dep_stormwater:"dep",floodnet:"floodnet",nyc311:"nyc311",noaa_tides:"noaa_tides",nws_alerts:"nws_alerts",nws_obs:"nws_obs",ttm_forecast:"ttm_forecast",ttm_311_forecast:"ttm_311_forecast",ttm_battery_surge:"ttm_battery_surge",floodnet_forecast:"floodnet_forecast",ida_hwm_2021:"ida_hwm",prithvi_eo_v2:"prithvi_water",prithvi_eo_live:"prithvi_live",microtopo_lidar:"microtopo",mta_entrance_exposure:"mta_entrances",nycha_development_exposure:"nycha_developments",doe_school_exposure:"doe_schools",doh_hospital_exposure:"doh_hospitals",terramind_synthesis:"terramind",terramind_lulc:"terramind_lulc",terramind_buildings:"terramind_buildings",eo_chip_fetch:"eo_chip",geocode:"geocode"}[e];if(!d)return[];if(e==="sandy_inundation"){const o=t;n[d]=r&&(o==null?void 0:o.inside)===!0?!0:r?!1:null}else if(e==="dep_stormwater"){const o=t??{},p={};for(const[f,l]of Object.entries(o)){const c=typeof l=="string"?l:"";c&&(p[f]={depth_class:1,depth_label:c})}n[d]=Object.keys(p).length?p:null}else r&&t!=null?n[d]=t:n[d]=null;return[d]}const we={subway:"MTA Β· USGS Β· FEMA Β· NYC OEM Β· NYC DEP",nycha:"NYC HA Β· USGS Β· NYC OEM Β· NYC DEP",school:"NYC DOE Β· USGS Β· NYC OEM Β· NYC DEP",hospital:"NYS DOH Β· USGS Β· NYC OEM Β· NYC DEP"},Se={subway:"subway entrances",nycha:"NYCHA developments",school:"public schools",hospital:"hospitals"};function xe(n){return!n||!Number.isFinite(n)?"β":`${Math.round(n)}m`}function ke(n){return n==null||!Number.isFinite(n)?"β":`${(n*3.28084).toFixed(1)} ft`}function Ae(n,e){return typeof e=="number"?e>=.5?`Inundated 2012 (${Math.round(e*100)}%)`:e>0?`Edge (${Math.round(e*100)}%)`:"β":n?"Inundated 2012":"β"}function Ne(n,e,t){return typeof t=="number"?t>=.5?`β₯${Math.round(t*100)}% in scenario`:t>0?`${Math.round(t*100)}% edge`:"minimal":n&&n.length?n:e&&e>0?`class ${e}`:"minimal"}function In(n){return n?/elevator|easement|stair.*ramp/i.test(n):!1}function Mn(n){if(!n.available)return null;const t=(n.entrances??[]).map(r=>{const s=In(r.entrance_type);return{name:`${r.station_name??"?"}${r.daytime_routes?` (${String(r.daytime_routes).split(/\s+/).slice(0,3).join("/")})`:""}`,elev:ke(r.elev_m),ada:s,fema:"Zone X",sandy:Ae(r.inside_sandy_2012),dep:Ne(r.dep_extreme_2080_label,r.dep_extreme_2080_class),asset:"subway",primaryTier:r.inside_sandy_2012?"empirical":"modeled"}});return{type:Se.subway,radius:xe(n.radius_m),count:n.n_entrances??t.length,rows:t,sourceLabel:we.subway}}function qn(n){if(!n.available)return null;const t=(n.developments??[]).map(r=>{const s=r.pct_inside_sandy_2012,d=r.pct_in_dep_extreme_2080;return{name:`${r.development??"?"}${r.borough?` Β· ${r.borough}`:""}`,elev:ke(r.rep_elevation_m),ada:!1,fema:"β",sandy:Ae(void 0,s),dep:Ne(void 0,void 0,d),asset:"nycha",primaryTier:s&&s>0?"empirical":"modeled"}});return{type:Se.nycha,radius:xe(n.radius_m),count:n.n_developments??t.length,rows:t,sourceLabel:we.nycha}}function Fn(n){if(!n.available)return null;const t=(n.schools??[]).map(r=>({name:`${r.school_name??r.name??"?"}${r.borough?` Β· ${r.borough}`:""}`,elev:ke(r.elev_m),ada:!1,fema:"β",sandy:Ae(r.inside_sandy_2012),dep:Ne(r.dep_extreme_2080_label,r.dep_extreme_2080_class),asset:"school",primaryTier:r.inside_sandy_2012?"empirical":"modeled"}));return{type:Se.school,radius:xe(n.radius_m),count:n.n_schools??t.length,rows:t,sourceLabel:we.school}}function En(n){if(!n.available)return null;const t=(n.hospitals??[]).map(r=>({name:`${r.facility_name??r.name??"?"}${r.borough?` Β· ${r.borough}`:""}`,elev:ke(r.elev_m),ada:!0,fema:"β",sandy:Ae(r.inside_sandy_2012),dep:Ne(r.dep_extreme_2080_label,r.dep_extreme_2080_class),asset:"hospital",primaryTier:r.inside_sandy_2012?"empirical":"modeled"}));return{type:Se.hospital,radius:xe(n.radius_m),count:n.n_hospitals??t.length,rows:t,sourceLabel:we.hospital}}function Ln(n){if(!n)return[];const e=[],t=Mn(n.mta_entrances??{});t&&t.rows.length&&e.push(t);const r=qn(n.nycha_developments??{});r&&r.rows.length&&e.push(r);const s=Fn(n.doe_schools??{});s&&s.rows.length&&e.push(s);const d=En(n.doh_hospitals??{});return d&&d.rows.length&&e.push(d),e}function Pn(n,e){const t=`/api/agent/stream?q=${encodeURIComponent(n)}`,r=new EventSource(t);let s="",d;const o=/([.?!])(\s|$)/;function p(l=!1){var h,M;let c;for(;c=o.exec(s);){const B=c.index+c[1].length+(c[2]?c[2].length:0),j=s.slice(0,B).trim();s=s.slice(B),j&&((h=e.onSentence)==null||h.call(e,j,d))}l&&s.trim()&&((M=e.onSentence)==null||M.call(e,s.trim(),d),s="")}function f(l,c){r.addEventListener(l,h=>{try{c(JSON.parse(h.data))}catch{}})}return f("hello",l=>{var c;return(c=e.onHello)==null?void 0:c.call(e,l.query)}),f("plan_token",l=>{var c;return(c=e.onPlanToken)==null?void 0:c.call(e,l.delta)}),f("plan",l=>{var c;return(c=e.onPlan)==null?void 0:c.call(e,l)}),f("step",l=>{var c;return(c=e.onStep)==null?void 0:c.call(e,l)}),f("token",l=>{var c,h;l.attempt!==d&&(d=l.attempt,s="",(c=e.onAttemptStart)==null||c.call(e,l.attempt??1)),(h=e.onToken)==null||h.call(e,l.delta,l.attempt),s+=l.delta,p(!1)}),f("mellea_attempt",l=>{var c;return(c=e.onMelleaAttempt)==null?void 0:c.call(e,l)}),f("final",l=>{var c;p(!0),(c=e.onFinal)==null||c.call(e,l)}),f("error",l=>{var c;return(c=e.onError)==null?void 0:c.call(e,l.err)}),r.addEventListener("done",()=>{var l;p(!0),(l=e.onDone)==null||l.call(e),r.close()}),r.addEventListener("error",()=>{var l;p(!0),(l=e.onError)==null||l.call(e,"SSE connection error"),r.close()}),{close:()=>r.close()}}const ut=[{key:"status",label:"Status",n:"01",aliases:["status"]},{key:"empirical",label:"Empirical evidence",n:"02",tier:"empirical",aliases:["empirical evidence","empirical"]},{key:"modeled",label:"Modeled scenarios",n:"03",tier:"modeled",aliases:["modeled scenarios","modeled"]},{key:"policy",label:"Policy context",n:"04",aliases:["policy context","policy"]}];function tt(n){const e=n.toLowerCase().replace(/[.:]+\s*$/,"").trim();return ut.find(t=>t.aliases.includes(e))}const nt=/(^|\n)\s*(?:\*\*([A-Z][A-Za-z\s/]+?)\.\s*\*\*|#{1,3}\s*(0[1-4])\s*[:\-β.]?\s*([^\n]+))/g;function pt(n,e,t){return{id:e,n,tier:lt(e),source:(t==null?void 0:t.source)??e.split(/[_-]/)[0].toUpperCase(),title:(t==null?void 0:t.title)??e,docId:e,url:(t==null?void 0:t.url)??"",vintage:(t==null?void 0:t.vintage)??"",retrieved:(t==null?void 0:t.retrieved)??""}}const jn=/\[([a-z][a-z0-9_]*(?:\s*,\s*[a-z][a-z0-9_]*)*)\]/gi;function rt(n){return n.split(new RegExp("(?<=[.!?])\\s+(?=[A-Z(])","g")).filter(t=>t.trim().length>0)}function it(n,e,t){let r=0;const s=[],d=[...n.matchAll(jn)];if(d.length===0)return[{text:n}];for(const o of d){const p=n.slice(r,o.index??0),f=o[1].split(/\s*,\s*/).filter(Boolean);r=(o.index??0)+o[0].length;const l=lt(f[0]);s.push({text:p,tier:l,cite:f[0]});for(const c of f)e[c]||(e[c]=t(c))}if(r<n.length){const o=n.slice(r);o.trim()&&s.push({text:o})}return s}function On(n,e={}){const t={...e};let r=Object.values(t).reduce((l,c)=>Math.max(l,c.n),0)+1;const s=new Set,d=l=>(e[l]||s.add(l),pt(r++,l)),o=[],p=[];let f;for(nt.lastIndex=0;f=nt.exec(n);)if(f[2]!==void 0){const l=tt(f[2]);if(!l)continue;p.push({num:l.n,label:l.label,tier:l.tier,start:f.index+f[1].length,bodyStart:f.index+f[0].length})}else if(f[3]!==void 0){const l=f[3],c=(f[4]??"").trim(),h=ut.find(M=>M.n===l)??tt(c);p.push({num:l,label:(h==null?void 0:h.label)??c,tier:h==null?void 0:h.tier,titleExtra:h&&c.toLowerCase()!==h.label.toLowerCase()?c:void 0,start:f.index+f[1].length,bodyStart:f.index+f[0].length})}for(let l=0;l<p.length;l++){const c=p[l],h=p[l+1],M=n.slice(c.bodyStart,h?h.start:n.length).trim();if(M){o.push({kind:"head",n:c.num,label:c.label,tier:c.tier,title:c.titleExtra});for(const B of M.split(/\n\s*\n/)){const j=B.replace(/\s+/g," ").trim();if(!j)continue;const K=rt(j),E=[];for(const R of K)E.push(...it(R,t,d)),E.push({text:" "});for(;E.length&&E[E.length-1].text.trim()===""&&!E[E.length-1].tier;)E.pop();E.length&&o.push({kind:"prose",parts:E})}}}if(o.length===0&&n.trim()){o.push({kind:"head",n:"01",label:"Status"});const l=n.replace(/\s+/g," ").trim(),c=rt(l),h=[];for(const M of c)h.push(...it(M,t,d)),h.push({text:" "});for(;h.length&&h[h.length-1].text.trim()===""&&!h[h.length-1].tier;)h.pop();h.length&&o.push({kind:"prose",parts:h})}return{blocks:o,citations:t,unresolvedDocIds:[...s]}}const le={type:"FeatureCollection",features:[]};async function ce(n){try{const e=await fetch(n);if(!e.ok)return le;const t=await e.json();return!t||t.type!=="FeatureCollection"?le:t}catch{return le}}async function zn(n,e,t=1500){return ce(`/api/layers/sandy?lat=${n}&lon=${e}&r=${t}`)}async function Dn(n,e,t=1500){return ce(`/api/layers/dep_extreme_2080?lat=${n}&lon=${e}&r=${t}`)}async function at(n,e,t=1500){return ce(`/api/layers/prithvi_water?lat=${n}&lon=${e}&r=${t}`)}async function Rn(n){return ce(`/api/layers/sandy_clipped?code=${encodeURIComponent(n)}`)}async function Yn(n,e="dep_extreme_2080"){return ce(`/api/layers/dep_clipped?code=${encodeURIComponent(n)}&scenario=${e}`)}async function st(n,e,t=1500){try{const r=await fetch(`/api/floodnet_near?lat=${n}&lon=${e}&r=${t}`);return r.ok?{type:"FeatureCollection",features:(await r.json()).features.map(o=>{const p=o.properties??{};return{...o,properties:{...p,count:typeof p.n_events_3y=="number"?p.n_events_3y:1}}})}:le}catch{return le}}var Bn=P('<span class="region-head-meta svelte-1q8jizq"> <!></span>'),Hn=P('<span class="region-head-meta svelte-1q8jizq">planningβ¦</span>'),Un=P('<div class="reroll-prev svelte-1q8jizq" aria-hidden="true"><p class="reroll-prev-line svelte-1q8jizq"> </p></div>'),Gn=P("<!> <!>",1),Wn=P('<span class="streaming-caret svelte-1q8jizq" aria-hidden="true">β</span>'),Kn=P("<!> <!>",1),Vn=P('<details class="plan-details svelte-1q8jizq"><summary class="svelte-1q8jizq"> </summary> <pre class="plan-stream svelte-1q8jizq"> </pre></details>'),Zn=P('<div class="generating-status svelte-1q8jizq" aria-live="polite"><span class="pulse svelte-1q8jizq"></span> Planning intentβ¦ <!></div>'),Jn=P('<div class="generating-status svelte-1q8jizq" aria-live="polite"><span class="pulse svelte-1q8jizq"></span> Resolving addressβ¦</div>'),Xn=P("<!> <!>",1),Qn=P('<span class="region-head-meta svelte-1q8jizq"> </span>'),er=P('<span class="region-head-meta svelte-1q8jizq">awaiting geocodeβ¦</span>'),tr=P('<div style="position: relative; flex: 1; min-height: 0;" class="svelte-1q8jizq"><!> <!></div>'),nr=P('<section class="hero-band svelte-1q8jizq"><div class="hero-band-inner svelte-1q8jizq"><div class="app-shell-top is-desktop svelte-1q8jizq"><main id="region-briefing" class="app-region app-region-brief svelte-1q8jizq" aria-labelledby="brief-h1"><header class="region-head svelte-1q8jizq"><span class="section-label svelte-1q8jizq">Briefing</span> <!></header> <h1 id="brief-h1" class="brief-h1 svelte-1q8jizq">Flood-exposure briefing <span class="brief-h1-addr svelte-1q8jizq"> </span></h1> <!></main> <div class="app-region-side svelte-1q8jizq" style="grid-area: side;"><aside id="region-map" class="app-region app-region-map svelte-1q8jizq" aria-label="Map region"><header class="region-head svelte-1q8jizq"><span class="section-label svelte-1q8jizq">Map</span> <!></header> <!></aside> <aside id="region-cites" class="app-region app-region-cites svelte-1q8jizq" aria-label="Citations"><!></aside></div></div> <div class="app-shell-bottom svelte-1q8jizq"><section class="app-region app-region-findings svelte-1q8jizq" aria-label="Findings"><!></section></div></div></section>');function fr(n,e){Pt(e,!0);let t=re(()=>zt.params.queryId??""),r=re(()=>()=>{try{return decodeURIComponent(a(t))}catch{return a(t)}}),s=A(null),d=A(""),o=A(""),p=A(null),f=A(!1),l=A(0),c=2,h=A(!1),M=A(!1),B=A(""),j=A(null),K=A(ne([])),E=re(()=>{var u,i,_,m;return{empirical:((u=a(me))==null?void 0:u.features.length)??0,modeled:((i=a(fe))==null?void 0:i.features.length)??0,synthetic:((_=a(_e))==null?void 0:_.features.length)??0,proxy:((m=a(he))==null?void 0:m.features.length)??0}}),R=A(ne({id:"root",name:"briefing.run",status:"ok",ms:0,tier:null,children:[]})),ee=A(null),$e="comfortable",Te="smart",de=A(!1);Oe(()=>{typeof window<"u"&&v(de,new URL(window.location.href).searchParams.get("grammar")==="1")});let V=A(null),D=A(void 0),Q=ne({}),ie=A(0),ue=re(()=>{if(a(ie),a(p)){const u={...Q,...a(p)};return et(u,a(R),a(D),!0)}return et(Q,a(R),a(D),!1)});function mt(u){v(ee,u,!0)}function ft(u){const i=document.getElementById("region-cites");i&&i.scrollIntoView({behavior:"smooth",block:"start"})}const Ye=new Set(["ttm_forecast","ttm_311_forecast","floodnet_forecast"]),Ce="group-ttm-r2";function _t(u,i,_,m){if(m==="error")return _??void 0;if(m==="silent")return _??"no data";if(i==null||typeof i!="object")return;const $=i,g={sandy_inundation:["inside"],dep_stormwater:["dep_extreme_2080","dep_moderate_2050"],floodnet:["n_sensors","n_events_3y"],nyc311:["n"],noaa_tides:["observed_ft_mllw","residual_ft","station"],nws_alerts:["n_active"],nws_obs:["p1h_mm","p6h_mm","station"],ttm_forecast:["forecast_peak_ft","forecast_peak_min_ahead"],ttm_311_forecast:["forecast_mean","forecast_peak","accelerating"],ida_hwm_2021:["n_within_800m","max_height_above_gnd_ft"],prithvi_eo_v2:["inside_water_polygon","nearest_distance_m"],prithvi_eo_live:["scene_date","pct_water_500m"],microtopo_lidar:["elev_m","pct_200m","relief_m"],mta_entrance_exposure:["n_entrances","n_inside_sandy_2012","n_in_dep_extreme_2080"],nycha_development_exposure:["n_developments","n_majority_inside_sandy_2012"],doe_school_exposure:["n_schools","n_inside_sandy_2012"],doh_hospital_exposure:["n_hospitals","n_inside_sandy_2012"],floodnet_forecast:["sensor_id","distance_m","forecast_28d","accelerating"],terramind_synthesis:["tim_chain","dem_mean_m"],rag_granite_embedding:["hits"],gliner_extract:["sources"]}[u],L=[];if(g){for(const q of g)if($[q]!==void 0&&L.push(He(q,$[q])),L.length>=3)break}else for(const[q,k]of Object.entries($))if(k!==null&&typeof k!="object"&&(L.push(He(q,k)),L.length>=2))break;return L.join(" Β· ")||void 0}function ht(u){const i=[],_=u.mta_entrances;if(_&&Array.isArray(_.entrances))for(const g of _.entrances){const L=Number(g.entrance_lat),q=Number(g.entrance_lon);!Number.isFinite(L)||!Number.isFinite(q)||i.push({type:"Feature",geometry:{type:"Point",coordinates:[q,L]},properties:{kind:"subway",name:`${g.station_name??"?"} (${g.daytime_routes??"?"})`,doc_id:`mta_entrance_${g.station_id??""}`,inside_sandy_2012:g.inside_sandy_2012===!0}})}const m=u.doe_schools;if(m&&Array.isArray(m.schools))for(const g of m.schools){const L=Number(g.school_lat),q=Number(g.school_lon);!Number.isFinite(L)||!Number.isFinite(q)||i.push({type:"Feature",geometry:{type:"Point",coordinates:[q,L]},properties:{kind:"school",name:String(g.loc_name??g.school_name??"?"),doc_id:`doe_school_${g.loc_code??""}`,inside_sandy_2012:g.inside_sandy_2012===!0}})}const $=u.nycha_developments;if($&&Array.isArray($.developments))for(const g of $.developments){const L=Number(g.centroid_lat),q=Number(g.centroid_lon);if(!Number.isFinite(L)||!Number.isFinite(q))continue;const k=Number(g.pct_inside_sandy_2012??0);i.push({type:"Feature",geometry:{type:"Point",coordinates:[q,L]},properties:{kind:"nycha",name:String(g.development??"?"),doc_id:`nycha_dev_${g.tds_num??""}`,inside_sandy_2012:k>=50,pct_inside_sandy:k}})}const S=u.doh_hospitals;if(S&&Array.isArray(S.hospitals))for(const g of S.hospitals){const L=Number(g.hospital_lat),q=Number(g.hospital_lon);!Number.isFinite(L)||!Number.isFinite(q)||i.push({type:"Feature",geometry:{type:"Point",coordinates:[q,L]},properties:{kind:"hospital",name:String(g.facility_name??"?"),doc_id:`nyc_hospital_${g.fac_id??""}`,inside_sandy_2012:g.inside_sandy_2012===!0}})}return{type:"FeatureCollection",features:i}}function vt(u){return{type:"FeatureCollection",features:[]}}function Be(u){return 1+(u.children??[]).reduce((_,m)=>_+Be(m),0)}function He(u,i){if(typeof i=="number"){const _=Number.isInteger(i)?`${i}`:i.toFixed(2);return`${u}=${_}`}if(typeof i=="boolean")return`${u}=${i}`;if(typeof i=="string"){const _=i.length>24?i.slice(0,22)+"β¦":i;return`${u}=${_}`}return u}let ae=A(ne({empirical:!0,modeled:!0,synthetic:!0,proxy:!0})),J=A(null),pe=A(null),Ue=A(void 0),Ge=A(void 0),me=A(void 0),fe=A(void 0),_e=A(void 0),he=A(void 0),te=A(ne([])),se=A(ne({})),ve=[];function gt(){var $;if(!a(o)){v(te,[],!0),v(se,{},!0),ve=[];return}const u={};($=a(p))!=null&&$.citations&&a(p).citations.forEach((S,g)=>{u[S.doc_id]=pt(g+1,S.doc_id,{source:S.source,title:S.title,url:S.url,vintage:S.vintage})});const i=On(a(o),u),_={};let m=1;for(const S of ve){const g=i.citations[S];g&&(_[S]={...g,n:m++})}for(const[S,g]of Object.entries(i.citations))_[S]||(_[S]={...g,n:m++},ve.push(S));v(te,i.blocks,!0),v(se,_,!0)}Oe(()=>{a(o),a(p),gt()}),Oe(()=>{if(!a(J))return;const{lat:u,lon:i,source:_}=a(J);_==="nta"&&a(pe)?(Rn(a(pe)).then(m=>v(me,m,!0)),Yn(a(pe)).then(m=>v(fe,m,!0)),at(u,i,2500).then(m=>v(_e,m,!0)),st(u,i,3e3).then(m=>v(he,m,!0))):(zn(u,i).then(m=>v(me,m,!0)),Dn(u,i).then(m=>v(fe,m,!0)),at(u,i).then(m=>v(_e,m,!0)),st(u,i).then(m=>v(he,m,!0)))}),jt(()=>{if(z.reset(),!a(r)())return;v(V,Date.now(),!0),z.phase="planning";const u=Pn(a(r)(),{onPlanToken:i=>v(d,a(d)+i),onPlan:i=>{var _;v(s,i,!0),z.phase="specialists",z.totalSpecialists=((_=i.specialists)==null?void 0:_.length)??0},onStep:i=>{if(new Set(["reconcile_granite41","mellea_reconcile_address","reconcile_neighborhood","reconcile_development","reconcile_live_now"]).has(i.step)||(z.activeStep=i.step,i.ok&&(z.firedCount=z.firedCount+1)),Cn(Q,i.step,i.result,i.ok),v(ie,a(ie)+1),i.step==="geocode")if(i.ok&&i.result&&typeof i.result=="object"){const x=i.result;if(typeof x.lat=="number"&&typeof x.lon=="number"){const C=typeof x.address=="string"?x.address:a(r)();v(J,{label:C,lat:x.lat,lon:x.lon,source:"geocode"},!0),v(M,!0)}}else v(j,"geocoder");if(i.step==="nta_resolve"&&i.ok&&i.result&&typeof i.result=="object"){const x=i.result,C=Array.isArray(x.bbox)?x.bbox:null,H=typeof x.nta_code=="string"?x.nta_code:null;if(C&&C.length===4&&H){v(pe,H,!0);const U=(C[0]+C[2])/2,O=(C[1]+C[3])/2,G=typeof x.nta_name=="string"?x.nta_name:a(r)();v(J,{label:G,lat:O,lon:U,source:"nta"},!0)}}const m=Dt(i.step),$=i.ok?i.result==null&&i.err==null?"silent":"ok":"error",S=Math.round((i.elapsed_s??0)*1e3),g=i.result!=null?i.result:i.err??null,L=_t(i.step,i.result,i.err,$),q={id:`step-${Be(a(R))}`,name:i.step,status:$,ms:S,tier:m,note:L,output:g,error:$==="error"?i.err??"unknown error":void 0,model:Ye.has(i.step)?"granite-timeseries-ttm-r2":void 0},k={...a(R),ms:(a(R).ms??0)+S};if(Ye.has(i.step)){const x=[...k.children??[]];let C=x.find(O=>O.id===Ce);C||(C={id:Ce,name:"forecasting.granite-timeseries-ttm-r2",status:"fan",ms:0,tier:"modeled",note:"1 instance",model:"granite-timeseries-ttm-r2",children:[]},x.push(C));const H=[...C.children??[],q],U={...C,ms:(C.ms??0)+S,note:`${H.length} instance${H.length===1?"":"s"}`,children:H};v(R,{...k,children:x.map(O=>O.id===Ce?U:O)},!0)}else v(R,{...k,children:[...k.children??[],q]},!0)},onAttemptStart:i=>{v(l,i,!0),z.phase="reconciling",z.attempt=i,z.activeStep="granite4.1 + mellea",i>1&&(v(B,a(o),!0),v(o,""),ve=[])},onToken:i=>{a(h)||(v(h,!0),a(l)===0&&v(l,1),z.phase="streaming",z.attempt=Math.max(1,z.attempt)),v(o,a(o)+i)},onMelleaAttempt:i=>{i.attempt>0&&(v(l,i.attempt,!0),z.attempt=i.attempt)},onFinal:i=>{v(p,i,!0),i.paragraph&&v(o,i.paragraph,!0),v(K,Ln(i),!0),v(Ue,ht(i),!0),v(Ge,vt(),!0);const m=i.mellea;m&&m.failed&&m.failed.length>0&&m.attempts&&m.attempts>=c&&v(j,"grounding")},onError:i=>{const _=i.toLowerCase();(_.includes("connection")||_.includes("502")||_.includes("503")||_.includes("timeout")||_.includes("routing"))&&v(j,"backend"),z.markError(i)},onDone:()=>{var i,_,m,$,S;v(f,!0),a(V)!=null&&v(D,(Date.now()-a(V))/1e3),!a(h)&&!a(j)&&a(M)&&v(j,"all-silent"),!a(j)&&a(te).length>0&&(Vt({queryId:a(t),queryText:a(r)(),intent:((i=a(s))==null?void 0:i.intent)??null,specialists:((m=(_=a(s))==null?void 0:_.specialists)==null?void 0:m.length)??0,blocks:a(te),citations:a(se),generatedAt:new Date().toISOString(),attempts:((S=($=a(p))==null?void 0:$.mellea)==null?void 0:S.attempts)??a(l)}),z.markReady())}});return()=>u.close()});var Ie=nr(),We=w(Ie),Me=w(We),qe=w(Me),Fe=w(qe),yt=N(w(Fe),2);{var bt=u=>{var i=Bn(),_=w(i),m=N(_);{var $=S=>{var g=Lt("Β· β done");F(S,g)};W(m,S=>{a(f)&&S($)})}y(i),Z(()=>{var S;return Y(_,`intent: ${a(s).intent??""} Β· ${((S=a(s).specialists)==null?void 0:S.length)??0??""} specialists Β· attempt ${a(l)??""} `)}),F(u,i)},wt=u=>{var i=Hn();F(u,i)};W(yt,u=>{a(s)?u(bt):u(wt,-1)})}y(Fe);var Ee=N(Fe,2),Ke=N(w(Ee)),St=w(Ke,!0);y(Ke),y(Ee);var xt=N(Ee,2);{var kt=u=>{on(u,{get state(){return a(j)}})},At=u=>{var i=Xn(),_=be(i);{var m=k=>{var x=Gn(),C=be(x);nn(C,{get attempt(){return a(l)},max:c});var H=N(C,2);{var U=O=>{var G=Un(),ge=w(G),ye=w(ge);y(ge),y(G),Z(je=>Y(ye,`${je??""}β¦`),[()=>a(B).slice(0,360)]),F(O,G)};W(H,O=>{a(B)&&O(U)})}F(k,x)};W(_,k=>{a(l)>1&&k(m)})}var $=N(_,2);{var S=k=>{var x=Kn(),C=be(x);Rt(C,{get blocks(){return a(te)},get citations(){return a(se)},streaming:!1});var H=N(C,2);{var U=O=>{var G=Wn();F(O,G)};W(H,O=>{a(f)||O(U)})}F(k,x)},g=k=>{en(k)},L=k=>{var x=Zn(),C=N(w(x),2);{var H=U=>{var O=Vn(),G=w(O),ge=w(G);y(G);var ye=N(G,2),je=w(ye,!0);y(ye),y(O),Z(()=>{Y(ge,`Planner streaming (${a(d).length??""} chars)`),Y(je,a(d))}),F(U,O)};W(C,U=>{a(d)&&U(H)})}y(x),F(k,x)},q=k=>{var x=Jn();F(k,x)};W($,k=>{a(te).length?k(S):a(M)&&!a(h)?k(g,1):a(s)?k(q,-1):k(L,2)})}F(u,i)};W(xt,u=>{a(j)?u(kt):u(At,-1)})}y(qe);var Ve=N(qe,2),Le=w(Ve),Pe=w(Le),Nt=N(w(Pe),2);{var $t=u=>{var i=Qn(),_=w(i);y(i),Z((m,$)=>Y(_,`Carto Positron Β· z15 Β· ${m??""}Β°N ${$??""}Β°W`),[()=>a(J).lat.toFixed(4),()=>Math.abs(a(J).lon).toFixed(4)]),F(u,i)},Tt=u=>{var i=er();F(u,i)};W(Nt,u=>{a(J)?u($t):u(Tt,-1)})}y(Pe);var Ct=N(Pe,2);{var It=u=>{var i=tr(),_=w(i);Ut(_,{get address(){return a(J)},get activeLayers(){return a(ae)},get sandyEmpirical(){return a(me)},get depModeled(){return a(fe)},get syntheticPrior(){return a(_e)},get proxy311(){return a(he)},get registerPoints(){return a(Ue)},get registerPolygons(){return a(Ge)},get linkedKey(){return a(ee)}});var m=N(_,2);Gt(m,{get active(){return a(ae)},get featureCounts(){return a(E)},onToggle:$=>v(ae,{...a(ae),[$]:!a(ae)[$]},!0)}),y(i),F(u,i)};W(Ct,u=>{a(J)&&u(It)})}y(Le);var Ze=N(Le,2),Mt=w(Ze);Bt(Mt,{get citations(){return a(se)}}),y(Ze),y(Ve),y(Me);var Je=N(Me,2),Xe=w(Je),qt=w(Xe);Ht(qt,{get data(){return a(ue)},density:$e,provenanceMode:Te,get showGrammar(){return a(de)},get linkedKey(){return a(ee)},onLink:mt,onCite:ft}),y(Xe),y(Je),y(We),y(Ie),Z(u=>Y(St,u),[()=>a(r)()]),F(n,Ie),Ot()}export{fr as component,mr as universal};
|
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":"
|
|
|
|
| 1 |
+
{"version":"1778031470202"}
|
|
@@ -6,19 +6,19 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<meta name="description" content="Riprap β citation-grounded NYC flood-exposure briefings." />
|
| 8 |
<title>Riprap β flood-exposure briefing</title>
|
| 9 |
-
<link href="./_app/immutable/entry/start.
|
| 10 |
-
<link href="./_app/immutable/chunks/
|
| 11 |
<link href="./_app/immutable/chunks/R1l3q-hJ.js" rel="modulepreload">
|
| 12 |
-
<link href="./_app/immutable/entry/app.
|
| 13 |
<link href="./_app/immutable/chunks/DZRTzx66.js" rel="modulepreload">
|
| 14 |
<link href="./_app/immutable/chunks/CzfSRAFS.js" rel="modulepreload">
|
| 15 |
<link href="./_app/immutable/chunks/C6-4B-da.js" rel="modulepreload">
|
| 16 |
-
<link href="./_app/immutable/nodes/0.
|
| 17 |
<link href="./_app/immutable/chunks/Bu_bEyoS.js" rel="modulepreload">
|
| 18 |
-
<link href="./_app/immutable/chunks/
|
| 19 |
<link href="./_app/immutable/chunks/a4L4UsYq.js" rel="modulepreload">
|
| 20 |
<link href="./_app/immutable/chunks/B_9mIQpm.js" rel="modulepreload">
|
| 21 |
-
<link href="./_app/immutable/nodes/2.
|
| 22 |
<link href="./_app/immutable/chunks/L2xkwLPH.js" rel="modulepreload">
|
| 23 |
<link href="./_app/immutable/chunks/CGe8VjDs.js" rel="modulepreload">
|
| 24 |
<link href="./_app/immutable/chunks/D907np-5.js" rel="modulepreload">
|
|
@@ -34,15 +34,15 @@
|
|
| 34 |
|
| 35 |
<script>
|
| 36 |
{
|
| 37 |
-
|
| 38 |
base: new URL(".", location).pathname.slice(0, -1)
|
| 39 |
};
|
| 40 |
|
| 41 |
const element = document.currentScript.parentElement;
|
| 42 |
|
| 43 |
Promise.all([
|
| 44 |
-
import("./_app/immutable/entry/start.
|
| 45 |
-
import("./_app/immutable/entry/app.
|
| 46 |
]).then(([kit, app]) => {
|
| 47 |
kit.start(app, element, {
|
| 48 |
node_ids: [0, 2],
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<meta name="description" content="Riprap β citation-grounded NYC flood-exposure briefings." />
|
| 8 |
<title>Riprap β flood-exposure briefing</title>
|
| 9 |
+
<link href="./_app/immutable/entry/start.DcfT94lp.js" rel="modulepreload">
|
| 10 |
+
<link href="./_app/immutable/chunks/D9Zf6nF7.js" rel="modulepreload">
|
| 11 |
<link href="./_app/immutable/chunks/R1l3q-hJ.js" rel="modulepreload">
|
| 12 |
+
<link href="./_app/immutable/entry/app.qmZS3WSP.js" rel="modulepreload">
|
| 13 |
<link href="./_app/immutable/chunks/DZRTzx66.js" rel="modulepreload">
|
| 14 |
<link href="./_app/immutable/chunks/CzfSRAFS.js" rel="modulepreload">
|
| 15 |
<link href="./_app/immutable/chunks/C6-4B-da.js" rel="modulepreload">
|
| 16 |
+
<link href="./_app/immutable/nodes/0.IL53jLg5.js" rel="modulepreload">
|
| 17 |
<link href="./_app/immutable/chunks/Bu_bEyoS.js" rel="modulepreload">
|
| 18 |
+
<link href="./_app/immutable/chunks/DP_9AkkW.js" rel="modulepreload">
|
| 19 |
<link href="./_app/immutable/chunks/a4L4UsYq.js" rel="modulepreload">
|
| 20 |
<link href="./_app/immutable/chunks/B_9mIQpm.js" rel="modulepreload">
|
| 21 |
+
<link href="./_app/immutable/nodes/2.C4OcOHhN.js" rel="modulepreload">
|
| 22 |
<link href="./_app/immutable/chunks/L2xkwLPH.js" rel="modulepreload">
|
| 23 |
<link href="./_app/immutable/chunks/CGe8VjDs.js" rel="modulepreload">
|
| 24 |
<link href="./_app/immutable/chunks/D907np-5.js" rel="modulepreload">
|
|
|
|
| 34 |
|
| 35 |
<script>
|
| 36 |
{
|
| 37 |
+
__sveltekit_186n2ot = {
|
| 38 |
base: new URL(".", location).pathname.slice(0, -1)
|
| 39 |
};
|
| 40 |
|
| 41 |
const element = document.currentScript.parentElement;
|
| 42 |
|
| 43 |
Promise.all([
|
| 44 |
+
import("./_app/immutable/entry/start.DcfT94lp.js"),
|
| 45 |
+
import("./_app/immutable/entry/app.qmZS3WSP.js")
|
| 46 |
]).then(([kit, app]) => {
|
| 47 |
kit.start(app, element, {
|
| 48 |
node_ids: [0, 2],
|
|
@@ -6,16 +6,16 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<meta name="description" content="Riprap β citation-grounded NYC flood-exposure briefings." />
|
| 8 |
<title>Riprap β flood-exposure briefing</title>
|
| 9 |
-
<link href="../_app/immutable/entry/start.
|
| 10 |
-
<link href="../_app/immutable/chunks/
|
| 11 |
<link href="../_app/immutable/chunks/R1l3q-hJ.js" rel="modulepreload">
|
| 12 |
-
<link href="../_app/immutable/entry/app.
|
| 13 |
<link href="../_app/immutable/chunks/DZRTzx66.js" rel="modulepreload">
|
| 14 |
<link href="../_app/immutable/chunks/CzfSRAFS.js" rel="modulepreload">
|
| 15 |
<link href="../_app/immutable/chunks/C6-4B-da.js" rel="modulepreload">
|
| 16 |
-
<link href="../_app/immutable/nodes/0.
|
| 17 |
<link href="../_app/immutable/chunks/Bu_bEyoS.js" rel="modulepreload">
|
| 18 |
-
<link href="../_app/immutable/chunks/
|
| 19 |
<link href="../_app/immutable/chunks/a4L4UsYq.js" rel="modulepreload">
|
| 20 |
<link href="../_app/immutable/chunks/B_9mIQpm.js" rel="modulepreload">
|
| 21 |
<link href="../_app/immutable/nodes/5.Bw01bLNz.js" rel="modulepreload">
|
|
@@ -35,15 +35,15 @@
|
|
| 35 |
|
| 36 |
<script>
|
| 37 |
{
|
| 38 |
-
|
| 39 |
base: new URL("..", location).pathname.slice(0, -1)
|
| 40 |
};
|
| 41 |
|
| 42 |
const element = document.currentScript.parentElement;
|
| 43 |
|
| 44 |
Promise.all([
|
| 45 |
-
import("../_app/immutable/entry/start.
|
| 46 |
-
import("../_app/immutable/entry/app.
|
| 47 |
]).then(([kit, app]) => {
|
| 48 |
kit.start(app, element, {
|
| 49 |
node_ids: [0, 5],
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
<meta name="description" content="Riprap β citation-grounded NYC flood-exposure briefings." />
|
| 8 |
<title>Riprap β flood-exposure briefing</title>
|
| 9 |
+
<link href="../_app/immutable/entry/start.DcfT94lp.js" rel="modulepreload">
|
| 10 |
+
<link href="../_app/immutable/chunks/D9Zf6nF7.js" rel="modulepreload">
|
| 11 |
<link href="../_app/immutable/chunks/R1l3q-hJ.js" rel="modulepreload">
|
| 12 |
+
<link href="../_app/immutable/entry/app.qmZS3WSP.js" rel="modulepreload">
|
| 13 |
<link href="../_app/immutable/chunks/DZRTzx66.js" rel="modulepreload">
|
| 14 |
<link href="../_app/immutable/chunks/CzfSRAFS.js" rel="modulepreload">
|
| 15 |
<link href="../_app/immutable/chunks/C6-4B-da.js" rel="modulepreload">
|
| 16 |
+
<link href="../_app/immutable/nodes/0.IL53jLg5.js" rel="modulepreload">
|
| 17 |
<link href="../_app/immutable/chunks/Bu_bEyoS.js" rel="modulepreload">
|
| 18 |
+
<link href="../_app/immutable/chunks/DP_9AkkW.js" rel="modulepreload">
|
| 19 |
<link href="../_app/immutable/chunks/a4L4UsYq.js" rel="modulepreload">
|
| 20 |
<link href="../_app/immutable/chunks/B_9mIQpm.js" rel="modulepreload">
|
| 21 |
<link href="../_app/immutable/nodes/5.Bw01bLNz.js" rel="modulepreload">
|
|
|
|
| 35 |
|
| 36 |
<script>
|
| 37 |
{
|
| 38 |
+
__sveltekit_186n2ot = {
|
| 39 |
base: new URL("..", location).pathname.slice(0, -1)
|
| 40 |
};
|
| 41 |
|
| 42 |
const element = document.currentScript.parentElement;
|
| 43 |
|
| 44 |
Promise.all([
|
| 45 |
+
import("../_app/immutable/entry/start.DcfT94lp.js"),
|
| 46 |
+
import("../_app/immutable/entry/app.qmZS3WSP.js")
|
| 47 |
]).then(([kit, app]) => {
|
| 48 |
kit.start(app, element, {
|
| 49 |
node_ids: [0, 5],
|
|
@@ -572,16 +572,27 @@ function buildNwsAlerts(state: Final): Card | null {
|
|
| 572 |
|
| 573 |
function buildCapstoneMeta(final: FinalResult, wallSeconds?: number): Card {
|
| 574 |
// v0.4.5 Β§2 β wire the four metrics to the reconciler's actual state.
|
| 575 |
-
// The
|
| 576 |
-
//
|
| 577 |
-
//
|
| 578 |
-
//
|
| 579 |
-
const m = final.mellea;
|
| 580 |
-
const
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
const
|
| 584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 585 |
const cites = final.citations?.length ?? 0;
|
| 586 |
return {
|
| 587 |
id: 'fsm-capstone-meta',
|
|
|
|
| 572 |
|
| 573 |
function buildCapstoneMeta(final: FinalResult, wallSeconds?: number): Card {
|
| 574 |
// v0.4.5 Β§2 β wire the four metrics to the reconciler's actual state.
|
| 575 |
+
// The FSM emits `mellea` as `{ rerolls, n_attempts, requirements_passed,
|
| 576 |
+
// requirements_failed, requirements_total }` (the mellea_validator
|
| 577 |
+
// shape). Earlier UI types used `{ passed, failed, attempts }`; we
|
| 578 |
+
// accept both so cards keep rendering across backend versions.
|
| 579 |
+
const m = (final.mellea ?? {}) as Record<string, unknown>;
|
| 580 |
+
const passedArr = Array.isArray(m.requirements_passed)
|
| 581 |
+
? (m.requirements_passed as unknown[])
|
| 582 |
+
: Array.isArray(m.passed) ? (m.passed as unknown[]) : [];
|
| 583 |
+
const failedArr = Array.isArray(m.requirements_failed)
|
| 584 |
+
? (m.requirements_failed as unknown[])
|
| 585 |
+
: Array.isArray(m.failed) ? (m.failed as unknown[]) : [];
|
| 586 |
+
const passed = passedArr.length;
|
| 587 |
+
const failed = failedArr.length;
|
| 588 |
+
const totalChecks = (typeof m.requirements_total === 'number'
|
| 589 |
+
? (m.requirements_total as number)
|
| 590 |
+
: (passed + failed)) || 4;
|
| 591 |
+
const attempts = (typeof m.n_attempts === 'number'
|
| 592 |
+
? (m.n_attempts as number)
|
| 593 |
+
: (typeof m.attempts === 'number' ? (m.attempts as number) : 0));
|
| 594 |
+
const rerollsField = typeof m.rerolls === 'number' ? (m.rerolls as number) : null;
|
| 595 |
+
const rerolls = rerollsField ?? Math.max(0, attempts - 1);
|
| 596 |
const cites = final.citations?.length ?? 0;
|
| 597 |
return {
|
| 598 |
id: 'fsm-capstone-meta',
|