{
  "version": 3,
  "sources": ["offline_journey_core.js"],
  "sourcesContent": ["// @ts-check\n/*\n * static/js/offline_journey_core.js \u2014 one panel per downloaded area on\n * /offline/: three stages and one verdict (SNOW-1308).\n *\n * The offline report (`offline_audit_core.js`) answers about the app and\n * the map as a whole. What a reader about to lose signal asks is narrower\n * and more useful: *will THIS area work?* So each area the device holds\n * gets a panel above the report, and the panel answers three questions in\n * the order a trip depends on them:\n *\n *   - **The map.** The area's bucket verifies \u2014 its style, TileJSON and\n *     sprite (`areaState`, unchanged, SNOW-843/844), its terrain-class\n *     tiles where it was downloaded with them (SNOW-1138) \u2014 AND its\n *     basemap tiles are all there (`blobFullyCached` over the record's own\n *     tile template and ground, injected as `tiles`). The report never\n *     checked the tiles themselves; a bucket holding its documents and\n *     half its tiles read ready.\n *   - **The conditions.** The bulletins and weather inside the boundary\n *     were fetched today (`areaContentState` is `fresh`). Stale or never\n *     is a No here, not a caveat: the panel's question is whether the area\n *     is ready, and yesterday's bulletin is not. SNOW-1379: an area that\n *     carries the problem-terrain feed (downloaded with terrain tiles, in\n *     a terrain country) adds a \"Problem terrain\" line counting the days\n *     saved, from the urls the last sync stamped (`items.problemTerrain`,\n *     `withProblemTerrain`). SNOW-1387: a day not held makes the stage\n *     No (reason `terrain`), so the area reads \"Needs a refresh\" and Sync\n *     now fetches it again; a line that could not be read makes a Yes\n *     unknown. The stage's own No (stale, never) keeps its reason.\n *   - **User data.** Each trip and pin in the area, by name, Yes only\n *     when every url it needs is in Cache Storage. What \"needs\" means is\n *     stamped on the record by the sync that fetched them\n *     (`stampContentRecord`, `areaItemExpectation`) \u2014 `/api/area-items/`\n *     is never cached, so this page cannot ask offline. No stamp is\n *     unknown, and a signed-out reader gets no stage at all: they have no\n *     things, and an absent stage must not read as a fault.\n *\n *   SNOW-1417: the conditions stage also carries a \"SAC tours\" line (each\n *   tour's Feature and profile in Cache Storage, `toursLine`) and a\n *   \"Community reports\" line (the stamped report ids against the ids the\n *   map's overlay cache holds, which the caller reads and passes as\n *   `readings.reportIds`, `reportsLine`). Either short makes the stage No\n *   (`tours-missing`, `reports-missing`), as a missing problem-terrain day\n *   does.\n *\n * The verdict is one plain line, from `verdictFor`:\n *\n *   - `ready` \u2014 every stage is Yes.\n *   - `open-map` \u2014 the map stage is No. Tiles and documents can only be\n *     fetched where the basemap style is loaded, so the remedy is the\n *     map's Manage downloads sheet, never a tap here.\n *   - `refresh` \u2014 another stage is No; the tap runs Sync now.\n *   - `unknown` \u2014 a stage could not be read and none is No.\n *\n * A reading that could not be taken is unknown, never a Yes and never a\n * No \u2014 the report's rule, kept here.\n *\n * Pure: no DOM and no storage. Every reading arrives as an argument.\n * Reads `pwaOfflineAuditCore` at call time for `areaState`,\n * `areaContentState`, `completableArea` and `chosenAreas`, so the panels\n * and the report cannot disagree about one area.\n *\n * ## The connection panel (SNOW-1415)\n *\n * The header's connection panel asks the same question of every area on\n * every page, where the audit core is not loaded. `base.html` loads this\n * file globally for it. `stagesFromRecord` builds the stages from the\n * stored record alone: the map stage from a `verified` stamp that the\n * tile-capable pages write (`verifiedFromSync` on the map,\n * `verifiedFromStages` on /offline/), the conditions from `contentAt`,\n * and the reader's things from the same stamp. `verdictFor` is unchanged\n * and stays the one verdict. The record-only path never reads the audit\n * core, so it works where that core is absent.\n *\n * ## The Downloads inventory (SNOW-1418)\n *\n * `inventoryFor` lists what one area holds, row by row, for the reveal\n * under its row in the map's Downloads sheet: the map, the bulletin, the\n * weather, the reader's routes, trips and saved places, the SAC tours, the\n * resorts and the community reports. It reads the same stamp as\n * `stagesFromRecord`, and takes what the worker and the overlay cache\n * were read to hold as injected readings (`inventoryUrls` names the urls\n * to ask about).\n */\n\n(function () {\n  'use strict';\n\n  /**\n   * @typedef {'yes'|'no'|'unknown'} StageStatus\n   */\n\n  /**\n   * @typedef {Object} ThingRow\n   * @property {'trip'|'pin'} kind\n   * @property {string} name\n   * @property {StageStatus} status\n   */\n\n  /**\n   * @typedef {Object} TerrainLine\n   * @property {StageStatus} status Yes when every day is held.\n   * @property {number} held The days in Cache Storage.\n   * @property {number} total The days the last sync saved.\n   */\n\n  /**\n   * @typedef {Object} CountLine\n   * @property {StageStatus} status Yes when everything stamped is held.\n   * @property {number} held How many are on the device.\n   * @property {number} total How many the last sync saved.\n   * @property {string|null} [newestAt] Reports only: the newest one's\n   *   observed time (SNOW-1417).\n   */\n\n  /**\n   * @typedef {Object} Stage\n   * @property {StageStatus} status\n   * @property {string} [reason]\n   * @property {ThingRow[]} [rows] User data only.\n   * @property {TerrainLine} [terrain] The conditions stage only (SNOW-1379).\n   * @property {CountLine} [tours] The conditions stage only (SNOW-1417).\n   * @property {CountLine} [reports] The conditions stage only (SNOW-1417).\n   */\n\n  /**\n   * @typedef {Object} Panel\n   * @property {string} id The bucket id.\n   * @property {string} name\n   * @property {'region'|'dropzone'|'custom'} kind\n   * @property {boolean} orphaned\n   * @property {string|null} contentAt\n   * @property {{map: Stage, conditions: Stage, things: Stage|null}} stages\n   * @property {'ready'|'open-map'|'refresh'|'unknown'} verdict\n   * @property {boolean} canSync Whether this host can run Sync now for it.\n   * @property {number} bytes The recorded size, 0 where none landed.\n   */\n\n  // Regions first: a region is what most people download, and the ones\n  // they drew themselves are the exceptions. The order the report's Map\n  // downloads section used, kept.\n  /** @type {Array<'region'|'dropzone'|'custom'>} */\n  var KIND_ORDER = ['region', 'dropzone', 'custom'];\n\n  /**\n   * The audit core, read at call time.\n   *\n   * @returns {any}\n   */\n  function audit() {\n    return self.pwaOfflineAuditCore;\n  }\n\n  /**\n   * Fill ``%(key)s`` placeholders.\n   *\n   * @param {string} template\n   * @param {Record<string, string>} values\n   * @returns {string}\n   */\n  function fill(template, values) {\n    return String(template || '').replace(/%\\((\\w+)\\)s/g, function (_m, key) {\n      return Object.prototype.hasOwnProperty.call(values, key) ? values[key] : '';\n    });\n  }\n\n  /**\n   * Which kind of download a record is.\n   *\n   * @param {any} area\n   * @returns {'region'|'dropzone'|'custom'}\n   */\n  function areaKind(area) {\n    if (area && area.kind === 'region') return 'region';\n    return area && area.type === 'dropzone' ? 'dropzone' : 'custom';\n  }\n\n  /**\n   * The name an area is spoken of by: its stored name, the sheet's\n   * \"Custom area N\" default from its ordinal (SNOW-1133), or its id.\n   *\n   * @param {any} area\n   * @param {Record<string, string>} t\n   * @returns {string}\n   */\n  function areaName(area, t) {\n    if (area.name) return String(area.name);\n    if (typeof area.ordinal === 'number' && Number.isFinite(area.ordinal)) {\n      return fill(t['default-custom-name'] || 'Custom area %(n)s', { n: String(area.ordinal) });\n    }\n    return String(area.id);\n  }\n\n  /**\n   * The ground a record's tiles cover, as the blob `blobFullyCached`\n   * walks.\n   *\n   * A region carries the run's own `z` row spans. A custom area carries\n   * `bbox` + `band`, rebuilt the way it was fetched: a drop zone as its\n   * circle (`circleBlobForBBox`, SNOW-1136), a framed box as `buildBlob`.\n   *\n   * @param {any} area\n   * @param {any} download `pwaBasemapDownloadCore`.\n   * @returns {any} Null where the record names no ground.\n   */\n  function areaBlob(area, download) {\n    if (area.z) return { z: area.z };\n    var band = Array.isArray(area.band) ? area.band : null;\n    if (!Array.isArray(area.bbox) || !band) return null;\n    if (area.type === 'dropzone' && typeof download.circleBlobForBBox === 'function') {\n      return download.circleBlobForBBox(area.bbox, band[0], band[1]);\n    }\n    if (typeof download.buildBlob !== 'function') return null;\n    return download.buildBlob(area.bbox, band[0], band[1]);\n  }\n\n  /**\n   * Whether every basemap tile an area's ground implies is in its bucket.\n   *\n   * The reading is injected \u2014 `download` is `pwaBasemapDownloadCore`,\n   * passed by the caller \u2014 because static/offline.html loads no such core\n   * and this module stays pure. Unknown (null) for: no core, a bucket that\n   * did not answer, a record naming no tile template or no ground, or any\n   * throw. Never a No drawn from a reading that was not taken.\n   *\n   * @param {any} area An audit area reading.\n   * @param {any} download `pwaBasemapDownloadCore`, or null.\n   * @returns {boolean|null}\n   */\n  function tileReading(area, download) {\n    if (!area || !download || typeof download.blobFullyCached !== 'function') return null;\n    if (area.bucketReadable === false || area.orphaned) return null;\n    // SNOW-1478: every map the area holds, primary first; a record before\n    // that ticket reads as one, from its own `template`.\n    var templates =\n      typeof download.recordBasemaps === 'function'\n        ? download\n            .recordBasemaps(area)\n            .map(function (/** @type {any} */ entry) {\n              return entry.template;\n            })\n            .filter(Boolean)\n        : area.template\n          ? [area.template]\n          : [];\n    if (templates.length === 0) return null;\n    try {\n      var blob = areaBlob(area, download);\n      if (!blob) return null;\n      return templates.every(function (/** @type {any} */ template) {\n        return !!download.blobFullyCached(template, blob, area.entries || []);\n      });\n    } catch (_err) {\n      return null;\n    }\n  }\n\n  /**\n   * The map stage: the bucket verifies AND its tiles are all there.\n   *\n   * @param {any} area\n   * @param {boolean|null|undefined} tiles From `tileReading`.\n   * @returns {Stage}\n   */\n  function mapStage(area, tiles) {\n    var core = audit();\n    if (!core) return { status: 'unknown' };\n    var state = core.areaState(area).status;\n    if (state === 'ready') {\n      if (tiles === true) return { status: 'yes' };\n      if (tiles === false) return { status: 'no', reason: 'tiles' };\n      return { status: 'unknown', reason: 'tiles-unread' };\n    }\n    if (state === 'unreadable' || state === 'unverifiable') {\n      return { status: 'unknown', reason: state };\n    }\n    // `orphaned`, `incomplete`, `missing`.\n    return { status: 'no', reason: state };\n  }\n\n  /**\n   * The conditions stage: today's bulletins and weather are here.\n   *\n   * @param {any} area\n   * @param {string} [now]\n   * @returns {Stage}\n   */\n  function conditionsStage(area, now) {\n    var core = audit();\n    if (!core) return { status: 'unknown' };\n    var content = core.areaContentState(area, now);\n    if (content === 'fresh') return { status: 'yes' };\n    if (content === 'stale') return { status: 'no', reason: 'stale' };\n    if (content === 'never') return { status: 'no', reason: 'never' };\n    // `none`: the tiles do not verify (the map stage already says so) or\n    // an unparseable stamp. Neither is evidence about the content.\n    return { status: 'unknown' };\n  }\n\n  /**\n   * Whether a reader is signed in, from the account the device's queue is\n   * set for (`mutations.principal`, null when signed out).\n   *\n   * @param {any} readings\n   * @returns {boolean}\n   */\n  function isSignedIn(readings) {\n    var p = readings && readings.currentPrincipal;\n    return typeof p === 'string' && p !== '' && p !== 'anonymous' && p !== 'unknown';\n  }\n\n  /**\n   * Every url the shell cache holds, or null where it could not be read.\n   *\n   * @param {any} readings\n   * @returns {Map<string, any>|null} By url, each to its entry.\n   */\n  function shellUrls(readings) {\n    if (!readings || readings.cachesReadable === false || readings.failure) return null;\n    /** @type {Map<string, any>} */\n    var urls = new Map();\n    (Array.isArray(readings.shellEntries) ? readings.shellEntries : []).forEach(\n      /** @param {any} entry */ function (entry) {\n        if (entry && entry.url) urls.set(entry.url, entry);\n      },\n    );\n    return urls;\n  }\n\n  /**\n   * Whether one of your things' urls will open offline for this reader.\n   *\n   * Presence is not enough for the principal-scoped families \u2014 a trip page,\n   * its route, a pin's place sheet (`isPrincipalScoped`): the worker\n   * serves those only under a matching `X-SW-Principal`\n   * (`_principalMatches`), so one cached for another account is a No. A\n   * stamp whose read did not come back is unknown. Public weather sheets\n   * need only be there (SNOW-1308 review).\n   *\n   * @param {string} url Absolute.\n   * @param {Map<string, any>} held\n   * @param {string|null} principal\n   * @returns {StageStatus}\n   */\n  function urlState(url, held, principal) {\n    var entry = held.get(url);\n    if (!entry) return 'no';\n    var core = audit();\n    if (!core || typeof core.isPrincipalScoped !== 'function') return 'unknown';\n    if (!core.isPrincipalScoped(url)) return 'yes';\n    if (entry.stampUnread) return 'unknown';\n    return core.principalMatches(entry.principal, principal) ? 'yes' : 'no';\n  }\n\n  /**\n   * One url as the cache keys it \u2014 absolute, on this origin.\n   *\n   * @param {string} url\n   * @param {string} origin\n   * @returns {string}\n   */\n  function absolute(url, origin) {\n    try {\n      return new URL(url, origin || 'http://localhost').toString();\n    } catch (_err) {\n      return url;\n    }\n  }\n\n  /**\n   * The conditions stage's \"Problem terrain\" line: how many of the days\n   * the last sync saved are in Cache Storage (SNOW-1379).\n   *\n   * Only for an area that carries the feed: one downloaded with terrain\n   * tiles (`area.terrain`) whose last sync stamped a non-empty\n   * `items.problemTerrain` \u2014 the stamp is empty for an area outside the\n   * terrain countries, and absent for one not synced since this ticket.\n   * The feed is public, so presence is enough (`urlState`). A cache that\n   * could not be read counts nothing and is unknown.\n   *\n   * @param {any} area\n   * @param {{urls: Map<string, any>|null, origin: string,\n   *   principal?: string|null}} ctx\n   * @returns {TerrainLine|null} Null where the area carries no feed.\n   */\n  function problemTerrainLine(area, ctx) {\n    if (!area || !area.terrain) return null;\n    var stamped = area.items && area.items.problemTerrain;\n    if (!Array.isArray(stamped) || stamped.length === 0) return null;\n    var total = stamped.length;\n    if (!ctx.urls) return { status: 'unknown', held: 0, total: total };\n    var held = /** @type {Map<string, any>} */ (ctx.urls);\n    var count = stamped.filter(function (/** @type {string} */ url) {\n      return urlState(absolute(url, ctx.origin), held, ctx.principal || null) === 'yes';\n    }).length;\n    return { status: count === total ? 'yes' : 'no', held: count, total: total };\n  }\n\n  /**\n   * The conditions stage's \"SAC tours\" line: how many of the tours the\n   * last sync saved will open offline (SNOW-1417).\n   *\n   * A tour opens when its Feature and its height profile are both in\n   * Cache Storage. Public, so presence is enough (`urlState`). Null where\n   * the last sync stamped no tours: an area with none, or one not synced\n   * since this ticket, or a page without the ski-touring layer.\n   *\n   * @param {any} area\n   * @param {{urls: Map<string, any>|null, origin: string,\n   *   principal?: string|null}} ctx\n   * @returns {CountLine|null}\n   */\n  function toursLine(area, ctx) {\n    var stamped = area && area.items && area.items.tours;\n    if (!Array.isArray(stamped) || stamped.length === 0) return null;\n    var total = stamped.length;\n    if (!ctx.urls) return { status: 'unknown', held: 0, total: total };\n    var held = /** @type {Map<string, any>} */ (ctx.urls);\n    var count = stamped.filter(function (/** @type {any} */ tour) {\n      var urls = tour && Array.isArray(tour.urls) ? tour.urls : [];\n      return urls.length > 0 && urls.every(function (/** @type {string} */ url) {\n        return urlState(absolute(url, ctx.origin), held, ctx.principal || null) === 'yes';\n      });\n    }).length;\n    return { status: count === total ? 'yes' : 'no', held: count, total: total };\n  }\n\n  /**\n   * The conditions stage's \"Community reports\" line: how many of the\n   * reports inside the area the last sync saved are in the map's overlay\n   * cache (SNOW-1417).\n   *\n   * Reports are not in Cache Storage: the map keeps the whole feed in\n   * IndexedDB (`pwaMapOverlayCache`), so the caller reads it and passes\n   * the ids it holds. Null where the last sync stamped no reports field;\n   * an empty stamp is a Yes with nothing to count.\n   *\n   * @param {any} area\n   * @param {Set<string>|null|undefined} ids The report ids the overlay\n   *   cache holds, or null when it could not be read.\n   * @returns {CountLine|null}\n   */\n  function reportsLine(area, ids) {\n    var items = area && area.items;\n    var stamped = items && items.reports;\n    if (!Array.isArray(stamped)) return null;\n    var total = stamped.length;\n    var newestAt = typeof items.reportsNewestAt === 'string' ? items.reportsNewestAt : null;\n    if (!ids) return { status: 'unknown', held: 0, total: total, newestAt: newestAt };\n    var have = /** @type {Set<string>} */ (ids);\n    var count = stamped.filter(function (/** @type {any} */ report) {\n      return !!report && have.has(String(report.id));\n    }).length;\n    return { status: count === total ? 'yes' : 'no', held: count, total: total, newestAt: newestAt };\n  }\n\n  /**\n   * The \"User data\" stage: each trip and pin, Yes only when every url\n   * it needs is cached.\n   *\n   * @param {any} area\n   * @param {{signedIn: boolean, urls: Map<string, any>|null, origin: string,\n   *   principal?: string|null}} ctx\n   * @returns {Stage|null} Null for a signed-out reader: no stage at all.\n   */\n  function thingsStage(area, ctx) {\n    if (!ctx.signedIn) return null;\n    var items = area.items;\n    if (!items || !Array.isArray(items.trips) || !Array.isArray(items.pins)) {\n      return { status: 'unknown', reason: 'unrecorded', rows: [] };\n    }\n    // SNOW-1308 review: the names were written by whoever SYNCED, which\n    // need not be the area's downloader (`area.principal`) \u2014 another\n    // account signed in on this device can press Sync now. So the guard is\n    // the principal stamped with the items, and nothing is named unless it\n    // is this reader's: a missing, empty or different stamp is unknown.\n    var stamped = typeof items.principal === 'string' ? items.principal : '';\n    if (!stamped || stamped !== ctx.principal) {\n      return { status: 'unknown', reason: 'other-account', rows: [] };\n    }\n    /** @type {ThingRow[]} */\n    var rows = [];\n    /**\n     * @param {'trip'|'pin'} kind\n     * @param {any} item\n     */\n    var add = function (kind, item) {\n      if (!item) return;\n      var urls = Array.isArray(item.urls) ? item.urls : [];\n      /** @type {StageStatus} */\n      var status = 'unknown';\n      if (urls.length > 0 && ctx.urls) {\n        var held = /** @type {Map<string, any>} */ (ctx.urls);\n        var states = urls.map(function (/** @type {string} */ url) {\n          return urlState(absolute(url, ctx.origin), held, ctx.principal || null);\n        });\n        status =\n          states.indexOf('no') >= 0 ? 'no' : states.indexOf('unknown') >= 0 ? 'unknown' : 'yes';\n      }\n      rows.push({ kind: kind, name: typeof item.name === 'string' ? item.name : '', status: status });\n    };\n    items.trips.forEach(function (/** @type {any} */ trip) {\n      add('trip', trip);\n    });\n    items.pins.forEach(function (/** @type {any} */ pin) {\n      add('pin', pin);\n    });\n    if (rows.length === 0) return { status: 'yes', reason: 'none-here', rows: rows };\n    var statuses = rows.map(function (row) {\n      return row.status;\n    });\n    if (statuses.indexOf('no') >= 0) return { status: 'no', rows: rows };\n    if (statuses.indexOf('unknown') >= 0) return { status: 'unknown', rows: rows };\n    return { status: 'yes', rows: rows };\n  }\n\n  /**\n   * The one line a panel leads with.\n   *\n   * A map No outranks every other answer, because its remedy is somewhere\n   * else: tiles can only be fetched where the style is loaded. Any other\n   * No outranks an unknown, because the tap that fixes it is right here.\n   *\n   * @param {{map: Stage, conditions: Stage, things: Stage|null}} stages\n   * @returns {'ready'|'open-map'|'refresh'|'unknown'}\n   */\n  function verdictFor(stages) {\n    var list = [stages.map, stages.conditions];\n    if (stages.things) list.push(stages.things);\n    // SNOW-1483: a map missing only its terrain data is one Sync mends\n    // (it fetches the terrain tiles alone), so the tap is right here.\n    if (stages.map.status === 'no' && stages.map.reason !== 'terrain') return 'open-map';\n    var any = /** @param {StageStatus} status */ function (status) {\n      return list.some(function (stage) {\n        return stage.status === status;\n      });\n    };\n    if (any('no')) return 'refresh';\n    if (any('unknown')) return 'unknown';\n    return 'ready';\n  }\n\n  /**\n   * A \"tap to fix\" verdict only where a tap can fix it.\n   *\n   * Sync now needs an area whose tiles verify (`completableArea`); one\n   * whose map stage could not be read, with another stage No, would\n   * otherwise promise a tap that is never offered. It reads \"Can't tell\"\n   * instead (SNOW-1308 review).\n   *\n   * @param {'ready'|'open-map'|'refresh'|'unknown'} verdict\n   * @param {boolean} completable\n   * @returns {'ready'|'open-map'|'refresh'|'unknown'}\n   */\n  function tapCanFix(verdict, completable) {\n    return verdict === 'refresh' && !completable ? 'unknown' : verdict;\n  }\n\n  /**\n   * A stage with its \"Problem terrain\" line, where the area has one, and\n   * the line folded into the stage's answer (SNOW-1387, Hugo 2 Nov 2026):\n   * an area missing a day of the bulletin's slopes is not ready for\n   * offline, so a No line makes the stage No and the verdict \"Needs a\n   * refresh\". The stage's own No outranks it and keeps its reason (the\n   * bulletins themselves are stale, which the note says); an unread line\n   * makes a Yes unknown, never a Yes. A `terrain` reason has no note of\n   * its own: the line under the stage already says how many days are\n   * saved.\n   *\n   * @param {Stage} stage\n   * @param {TerrainLine|null} line\n   * @returns {Stage}\n   */\n  function withTerrainLine(stage, line) {\n    if (!line) return stage;\n    var out = Object.assign({}, stage, { terrain: line });\n    if (stage.status === 'no') return out;\n    if (line.status === 'no') return Object.assign(out, { status: 'no', reason: 'terrain' });\n    if (line.status === 'unknown' && stage.status === 'yes') {\n      return Object.assign(out, { status: 'unknown' });\n    }\n    return out;\n  }\n\n  /**\n   * A stage with a tours or reports line folded in (SNOW-1417), by the\n   * same rule as the problem-terrain line (`withTerrainLine`): a No line\n   * makes a stage that is not already No say No with the line's reason;\n   * an unread line makes a Yes unknown.\n   *\n   * @param {Stage} stage\n   * @param {'tours'|'reports'} key\n   * @param {CountLine|null} line\n   * @param {string} reason `tours-missing` or `reports-missing`.\n   * @returns {Stage}\n   */\n  function withCountLine(stage, key, line, reason) {\n    if (!line) return stage;\n    /** @type {Stage} */\n    var out = Object.assign({}, stage);\n    out[key] = line;\n    if (stage.status === 'no') return out;\n    if (line.status === 'no') return Object.assign(out, { status: 'no', reason: reason });\n    if (line.status === 'unknown' && stage.status === 'yes') {\n      return Object.assign(out, { status: 'unknown' });\n    }\n    return out;\n  }\n\n  /**\n   * @typedef {Object} Verified\n   * @property {'yes'|'no'|null} [map] Whether the area's tiles verified.\n   * @property {'yes'|'no'|null} [content] Whether everything the area's\n   *   content plan named, the reader's own things included, landed.\n   * @property {string} [reason] Why the map is No, where it is.\n   * @property {string} [principal] The account the content answer was\n   *   read for (the `pwa-user-id` meta). A content answer is only ever\n   *   shown back to that account.\n   * @property {string} at When the reading was taken (ISO).\n   * @property {Array<SyncStep>} [steps] SNOW-1487: the steps the last sync\n   *   did not finish, failed ones only. Absent when it finished them all.\n   * @property {Array<string>} [ran] SNOW-1487 review: the stages the sync\n   *   reached, by step name \u2014 only these replace their step. Read by\n   *   `stampVerifiedRecord`, never stored.\n   * @property {boolean} [cancelled] SNOW-1487 review: the sync was\n   *   stopped, so the stamp does not move `at`. Never stored.\n   */\n\n  /**\n   * SNOW-1487: one step a sync did not finish \u2014 `syncArea`'s, as stamped.\n   *\n   * @typedef {Object} SyncStep\n   * @property {'basemap'|'terrain'|'deps'|'content'} step\n   * @property {'network'|'interrupted'|'budget'|'quota'|'plan'} reason\n   * @property {number} [done]\n   * @property {number} [total]\n   * @property {number} [neededMb]\n   * @property {number|null} [freeMb]\n   */\n\n  /**\n   * SNOW-1487: the steps a stamp carries, narrowed to well-formed ones.\n   *\n   * @param {unknown} steps\n   * @returns {Array<SyncStep>}\n   */\n  function stepsOf(steps) {\n    if (!Array.isArray(steps)) return [];\n    return steps.filter(function (/** @type {any} */ entry) {\n      return !!entry && typeof entry.step === 'string' && typeof entry.reason === 'string';\n    });\n  }\n\n  /**\n   * SNOW-1487: whether a record's last sync failed to ADD a map or its\n   * terrain data \u2014 a step the verdict never reads\n   * (docs/decisions/a-failed-addition-never-hides-a-working-map.md).\n   *\n   * @param {any} record\n   * @param {'basemap'|'terrain'} step\n   * @returns {boolean}\n   */\n  function additionFailed(record, step) {\n    var v = record && record.verified && typeof record.verified === 'object' ? record.verified : null;\n    return stepsOf(v && v.steps).some(function (entry) {\n      return entry.step === step;\n    });\n  }\n\n  /**\n   * One stamp answer, narrowed: only Yes and No are claims.\n   *\n   * @param {unknown} value\n   * @returns {'yes'|'no'|null}\n   */\n  function answer(value) {\n    return value === 'yes' || value === 'no' ? value : null;\n  }\n\n  /**\n   * SNOW-1415: what one map-page sync learned, as a `verified` stamp.\n   *\n   * `syncArea`'s `tiles` is the map half. `'ok'` and `'none'` say only\n   * that the render dependencies are established\n   * (docs/decisions/a-pre-departure-sync-is-unconditional.md), so a Yes\n   * also needs `tilesHeld === true`: every tile of the area's grid is in\n   * its bucket (`tileReading`). `tilesHeld === false` is a No for the\n   * tiles; null is no reading, and leaves the map answer as it was.\n   * `'absent'`, `'failed'` and `'incomplete'` are No, and `'unknown'` is\n   * no claim at all. `content` is the content half's own answer, stamped\n   * for `principal` and only when there is one (a signed-out sync has no\n   * things of its own to answer for).\n   *\n   * SNOW-1487: the sync's `steps`, the ones it did not finish, are copied\n   * on, and an empty list is a claim too: it clears the last sync's. A\n   * `content` that is neither true nor false (a sync stopped before it\n   * read the content) stamps no content answer. SNOW-1487 review: the\n   * stages it reached (`ran`) and whether it was stopped (`cancelled`)\n   * ride along for `stampVerifiedRecord`.\n   *\n   * @param {{tiles?: string, tilesHeld?: boolean|null, content?: boolean,\n   *   steps?: Array<SyncStep>, ran?: Array<string>,\n   *   cancelled?: boolean}|null|undefined} result\n   * @param {string} at\n   * @param {string} [principal] The `pwa-user-id` the sync ran as.\n   * @returns {Verified|null} Null when the sync claimed nothing.\n   */\n  function verifiedFromSync(result, at, principal) {\n    if (!result) return null;\n    /** @type {Verified} */\n    var out = { at: at };\n    var depsOk = result.tiles === 'ok' || result.tiles === 'none';\n    if (depsOk && result.tilesHeld === true) out.map = 'yes';\n    else if (depsOk && result.tilesHeld === false) {\n      out.map = 'no';\n      out.reason = 'tiles';\n    } else if (\n      result.tiles === 'absent' ||\n      result.tiles === 'failed' ||\n      result.tiles === 'incomplete'\n    ) {\n      out.map = 'no';\n      out.reason = result.tiles === 'incomplete' ? 'tiles' : result.tiles;\n    }\n    // An absent bucket is never fetched into, so its content answer is\n    // no reading of the content at all.\n    if (result.tiles !== 'absent' && principal && typeof result.content === 'boolean') {\n      out.content = result.content ? 'yes' : 'no';\n      out.principal = principal;\n    }\n    var steps = Array.isArray(result.steps) ? stepsOf(result.steps) : null;\n    if (steps) out.steps = steps;\n    if (Array.isArray(result.ran)) {\n      out.ran = result.ran.filter(function (name) {\n        return typeof name === 'string';\n      });\n    }\n    if (result.cancelled) out.cancelled = true;\n    return out.map || out.content || steps ? out : null;\n  }\n\n  /**\n   * SNOW-1415: what one /offline/ panel read, as a `verified` stamp.\n   *\n   * The panel's map stage is the full reading (bucket and tiles); its\n   * things stage is the cache walk over the urls the last sync stamped.\n   * Unknown stages claim nothing, so a host that cannot read tiles\n   * (static/offline.html) never overwrites what the map page learned.\n   *\n   * @param {{map: Stage, things: Stage|null}} stages\n   * @param {string} at\n   * @param {string} [principal] The `pwa-user-id` the page was rendered\n   *   for. With none, the things answer is not stamped.\n   * @returns {Verified|null}\n   */\n  function verifiedFromStages(stages, at, principal) {\n    if (!stages) return null;\n    /** @type {Verified} */\n    var out = { at: at };\n    var map = stages.map ? answer(stages.map.status) : null;\n    if (map) out.map = map;\n    if (map === 'no' && stages.map.reason) out.reason = stages.map.reason;\n    var things = stages.things ? answer(stages.things.status) : null;\n    if (things && principal) {\n      out.content = things;\n      out.principal = principal;\n    }\n    return out.map || out.content ? out : null;\n  }\n\n  /**\n   * SNOW-1415: one record with a `verified` stamp merged in.\n   *\n   * Merged field by field, so a reading that claims only the content (a\n   * map-page sync that could not judge the tiles) keeps the map answer an\n   * earlier reading gave. A map Yes drops a stale map-No reason.\n   *\n   * SNOW-1487 review: `at` is when a reading last finished, which the\n   * Downloads sheet's \"Last synced\" line reads, so a stopped sync\n   * (`cancelled`) leaves it where it was. And a sync that names the stages\n   * it reached (`ran`) replaces only their steps: the last sync's step for\n   * a stage this one never started is kept.\n   *\n   * Synchronous, because every caller runs it inside a `readModifyWrite`\n   * mutator, which must not await. Device-only: `downloads_sync.js` sends\n   * a whitelist of fields, and this is not one of them.\n   *\n   * @param {any} entry The stored record.\n   * @param {Verified|null} verified\n   * @returns {any} A new record, or the entry itself when there is nothing\n   *   to stamp.\n   */\n  function stampVerifiedRecord(entry, verified) {\n    if (!entry || !verified) return entry;\n    var prior = entry.verified && typeof entry.verified === 'object' ? entry.verified : {};\n    var next = Object.assign({}, prior);\n    if (!verified.cancelled) next.at = verified.at;\n    if (verified.map) {\n      next.map = verified.map;\n      if (verified.map === 'no' && verified.reason) next.reason = verified.reason;\n      else delete next.reason;\n    }\n    if (verified.content) {\n      next.content = verified.content;\n      next.principal = verified.principal || '';\n    }\n    // SNOW-1487: the last sync's steps replace the one before's; a sync\n    // that finished them all clears them.\n    if (Array.isArray(verified.steps)) {\n      var ran = verified.ran;\n      var kept = Array.isArray(ran)\n        ? stepsOf(prior.steps).filter(function (entry) {\n            return /** @type {Array<string>} */ (ran).indexOf(entry.step) < 0;\n          })\n        : [];\n      var steps = kept.concat(verified.steps);\n      if (steps.length) next.steps = steps;\n      else delete next.steps;\n    }\n    return Object.assign({}, entry, { verified: next });\n  }\n\n  /**\n   * SNOW-1415: the stages of one area from its stored record alone.\n   *\n   * The connection panel runs on every page, where neither the audit's\n   * readings nor the tile arithmetic exist. So the pages that CAN read\n   * them stamp what they learned on the record (`verified`, from\n   * `verifiedFromSync` and `verifiedFromStages`), and every other page\n   * reads the stamp back through here. `verdictFor` then gives the same\n   * one-line answer the /offline/ panels give.\n   *\n   *   - **map** \u2014 the stamp's map answer. No stamp is unknown, which is\n   *     the honest answer for a record no tile-capable page has read.\n   *   - **conditions** \u2014 the record's own `contentAt`, by calendar day,\n   *     as `areaContentState` reads it; a fetch that fell short\n   *     (`contentIncomplete`) makes a fresh stamp No.\n   *   - **things** \u2014 the stamp's content answer, signed-in readers only,\n   *     and only when it was read for this reader's account\n   *     (`verified.principal`). Another account's answer is unknown here,\n   *     as `thingsStage` treats another account's items on /offline/.\n   *\n   * SNOW-1483: `terrainExpected` is whether this area should hold the\n   * terrain-class tiles (the page fetches terrain data and the area's\n   * ground meets their coverage). With it set, a record saved without\n   * `terrain` has a map stage of No, reason `terrain`, in place of a Yes,\n   * so the dot agrees with the inventory's Terrain row. A map No or\n   * unknown keeps its own answer. 3D (elevation) is never read.\n   *\n   * SNOW-1487: the steps a sync did not finish (`verified.steps`) are not\n   * read for the map or the verdict when they are ADDITIONS (`basemap`,\n   * `terrain`): a failed addition never hides a working map. A missing\n   * render dependency or a short content fetch already shows in the map\n   * and conditions answers.\n   *\n   * @param {any} record A `basemap.regions` or `basemap.customAreas` row.\n   * @param {string|Date} [now]\n   * @param {{signedIn?: boolean, principal?: string, terrainExpected?: boolean}} [options]\n   * @returns {{map: Stage, conditions: Stage, things: Stage|null}}\n   */\n  function stagesFromRecord(record, now, options) {\n    var opts = options || {};\n    var r = record || {};\n    var v = r.verified && typeof r.verified === 'object' ? r.verified : null;\n\n    /** @type {Stage} */\n    var map = { status: 'unknown', reason: 'unverified' };\n    var mapAnswer = v ? answer(v.map) : null;\n    if (mapAnswer === 'yes') map = { status: 'yes' };\n    else if (mapAnswer === 'no') map = { status: 'no', reason: String(v.reason || 'tiles') };\n    // SNOW-1487: a sync that tried to add the terrain data and failed has\n    // a notice of its own under the row, which says why and what to do;\n    // the map it holds still draws, so the dot stays as the map reads.\n    if (map.status === 'yes' && opts.terrainExpected && !r.terrain && !additionFailed(r, 'terrain')) {\n      map = { status: 'no', reason: 'terrain' };\n    }\n\n    /** @type {Stage} */\n    var conditions;\n    if (!r.contentAt) {\n      conditions = { status: 'no', reason: 'never' };\n    } else {\n      var fetched = new Date(r.contentAt);\n      var today = now ? new Date(now) : new Date();\n      if (Number.isNaN(fetched.getTime()) || Number.isNaN(today.getTime())) {\n        conditions = { status: 'unknown' };\n      } else if (fetched.toDateString() !== today.toDateString()) {\n        conditions = { status: 'no', reason: 'stale' };\n      } else if (r.contentIncomplete) {\n        conditions = { status: 'no', reason: 'incomplete' };\n      } else {\n        conditions = { status: 'yes' };\n      }\n    }\n\n    /** @type {Stage|null} */\n    var things = null;\n    if (opts.signedIn) {\n      var ours = !!(v && opts.principal && v.principal === opts.principal);\n      var contentAnswer = ours ? answer(v.content) : null;\n      if (contentAnswer === 'yes') things = { status: 'yes', rows: [] };\n      else if (contentAnswer === 'no') things = { status: 'no', reason: 'incomplete', rows: [] };\n      else things = { status: 'unknown', rows: [] };\n    }\n    return { map: map, conditions: conditions, things: things };\n  }\n\n  /**\n   * @typedef {'yes'|'partial'|'missing'|'unknown'} InventoryStatus\n   */\n\n  /**\n   * @typedef {Object} InventoryRow\n   * @property {'map'|'swiss'|'terrain'|'bulletin'|'weather'|'routes'|'trips'|'places'|'tours'|'resorts'|'reports'} key\n   * @property {InventoryStatus} status `partial` is what a sync fixes;\n   *   `missing` is the map or terrain, which only a fresh download fixes.\n   * @property {number} [count] A count row's stamped total.\n   * @property {string} [at] The bulletin and weather rows: `contentAt`.\n   */\n\n  /**\n   * One stage status as an inventory status. A content No is something a\n   * sync fixes, so it is partial; the map's No is missing.\n   *\n   * @param {Stage|null} stage\n   * @param {boolean} [isMap]\n   * @returns {InventoryStatus}\n   */\n  function fromStage(stage, isMap) {\n    if (!stage) return 'unknown';\n    if (stage.status === 'yes') return 'yes';\n    if (stage.status === 'no') return isMap ? 'missing' : 'partial';\n    return 'unknown';\n  }\n\n  /**\n   * A count row's status from what the device was read to hold.\n   *\n   * Yes when every stamped thing is held, partial when one is not. Where\n   * nothing was read (`check` answers null), the row follows its stage,\n   * so it never says No on a reading it did not take.\n   *\n   * @param {any[]} stamped\n   * @param {function(any): (boolean|null)} check Held, not held, or unread.\n   * @param {InventoryStatus} fallback\n   * @returns {InventoryStatus}\n   */\n  function countStatus(stamped, check, fallback) {\n    var unread = false;\n    for (var i = 0; i < stamped.length; i++) {\n      var held = check(stamped[i]);\n      if (held === false) return 'partial';\n      if (held === null) unread = true;\n    }\n    return unread ? fallback : 'yes';\n  }\n\n  /**\n   * SNOW-1418: what one downloaded area holds, row by row \u2014 the inventory\n   * the Downloads sheet reveals under an area's row.\n   *\n   * Built on `stagesFromRecord`, so a row's verdict dot and the inventory\n   * under it read the same stamp. The map, bulletin and weather rows are\n   * always there. A count row is there only when the last sync stamped its\n   * field, so a record synced before its field existed lists less rather\n   * than a zero it never counted. Routes, trips and saved places are the\n   * reader's own: shown only signed in, and only when the account that\n   * stamped them (`items.principal`) is this reader's. Saved places only\n   * when the area has some.\n   *\n   * The readings are optional and injected by the caller: `held`, the\n   * absolute urls the worker said it would serve offline (SNOW-1416's\n   * `held-content`), and `overlayIds`, the route and report ids the\n   * map's overlay cache holds. Absent or null, a row follows its stage.\n   * `terrainAvailable` adds the terrain row. SNOW-1487: it reads its own\n   * state, never the map's: missing when the area was saved without\n   * terrain data, and otherwise `terrainHeld` \u2014 whether every terrain\n   * tile the record implies is in its bucket (yes, partial when one is\n   * not, unknown when unread). `swissMissing` adds the \"Swiss map\" row,\n   * partial, for an area whose ground wants the Swisstopo map it does not\n   * hold yet: the next sync adds it.\n   *\n   * @param {any} record A `basemap.regions` or `basemap.customAreas` row.\n   * @param {string|Date} [now]\n   * @param {{signedIn?: boolean, principal?: string, origin?: string,\n   *   terrainAvailable?: boolean, terrainHeld?: boolean|null,\n   *   swissMissing?: boolean, held?: Set<string>|null,\n   *   overlayIds?: {routes?: Set<string>|null, reports?: Set<string>|null}|null}} [options]\n   * @returns {InventoryRow[]}\n   */\n  function inventoryFor(record, now, options) {\n    var opts = options || {};\n    var r = record || {};\n    // The map row is the map itself: terrain has its own row below, so\n    // the map stage is read without it.\n    var stages = stagesFromRecord(r, now, Object.assign({}, opts, { terrainExpected: false }));\n    var items = r.items && typeof r.items === 'object' ? r.items : {};\n    var held = opts.held instanceof Set ? opts.held : null;\n    var overlays = opts.overlayIds || {};\n    var origin = opts.origin || '';\n    var conditions = fromStage(stages.conditions);\n    var things = fromStage(stages.things);\n    var at = typeof r.contentAt === 'string' ? r.contentAt : undefined;\n\n    /** @param {any} thing */\n    var urlsHeld = function (thing) {\n      var urls = thing && Array.isArray(thing.urls) ? thing.urls : [];\n      if (!held || urls.length === 0) return null;\n      var set = /** @type {Set<string>} */ (held);\n      return urls.every(function (/** @type {string} */ url) {\n        return set.has(absolute(url, origin));\n      });\n    };\n    /**\n     * @param {Set<string>|null|undefined} ids\n     * @param {string} field\n     */\n    var idHeld = function (ids, field) {\n      return function (/** @type {any} */ thing) {\n        if (!(ids instanceof Set) || !thing || !thing[field]) return null;\n        return ids.has(String(thing[field]));\n      };\n    };\n\n    /** @type {InventoryRow[]} */\n    var rows = [\n      { key: 'map', status: fromStage(stages.map, true) },\n    ];\n    // SNOW-1487: the Swisstopo map a sync has still to add.\n    if (opts.swissMissing) rows.push({ key: 'swiss', status: 'partial' });\n    // The terrain-class tiles, on their own row where this page can fetch\n    // them, read from their own state: they ride in the map's bucket, but\n    // a map that draws says nothing about them (SNOW-1487).\n    if (opts.terrainAvailable) {\n      /** @type {InventoryStatus} */\n      var terrain = 'missing';\n      if (r.terrain) {\n        if (opts.terrainHeld === true) terrain = 'yes';\n        else if (opts.terrainHeld === false) terrain = 'partial';\n        else terrain = 'unknown';\n      }\n      rows.push({ key: 'terrain', status: terrain });\n    }\n    rows.push(\n      { key: 'bulletin', status: conditions, at: at },\n      { key: 'weather', status: conditions, at: at },\n    );\n    var ours =\n      !!opts.signedIn &&\n      typeof items.principal === 'string' &&\n      items.principal !== '' &&\n      items.principal === opts.principal;\n    if (ours && Array.isArray(items.routes)) {\n      rows.push({\n        key: 'routes',\n        status: countStatus(items.routes, idHeld(overlays.routes, 'uuid'), things),\n        count: items.routes.length,\n      });\n    }\n    if (ours && Array.isArray(items.trips)) {\n      rows.push({\n        key: 'trips',\n        status: countStatus(items.trips, urlsHeld, things),\n        count: items.trips.length,\n      });\n    }\n    if (ours && Array.isArray(items.pins) && items.pins.length > 0) {\n      rows.push({\n        key: 'places',\n        status: countStatus(items.pins, urlsHeld, things),\n        count: items.pins.length,\n      });\n    }\n    if (Array.isArray(items.tours)) {\n      rows.push({\n        key: 'tours',\n        status: countStatus(items.tours, urlsHeld, conditions),\n        count: items.tours.length,\n      });\n    }\n    if (Array.isArray(items.resorts)) {\n      rows.push({\n        key: 'resorts',\n        status: countStatus(items.resorts, urlsHeld, conditions),\n        count: items.resorts.length,\n      });\n    }\n    if (Array.isArray(items.reports)) {\n      rows.push({\n        key: 'reports',\n        status: countStatus(items.reports, idHeld(overlays.reports, 'id'), conditions),\n        count: items.reports.length,\n      });\n    }\n    return rows;\n  }\n\n  /**\n   * SNOW-1418: every url an area's inventory asks the worker about \u2014 the\n   * stamped urls of its trips, pins, tours and resorts, absolute.\n   *\n   * @param {any} record\n   * @param {string} origin\n   * @returns {string[]}\n   */\n  function inventoryUrls(record, origin) {\n    var items = record && record.items && typeof record.items === 'object' ? record.items : {};\n    /** @type {string[]} */\n    var out = [];\n    ['trips', 'pins', 'tours', 'resorts'].forEach(function (field) {\n      var list = Array.isArray(items[field]) ? items[field] : [];\n      list.forEach(function (/** @type {any} */ thing) {\n        (thing && Array.isArray(thing.urls) ? thing.urls : []).forEach(function (/** @type {string} */ url) {\n          var href = absolute(url, origin);\n          if (out.indexOf(href) < 0) out.push(href);\n        });\n      });\n    });\n    return out;\n  }\n\n  /**\n   * Every panel, in paint order.\n   *\n   * @param {any} readings What `offline_audit.js` collected.\n   * @param {Record<string, string>} t The journey's strings.\n   * @param {{tiles?: Record<string, boolean|null>, origin?: string,\n   *   canFetch?: boolean}} [options] `tiles` is each area's\n   *   `tileReading`, by id; `canFetch` whether this host can run Sync now.\n   * @returns {Panel[]}\n   */\n  function buildPanels(readings, t, options) {\n    var core = audit();\n    var opts = options || {};\n    var r = readings || {};\n    if (!core) return [];\n    var strings = t || {};\n    var tiles = opts.tiles || {};\n    var failed = !!r.failure;\n    var ctx = {\n      signedIn: isSignedIn(r),\n      urls: shellUrls(r),\n      origin: opts.origin || '',\n      principal: typeof r.currentPrincipal === 'string' ? r.currentPrincipal : null,\n    };\n    // SNOW-1417: the report ids the map's overlay cache holds, read by\n    // the caller; absent is unread.\n    /** @type {Set<string>|null} */\n    var reportIds = r.reportIds instanceof Set ? r.reportIds : null;\n    /** @type {any[]} */\n    var areas = core.chosenAreas(r);\n    /** @type {Panel[]} */\n    var panels = [];\n    KIND_ORDER.forEach(function (kind) {\n      areas\n        .filter(function (area) {\n          return areaKind(area) === kind;\n        })\n        .forEach(function (area) {\n          /** @type {{map: Stage, conditions: Stage, things: Stage|null}} */\n          var stages = failed\n            ? {\n                map: { status: 'unknown' },\n                conditions: { status: 'unknown' },\n                things: ctx.signedIn ? { status: 'unknown', rows: [] } : null,\n              }\n            : {\n                map: mapStage(area, tiles[area.id]),\n                conditions: withCountLine(\n                  withCountLine(\n                    withTerrainLine(conditionsStage(area, r.now), problemTerrainLine(area, ctx)),\n                    'tours',\n                    toursLine(area, ctx),\n                    'tours-missing',\n                  ),\n                  'reports',\n                  reportsLine(area, reportIds),\n                  'reports-missing',\n                ),\n                things: thingsStage(area, ctx),\n              };\n          panels.push({\n            id: String(area.id),\n            name: areaName(area, strings),\n            kind: kind,\n            orphaned: !!area.orphaned,\n            contentAt: typeof area.contentAt === 'string' ? area.contentAt : null,\n            stages: stages,\n            verdict: tapCanFix(verdictFor(stages), !failed && core.completableArea(area, r.now)),\n            canSync: !!opts.canFetch && !failed && core.completableArea(area, r.now),\n            bytes: typeof area.bytes === 'number' ? area.bytes : 0,\n          });\n        });\n    });\n    return panels;\n  }\n\n  self.pwaOfflineJourneyCore = Object.freeze({\n    buildPanels: buildPanels,\n    verdictFor: verdictFor,\n    stagesFromRecord: stagesFromRecord,\n    inventoryFor: inventoryFor,\n    inventoryUrls: inventoryUrls,\n    verifiedFromSync: verifiedFromSync,\n    additionFailed: additionFailed,\n    verifiedFromStages: verifiedFromStages,\n    stampVerifiedRecord: stampVerifiedRecord,\n    mapStage: mapStage,\n    conditionsStage: conditionsStage,\n    thingsStage: thingsStage,\n    problemTerrainLine: problemTerrainLine,\n    toursLine: toursLine,\n    reportsLine: reportsLine,\n    withCountLine: withCountLine,\n    tileReading: tileReading,\n    isSignedIn: isSignedIn,\n    areaName: areaName,\n  });\n})();\n"],
  "mappings": "CAqFC,UAAY,CACX,aAwDA,IAAIA,EAAa,CAAC,SAAU,WAAY,QAAQ,EAOhD,SAASC,GAAQ,CACf,OAAO,KAAK,mBACd,CASA,SAASC,EAAKC,EAAUC,EAAQ,CAC9B,OAAO,OAAOD,GAAY,EAAE,EAAE,QAAQ,eAAgB,SAAUE,EAAIC,EAAK,CACvE,OAAO,OAAO,UAAU,eAAe,KAAKF,EAAQE,CAAG,EAAIF,EAAOE,CAAG,EAAI,EAC3E,CAAC,CACH,CAQA,SAASC,EAASC,EAAM,CACtB,OAAIA,GAAQA,EAAK,OAAS,SAAiB,SACpCA,GAAQA,EAAK,OAAS,WAAa,WAAa,QACzD,CAUA,SAASC,EAASD,EAAM,EAAG,CACzB,OAAIA,EAAK,KAAa,OAAOA,EAAK,IAAI,EAClC,OAAOA,EAAK,SAAY,UAAY,OAAO,SAASA,EAAK,OAAO,EAC3DN,EAAK,EAAE,qBAAqB,GAAK,oBAAqB,CAAE,EAAG,OAAOM,EAAK,OAAO,CAAE,CAAC,EAEnF,OAAOA,EAAK,EAAE,CACvB,CAcA,SAASE,EAASF,EAAMG,EAAU,CAChC,GAAIH,EAAK,EAAG,MAAO,CAAE,EAAGA,EAAK,CAAE,EAC/B,IAAII,EAAO,MAAM,QAAQJ,EAAK,IAAI,EAAIA,EAAK,KAAO,KAClD,MAAI,CAAC,MAAM,QAAQA,EAAK,IAAI,GAAK,CAACI,EAAa,KAC3CJ,EAAK,OAAS,YAAc,OAAOG,EAAS,mBAAsB,WAC7DA,EAAS,kBAAkBH,EAAK,KAAMI,EAAK,CAAC,EAAGA,EAAK,CAAC,CAAC,EAE3D,OAAOD,EAAS,WAAc,WAAmB,KAC9C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EAAG,CAAC+D,GAAUxG,EAAK,gBAAgBX,EAAMyF,EAAE,GAAG,CAAC,EACnF,QAAS,CAAC,CAACD,EAAK,UAAY,CAAC2B,GAAUxG,EAAK,gBAAgBX,EAAMyF,EAAE,GAAG,EACvE,MAAO,OAAOzF,EAAK,OAAU,SAAWA,EAAK,MAAQ,CACvD,CAAC,CACH,CAAC,CACL,CAAC,EACMsH,CACT,CAEA,KAAK,sBAAwB,OAAO,OAAO,CACzC,YAAaL,EACb,WAAY9D,EACZ,iBAAkBmC,EAClB,aAAciB,EACd,cAAeQ,EACf,iBAAkBvC,EAClB,eAAgBN,EAChB,mBAAoBW,EACpB,oBAAqBG,EACrB,SAAUvE,EACV,gBAAiBI,EACjB,YAAa2B,EACb,mBAAoBb,EACpB,UAAWK,EACX,YAAaE,EACb,cAAe4B,EACf,YAAazD,EACb,WAAYW,EACZ,SAAUf,CACZ,CAAC,CACH,GAAG",
  "names": ["KIND_ORDER", "audit", "fill", "template", "values", "_m", "key", "areaKind", "area", "areaName", "areaBlob", "download", "band", "tileReading", "templates", "entry", "blob", "mapStage", "tiles", "core", "state", "conditionsStage", "now", "content", "isSignedIn", "readings", "p", "shellUrls", "urls", "urlState", "url", "held", "principal", "absolute", "origin", "problemTerrainLine", "ctx", "stamped", "total", "count", "toursLine", "tour", "reportsLine", "ids", "items", "newestAt", "have", "report", "thingsStage", "rows", "add", "kind", "item", "status", "states", "trip", "pin", "statuses", "row", "verdictFor", "stages", "list", "any", "stage", "tapCanFix", "verdict", "completable", "withTerrainLine", "line", "out", "withCountLine", "reason", "stepsOf", "steps", "additionFailed", "record", "step", "v", "answer", "value", "verifiedFromSync", "result", "at", "depsOk", "name", "verifiedFromStages", "map", "things", "stampVerifiedRecord", "verified", "prior", "next", "ran", "kept", "stagesFromRecord", "options", "opts", "r", "mapAnswer", "conditions", "fetched", "today", "ours", "contentAnswer", "fromStage", "isMap", "countStatus", "check", "fallback", "unread", "i", "inventoryFor", "overlays", "urlsHeld", "thing", "set", "idHeld", "field", "terrain", "inventoryUrls", "href", "buildPanels", "strings", "failed", "reportIds", "areas", "panels"]
}
