{
  "version": 3,
  "sources": ["terrain_filter_core.js"],
  "sourcesContent": ["/*\n * static/js/terrain_filter_core.js \u2014 the pure half of the map's terrain\n * filter (SNOW-978).\n *\n * The filter highlights ground by aspect, slope angle and elevation. Its\n * tiles do not carry a picture: each pixel of a terrain-class tile\n * (published by the snowdesk-tiles repo, SNOW-987) carries three FACTS\n * about the ground under it, and the device turns those into colour for\n * whatever filter the reader has set. So a filter change repaints from\n * tiles already held, with no network, and the server never learns what\n * anyone is filtering for.\n *\n * THE PIXEL CONTRACT (opaque 256 px PNG, alpha always 255):\n *\n *   R, G  \u2014 height in whole metres, uint16 big-endian (R is the high byte).\n *   B     \u2014 octant << 5 | band, where\n *             octant: N=0, NE=1 \u2026 NW=7, N covering 337.5\u201322.5\u00B0 \u2014 the same\n *                     split as apps/core/geo.py's octant_for;\n *             band:   floor(slope / 5), 0..17.\n *           B = 254 \u2014 level ground: no aspect, R/G still hold the height.\n *           B = 255 \u2014 no data, R = G = 0.\n *\n * A tile with no data at all, or a zoom outside 12\u201314, answers HTTP 204.\n *\n * THE CLASSIFIER RETURNS A PALETTE INDEX, NOT A BOOLEAN, and it is handed\n * the tile and the pixel's coordinates as well as the decoded cell. Nothing\n * in this ticket needs either, but SNOW-979 plugs a four-state palette and\n * per-region clipping into exactly this seam, and a boolean predicate would\n * have to be torn out to do it. The palette here has three entries:\n *\n *   0 \u2014 transparent: the ground does not match (and level ground never does);\n *   1 \u2014 the match tint, see-through so contours and hillshade still read;\n *   2 \u2014 the no-data hatch, drawn from pixel coordinates so blank never has\n *       to mean \"no data\".\n *\n * TWO MODES (SNOW-1073). The filter's `mode` picks the classifier and the\n * palette together:\n *\n *   'match' \u2014 the three-entry palette above: matching ground in one tint.\n *   'slope' \u2014 \"colour by slope class\": SLOPE_PALETTE paints each matching\n *             pixel by its 5\u00B0 band on the 30/35/40/45/50+ ramp\n *             (slope_classes_core.js's CLASSES). This is the map's slope\n *             layer; it replaced swisstopo's pre-rendered raster, so the\n *             slope colours come from the same terrain model as the route\n *             line and the point card. The aspect, slope-range and\n *             elevation settings mask it exactly as they mask the tint.\n *\n * SNOW-1194 added a third, 'bulletin' (\"By bulletin\"), and 2026-10-23 took\n * it out again: the bulletins' own terrain is not a filter the reader sets\n * but the bulletin drawn another way, so it became its own layers-menu row,\n * now \"Sync with map terrain\" (bulletin_terrain_core.js; map.js's\n * pwaBulletinTerrain). A stored 'bulletin' now reads back as 'match', with\n * the reader's own settings intact; map.js carries its switch over first.\n *\n * An absent or unknown mode is 'match', so a filter stored before the mode\n * existed reads back as it always did.\n *\n * Lives outside `map.js` for the usual reason: `map.js` is one file of IIFEs\n * that jsdom cannot import, and an off-by-one in an octant or band boundary\n * would paint the wrong slopes without any error anywhere.\n *\n * Reads `self.pwaSlopeClassesCore` and `self.pwaTerrainCoverage` at parse\n * time, so slope_classes_core.js and terrain_coverage.js must load first.\n *\n * COVERAGE (SNOW-1459). The class tiles reach the Alps beyond Switzerland,\n * cut from our Mapterhorn copy wherever a national survey exists. Where\n * they reach is terrain_coverage.js's OUTLINE, a polygon: `coversPoint` and\n * `tileInCoverage` test it, so a 204 inside it (ground only the 30 m global\n * model covers, never shown as gentle ground) is hatched and one outside it\n * is nothing. COVERAGE_BOUNDS is the outline's bbox, for where a box is the\n * right tool: a MapLibre source's `bounds` and a cheap prefilter.\n * SWISS_BOUNDS is swissALTI3D's own box, for what has not widened: where\n * 3D opens without the beyond-Switzerland flag, and the elevation tiles a\n * download pins.\n *\n * Every function here is pure.\n *\n * Exports (frozen `self.pwaTerrainFilterCore`):\n *\n *   OCTANTS / MIN_ZOOM / DRAW_MIN_ZOOM / MAX_ZOOM / TILE_SIZE\n *   COVERAGE_BOUNDS / SWISS_BOUNDS\n *   SLOPE_LADDER / ELEVATION_STEP_M / ELEVATION_MAX_M / B_LEVEL / B_NODATA\n *   PALETTE_INDEX / PALETTE / HATCH_PERIOD / HATCH_WIDTH / PROTOCOL\n *   MODES / SLOPE_PALETTE_INDEX / SLOPE_PALETTE / SLOPE_RASTER_ALPHA\n *   DEFAULT_FILTER\n *   decodeCell(r, g, b, out?)\n *   createFilterClassifier(filter)  \u2192 (cell, px, py, tile) => paletteIndex\n *   createSlopeClassifier(filter)   \u2192 the same, into SLOPE_PALETTE\n *   createClassifier(filter) / paletteFor(filter) \u2014 picked by filter.mode\n *   paintTile(src, out, classify, palette, tile)\n *   noDataTile()\n *   coversPoint(lng, lat) / tileInCoverage(z, x, y)\n *   availability({zoom, lng, lat})  \u2192 'ok' | 'zoom-in' | 'out-of-coverage'\n *   normaliseFilter(raw) / parseFilter(text) / serialiseFilter(filter)\n *   filterHash(filter)\n *   summarise(filter, strings, options?)\n *   ELEVATION_LIST_MIN_M / ELEVATION_LIST_MAX_M (SNOW-1109)\n *   slopeClassRange(filter) / tapSlopeClass(filter, index)\n *   elevationOptions(filter, which) / elevationBand(filter)\n *   tileUrl(template, z, x, y) / protocolTileUrl(hash) / parseProtocolUrl(url)\n *   createTileCache(limit)\n */\n\n// @ts-check\n\n(function () {\n  'use strict';\n\n  /**\n   * @typedef {object} TerrainFilter\n   * @property {'match'|'slope'} mode What a matching pixel is painted\n   *   with: the match tint, or its slope class.\n   * @property {ReadonlyArray<number>} aspects Octants that match, 0 (N) \u2026 7 (NW), sorted.\n   * @property {number} minSlope Lowest matching slope, a SLOPE_LADDER value.\n   * @property {number|null} maxSlope Exclusive upper slope, or null for none.\n   * @property {number|null} minElevation Lowest matching height (m), or null.\n   * @property {number|null} maxElevation Highest matching height (m), or null.\n   */\n\n  /**\n   * @typedef {object} Cell\n   * @property {'data'|'level'|'nodata'} kind What the pixel says.\n   * @property {number} height Height in whole metres (0 for no data).\n   * @property {number} octant 0 (N) \u2026 7 (NW); -1 when there is no aspect.\n   * @property {number} band floor(slope / 5); -1 when there is no aspect.\n   */\n\n  /**\n   * @typedef {object} TileCoord\n   * @property {number} z Zoom.\n   * @property {number} x Column.\n   * @property {number} y Row.\n   */\n\n  /**\n   * @typedef {object} PaletteEntry\n   * @property {string} id Name of the state.\n   * @property {ReadonlyArray<number>} rgba Straight (unpremultiplied) RGBA, 0\u2013255.\n   * @property {string} [token] The `@theme` token the legend paints with.\n   * @property {string} [hex] That token's value, for a drift test.\n   * @property {boolean} [hatch] Paint only on the hatch's stroke pixels.\n   * @property {boolean} [hatchBack] Run those strokes the other way (135\u00B0),\n   *   for a second hatch that must not read as the no-data one (SNOW-979).\n   */\n\n  /** @typedef {(cell: Cell, px: number, py: number, tile: TileCoord) => number} Classifier */\n\n  /** The eight octants, by index \u2014 the order SNOW-1063's aspect wheel uses. */\n  const OCTANTS = Object.freeze(['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']);\n\n  /**\n   * The zoom range the tiles exist at. The origin answers 204 outside it;\n   * MapLibre overzooms the z14 tile above, which is exact for a nearest-\n   * neighbour raster of facts.\n   */\n  const MIN_ZOOM = 12;\n  const MAX_ZOOM = 14;\n  const TILE_SIZE = 256;\n\n  /**\n   * The map zoom Steep terrain draws from \u2014 one below the tiles' MIN_ZOOM.\n   * The tiles are 256 px, so at map zoom 11 MapLibre is already reading\n   * z12 tiles at their own resolution; nothing is stretched. Hugo,\n   * 3 Nov 2026: it reads well from there. map.js gives it to the layer as\n   * its minzoom and to the zoom control's scale as the terrain_filter\n   * gate, so the two never disagree again.\n   */\n  const DRAW_MIN_ZOOM = 11;\n\n  /**\n   * swissALTI3D's bbox, `[west, south, east, north]` \u2014 the box the\n   * snowdesk-tiles build lists swissALTI3D squares over, and until SNOW-1459\n   * the class tiles' whole coverage. It still bounds what has not widened:\n   * where 3D opens without the beyond-Switzerland flag, and the elevation\n   * tiles a download pins. bin/build-terrain-coverage restates it.\n   */\n  const SWISS_BOUNDS = Object.freeze([5.9503666, 45.7213375, 10.4998461, 47.8216742]);\n\n  /**\n   * The class tiles' coverage outline (SNOW-1459): terrain_coverage.js's\n   * polygons, each outer ring first and its holes after.\n   *\n   * @type {ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<number>>>>}\n   */\n  const OUTLINE = self.pwaTerrainCoverage.OUTLINE;\n\n  /**\n   * The outline's bbox, `[west, south, east, north]`. It keeps MapLibre\n   * from requesting tiles nowhere near the survey, and prefilters the\n   * polygon test; the polygon decides.\n   */\n  const COVERAGE_BOUNDS = self.pwaTerrainCoverage.OUTLINE_BBOX;\n\n  /**\n   * Each outline polygon's outer-ring bbox, so a point tests only the\n   * polygons whose box holds it.\n   *\n   * @type {ReadonlyArray<ReadonlyArray<number>>}\n   */\n  const OUTLINE_BOXES = Object.freeze(OUTLINE.map((polygon) => {\n    let west = Infinity;\n    let south = Infinity;\n    let east = -Infinity;\n    let north = -Infinity;\n    for (const [lng, lat] of polygon[0]) {\n      if (lng < west) west = lng;\n      if (lng > east) east = lng;\n      if (lat < south) south = lat;\n      if (lat > north) north = lat;\n    }\n    return Object.freeze([west, south, east, north]);\n  }));\n\n  /** The slope thresholds a reader can pick, in degrees. */\n  const SLOPE_LADDER = Object.freeze([30, 35, 40, 45, 50]);\n\n  /** Width of one slope band, and the highest band the contract allows. */\n  const BAND_DEG = 5;\n  const MAX_BAND = 17;\n\n  /** The elevation band's step and ceiling, in metres. */\n  const ELEVATION_STEP_M = 100;\n  const ELEVATION_MAX_M = 4800;\n\n  /**\n   * The sheet's elevation lists (SNOW-1109): the heights a reader picks\n   * from, and the scale the sheet's mountain is drawn against. Narrower\n   * than the 0\u20134,800 m the filter accepts, because a bound under 1,000 m\n   * or over 4,500 m changes nothing in Switzerland's avalanche terrain; a\n   * stored value outside it is still kept, never rewritten.\n   */\n  const ELEVATION_LIST_MIN_M = 1000;\n  const ELEVATION_LIST_MAX_M = 4500;\n\n  /** The two reserved blue-channel values. */\n  const B_LEVEL = 254;\n  const B_NODATA = 255;\n\n  const PALETTE_INDEX = Object.freeze({ NONE: 0, MATCH: 1, NODATA: 2 });\n\n  /**\n   * The no-data hatch: a 45\u00B0 stroke where `(px + py) % PERIOD < WIDTH`.\n   * PERIOD divides TILE_SIZE, so the strokes run on across tile seams.\n   */\n  const HATCH_PERIOD = 8;\n  const HATCH_WIDTH = 2;\n\n  /**\n   * Parse `#rrggbb` into three channels.\n   *\n   * @param {string} hex A six-digit hex colour.\n   * @returns {number[]} `[r, g, b]`.\n   */\n  function hexChannels(hex) {\n    const n = parseInt(hex.slice(1), 16);\n    return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n  }\n\n  const MATCH_HEX = '#2563eb';\n  const NODATA_HEX = '#475569';\n\n  /**\n   * What each palette index paints. The match tint is about 45% opaque so\n   * the basemap's contours and hillshade read through it; the hatch's\n   * strokes are stronger because they cover only a quarter of the area.\n   * `token`/`hex` tie each colour to `src/css/main.css`, which the legend\n   * and the sheet's key paint from \u2014 a Vitest test asserts they agree.\n   *\n   * @type {ReadonlyArray<PaletteEntry>}\n   */\n  const PALETTE = Object.freeze([\n    Object.freeze({ id: 'none', rgba: Object.freeze([0, 0, 0, 0]) }),\n    Object.freeze({\n      id: 'match',\n      token: '--color-terrain-match',\n      hex: MATCH_HEX,\n      rgba: Object.freeze([...hexChannels(MATCH_HEX), 115]),\n    }),\n    Object.freeze({\n      id: 'nodata',\n      token: '--color-terrain-nodata',\n      hex: NODATA_HEX,\n      rgba: Object.freeze([...hexChannels(NODATA_HEX), 170]),\n      hatch: true,\n    }),\n  ]);\n\n  /**\n   * The two modes, the default first: 'match' paints matching ground in\n   * one tint, 'slope' paints it by slope class.\n   */\n  const MODES = Object.freeze(['match', 'slope']);\n\n  const SLOPE_PALETTE_INDEX = Object.freeze({ NONE: 0, NODATA: 1, FIRST_CLASS: 2 });\n\n  /**\n   * The slope classes' alpha. swisstopo's raster was drawn at 0.6 layer\n   * opacity under the danger choropleth (SNOW-691), and readers know the\n   * ramp at that strength; here the translucency is in the pixels, so 0.6\n   * of 255.\n   */\n  const SLOPE_RASTER_ALPHA = 153;\n\n  /**\n   * What the slope mode paints: transparent, the same no-data hatch as the\n   * match palette, then one entry per slope class, gentlest first. The\n   * classes are slope_classes_core.js's, so the map, the legend and a\n   * route's slope-coloured core share one ramp.\n   *\n   * @type {ReadonlyArray<PaletteEntry>}\n   */\n  const SLOPE_PALETTE = Object.freeze([\n    PALETTE[PALETTE_INDEX.NONE],\n    PALETTE[PALETTE_INDEX.NODATA],\n    ...self.pwaSlopeClassesCore.CLASSES.map((/** @type {*} */ klass) => Object.freeze({\n      id: klass.id,\n      token: klass.token,\n      hex: klass.hex,\n      rgba: Object.freeze([...hexChannels(klass.hex), SLOPE_RASTER_ALPHA]),\n    })),\n  ]);\n\n  /**\n   * Band \u2192 SLOPE_PALETTE index, for every band the contract allows. A band\n   * below the first class (under 30\u00B0) maps to NONE; the classifier never\n   * reaches it, because the lowest slope a reader can pick is 30\u00B0.\n   *\n   * @type {ReadonlyArray<number>}\n   */\n  const SLOPE_INDEX_BY_BAND = Object.freeze(Array.from({ length: 18 }, (_unused, band) => {\n    const deg = band * 5;\n    const classes = self.pwaSlopeClassesCore.CLASSES;\n    for (let i = classes.length - 1; i >= 0; i -= 1) {\n      if (deg >= classes[i].from) return SLOPE_PALETTE_INDEX.FIRST_CLASS + i;\n    }\n    return SLOPE_PALETTE_INDEX.NONE;\n  }));\n\n  /** @type {Readonly<TerrainFilter>} */\n  const DEFAULT_FILTER = Object.freeze({\n    mode: 'match',\n    aspects: Object.freeze([0, 1, 2, 3, 4, 5, 6, 7]),\n    minSlope: 30,\n    maxSlope: null,\n    minElevation: null,\n    maxElevation: null,\n  });\n\n  /** The custom protocol MapLibre fetches painted tiles through. */\n  const PROTOCOL = 'terrainfilter';\n\n  /**\n   * Decode one pixel into the facts it carries.\n   *\n   * @param {number} r Red: the height's high byte.\n   * @param {number} g Green: the height's low byte.\n   * @param {number} b Blue: octant << 5 | band, or 254 / 255.\n   * @param {Cell} [out] An object to write into, so a tile's 65,536 pixels\n   *   need not allocate 65,536 objects.\n   * @returns {Cell} The cell.\n   */\n  function decodeCell(r, g, b, out) {\n    const cell = out || { kind: 'nodata', height: 0, octant: -1, band: -1 };\n    if (b === B_NODATA) {\n      cell.kind = 'nodata';\n      cell.height = 0;\n      cell.octant = -1;\n      cell.band = -1;\n      return cell;\n    }\n    cell.height = r * 256 + g;\n    if (b === B_LEVEL) {\n      cell.kind = 'level';\n      cell.octant = -1;\n      cell.band = -1;\n      return cell;\n    }\n    cell.kind = 'data';\n    cell.octant = b >> 5;\n    cell.band = b & 31;\n    return cell;\n  }\n\n  /**\n   * Snap a height to the elevation step, inside the allowed range.\n   *\n   * @param {*} value A candidate height.\n   * @returns {number|null} The snapped height, or null for anything unusable.\n   */\n  function normaliseElevation(value) {\n    if (value === null || value === undefined || value === '') return null;\n    const n = Number(value);\n    if (!Number.isFinite(n)) return null;\n    const snapped = Math.round(n / ELEVATION_STEP_M) * ELEVATION_STEP_M;\n    if (snapped < 0 || snapped > ELEVATION_MAX_M) return null;\n    return snapped;\n  }\n\n  /**\n   * Validate a filter, falling back field by field to the defaults.\n   *\n   * An empty aspect list is VALID \u2014 it is what a reader gets by switching\n   * every aspect off, and it matches nothing. A maximum slope at or below\n   * the minimum, or a maximum height at or below the minimum, is dropped.\n   * An absent or unknown mode is 'match'.\n   *\n   * @param {*} raw Anything \u2014 usually a parsed JSON blob.\n   * @returns {TerrainFilter} A filter safe to classify with.\n   */\n  function normaliseFilter(raw) {\n    const src = raw && typeof raw === 'object' ? raw : {};\n    const mode = MODES.includes(src.mode) ? src.mode : DEFAULT_FILTER.mode;\n    let aspects = [...DEFAULT_FILTER.aspects];\n    if (Array.isArray(src.aspects)) {\n      const valid = src.aspects.filter(\n        (/** @type {*} */ a) => Number.isInteger(a) && a >= 0 && a < OCTANTS.length,\n      );\n      if (valid.length === src.aspects.length) {\n        aspects = [...new Set(/** @type {number[]} */ (valid))].sort((a, b) => a - b);\n      }\n    }\n    const minSlope = SLOPE_LADDER.includes(src.minSlope) ? src.minSlope : DEFAULT_FILTER.minSlope;\n    const maxSlope = SLOPE_LADDER.includes(src.maxSlope) && src.maxSlope > minSlope\n      ? src.maxSlope\n      : null;\n    const minElevation = normaliseElevation(src.minElevation);\n    let maxElevation = normaliseElevation(src.maxElevation);\n    if (minElevation !== null && maxElevation !== null && maxElevation <= minElevation) {\n      maxElevation = null;\n    }\n    return { mode, aspects, minSlope, maxSlope, minElevation, maxElevation };\n  }\n\n  /**\n   * Read a stored filter. Anything unparseable yields the defaults.\n   *\n   * @param {string|null|undefined} text The stored JSON.\n   * @returns {TerrainFilter} The filter.\n   */\n  function parseFilter(text) {\n    if (typeof text !== 'string' || !text) return normaliseFilter(null);\n    try {\n      return normaliseFilter(JSON.parse(text));\n    } catch {\n      return normaliseFilter(null);\n    }\n  }\n\n  /**\n   * Serialise a filter for storage, in a fixed key order.\n   *\n   * @param {*} filter The filter.\n   * @returns {string} JSON.\n   */\n  function serialiseFilter(filter) {\n    const f = normaliseFilter(filter);\n    return JSON.stringify({\n      mode: f.mode,\n      aspects: f.aspects,\n      minSlope: f.minSlope,\n      maxSlope: f.maxSlope,\n      minElevation: f.minElevation,\n      maxElevation: f.maxElevation,\n    });\n  }\n\n  /**\n   * A short, URL-safe identity for a filter \u2014 the `v` that makes MapLibre\n   * treat a repainted tile as a new one.\n   *\n   * The slope mode adds a trailing `-s`, so switching mode repaints; the\n   * match mode's hash is unchanged from before the mode existed.\n   *\n   * @param {*} filter The filter.\n   * @returns {string} e.g. `ff-30--2400-`, or `ff-30--2400--s` in slope mode.\n   */\n  function filterHash(filter) {\n    const f = normaliseFilter(filter);\n    const mask = f.aspects.reduce((acc, a) => acc | (1 << a), 0);\n    const part = (/** @type {number|null} */ v) => (v === null ? '' : String(v));\n    const parts = [\n      mask.toString(16).padStart(2, '0'),\n      String(f.minSlope),\n      part(f.maxSlope),\n      part(f.minElevation),\n      part(f.maxElevation),\n    ];\n    if (f.mode === 'slope') parts.push('s');\n    return parts.join('-');\n  }\n\n  /**\n   * Build the per-pixel classifier for one filter.\n   *\n   * The filter is resolved ONCE here \u2014 an aspect bitmask and a band range \u2014\n   * so the per-pixel function is a handful of integer comparisons.\n   *\n   * Slope bands are 5\u00B0 wide and every ladder value is a multiple of 5, so\n   * \"at least 35\u00B0\" is exactly \"band \u2265 7\" and \"under 45\u00B0\" exactly \"band < 9\".\n   *\n   * @param {*} filter The filter (normalised here).\n   * @returns {Classifier} `(cell, px, py, tile) => paletteIndex`.\n   */\n  function createFilterClassifier(filter) {\n    const f = normaliseFilter(filter);\n    const mask = f.aspects.reduce((acc, a) => acc | (1 << a), 0);\n    const loBand = f.minSlope / BAND_DEG;\n    const hiBand = f.maxSlope === null ? MAX_BAND : f.maxSlope / BAND_DEG - 1;\n    const loHeight = f.minElevation === null ? -Infinity : f.minElevation;\n    const hiHeight = f.maxElevation === null ? Infinity : f.maxElevation;\n    return function classify(cell, _px, _py, _tile) {\n      if (cell.kind === 'nodata') return PALETTE_INDEX.NODATA;\n      if (cell.kind === 'level') return PALETTE_INDEX.NONE;\n      if ((mask & (1 << cell.octant)) === 0) return PALETTE_INDEX.NONE;\n      if (cell.band < loBand || cell.band > hiBand) return PALETTE_INDEX.NONE;\n      if (cell.height < loHeight || cell.height > hiHeight) return PALETTE_INDEX.NONE;\n      return PALETTE_INDEX.MATCH;\n    };\n  }\n\n  /**\n   * Build the per-pixel classifier for the slope-class mode.\n   *\n   * The same masks as createFilterClassifier \u2014 aspect, slope range,\n   * elevation \u2014 so the sheet's settings narrow the slope layer exactly as\n   * they narrow the tint; a pixel that passes is painted by its band's\n   * class rather than the match tint. Level ground is never painted, and\n   * no-data is hatched, as in the match mode.\n   *\n   * @param {*} filter The filter (normalised here; its mode is ignored).\n   * @returns {Classifier} `(cell, px, py, tile) => SLOPE_PALETTE index`.\n   */\n  function createSlopeClassifier(filter) {\n    const f = normaliseFilter(filter);\n    const mask = f.aspects.reduce((acc, a) => acc | (1 << a), 0);\n    const loBand = f.minSlope / BAND_DEG;\n    const hiBand = f.maxSlope === null ? MAX_BAND : f.maxSlope / BAND_DEG - 1;\n    const loHeight = f.minElevation === null ? -Infinity : f.minElevation;\n    const hiHeight = f.maxElevation === null ? Infinity : f.maxElevation;\n    return function classify(cell, _px, _py, _tile) {\n      if (cell.kind === 'nodata') return SLOPE_PALETTE_INDEX.NODATA;\n      if (cell.kind === 'level') return SLOPE_PALETTE_INDEX.NONE;\n      if ((mask & (1 << cell.octant)) === 0) return SLOPE_PALETTE_INDEX.NONE;\n      if (cell.band < loBand || cell.band > hiBand) return SLOPE_PALETTE_INDEX.NONE;\n      if (cell.height < loHeight || cell.height > hiHeight) return SLOPE_PALETTE_INDEX.NONE;\n      return SLOPE_INDEX_BY_BAND[cell.band] ?? SLOPE_PALETTE_INDEX.NONE;\n    };\n  }\n\n  /**\n   * The classifier for a filter's mode.\n   *\n   * @param {*} filter The filter.\n   * @returns {Classifier}\n   */\n  function createClassifier(filter) {\n    const f = normaliseFilter(filter);\n    return f.mode === 'slope' ? createSlopeClassifier(f) : createFilterClassifier(f);\n  }\n\n  /**\n   * The palette that goes with createClassifier(filter).\n   *\n   * @param {*} filter The filter.\n   * @returns {ReadonlyArray<PaletteEntry>}\n   */\n  function paletteFor(filter) {\n    return normaliseFilter(filter).mode === 'slope' ? SLOPE_PALETTE : PALETTE;\n  }\n\n  /**\n   * Whether a pixel lies on one of the hatch's strokes.\n   *\n   * @param {number} px Column within the tile.\n   * @param {number} py Row within the tile.\n   * @param {boolean} [back] The 135\u00B0 hatch rather than the 45\u00B0 one.\n   * @returns {boolean}\n   */\n  function onHatch(px, py, back) {\n    if (back) return (((px - py) % HATCH_PERIOD) + HATCH_PERIOD) % HATCH_PERIOD < HATCH_WIDTH;\n    return (px + py) % HATCH_PERIOD < HATCH_WIDTH;\n  }\n\n  /**\n   * Paint a decoded class tile into RGBA for one classifier.\n   *\n   * @param {Uint8ClampedArray} src The class tile's RGBA pixels.\n   * @param {Uint8ClampedArray} out Where to write; same length as `src`.\n   * @param {Classifier} classify From createFilterClassifier, or\n   *   bulletin_terrain_core.js's indexClassifier (SNOW-1194).\n   * @param {ReadonlyArray<PaletteEntry>} palette Index \u2192 colour.\n   * @param {TileCoord} tile The tile being painted.\n   * @returns {Uint8ClampedArray} `out`.\n   */\n  function paintTile(src, out, classify, palette, tile) {\n    const size = Math.round(Math.sqrt(src.length / 4));\n    /** @type {Cell} */\n    const cell = { kind: 'nodata', height: 0, octant: -1, band: -1 };\n    for (let py = 0; py < size; py += 1) {\n      for (let px = 0; px < size; px += 1) {\n        const i = (py * size + px) * 4;\n        decodeCell(src[i], src[i + 1], src[i + 2], cell);\n        const entry = palette[classify(cell, px, py, tile)] || palette[0];\n        const rgba = entry.hatch && !onHatch(px, py, entry.hatchBack) ? palette[0].rgba : entry.rgba;\n        out[i] = rgba[0];\n        out[i + 1] = rgba[1];\n        out[i + 2] = rgba[2];\n        out[i + 3] = rgba[3];\n      }\n    }\n    return out;\n  }\n\n  /**\n   * A class tile with no data anywhere \u2014 what a 204 inside coverage stands\n   * for, so it goes through the same classifier as any other tile.\n   *\n   * @returns {Uint8ClampedArray} TILE_SIZE\u00B2 RGBA pixels, every B = 255.\n   */\n  function noDataTile() {\n    const data = new Uint8ClampedArray(TILE_SIZE * TILE_SIZE * 4);\n    for (let i = 0; i < data.length; i += 4) {\n      data[i + 2] = B_NODATA;\n      data[i + 3] = 255;\n    }\n    return data;\n  }\n\n  /**\n   * Even-odd: whether a point is inside one closed ring.\n   *\n   * @param {ReadonlyArray<ReadonlyArray<number>>} ring\n   * @param {number} x Longitude.\n   * @param {number} y Latitude.\n   * @returns {boolean}\n   */\n  function inRing(ring, x, y) {\n    let inside = false;\n    for (let i = 0, j = ring.length - 1; i < ring.length; j = i, i += 1) {\n      const xi = ring[i][0];\n      const yi = ring[i][1];\n      const xj = ring[j][0];\n      const yj = ring[j][1];\n      if ((yi > y) !== (yj > y) && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) inside = !inside;\n    }\n    return inside;\n  }\n\n  /**\n   * Whether a point falls inside the class tiles' coverage outline\n   * (SNOW-1459): inside an outer ring and none of its holes. The bbox\n   * prefilter turns away most of the map at four comparisons.\n   *\n   * @param {number} lng Longitude in degrees.\n   * @param {number} lat Latitude in degrees.\n   * @returns {boolean}\n   */\n  function coversPoint(lng, lat) {\n    if (!Number.isFinite(lng) || !Number.isFinite(lat)) return false;\n    const [west, south, east, north] = COVERAGE_BOUNDS;\n    if (lng < west || lng > east || lat < south || lat > north) return false;\n    for (let i = 0; i < OUTLINE.length; i += 1) {\n      const box = OUTLINE_BOXES[i];\n      if (lng < box[0] || lng > box[2] || lat < box[1] || lat > box[3]) continue;\n      const [outer, ...holes] = OUTLINE[i];\n      if (inRing(outer, lng, lat) && !holes.some((hole) => inRing(hole, lng, lat))) return true;\n    }\n    return false;\n  }\n\n  /** Tiles already answered, by `z/x/y`; downloads ask thousands at once. */\n  const tileCoverage = new Map();\n  const TILE_COVERAGE_LIMIT = 65536;\n\n  /**\n   * Whether a tile's centre falls inside the coverage outline \u2014 the test\n   * for whether a 204 means \"no data here\" (hatched) or \"outside the\n   * survey\", and for which class tiles a download prices and pins. The\n   * outline beyond Switzerland is a union of z12 tiles, so for the z12\u201314\n   * class tiles the centre decides exactly what an overlap test would,\n   * without a tile that merely touches the edge counting. Remembered per\n   * tile, since a download walks the same tiles more than once.\n   *\n   * @param {number} z Zoom.\n   * @param {number} x Column.\n   * @param {number} y Row.\n   * @returns {boolean}\n   */\n  function tileInCoverage(z, x, y) {\n    const key = z + '/' + x + '/' + y;\n    const known = tileCoverage.get(key);\n    if (known !== undefined) return known;\n    const n = 2 ** z;\n    const lng = ((x + 0.5) / n) * 360 - 180;\n    const lat = (Math.atan(Math.sinh(Math.PI * (1 - (2 * (y + 0.5)) / n))) * 180) / Math.PI;\n    const covered = coversPoint(lng, lat);\n    if (tileCoverage.size >= TILE_COVERAGE_LIMIT) tileCoverage.clear();\n    tileCoverage.set(key, covered);\n    return covered;\n  }\n\n  /**\n   * Whether the filter can show anything where the map is looking.\n   *\n   * Coverage is asked first: zooming in does not help outside the survey.\n   *\n   * @param {{zoom: number, lng: number, lat: number}} view The camera.\n   * @returns {'ok'|'zoom-in'|'out-of-coverage'}\n   */\n  function availability(view) {\n    if (!coversPoint(view.lng, view.lat)) return 'out-of-coverage';\n    if (!(view.zoom >= DRAW_MIN_ZOOM)) return 'zoom-in';\n    return 'ok';\n  }\n\n  /**\n   * Substitute `%(name)s` placeholders.\n   *\n   * @param {string} template The string.\n   * @param {Object<string, string|number>} values Replacements.\n   * @returns {string}\n   */\n  function fill(template, values) {\n    return String(template).replace(/%\\((\\w+)\\)s/g, (_m, key) =>\n      key in values ? String(values[key]) : '');\n  }\n\n  /**\n   * The filter in words, for the legend (long) or the menu row (short).\n   *\n   * Aspects, slope angle, elevation \u2014 the mode is not named (SNOW-1109).\n   * Long: \"N, NE, NW \u00B7 35\u00B0+ \u00B7 above 2,400 m\". Short: \"3 aspects \u00B7 35\u00B0+ \u00B7\n   * above 2,400 m\". The elevation part is left out when both bounds are null.\n   *\n   * @param {*} filter The filter.\n   * @param {Object<string, string>} strings The sheet's strings \u2014 see\n   *   terrain_filter_sheet.js for the keys and their English fallbacks.\n   * @param {{short?: boolean, formatNumber?: (n: number) => string}} [options]\n   * @returns {string}\n   */\n  function summarise(filter, strings, options) {\n    const f = normaliseFilter(filter);\n    const opts = options || {};\n    const num = opts.formatNumber || ((/** @type {number} */ n) => n.toLocaleString('en-GB'));\n    const parts = [];\n    if (f.aspects.length === OCTANTS.length) {\n      parts.push(strings['aspects-all']);\n    } else if (f.aspects.length === 0) {\n      parts.push(strings['aspects-none']);\n    } else if (opts.short) {\n      parts.push(f.aspects.length === 1\n        ? strings['aspects-one']\n        : fill(strings['aspects-count'], { count: f.aspects.length }));\n    } else {\n      parts.push(f.aspects.map((a) => strings[`compass-${a}`] || OCTANTS[a]).join(', '));\n    }\n    parts.push(f.maxSlope === null\n      ? fill(strings['slope-min'], { min: f.minSlope })\n      : fill(strings['slope-range'], { min: f.minSlope, max: f.maxSlope }));\n    const lo = f.minElevation;\n    const hi = f.maxElevation;\n    if (lo !== null && hi !== null) {\n      parts.push(fill(strings['elevation-range'], { min: num(lo), max: num(hi) }));\n    } else if (lo !== null) {\n      parts.push(fill(strings['elevation-above'], { min: num(lo) }));\n    } else if (hi !== null) {\n      parts.push(fill(strings['elevation-below'], { max: num(hi) }));\n    }\n    // A middle dot between parts \u2014 a glyph, not a word, so not a string.\n    return parts.join(' \u00B7 ');\n  }\n\n  /**\n   * The slope ramp's selected classes, as indexes into SLOPE_LADDER.\n   *\n   * Class i covers SLOPE_LADDER[i] up to the next rung; the last class\n   * (index 4, 50\u00B0+) has no top, which the filter writes as maxSlope null.\n   *\n   * @param {*} filter The filter.\n   * @returns {{lo: number, hi: number}} First and last selected class.\n   */\n  function slopeClassRange(filter) {\n    const f = normaliseFilter(filter);\n    const last = SLOPE_LADDER.length - 1;\n    const lo = SLOPE_LADDER.indexOf(f.minSlope);\n    const hi = f.maxSlope === null ? last : SLOPE_LADDER.indexOf(f.maxSlope) - 1;\n    return { lo, hi };\n  }\n\n  /**\n   * The slope range after a tap on one class of the sheet's ramp.\n   *\n   * A class outside the range extends the range to it. An end class\n   * removes itself, unless it is the only class selected. An interior\n   * class collapses the range to that class alone.\n   *\n   * @param {*} filter The filter before the tap.\n   * @param {number} index The class tapped, 0 (30\u201335\u00B0) \u2026 4 (50\u00B0+).\n   * @returns {{minSlope: number, maxSlope: number|null}}\n   */\n  function tapSlopeClass(filter, index) {\n    const last = SLOPE_LADDER.length - 1;\n    const i = Math.max(0, Math.min(last, Math.trunc(Number(index)) || 0));\n    let { lo, hi } = slopeClassRange(filter);\n    // The only class selected stays selected: an empty range is not a filter.\n    if (i < lo) {\n      lo = i;\n    } else if (i > hi) {\n      hi = i;\n    } else if (lo !== hi) {\n      if (i === lo) {\n        lo += 1;\n      } else if (i === hi) {\n        hi -= 1;\n      } else {\n        lo = i;\n        hi = i;\n      }\n    }\n    return {\n      minSlope: SLOPE_LADDER[lo],\n      maxSlope: hi === last ? null : SLOPE_LADDER[hi + 1],\n    };\n  }\n\n  /**\n   * The heights one of the sheet's elevation lists offers.\n   *\n   * 'min' (\"Above\") runs up from ELEVATION_LIST_MIN_M to 100 m under the\n   * set maximum; 'max' (\"Below\") runs down from ELEVATION_LIST_MAX_M to\n   * 100 m over the set minimum. A stored value of the list's own bound\n   * that falls outside 1,000\u20134,500 m is kept, in order, so opening the\n   * sheet never rewrites it.\n   *\n   * @param {*} filter The filter.\n   * @param {'min'|'max'} which Which list.\n   * @returns {number[]} Ascending for 'min', descending for 'max'.\n   */\n  function elevationOptions(filter, which) {\n    const f = normaliseFilter(filter);\n    /** @type {number[]} */\n    const values = [];\n    if (which === 'min') {\n      const top = f.maxElevation === null\n        ? ELEVATION_LIST_MAX_M\n        : Math.min(ELEVATION_LIST_MAX_M, f.maxElevation - ELEVATION_STEP_M);\n      for (let v = ELEVATION_LIST_MIN_M; v <= top; v += ELEVATION_STEP_M) values.push(v);\n      if (f.minElevation !== null && !values.includes(f.minElevation)) {\n        values.push(f.minElevation);\n      }\n      return values.sort((a, b) => a - b);\n    }\n    const bottom = f.minElevation === null\n      ? ELEVATION_LIST_MIN_M\n      : Math.max(ELEVATION_LIST_MIN_M, f.minElevation + ELEVATION_STEP_M);\n    for (let v = ELEVATION_LIST_MAX_M; v >= bottom; v -= ELEVATION_STEP_M) values.push(v);\n    if (f.maxElevation !== null && !values.includes(f.maxElevation)) {\n      values.push(f.maxElevation);\n    }\n    return values.sort((a, b) => b - a);\n  }\n\n  /**\n   * Where the elevation band sits on the sheet's mountain.\n   *\n   * Fractions of the ELEVATION_LIST_MIN_M\u2013ELEVATION_LIST_MAX_M scale\n   * measured down from the peak: 0 is the peak, 1 the base. An open bound\n   * runs to its edge; a bound outside the scale is clamped onto it.\n   *\n   * @param {*} filter The filter.\n   * @returns {{top: number, bottom: number}}\n   */\n  function elevationBand(filter) {\n    const f = normaliseFilter(filter);\n    const span = ELEVATION_LIST_MAX_M - ELEVATION_LIST_MIN_M;\n    const fraction = (/** @type {number} */ m) =>\n      Math.max(0, Math.min(1, (ELEVATION_LIST_MAX_M - m) / span));\n    return {\n      top: f.maxElevation === null ? 0 : fraction(f.maxElevation),\n      bottom: f.minElevation === null ? 1 : fraction(f.minElevation),\n    };\n  }\n\n  /**\n   * Fill an XYZ template.\n   *\n   * @param {string} template e.g. `https://\u2026/{z}/{x}/{y}.png`.\n   * @param {number} z Zoom.\n   * @param {number} x Column.\n   * @param {number} y Row.\n   * @returns {string}\n   */\n  function tileUrl(template, z, x, y) {\n    return template\n      .replace('{z}', String(z))\n      .replace('{x}', String(x))\n      .replace('{y}', String(y));\n  }\n\n  /**\n   * The template MapLibre's source requests painted tiles through. The\n   * hash changes with the filter, so a repaint is a new URL and never a\n   * stale tile from MapLibre's own cache.\n   *\n   * @param {string} hash From filterHash().\n   * @returns {string}\n   */\n  function protocolTileUrl(hash) {\n    return `${PROTOCOL}://{z}/{x}/{y}?v=${encodeURIComponent(hash)}`;\n  }\n\n  /**\n   * Read the tile coordinates back out of a protocol URL.\n   *\n   * @param {string} url e.g. `terrainfilter://13/4262/2905?v=ff-30----`.\n   * @returns {TileCoord|null}\n   */\n  function parseProtocolUrl(url) {\n    const m = /^terrainfilter:\\/\\/(\\d+)\\/(\\d+)\\/(\\d+)(?:[?#]|$)/.exec(String(url));\n    if (!m) return null;\n    return { z: Number(m[1]), x: Number(m[2]), y: Number(m[3]) };\n  }\n\n  /**\n   * A small least-recently-used map, for the decoded class tiles a filter\n   * change repaints from.\n   *\n   * @param {number} limit Most entries kept.\n   * @returns {{get: (key: string) => *, set: (key: string, value: *) => void, size: () => number}}\n   */\n  function createTileCache(limit) {\n    /** @type {Map<string, *>} */\n    const entries = new Map();\n    return {\n      get(key) {\n        if (!entries.has(key)) return undefined;\n        const value = entries.get(key);\n        entries.delete(key);\n        entries.set(key, value);\n        return value;\n      },\n      set(key, value) {\n        entries.delete(key);\n        entries.set(key, value);\n        while (entries.size > limit) {\n          const oldest = entries.keys().next().value;\n          if (oldest === undefined) break;\n          entries.delete(oldest);\n        }\n      },\n      size() {\n        return entries.size;\n      },\n    };\n  }\n\n  self.pwaTerrainFilterCore = Object.freeze({\n    OCTANTS: OCTANTS,\n    MIN_ZOOM: MIN_ZOOM,\n    DRAW_MIN_ZOOM: DRAW_MIN_ZOOM,\n    MAX_ZOOM: MAX_ZOOM,\n    TILE_SIZE: TILE_SIZE,\n    COVERAGE_BOUNDS: COVERAGE_BOUNDS,\n    SWISS_BOUNDS: SWISS_BOUNDS,\n    SLOPE_LADDER: SLOPE_LADDER,\n    ELEVATION_STEP_M: ELEVATION_STEP_M,\n    ELEVATION_MAX_M: ELEVATION_MAX_M,\n    B_LEVEL: B_LEVEL,\n    B_NODATA: B_NODATA,\n    PALETTE_INDEX: PALETTE_INDEX,\n    PALETTE: PALETTE,\n    HATCH_PERIOD: HATCH_PERIOD,\n    HATCH_WIDTH: HATCH_WIDTH,\n    PROTOCOL: PROTOCOL,\n    MODES: MODES,\n    SLOPE_PALETTE_INDEX: SLOPE_PALETTE_INDEX,\n    SLOPE_PALETTE: SLOPE_PALETTE,\n    SLOPE_RASTER_ALPHA: SLOPE_RASTER_ALPHA,\n    DEFAULT_FILTER: DEFAULT_FILTER,\n    decodeCell: decodeCell,\n    createFilterClassifier: createFilterClassifier,\n    createSlopeClassifier: createSlopeClassifier,\n    createClassifier: createClassifier,\n    paletteFor: paletteFor,\n    paintTile: paintTile,\n    noDataTile: noDataTile,\n    coversPoint: coversPoint,\n    tileInCoverage: tileInCoverage,\n    availability: availability,\n    normaliseFilter: normaliseFilter,\n    parseFilter: parseFilter,\n    serialiseFilter: serialiseFilter,\n    filterHash: filterHash,\n    summarise: summarise,\n    ELEVATION_LIST_MIN_M: ELEVATION_LIST_MIN_M,\n    ELEVATION_LIST_MAX_M: ELEVATION_LIST_MAX_M,\n    slopeClassRange: slopeClassRange,\n    tapSlopeClass: tapSlopeClass,\n    elevationOptions: elevationOptions,\n    elevationBand: elevationBand,\n    tileUrl: tileUrl,\n    protocolTileUrl: protocolTileUrl,\n    parseProtocolUrl: parseProtocolUrl,\n    createTileCache: createTileCache,\n  });\n})();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oE,EAAKpE,EAAO,CAGd,IAFAuG,EAAQ,OAAOnC,CAAG,EAClBmC,EAAQ,IAAInC,EAAKpE,CAAK,EACfuG,EAAQ,KAAOD,GAAO,CAC3B,MAAME,EAASD,EAAQ,KAAK,EAAE,KAAK,EAAE,MACrC,GAAIC,IAAW,OAAW,MAC1BD,EAAQ,OAAOC,CAAM,CACvB,CACF,EACA,MAAO,CACL,OAAOD,EAAQ,IACjB,CACF,CACF,CAEA,KAAK,qBAAuB,OAAO,OAAO,CACxC,QAAS5J,EACT,SAAUC,EACV,cAAeG,EACf,SAAUF,EACV,UAAWC,EACX,gBAAiBI,EACjB,aAAcF,EACd,aAAcW,EACd,iBAAkBG,EAClB,gBAAiBC,EACjB,QAASG,EACT,SAAUC,EACV,cAAeC,EACf,QAASQ,EACT,aAAcP,EACd,YAAaC,EACb,SAAUkB,EACV,MAAOX,EACP,oBAAqBC,EACrB,cAAeE,EACf,mBAAoBD,EACpB,eAAgBQ,EAChB,WAAYE,EACZ,uBAAwB+B,EACxB,sBAAuBQ,EACvB,iBAAkBC,GAClB,WAAYC,GACZ,UAAWK,GACX,WAAYQ,GACZ,YAAaY,EACb,eAAgBO,GAChB,aAAcK,GACd,gBAAiBrE,EACjB,YAAaW,GACb,gBAAiBE,GACjB,WAAYG,GACZ,UAAW2D,GACX,qBAAsB7G,EACtB,qBAAsBC,EACtB,gBAAiBmH,EACjB,cAAeE,GACf,iBAAkBE,GAClB,cAAeI,GACf,QAASI,GACT,gBAAiBC,GACjB,iBAAkBE,GAClB,gBAAiBE,EACnB,CAAC,CACH,GAAG",
  "names": ["OCTANTS", "MIN_ZOOM", "MAX_ZOOM", "TILE_SIZE", "DRAW_MIN_ZOOM", "SWISS_BOUNDS", "OUTLINE", "COVERAGE_BOUNDS", "OUTLINE_BOXES", "polygon", "west", "south", "east", "north", "lng", "lat", "SLOPE_LADDER", "BAND_DEG", "MAX_BAND", "ELEVATION_STEP_M", "ELEVATION_MAX_M", "ELEVATION_LIST_MIN_M", "ELEVATION_LIST_MAX_M", "B_LEVEL", "B_NODATA", "PALETTE_INDEX", "HATCH_PERIOD", "HATCH_WIDTH", "hexChannels", "hex", "n", "MATCH_HEX", "NODATA_HEX", "PALETTE", "MODES", "SLOPE_PALETTE_INDEX", "SLOPE_RASTER_ALPHA", "SLOPE_PALETTE", "klass", "SLOPE_INDEX_BY_BAND", "_unused", "band", "deg", "classes", "DEFAULT_FILTER", "PROTOCOL", "decodeCell", "r", "g", "b", "out", "cell", "normaliseElevation", "value", "snapped", "normaliseFilter", "raw", "src", "mode", "aspects", "valid", "a", "minSlope", "maxSlope", "minElevation", "maxElevation", "parseFilter", "text", "serialiseFilter", "filter", "f", "filterHash", "mask", "acc", "part", "v", "parts", "createFilterClassifier", "loBand", "hiBand", "loHeight", "hiHeight", "_px", "_py", "_tile", "createSlopeClassifier", "createClassifier", "paletteFor", "onHatch", "px", "py", "back", "paintTile", "classify", "palette", "tile", "size", "i", "entry", "rgba", "noDataTile", "data", "inRing", "ring", "x", "y", "inside", "j", "xi", "yi", "xj", "yj", "coversPoint", "box", "outer", "holes", "hole", "tileCoverage", "TILE_COVERAGE_LIMIT", "tileInCoverage", "z", "key", "known", "covered", "availability", "view", "fill", "template", "values", "_m", "summarise", "strings", "options", "opts", "num", "lo", "hi", "slopeClassRange", "last", "tapSlopeClass", "index", "elevationOptions", "which", "top", "bottom", "elevationBand", "span", "fraction", "m", "tileUrl", "protocolTileUrl", "hash", "parseProtocolUrl", "url", "createTileCache", "limit", "entries", "oldest"]
}
