{
  "version": 3,
  "sources": ["download_run_log_core.js"],
  "sourcesContent": ["// @ts-check\n/*\n * static/js/download_run_log_core.js \u2014 the shape of one download's own log\n * (SNOW-1582).\n *\n * Every pinned run \u2014 a region, a custom area, a Sync, a Retry (\"complete\")\n * \u2014 writes one entry to IndexedDB's `log:download_runs` store, whether or\n * not the debug log's Record is on. This module is that entry's rules and\n * nothing else: no DOM, no storage, no clock it does not take as an\n * argument. `download_run_log.js` holds the entry and writes it;\n * `offline_audit.js`, `offline_journey.js` and the telemetry event read it\n * through the helpers here, so the three can never disagree about what a\n * run said.\n *\n * ## The entry\n *\n *   {id, areaId, kind, name, startedAt, endedAt, outcome, stages, failures}\n *\n *   kind      'region' | 'custom' | 'sync' | 'complete'\n *   outcome   'running' | 'ok' | 'failed' | 'cancelled' \u2014 and, only as READ,\n *             'stopped': an entry still running whose heartbeat\n *             (`updatedAt`) has been quiet for `STALE_AFTER_MS` \u2014 its page\n *             closed, or the phone slept and the tab was discarded. A run\n *             another tab is still writing keeps a fresh heartbeat and\n *             reads as running (`readEntry`).\n *   stages    the stages reached, in order: plan, documents, content-plan,\n *             warm, base-layer, verify, record. Each is {stage, startedAt,\n *             endedAt, planned, ok, failed, reason, failures}.\n *   failures  every failed request, in the order seen, with no cap \u2014 each\n *             {stage, path, status, kind, detail}.\n *\n * ## Paths, never URLs\n *\n * A stored, copied or sent URL is reduced to its path. A query string can\n * carry a share token or a viewer's bounding box, and the path is what\n * says which item failed.\n *\n * ## Failure kinds\n *\n * `failureKind` names what a reader can act on: `connection` (no\n * connection, a timeout, no response), `server` (5xx and 429), `not-found`\n * (403, 404, 410), `storage` (the device is full) and `other`, with the\n * status beside it. SNOW-1583's retry rule reads the same function.\n */\n\n(function () {\n  'use strict';\n\n  /** How many runs an area keeps; writing one more deletes the oldest. */\n  var MAX_RUNS_PER_AREA = 5;\n\n  /** How many failures the telemetry event carries. */\n  var TELEMETRY_FAILURES = 5;\n\n  /**\n   * How often a page stamps `updatedAt` on a run it is still writing.\n   * Every stage write stamps it too.\n   */\n  var HEARTBEAT_MS = 15000;\n\n  /**\n   * How long a running entry's heartbeat may be silent before a reader\n   * calls it stopped. Generous against the heartbeat: a hidden tab's timers\n   * are throttled to about once a minute, and another tab (or an iPad\n   * Split View window) still running its download must not read as\n   * stopped from this one.\n   */\n  var STALE_AFTER_MS = 120000;\n\n  /** The stage names, in the order a run reaches them. */\n  var STAGES = Object.freeze([\n    'plan',\n    'documents',\n    'content-plan',\n    'warm',\n    'base-layer',\n    'verify',\n    'record',\n  ]);\n\n  /**\n   * @typedef {Object} RunFailure\n   * @property {string} stage\n   * @property {string} path\n   * @property {number|null} status\n   * @property {string} kind\n   * @property {string} detail\n   */\n\n  /**\n   * @typedef {Object} RunStage\n   * @property {string} stage\n   * @property {string} startedAt\n   * @property {string|null} endedAt\n   * @property {number} planned\n   * @property {number} ok\n   * @property {number} failed\n   * @property {string|null} reason\n   * @property {RunFailure[]} failures\n   */\n\n  /**\n   * @typedef {Object} RunEntry\n   * @property {number} [id]\n   * @property {string} areaId\n   * @property {string} kind\n   * @property {string} name\n   * @property {string} startedAt\n   * @property {string|null} endedAt\n   * @property {string} [updatedAt] The writing page's last heartbeat.\n   * @property {string} outcome\n   * @property {RunStage[]} stages\n   * @property {RunFailure[]} failures\n   * @property {boolean} [reported]\n   */\n\n  /**\n   * A URL reduced to its path: the query string and fragment dropped, and\n   * the origin with them.\n   *\n   * @param {*} url\n   * @returns {string}\n   */\n  function pathOf(url) {\n    var raw = String(url == null ? '' : url);\n    if (!raw) return '';\n    try {\n      return new URL(raw, 'https://snowdesk.invalid').pathname;\n    } catch (_err) {\n      return raw.split('#')[0].split('?')[0];\n    }\n  }\n\n  /**\n   * What an exception says about the request that threw it, in the\n   * worker's own vocabulary (`why`).\n   *\n   * @param {*} err\n   * @returns {string} 'network' for a fetch that could not reach anyone,\n   *   'timeout' for one cut off, 'quota' for a full device, else 'other'.\n   */\n  function whyOf(err) {\n    var name = err && typeof err === 'object' ? String(err.name || '') : '';\n    if (name === 'TypeError') return 'network';\n    if (name === 'AbortError' || name === 'TimeoutError') return 'timeout';\n    if (name === 'QuotaExceededError') return 'quota';\n    return 'other';\n  }\n\n  /**\n   * The kind of one failure.\n   *\n   * @param {{status?: (number|null), why?: string, detail?: string}} failure\n   * @returns {'connection'|'server'|'not-found'|'storage'|'other'}\n   */\n  function failureKind(failure) {\n    var f = failure || {};\n    var why = String(f.why || '');\n    var detail = String(f.detail || '');\n    var status = typeof f.status === 'number' ? f.status : null;\n    if (why === 'quota') return 'storage';\n    if (why === 'network' || why === 'timeout' || detail === 'timeout') return 'connection';\n    if (status !== null && status > 0) {\n      if (status >= 500 || status === 429) return 'server';\n      if (status === 403 || status === 404 || status === 410) return 'not-found';\n      return 'other';\n    }\n    // No response at all, from a fetch that was made: the worker reports\n    // that as `status: null` with the `status` branch.\n    if (status === null && why === 'other' && detail === 'status') return 'connection';\n    return 'other';\n  }\n\n  /**\n   * One failure, as a run stores it.\n   *\n   * @param {string} stage\n   * @param {{url?: string, path?: string, status?: (number|null), why?: string,\n   *   detail?: string}} raw The worker's `{url, status, why, detail}`, or a\n   *   page-side report of the same shape.\n   * @returns {RunFailure}\n   */\n  function toFailure(stage, raw) {\n    var r = raw || {};\n    var status = typeof r.status === 'number' ? r.status : null;\n    return {\n      stage: stage,\n      path: pathOf(r.url != null ? r.url : r.path),\n      status: status,\n      kind: failureKind(r),\n      detail: String(r.detail || r.why || ''),\n    };\n  }\n\n  /**\n   * A new run.\n   *\n   * @param {string} areaId\n   * @param {string} kind\n   * @param {string} now ISO timestamp.\n   * @param {string} [name]\n   * @returns {RunEntry}\n   */\n  function newEntry(areaId, kind, now, name) {\n    return {\n      areaId: String(areaId || ''),\n      kind: String(kind || 'region'),\n      name: String(name || ''),\n      startedAt: now,\n      endedAt: null,\n      outcome: 'running',\n      stages: [],\n      failures: [],\n    };\n  }\n\n  /**\n   * The open stage of that name, opened now if there is none.\n   *\n   * @param {RunEntry} entry\n   * @param {string} name\n   * @param {string} now\n   * @returns {RunStage}\n   */\n  function openStage(entry, name, now) {\n    for (var i = entry.stages.length - 1; i >= 0; i -= 1) {\n      var stage = entry.stages[i];\n      if (stage.stage === name && stage.endedAt === null) return stage;\n    }\n    /** @type {RunStage} */\n    var fresh = {\n      stage: name,\n      startedAt: now,\n      endedAt: null,\n      planned: 0,\n      ok: 0,\n      failed: 0,\n      reason: null,\n      failures: [],\n    };\n    entry.stages.push(fresh);\n    return fresh;\n  }\n\n  /**\n   * Record one failed request against a stage, and against the run.\n   *\n   * @param {RunEntry} entry\n   * @param {string} stageName\n   * @param {Object} raw `{url, status, why, detail}`.\n   * @param {string} now\n   * @returns {RunEntry}\n   */\n  function addFailure(entry, stageName, raw, now) {\n    var stage = openStage(entry, stageName, now);\n    var failure = toFailure(stageName, raw);\n    stage.failures.push(failure);\n    entry.failures.push(failure);\n    return entry;\n  }\n\n  /**\n   * End a stage with what it planned and how it went. A stage never\n   * opened is opened and ended at once. `failures` are the stage's own\n   * failed requests \u2014 the worker's whole list for `warm` \u2014 added to any\n   * the stage already holds.\n   *\n   * @param {RunEntry} entry\n   * @param {string} stageName\n   * @param {{planned?: number, ok?: number, failed?: number,\n   *   reason?: (string|null), failures?: Array<Object>|null}} fields\n   * @param {string} now\n   * @returns {RunEntry}\n   */\n  function closeStage(entry, stageName, fields, now) {\n    var f = fields || {};\n    var stage = openStage(entry, stageName, now);\n    (Array.isArray(f.failures) ? f.failures : []).forEach(function (raw) {\n      var failure = toFailure(stageName, raw);\n      stage.failures.push(failure);\n      entry.failures.push(failure);\n    });\n    stage.planned = Number(f.planned) || 0;\n    stage.ok = Number(f.ok) || 0;\n    stage.failed = Number.isFinite(f.failed) ? Number(f.failed) : stage.failures.length;\n    stage.reason = f.reason ? String(f.reason) : null;\n    stage.endedAt = now;\n    return entry;\n  }\n\n  /**\n   * End the run.\n   *\n   * @param {RunEntry} entry\n   * @param {string} outcome 'ok' | 'failed' | 'cancelled'.\n   * @param {string} now\n   * @returns {RunEntry}\n   */\n  function endEntry(entry, outcome, now) {\n    entry.stages.forEach(function (stage) {\n      if (stage.endedAt === null) stage.endedAt = now;\n    });\n    // The caller's verdict, as the roundel shows it: a run whose content\n    // plan lost a request can still be a download that worked. One whose\n    // record could not be written did not: the area reads as unfinished.\n    var recordFailed = entry.stages.some(function (stage) {\n      return stage.stage === 'record' && !!stage.reason;\n    });\n    entry.outcome = outcome === 'ok' && recordFailed ? 'failed' : String(outcome || 'failed');\n    entry.endedAt = now;\n    return entry;\n  }\n\n  /**\n   * A run that stopped before it began to fetch: the stage it reached,\n   * ended with `reason`, and the run failed.\n   *\n   * @param {RunEntry} entry\n   * @param {string} stageName\n   * @param {string} reason 'no-sources' | 'blob-failed' | 'quota' |\n   *   'no-basemap' | 'no-worker' | 'budget' | a caller's own.\n   * @param {string} now\n   * @param {string} [detail] What the error said.\n   * @returns {RunEntry}\n   */\n  function exitEntry(entry, stageName, reason, now, detail) {\n    var stage = openStage(entry, stageName, now);\n    closeStage(\n      entry,\n      stageName,\n      {\n        planned: stage.planned,\n        ok: stage.ok,\n        failed: stage.failures.length,\n        reason: detail ? reason + ': ' + detail : reason,\n      },\n      now,\n    );\n    return endEntry(entry, 'failed', now);\n  }\n\n  /**\n   * The stage a run failed at: the first with a reason or a failure.\n   *\n   * @param {RunEntry} entry\n   * @returns {RunStage|null}\n   */\n  function failedStage(entry) {\n    var stages = entry && Array.isArray(entry.stages) ? entry.stages : [];\n    for (var i = 0; i < stages.length; i += 1) {\n      if (stages[i].reason || stages[i].failed > 0 || stages[i].failures.length > 0) {\n        return stages[i];\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Whether a running entry's writer has gone quiet: its last heartbeat\n   * (`updatedAt`, or `startedAt` for an entry that never had one) is more\n   * than `STALE_AFTER_MS` before `nowIso`.\n   *\n   * @param {RunEntry} entry\n   * @param {string} nowIso The reader's clock, as an ISO timestamp.\n   * @param {number} [staleAfterMs]\n   * @returns {boolean}\n   */\n  function isStale(entry, nowIso, staleAfterMs) {\n    var limit = Number.isFinite(staleAfterMs) ? Number(staleAfterMs) : STALE_AFTER_MS;\n    var beat = Date.parse(String(entry.updatedAt || entry.startedAt || ''));\n    var at = Date.parse(String(nowIso || ''));\n    if (!Number.isFinite(beat) || !Number.isFinite(at)) return false;\n    return at - beat > limit;\n  }\n\n  /**\n   * An entry as a reader sees it: one still `running` whose heartbeat has\n   * gone quiet reads as `stopped` \u2014 its page closed, or the device\n   * suspended it, mid-download. One whose heartbeat is fresh is being\n   * written now, by this page or another tab, and reads as running.\n   *\n   * @param {RunEntry} entry\n   * @param {string} nowIso The reader's clock, as an ISO timestamp.\n   * @returns {RunEntry}\n   */\n  function readEntry(entry, nowIso) {\n    if (!entry || entry.outcome !== 'running') return entry;\n    if (!isStale(entry, nowIso)) return entry;\n    return Object.assign({}, entry, { outcome: 'stopped' });\n  }\n\n  /**\n   * The ids to delete so each area keeps its newest `keep` runs. Newest is\n   * the highest id, which is the order they were written.\n   *\n   * @param {RunEntry[]} entries One area's entries.\n   * @param {number} [keep]\n   * @returns {number[]}\n   */\n  function trimIds(entries, keep) {\n    var limit = Number.isFinite(keep) ? Number(keep) : MAX_RUNS_PER_AREA;\n    var ids = (entries || [])\n      .map(function (entry) {\n        return Number(entry && entry.id);\n      })\n      .filter(function (id) {\n        return Number.isFinite(id);\n      })\n      .sort(function (a, b) {\n        return b - a;\n      });\n    return ids.slice(limit);\n  }\n\n  /**\n   * Every area's runs, newest first.\n   *\n   * @param {RunEntry[]} entries\n   * @returns {Record<string, RunEntry[]>}\n   */\n  function runsByArea(entries) {\n    /** @type {Record<string, RunEntry[]>} */\n    var out = {};\n    (entries || []).forEach(function (entry) {\n      if (!entry || !entry.areaId) return;\n      (out[entry.areaId] = out[entry.areaId] || []).push(entry);\n    });\n    Object.keys(out).forEach(function (areaId) {\n      out[areaId].sort(function (a, b) {\n        return (Number(b.id) || 0) - (Number(a.id) || 0);\n      });\n    });\n    return out;\n  }\n\n  /**\n   * A reason as the server accepts it: a lowercase slug of at most 40\n   * characters (`DOWNLOAD_REASON_RE` in apps/analytics/schema.py).\n   *\n   * @param {*} reason\n   * @returns {string}\n   */\n  function telemetryReason(reason) {\n    return String(reason || '')\n      .toLowerCase()\n      .replace(/[^a-z0-9-]+/g, '-')\n      .slice(0, 40);\n  }\n\n  /**\n   * A failed request's path as the server accepts it: starting with `/`,\n   * with no query or fragment, and at most 300 characters\n   * (`DOWNLOAD_PATH_MAX`). A batch the server refuses is dropped whole, so\n   * the event must never carry one it would refuse.\n   *\n   * @param {*} path\n   * @returns {string}\n   */\n  function telemetryPath(path) {\n    var clean = pathOf(path).replace(/[?#]/g, '');\n    if (clean.charAt(0) !== '/') clean = '/' + clean;\n    return clean.slice(0, 300);\n  }\n\n  /**\n   * The telemetry event's properties for a failed or stopped run: the run\n   * kind, the stage and reason it failed with, the counts, and up to five\n   * failures as `{path, status, kind}` \u2014 paths only.\n   *\n   * @param {RunEntry} entry\n   * @returns {Record<string, any>}\n   */\n  function telemetryProperties(entry) {\n    var stage = failedStage(entry);\n    var totals = { planned: 0, ok: 0, failed: 0 };\n    entry.stages.forEach(function (s) {\n      totals.planned += s.planned;\n      totals.ok += s.ok;\n      totals.failed += s.failed;\n    });\n    var first = entry.failures[0];\n    return {\n      run_kind: entry.kind,\n      outcome: entry.outcome,\n      stage: stage ? stage.stage : entry.stages.length ? entry.stages[entry.stages.length - 1].stage : '',\n      reason: telemetryReason(stage && stage.reason ? String(stage.reason).split(':')[0] : entry.outcome),\n      kind: first ? first.kind : entry.outcome === 'stopped' ? 'stopped' : '',\n      planned: totals.planned,\n      ok: totals.ok,\n      failed: totals.failed,\n      failures: entry.failures.slice(0, TELEMETRY_FAILURES).map(function (f) {\n        return { path: telemetryPath(f.path), status: f.status, kind: f.kind };\n      }),\n    };\n  }\n\n  self.pwaDownloadRunLogCore = Object.freeze({\n    MAX_RUNS_PER_AREA: MAX_RUNS_PER_AREA,\n    TELEMETRY_FAILURES: TELEMETRY_FAILURES,\n    HEARTBEAT_MS: HEARTBEAT_MS,\n    STALE_AFTER_MS: STALE_AFTER_MS,\n    isStale: isStale,\n    STAGES: STAGES,\n    pathOf: pathOf,\n    whyOf: whyOf,\n    failureKind: failureKind,\n    toFailure: toFailure,\n    newEntry: newEntry,\n    openStage: openStage,\n    addFailure: addFailure,\n    closeStage: closeStage,\n    endEntry: endEntry,\n    exitEntry: exitEntry,\n    failedStage: failedStage,\n    readEntry: readEntry,\n    trimIds: trimIds,\n    runsByArea: runsByArea,\n    telemetryProperties: telemetryProperties,\n  });\n})();\n"],
  "mappings": "CA6CC,UAAY,CACX,aAGA,IAAIA,EAAoB,EAGpBC,EAAqB,EAMrBC,EAAe,KASfC,EAAiB,KAGjBC,EAAS,OAAO,OAAO,CACzB,OACA,YACA,eACA,OACA,aACA,SACA,QACF,CAAC,EA6CD,SAASC,EAAOC,EAAK,CACnB,IAAIC,EAAM,OAAOD,GAAc,EAAQ,EACvC,GAAI,CAACC,EAAK,MAAO,GACjB,GAAI,CACF,OAAO,IAAI,IAAIA,EAAK,0BAA0B,EAAE,QAClD,MAAe,CACb,OAAOA,EAAI,MAAM,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,CACvC,CACF,CAUA,SAASC,EAAMC,EAAK,CAClB,IAAIC,EAAOD,GAAO,OAAOA,GAAQ,SAAW,OAAOA,EAAI,MAAQ,EAAE,EAAI,GACrE,OAAIC,IAAS,YAAoB,UAC7BA,IAAS,cAAgBA,IAAS,eAAuB,UACzDA,IAAS,qBAA6B,QACnC,OACT,CAQA,SAASC,EAAYC,EAAS,CAC5B,IAAIC,EAAID,GAAW,CAAC,EAChBE,EAAM,OAAOD,EAAE,KAAO,EAAE,EACxBE,EAAS,OAAOF,EAAE,QAAU,EAAE,EAC9BG,EAAS,OAAOH,EAAE,QAAW,SAAWA,EAAE,OAAS,KACvD,OAAIC,IAAQ,QAAgB,UACxBA,IAAQ,WAAaA,IAAQ,WAAaC,IAAW,UAAkB,aACvEC,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,OAAO,OAAS,CAAC,EAAE,MAAQ,GACjG,OAAQ8B,EAAgBrC,GAASA,EAAM,OAAS,OAAOA,EAAM,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,EAAIO,EAAM,OAAO,EAClG,KAAMqC,EAAQA,EAAM,KAAOrC,EAAM,UAAY,UAAY,UAAY,GACrE,QAASmC,EAAO,QAChB,GAAIA,EAAO,GACX,OAAQA,EAAO,OACf,SAAUnC,EAAM,SAAS,MAAM,EAAGxB,CAAkB,EAAE,IAAI,SAAUY,EAAG,CACrE,MAAO,CAAE,KAAM2C,EAAc3C,EAAE,IAAI,EAAG,OAAQA,EAAE,OAAQ,KAAMA,EAAE,IAAK,CACvE,CAAC,CACH,CACF,CAEA,KAAK,sBAAwB,OAAO,OAAO,CACzC,kBAAmBb,EACnB,mBAAoBC,EACpB,aAAcC,EACd,eAAgBC,EAChB,QAASoC,EACT,OAAQnC,EACR,OAAQC,EACR,MAAOG,EACP,YAAaG,EACb,UAAWM,EACX,SAAUG,EACV,UAAWI,EACX,WAAYI,EACZ,WAAYE,EACZ,SAAUE,EACV,UAAWG,EACX,YAAaE,EACb,UAAWQ,EACX,QAASC,EACT,WAAYO,EACZ,oBAAqBM,CACvB,CAAC,CACH,GAAG",
  "names": ["MAX_RUNS_PER_AREA", "TELEMETRY_FAILURES", "HEARTBEAT_MS", "STALE_AFTER_MS", "STAGES", "pathOf", "url", "raw", "whyOf", "err", "name", "failureKind", "failure", "f", "why", "detail", "status", "toFailure", "stage", "r", "newEntry", "areaId", "kind", "now", "openStage", "entry", "i", "fresh", "addFailure", "stageName", "closeStage", "fields", "endEntry", "outcome", "recordFailed", "exitEntry", "reason", "failedStage", "stages", "isStale", "nowIso", "staleAfterMs", "limit", "beat", "at", "readEntry", "trimIds", "entries", "keep", "ids", "id", "a", "b", "runsByArea", "out", "telemetryReason", "telemetryPath", "path", "clean", "telemetryProperties", "totals", "s", "first"]
}
