UNPKG

ws-dottie

Version:

Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration

1 lines 92.8 kB
{"version":3,"sources":["../src/shared/utils/configManager.ts","../src/shared/utils/index.ts","../node_modules/jsonrepair/src/utils/JSONRepairError.ts","../node_modules/jsonrepair/src/utils/stringUtils.ts","../node_modules/jsonrepair/src/regular/jsonrepair.ts","../node_modules/jsonrepair/src/index.ts","../src/shared/utils/jsonParser.ts","../src/shared/utils/logger.ts","../src/shared/fetching/internal/buildUrl.ts","../src/shared/fetching/internal/handleError.ts","../src/shared/fetching/internal/handleFetch.ts","../src/shared/fetching/internal/fetchCore.ts","../src/shared/fetching/fetchDottie.ts","../src/shared/fetching/index.ts"],"names":["DEFAULT_BASE_URL","runtimeConfig","getApiKey","getDomain","setApiKey","setBaseUrl","configManager","init_configManager","__esmMin","apiKey","domain","init_utils","init_dateUtils","JSONRepairError","init_JSONRepairError","Error","constructor","message","position","isHex","char","test","isDigit","isValidStringCharacter","isDelimiter","includes","isFunctionNameCharStart","isFunctionNameChar","isUnquotedStringDelimiter","isStartOfValue","isQuote","regexStartOfValue","isControlCharacter","isWhitespace","text","index","code","charCodeAt","codeSpace","codeNewline","codeTab","codeReturn","isWhitespaceExceptNewline","isSpecialWhitespace","codeNonBreakingSpace","codeEnQuad","codeHairSpace","codeNarrowNoBreakSpace","codeMediumMathematicalSpace","codeIdeographicSpace","isDoubleQuoteLike","isSingleQuoteLike","isDoubleQuote","isSingleQuote","stripLastOccurrence","textToStrip","stripRemainingText","arguments","length","undefined","lastIndexOf","substring","insertBeforeLastWhitespace","textToInsert","removeAtIndex","start","count","endsWithCommaOrNewline","regexUrlStart","regexUrlChar","init_stringUtils","jsonrepair","i","output","parseMarkdownCodeBlock","parseValue","throwUnexpectedEnd","processedComma","parseCharacter","parseWhitespaceAndSkipComments","parseNewlineDelimitedJSON","throwUnexpectedCharacter","processed","parseObject","parseArray","parseString","parseNumber","parseKeywords","parseUnquotedString","parseRegex","skipNewline","changed","parseWhitespace","parseComment","_isWhiteSpace","whitespace","atEndOfBlockComment","blocks","skipMarkdownCodeBlock","block","end","slice","skipCharacter","skipEscapeCharacter","skipEllipsis","initial","throwObjectKeyExpected","processedColon","truncatedText","throwColonExpected","processedValue","stopAtDelimiter","stopAtIndex","skipEscapeChars","isEndQuote","iBefore","oBefore","str","iPrev","prevNonWhitespaceIndex","charAt","iQuote","oQuote","parseConcatenatedString","iPrevChar","prevChar","escapeCharacters","j","throwInvalidUnicodeCharacter","controlCharacters","throwInvalidCharacter","atEndOfNumber","repairNumberEndingWithNumericSymbol","num","hasInvalidLeadingZero","parseKeyword","name","value","isKey","symbol","JSON","stringify","prev","chars","init_jsonrepair","b","f","n","r","t","init_esm","parseJsonWithFallback","init_jsonParser","input","jsonError","result","JSON5","repaired","parsed","logApiCall","logApiResults","init_logger","endpoint","params","endpointName","paramsStr","pc","jsonData","startTime","responseSize","duration","objectCount","durationSec","sizeKb","results","buildCompleteUrl","splitUrlIntoParts","replacePathTemplates","buildQueryString","injectApiKey","getServiceType","formatParamValue","init_buildUrl","urlTemplate","pathOnly","templateParams","paramRecord","path","query","processedPath","queryString","baseUrl","remainingPathParams","url","pathTemplate","key","formattedValue","existingQuery","processedQuery","remainingTemplateParams","templateParam","paramName","searchParams","serviceType","keyParam","createApiError","isApiError","extractErrorInfo","init_handleError","error","status","zodError","z","statusMatch","handleFetchNative","handleFetchJsonp","init_handleFetch","response","resolve","reject","script","callbackName","cleanupDone","cleanup","data","fetchCore","init_fetchCore","logMode","strategy","completeUrl","responseData","fetchDottie","init_fetchDottie","fetchMode","validate","rawData","convertDotNetDates","init_fetching"],"mappings":"wJAAA,IAUMA,EAAAA,CAgBAC,CAAAA,CAaOC,EAAAA,CAYAC,EAAAA,CAYAC,EAAAA,CAYAC,EAAAA,CAUAC,CAAAA,CArFbC,CAAAA,CAAAC,CAAAA,CAAA,IAAA,CAUMR,EAAAA,CAAmB,0BAAA,CAgBnBC,CAAAA,CAAgB,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AEFA,CAAAA,CAAS,YAAY,KAAA,CAAMC,CAAM,EACnC,CAGA,IAAMwE,EAAU,MAAMV,EAAAA,CAAU/D,CAAAA,CAAUC,CAAAA,CAAQgE,CAAAA,CAASM,CAAS,EAGpE,GAAIC,CAAAA,CAAU,CACZ,GAAI,CAACxE,EAAS,YAAA,CACZ,MAAM,IAAI,KAAA,CACR,uIAEF,EAIF,OAAOA,CAAAA,CAAS,aAAa,KAAA,CAAMyE,CAAO,CAC5C,CAAA,KAEE,OAAOC,CAAAA,CAAmBD,CAAO,CAErC,CAAA,MAAS1B,EAAO,CAEd,MACEA,GACA,OAAOA,CAAAA,EAAU,UACjB,MAAA,GAAUA,CAAAA,EACVA,CAAAA,CAAM,IAAA,GAAS,UAAA,CAETA,CAAAA,CAEFJ,EAAeI,CAAAA,CAAO/C,CAAAA,CAAS,QAAQ,CAC/C,CACF,KC5FA,IAAA2E,EAAAA,CAAArO,CAAAA,CAAA,IAAA,CAaAgO,EAAAA,EAAAA,CAEAxB,CAAAA,GAAAA,CAAAA","file":"chunk-2FPG2HTT.mjs","sourcesContent":["/**\n * @fileoverview Configuration Management for WS-Dottie\n *\n * This module provides configuration management for WS-Dottie API operations,\n * including API key and domain configuration with runtime modification\n * capability. It supports environment variable configuration and runtime\n * updates for different deployment scenarios.\n */\n\n/** Default base URL for WSDOT/WSF API requests */\nconst DEFAULT_BASE_URL = \"https://www.wsdot.wa.gov\";\n\n/**\n * Configuration interface for WS-Dottie\n *\n * Defines the structure for WS-Dottie configuration including API key\n * and domain settings.\n */\nexport interface WsdotConfig {\n  /** WSDOT API access token for authentication */\n  apiKey: string;\n  /** Base domain for API requests */\n  domain: string;\n}\n\n/** Runtime configuration state */\nconst runtimeConfig = {\n  apiKey: process.env.WSDOT_ACCESS_TOKEN || \"\",\n  domain: process.env.WSDOT_BASE_URL || DEFAULT_BASE_URL,\n};\n\n/**\n * Gets the current WSDOT API access token\n *\n * This function returns the currently configured API access token,\n * which is used for authenticating requests to WSDOT/WSF APIs.\n *\n * @returns The current API key string\n */\nexport const getApiKey = (): string => {\n  return runtimeConfig.apiKey;\n};\n\n/**\n * Gets the current WSDOT base URL\n *\n * This function returns the currently configured base URL for\n * WSDOT/WSF API requests.\n *\n * @returns The current base URL string\n */\nexport const getDomain = (): string => {\n  return runtimeConfig.domain;\n};\n\n/**\n * Sets the WSDOT API access token\n *\n * This function allows runtime modification of the API access token,\n * useful for different environments or when tokens need to be updated.\n *\n * @param apiKey - The new API key string to set\n */\nexport const setApiKey = (apiKey: string): void => {\n  runtimeConfig.apiKey = apiKey;\n};\n\n/**\n * Sets WSDOT base URL\n *\n * This function allows runtime modification of the base URL,\n * useful for different environments or API endpoints.\n *\n * @param domain - The new domain string to set\n */\nexport const setBaseUrl = (domain: string): void => {\n  runtimeConfig.domain = domain;\n};\n\n/**\n * Configuration manager object\n *\n * This object provides a convenient interface for accessing and\n * modifying WS-Dottie configuration settings.\n */\nexport const configManager = {\n  getApiKey,\n  getDomain,\n  setApiKey,\n  setBaseUrl,\n};\n","/**\n * @fileoverview General utilities for WS-Dottie\n *\n * This module provides general-purpose utilities including configuration\n * management, logging functionality, and date utilities. These utilities\n * are used throughout the WS-Dottie library for common operations.\n *\n * Note: parseJsonWithFallback, logApiCall, logApiResults, and logger are\n * internal-only and not exported. Import them directly from their modules\n * if needed.\n */\n\n// Configuration management\nexport { configManager } from \"./configManager\";\n// Date utilities (consolidated)\nexport {\n  datesHelper,\n  jsDateToYyyyMmDd,\n} from \"./dateUtils\";\n","export class JSONRepairError extends Error {\n  position: number\n\n  constructor(message: string, position: number) {\n    super(`${message} at position ${position}`)\n\n    this.position = position\n  }\n}\n","const codeSpace = 0x20 // \" \"\nconst codeNewline = 0xa // \"\\n\"\nconst codeTab = 0x9 // \"\\t\"\nconst codeReturn = 0xd // \"\\r\"\nconst codeNonBreakingSpace = 0xa0\nconst codeEnQuad = 0x2000\nconst codeHairSpace = 0x200a\nconst codeNarrowNoBreakSpace = 0x202f\nconst codeMediumMathematicalSpace = 0x205f\nconst codeIdeographicSpace = 0x3000\n\nexport function isHex(char: string): boolean {\n  return /^[0-9A-Fa-f]$/.test(char)\n}\n\nexport function isDigit(char: string): boolean {\n  return char >= '0' && char <= '9'\n}\n\nexport function isValidStringCharacter(char: string): boolean {\n  // note that the valid range is between \\u{0020} and \\u{10ffff},\n  // but in JavaScript it is not possible to create a code point larger than\n  // \\u{10ffff}, so there is no need to test for that here.\n  return char >= '\\u0020'\n}\n\nexport function isDelimiter(char: string): boolean {\n  return ',:[]/{}()\\n+'.includes(char)\n}\n\nexport function isFunctionNameCharStart(char: string) {\n  return (\n    (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z') || char === '_' || char === '$'\n  )\n}\n\nexport function isFunctionNameChar(char: string) {\n  return (\n    (char >= 'a' && char <= 'z') ||\n    (char >= 'A' && char <= 'Z') ||\n    char === '_' ||\n    char === '$' ||\n    (char >= '0' && char <= '9')\n  )\n}\n\n// matches \"https://\" and other schemas\nexport const regexUrlStart = /^(http|https|ftp|mailto|file|data|irc):\\/\\/$/\n\n// matches all valid URL characters EXCEPT \"[\", \"]\", and \",\", since that are important JSON delimiters\nexport const regexUrlChar = /^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/\n\nexport function isUnquotedStringDelimiter(char: string): boolean {\n  return ',[]/{}\\n+'.includes(char)\n}\n\nexport function isStartOfValue(char: string): boolean {\n  return isQuote(char) || regexStartOfValue.test(char)\n}\n\n// alpha, number, minus, or opening bracket or brace\nconst regexStartOfValue = /^[[{\\w-]$/\n\nexport function isControlCharacter(char: string) {\n  return char === '\\n' || char === '\\r' || char === '\\t' || char === '\\b' || char === '\\f'\n}\n\nexport interface Text {\n  charCodeAt: (index: number) => number\n}\n\n/**\n * Check if the given character is a whitespace character like space, tab, or\n * newline\n */\nexport function isWhitespace(text: Text, index: number): boolean {\n  const code = text.charCodeAt(index)\n\n  return code === codeSpace || code === codeNewline || code === codeTab || code === codeReturn\n}\n\n/**\n * Check if the given character is a whitespace character like space or tab,\n * but NOT a newline\n */\nexport function isWhitespaceExceptNewline(text: Text, index: number): boolean {\n  const code = text.charCodeAt(index)\n\n  return code === codeSpace || code === codeTab || code === codeReturn\n}\n\n/**\n * Check if the given character is a special whitespace character, some\n * unicode variant\n */\nexport function isSpecialWhitespace(text: Text, index: number): boolean {\n  const code = text.charCodeAt(index)\n\n  return (\n    code === codeNonBreakingSpace ||\n    (code >= codeEnQuad && code <= codeHairSpace) ||\n    code === codeNarrowNoBreakSpace ||\n    code === codeMediumMathematicalSpace ||\n    code === codeIdeographicSpace\n  )\n}\n\n/**\n * Test whether the given character is a quote or double quote character.\n * Also tests for special variants of quotes.\n */\nexport function isQuote(char: string): boolean {\n  // the first check double quotes, since that occurs most often\n  return isDoubleQuoteLike(char) || isSingleQuoteLike(char)\n}\n\n/**\n * Test whether the given character is a double quote character.\n * Also tests for special variants of double quotes.\n */\nexport function isDoubleQuoteLike(char: string): boolean {\n  return char === '\"' || char === '\\u201c' || char === '\\u201d'\n}\n\n/**\n * Test whether the given character is a double quote character.\n * Does NOT test for special variants of double quotes.\n */\nexport function isDoubleQuote(char: string): boolean {\n  return char === '\"'\n}\n\n/**\n * Test whether the given character is a single quote character.\n * Also tests for special variants of single quotes.\n */\nexport function isSingleQuoteLike(char: string): boolean {\n  return (\n    char === \"'\" || char === '\\u2018' || char === '\\u2019' || char === '\\u0060' || char === '\\u00b4'\n  )\n}\n\n/**\n * Test whether the given character is a single quote character.\n * Does NOT test for special variants of single quotes.\n */\nexport function isSingleQuote(char: string): boolean {\n  return char === \"'\"\n}\n\n/**\n * Strip last occurrence of textToStrip from text\n */\nexport function stripLastOccurrence(\n  text: string,\n  textToStrip: string,\n  stripRemainingText = false\n): string {\n  const index = text.lastIndexOf(textToStrip)\n  return index !== -1\n    ? text.substring(0, index) + (stripRemainingText ? '' : text.substring(index + 1))\n    : text\n}\n\nexport function insertBeforeLastWhitespace(text: string, textToInsert: string): string {\n  let index = text.length\n\n  if (!isWhitespace(text, index - 1)) {\n    // no trailing whitespaces\n    return text + textToInsert\n  }\n\n  while (isWhitespace(text, index - 1)) {\n    index--\n  }\n\n  return text.substring(0, index) + textToInsert + text.substring(index)\n}\n\nexport function removeAtIndex(text: string, start: number, count: number) {\n  return text.substring(0, start) + text.substring(start + count)\n}\n\n/**\n * Test whether a string ends with a newline or comma character and optional whitespace\n */\nexport function endsWithCommaOrNewline(text: string): boolean {\n  return /[,\\n][ \\t\\r]*$/.test(text)\n}\n","import { JSONRepairError } from '../utils/JSONRepairError.js'\nimport {\n  endsWithCommaOrNewline,\n  insertBeforeLastWhitespace,\n  isControlCharacter,\n  isDelimiter,\n  isDigit,\n  isDoubleQuote,\n  isDoubleQuoteLike,\n  isFunctionNameChar,\n  isFunctionNameCharStart,\n  isHex,\n  isQuote,\n  isSingleQuote,\n  isSingleQuoteLike,\n  isSpecialWhitespace,\n  isStartOfValue,\n  isUnquotedStringDelimiter,\n  isValidStringCharacter,\n  isWhitespace,\n  isWhitespaceExceptNewline,\n  regexUrlChar,\n  regexUrlStart,\n  removeAtIndex,\n  stripLastOccurrence\n} from '../utils/stringUtils.js'\n\nconst controlCharacters: { [key: string]: string } = {\n  '\\b': '\\\\b',\n  '\\f': '\\\\f',\n  '\\n': '\\\\n',\n  '\\r': '\\\\r',\n  '\\t': '\\\\t'\n}\n\n// map with all escape characters\nconst escapeCharacters: { [key: string]: string } = {\n  '\"': '\"',\n  '\\\\': '\\\\',\n  '/': '/',\n  b: '\\b',\n  f: '\\f',\n  n: '\\n',\n  r: '\\r',\n  t: '\\t'\n  // note that \\u is handled separately in parseString()\n}\n\n/**\n * Repair a string containing an invalid JSON document.\n * For example changes JavaScript notation into JSON notation.\n *\n * Example:\n *\n *     try {\n *       const json = \"{name: 'John'}\"\n *       const repaired = jsonrepair(json)\n *       console.log(repaired)\n *       // '{\"name\": \"John\"}'\n *     } catch (err) {\n *       console.error(err)\n *     }\n *\n */\nexport function jsonrepair(text: string): string {\n  let i = 0 // current index in text\n  let output = '' // generated output\n\n  parseMarkdownCodeBlock(['```', '[```', '{```'])\n\n  const processed = parseValue()\n  if (!processed) {\n    throwUnexpectedEnd()\n  }\n\n  parseMarkdownCodeBlock(['```', '```]', '```}'])\n\n  const processedComma = parseCharacter(',')\n  if (processedComma) {\n    parseWhitespaceAndSkipComments()\n  }\n\n  if (isStartOfValue(text[i]) && endsWithCommaOrNewline(output)) {\n    // start of a new value after end of the root level object: looks like\n    // newline delimited JSON -> turn into a root level array\n    if (!processedComma) {\n      // repair missing comma\n      output = insertBeforeLastWhitespace(output, ',')\n    }\n\n    parseNewlineDelimitedJSON()\n  } else if (processedComma) {\n    // repair: remove trailing comma\n    output = stripLastOccurrence(output, ',')\n  }\n\n  // repair redundant end quotes\n  while (text[i] === '}' || text[i] === ']') {\n    i++\n    parseWhitespaceAndSkipComments()\n  }\n\n  if (i >= text.length) {\n    // reached the end of the document properly\n    return output\n  }\n\n  throwUnexpectedCharacter()\n\n  function parseValue(): boolean {\n    parseWhitespaceAndSkipComments()\n    const processed =\n      parseObject() ||\n      parseArray() ||\n      parseString() ||\n      parseNumber() ||\n      parseKeywords() ||\n      parseUnquotedString(false) ||\n      parseRegex()\n    parseWhitespaceAndSkipComments()\n\n    return processed\n  }\n\n  function parseWhitespaceAndSkipComments(skipNewline = true): boolean {\n    const start = i\n\n    let changed = parseWhitespace(skipNewline)\n    do {\n      changed = parseComment()\n      if (changed) {\n        changed = parseWhitespace(skipNewline)\n      }\n    } while (changed)\n\n    return i > start\n  }\n\n  function parseWhitespace(skipNewline: boolean): boolean {\n    const _isWhiteSpace = skipNewline ? isWhitespace : isWhitespaceExceptNewline\n    let whitespace = ''\n\n    while (true) {\n      if (_isWhiteSpace(text, i)) {\n        whitespace += text[i]\n        i++\n      } else if (isSpecialWhitespace(text, i)) {\n        // repair special whitespace\n        whitespace += ' '\n        i++\n      } else {\n        break\n      }\n    }\n\n    if (whitespace.length > 0) {\n      output += whitespace\n      return true\n    }\n\n    return false\n  }\n\n  function parseComment(): boolean {\n    // find a block comment '/* ... */'\n    if (text[i] === '/' && text[i + 1] === '*') {\n      // repair block comment by skipping it\n      while (i < text.length && !atEndOfBlockComment(text, i)) {\n        i++\n      }\n      i += 2\n\n      return true\n    }\n\n    // find a line comment '// ...'\n    if (text[i] === '/' && text[i + 1] === '/') {\n      // repair line comment by skipping it\n      while (i < text.length && text[i] !== '\\n') {\n        i++\n      }\n\n      return true\n    }\n\n    return false\n  }\n\n  function parseMarkdownCodeBlock(blocks: string[]): boolean {\n    // find and skip over a Markdown fenced code block:\n    //     ``` ... ```\n    // or\n    //     ```json ... ```\n    if (skipMarkdownCodeBlock(blocks)) {\n      if (isFunctionNameCharStart(text[i])) {\n        // strip the optional language specifier like \"json\"\n        while (i < text.length && isFunctionNameChar(text[i])) {\n          i++\n        }\n      }\n\n      parseWhitespaceAndSkipComments()\n\n      return true\n    }\n\n    return false\n  }\n\n  function skipMarkdownCodeBlock(blocks: string[]): boolean {\n    parseWhitespace(true)\n\n    for (const block of blocks) {\n      const end = i + block.length\n      if (text.slice(i, end) === block) {\n        i = end\n        return true\n      }\n    }\n\n    return false\n  }\n\n  function parseCharacter(char: string): boolean {\n    if (text[i] === char) {\n      output += text[i]\n      i++\n      return true\n    }\n\n    return false\n  }\n\n  function skipCharacter(char: string): boolean {\n    if (text[i] === char) {\n      i++\n      return true\n    }\n\n    return false\n  }\n\n  function skipEscapeCharacter(): boolean {\n    return skipCharacter('\\\\')\n  }\n\n  /**\n   * Skip ellipsis like \"[1,2,3,...]\" or \"[1,2,3,...,9]\" or \"[...,7,8,9]\"\n   * or a similar construct in objects.\n   */\n  function skipEllipsis(): boolean {\n    parseWhitespaceAndSkipComments()\n\n    if (text[i] === '.' && text[i + 1] === '.' && text[i + 2] === '.') {\n      // repair: remove the ellipsis (three dots) and optionally a comma\n      i += 3\n      parseWhitespaceAndSkipComments()\n      skipCharacter(',')\n\n      return true\n    }\n\n    return false\n  }\n\n  /**\n   * Parse an object like '{\"key\": \"value\"}'\n   */\n  function parseObject(): boolean {\n    if (text[i] === '{') {\n      output += '{'\n      i++\n      parseWhitespaceAndSkipComments()\n\n      // repair: skip leading comma like in {, message: \"hi\"}\n      if (skipCharacter(',')) {\n        parseWhitespaceAndSkipComments()\n      }\n\n      let initial = true\n      while (i < text.length && text[i] !== '}') {\n        let processedComma: boolean\n        if (!initial) {\n          processedComma = parseCharacter(',')\n          if (!processedComma) {\n            // repair missing comma\n            output = insertBeforeLastWhitespace(output, ',')\n          }\n          parseWhitespaceAndSkipComments()\n        } else {\n          processedComma = true\n          initial = false\n        }\n\n        skipEllipsis()\n\n        const processedKey = parseString() || parseUnquotedString(true)\n        if (!processedKey) {\n          if (\n            text[i] === '}' ||\n            text[i] === '{' ||\n            text[i] === ']' ||\n            text[i] === '[' ||\n            text[i] === undefined\n          ) {\n            // repair trailing comma\n            output = stripLastOccurrence(output, ',')\n          } else {\n            throwObjectKeyExpected()\n          }\n          break\n        }\n\n        parseWhitespaceAndSkipComments()\n        const processedColon = parseCharacter(':')\n        const truncatedText = i >= text.length\n        if (!processedColon) {\n          if (isStartOfValue(text[i]) || truncatedText) {\n            // repair missing colon\n            output = insertBeforeLastWhitespace(output, ':')\n          } else {\n            throwColonExpected()\n          }\n        }\n        const processedValue = parseValue()\n        if (!processedValue) {\n          if (processedColon || truncatedText) {\n            // repair missing object value\n            output += 'null'\n          } else {\n            throwColonExpected()\n          }\n        }\n      }\n\n      if (text[i] === '}') {\n        output += '}'\n        i++\n      } else {\n        // repair missing end bracket\n        output = insertBeforeLastWhitespace(output, '}')\n      }\n\n      return true\n    }\n\n    return false\n  }\n\n  /**\n   * Parse an array like '[\"item1\", \"item2\", ...]'\n   */\n  function parseArray(): boolean {\n    if (text[i] === '[') {\n      output += '['\n      i++\n      parseWhitespaceAndSkipComments()\n\n      // repair: skip leading comma like in [,1,2,3]\n      if (skipCharacter(',')) {\n        parseWhitespaceAndSkipComments()\n      }\n\n      let initial = true\n      while (i < text.length && text[i] !== ']') {\n        if (!initial) {\n          const processedComma = parseCharacter(',')\n          if (!processedComma) {\n            // repair missing comma\n            output = insertBeforeLastWhitespace(output, ',')\n          }\n        } else {\n          initial = false\n        }\n\n        skipEllipsis()\n\n        const processedValue = parseValue()\n        if (!processedValue) {\n          // repair trailing comma\n          output = stripLastOccurrence(output, ',')\n          break\n        }\n      }\n\n      if (text[i] === ']') {\n        output += ']'\n        i++\n      } else {\n        // repair missing closing array bracket\n        output = insertBeforeLastWhitespace(output, ']')\n      }\n\n      return true\n    }\n\n    return false\n  }\n\n  /**\n   * Parse and repair Newline Delimited JSON (NDJSON):\n   * multiple JSON objects separated by a newline character\n   */\n  function parseNewlineDelimitedJSON() {\n    // repair NDJSON\n    let initial = true\n    let processedValue = true\n    while (processedValue) {\n      if (!initial) {\n        // parse optional comma, insert when missing\n        const processedComma = parseCharacter(',')\n        if (!processedComma) {\n          // repair: add missing comma\n          output = insertBeforeLastWhitespace(output, ',')\n        }\n      } else {\n        initial = false\n      }\n\n      processedValue = parseValue()\n    }\n\n    if (!processedValue) {\n      // repair: remove trailing comma\n      output = stripLastOccurrence(output, ',')\n    }\n\n    // repair: wrap the output inside array brackets\n    output = `[\\n${output}\\n]`\n  }\n\n  /**\n   * Parse a string enclosed by double quotes \"...\". Can contain escaped quotes\n   * Repair strings enclosed in single quotes or special quotes\n   * Repair an escaped string\n   *\n   * The function can run in two stages:\n   * - First, it assumes the string has a valid end quote\n   * - If it turns out that the string does not have a valid end quote followed\n   *   by a delimiter (which should be the case), the function runs again in a\n   *   more conservative way, stopping the string at the first next delimiter\n   *   and fixing the string by inserting a quote there, or stopping at a\n   *   stop index detected in the first iteration.\n   */\n  function parseString(stopAtDelimiter = false, stopAtIndex = -1): boolean {\n    let skipEscapeChars = text[i] === '\\\\'\n    if (skipEscapeChars) {\n      // repair: remove the first escape character\n      i++\n      skipEscapeChars = true\n    }\n\n    if (isQuote(text[i])) {\n      // double quotes are correct JSON,\n      // single quotes come from JavaScript for example, we assume it will have a correct single end quote too\n      // otherwise, we will match any double-quote-like start with a double-quote-like end,\n      // or any single-quote-like start with a single-quote-like end\n      const isEndQuote = isDoubleQuote(text[i])\n        ? isDoubleQuote\n        : isSingleQuote(text[i])\n          ? isSingleQuote\n          : isSingleQuoteLike(text[i])\n            ? isSingleQuoteLike\n            : isDoubleQuoteLike\n\n      const iBefore = i\n      const oBefore = output.length\n\n      let str = '\"'\n      i++\n\n      while (true) {\n        if (i >= text.length) {\n          // end of text, we are missing an end quote\n\n          const iPrev = prevNonWhitespaceIndex(i - 1)\n          if (!stopAtDelimiter && isDelimiter(text.charAt(iPrev))) {\n            // if the text ends with a delimiter, like [\"hello],\n            // so the missing end quote should be inserted before this delimiter\n            // retry parsing the string, stopping at the first next delimiter\n            i = iBefore\n            output = output.substring(0, oBefore)\n\n            return parseString(true)\n          }\n\n          // repair missing quote\n          str = insertBeforeLastWhitespace(str, '\"')\n          output += str\n\n          return true\n        }\n\n        if (i === stopAtIndex) {\n          // use the stop index detected in the first iteration, and repair end quote\n          str = insertBeforeLastWhitespace(str, '\"')\n          output += str\n\n          return true\n        }\n\n        if (isEndQuote(text[i])) {\n          // end quote\n          // let us check what is before and after the quote to verify whether this is a legit end quote\n          const iQuote = i\n          const oQuote = str.length\n          str += '\"'\n          i++\n          output += str\n\n          parseWhitespaceAndSkipComments(false)\n\n          if (\n            stopAtDelimiter ||\n            i >= text.length ||\n            isDelimiter(text[i]) ||\n            isQuote(text[i]) ||\n            isDigit(text[i])\n          ) {\n            // The quote is followed by the end of the text, a delimiter,\n            // or a next value. So the quote is indeed the end of the string.\n            parseConcatenatedString()\n\n            return true\n          }\n\n          const iPrevChar = prevNonWhitespaceIndex(iQuote - 1)\n          const prevChar = text.charAt(iPrevChar)\n\n          if (prevChar === ',') {\n            // A comma followed by a quote, like '{\"a\":\"b,c,\"d\":\"e\"}'.\n            // We assume that the quote is a start quote, and that the end quote\n            // should have been located right before the comma but is missing.\n            i = iBefore\n            output = output.substring(0, oBefore)\n\n            return parseString(false, iPrevChar)\n          }\n\n          if (isDelimiter(prevChar)) {\n            // This is not the right end quote: it is preceded by a delimiter,\n            // and NOT followed by a delimiter. So, there is an end quote missing\n            // parse the string again and then stop at the first next delimiter\n            i = iBefore\n            output = output.substring(0, oBefore)\n\n            return parseString(true)\n          }\n\n          // revert to right after the quote but before any whitespace, and continue parsing the string\n          output = output.substring(0, oBefore)\n          i = iQuote + 1\n\n          // repair unescaped quote\n          str = `${str.substring(0, oQuote)}\\\\${str.substring(oQuote)}`\n        } else if (stopAtDelimiter && isUnquotedStringDelimiter(text[i])) {\n          // we're in the mode to stop the string at the first delimiter\n          // because there is an end quote missing\n\n          // test start of an url like \"https://...\" (this would be parsed as a comment)\n          if (text[i - 1] === ':' && regexUrlStart.test(text.substring(iBefore + 1, i + 2))) {\n            while (i < text.length && regexUrlChar.test(text[i])) {\n              str += text[i]\n              i++\n            }\n          }\n\n          // repair missing quote\n          str = insertBeforeLastWhitespace(str, '\"')\n          output += str\n\n          parseConcatenatedString()\n\n          return true\n        } else if (text[i] === '\\\\') {\n          // handle escaped content like \\n or \\u2605\n          const char = text.charAt(i + 1)\n          const escapeChar = escapeCharacters[char]\n          if (escapeChar !== undefined) {\n            str += text.slice(i, i + 2)\n            i += 2\n          } else if (char === 'u') {\n            let j = 2\n            while (j < 6 && isHex(text[i + j])) {\n              j++\n            }\n\n            if (j === 6) {\n              str += text.slice(i, i + 6)\n              i += 6\n            } else if (i + j >= text.length) {\n              // repair invalid or truncated unicode char at the end of the text\n              // by removing the unicode char and ending the string here\n              i = text.length\n            } else {\n              throwInvalidUnicodeCharacter()\n            }\n          } else {\n            // repair invalid escape character: remove it\n            str += char\n            i += 2\n          }\n        } else {\n          // handle regular characters\n          const char = text.charAt(i)\n\n          if (char === '\"' && text[i - 1] !== '\\\\') {\n            // repair unescaped double quote\n            str += `\\\\${char}`\n            i++\n          } else if (isControlCharacter(char)) {\n            // unescaped control character\n            str += controlCharacters[char]\n            i++\n          } else {\n            if (!isValidStringCharacter(char)) {\n              throwInvalidCharacter(char)\n            }\n            str += char\n            i++\n          }\n        }\n\n        if (skipEscapeChars) {\n          // repair: skipped escape character (nothing to do)\n          skipEscapeCharacter()\n        }\n      }\n    }\n\n    return false\n  }\n\n  /**\n   * Repair concatenated strings like \"hello\" + \"world\", change this into \"helloworld\"\n   */\n  function parseConcatenatedString(): boolean {\n    let processed = false\n\n    parseWhitespaceAndSkipComments()\n    while (text[i] === '+') {\n      processed = true\n      i++\n      parseWhitespaceAndSkipComments()\n\n      // repair: remove the end quote of the first string\n      output = stripLastOccurrence(output, '\"', true)\n      const start = output.length\n      const parsedStr = parseString()\n      if (parsedStr) {\n        // repair: remove the start quote of the second string\n        output = removeAtIndex(output, start, 1)\n      } else {\n        // repair: remove the + because it is not followed by a string\n        output = insertBeforeLastWhitespace(output, '\"')\n      }\n    }\n\n    return processed\n  }\n\n  /**\n   * Parse a number like 2.4 or 2.4e6\n   */\n  function parseNumber(): boolean {\n    const start = i\n    if (text[i] === '-') {\n      i++\n      if (atEndOfNumber()) {\n        repairNumberEndingWithNumericSymbol(start)\n        return true\n      }\n      if (!isDigit(text[i])) {\n        i = start\n        return false\n      }\n    }\n\n    // Note that in JSON leading zeros like \"00789\" are not allowed.\n    // We will allow all leading zeros here though and at the end of parseNumber\n    // check against trailing zeros and repair that if needed.\n    // Leading zeros can have meaning, so we should not clear them.\n    while (isDigit(text[i])) {\n      i++\n    }\n\n    if (text[i] === '.') {\n      i++\n      if (atEndOfNumber()) {\n        repairNumberEndingWithNumericSymbol(start)\n        return true\n      }\n      if (!isDigit(text[i])) {\n        i = start\n        return false\n      }\n      while (isDigit(text[i])) {\n        i++\n      }\n    }\n\n    if (text[i] === 'e' || text[i] === 'E') {\n      i++\n      if (text[i] === '-' || text[i] === '+') {\n        i++\n      }\n      if (atEndOfNumber()) {\n        repairNumberEndingWithNumericSymbol(start)\n        return true\n      }\n      if (!isDigit(text[i])) {\n        i = start\n        return false\n      }\n      while (isDigit(text[i])) {\n        i++\n      }\n    }\n\n    // if we're not at the end of the number by this point, allow this to be parsed as another type\n    if (!atEndOfNumber()) {\n      i = start\n      return false\n    }\n\n    if (i > start) {\n      // repair a number with leading zeros like \"00789\"\n      const num = text.slice(start, i)\n      const hasInvalidLeadingZero = /^0\\d/.test(num)\n\n      output += hasInvalidLeadingZero ? `\"${num}\"` : num\n      return true\n    }\n\n    return false\n  }\n\n  /**\n   * Parse keywords true, false, null\n   * Repair Python keywords True, False, None\n   */\n  function parseKeywords(): boolean {\n    return (\n      parseKeyword('true', 'true') ||\n      parseKeyword('false', 'false') ||\n      parseKeyword('null', 'null') ||\n      // repair Python keywords True, False, None\n      parseKeyword('True', 'true') ||\n      parseKeyword('False', 'false') ||\n      parseKeyword('None', 'null')\n    )\n  }\n\n  function parseKeyword(name: string, value: string): boolean {\n    if (text.slice(i, i + name.length) === name) {\n      output += value\n      i += name.length\n      return true\n    }\n\n    return false\n  }\n\n  /**\n   * Repair an unquoted string by adding quotes around it\n   * Repair a MongoDB function call like NumberLong(\"2\")\n   * Repair a JSONP function call like callback({...});\n   */\n  function parseUnquotedString(isKey: boolean) {\n    // note that the symbol can end with whitespaces: we stop at the next delimiter\n    // also, note that we allow strings to contain a slash / in order to support repairing regular expressions\n    const start = i\n\n    if (isFunctionNameCharStart(text[i])) {\n      while (i < text.length && isFunctionNameChar(text[i])) {\n        i++\n      }\n\n      let j = i\n      while (isWhitespace(text, j)) {\n        j++\n      }\n\n      if (text[j] === '(') {\n        // repair a MongoDB function call like NumberLong(\"2\")\n        // repair a JSONP function call like callback({...});\n        i = j + 1\n\n        parseValue()\n\n        if (text[i] === ')') {\n          // repair: skip close bracket of function call\n          i++\n          if (text[i] === ';') {\n            // repair: skip semicolon after JSONP call\n            i++\n          }\n        }\n\n        return true\n      }\n    }\n\n    while (\n      i < text.length &&\n      !isUnquotedStringDelimiter(text[i]) &&\n      !isQuote(text[i]) &&\n      (!isKey || text[i] !== ':')\n    ) {\n      i++\n    }\n\n    // test start of an url like \"https://...\" (this would be parsed as a comment)\n    if (text[i - 1] === ':' && regexUrlStart.test(text.substring(start, i + 2))) {\n      while (i < text.length && regexUrlChar.test(text[i])) {\n        i++\n      }\n    }\n\n    if (i > start) {\n      // repair unquoted string\n      // also, repair undefined into null\n\n      // first, go back to prevent getting trailing whitespaces in the string\n      while (isWhitespace(text, i - 1) && i > 0) {\n        i--\n      }\n\n      const symbol = text.slice(start, i)\n      output += symbol === 'undefined' ? 'null' : JSON.stringify(symbol)\n\n      if (text[i] === '\"') {\n        // we had a missing start quote, but now we encountered the end quote, so we can skip that one\n        i++\n      }\n\n      return true\n    }\n  }\n\n  function parseRegex() {\n    if (text[i] === '/') {\n      const start = i\n      i++\n\n      while (i < text.length && (text[i] !== '/' || text[i - 1] === '\\\\')) {\n        i++\n      }\n      i++\n\n      output += `\"${text.substring(start, i)}\"`\n\n      return true\n    }\n  }\n\n  function prevNonWhitespaceIndex(start: number): number {\n    let prev = start\n\n    while (prev > 0 && isWhitespace(text, prev)) {\n      prev--\n    }\n\n    return prev\n  }\n\n  function atEndOfNumber() {\n    return i >= text.length || isDelimiter(text[i]) || isWhitespace(text, i)\n  }\n\n  function repairNumberEndingWithNumericSymbol(start: number) {\n    // repair numbers cut off at the end\n    // this will only be called when we end after a '.', '-', or 'e' and does not\n    // change the number more than it needs to make it valid JSON\n    output += `${text.slice(start, i)}0`\n  }\n\n  function throwInvalidCharacter(char: string) {\n    throw new JSONRepairError(`Invalid character ${JSON.stringify(char)}`, i)\n  }\n\n  function throwUnexpectedCharacter() {\n    throw new JSONRepairError(`Unexpected character ${JSON.stringify(text[i])}`, i)\n  }\n\n  function throwUnexpectedEnd() {\n    throw new JSONRepairError('Unexpected end of json string', text.length)\n  }\n\n  function throwObjectKeyExpected() {\n    throw new JSONRepairError('Object key expected', i)\n  }\n\n  function throwColonExpected() {\n    throw new JSONRepairError('Colon expected', i)\n  }\n\n  function throwInvalidUnicodeCharacter() {\n    const chars = text.slice(i, i + 6)\n    throw new JSONRepairError(`Invalid unicode character \"${chars}\"`, i)\n  }\n}\n\nfunction atEndOfBlockComment(text: string, i: number) {\n  return text[i] === '*' && text[i + 1] === '/'\n}\n","// Cross-platform, non-streaming JavaScript API\nexport { jsonrepair } from './regular/jsonrepair.js'\nexport { JSONRepairError } from './utils/JSONRepairError.js'\n","/**\n * @fileoverview Robust JSON Parsing with Fallback Mechanisms\n *\n * This module provides a robust JSON parsing utility that attempts multiple\n * parsing strategies to handle various JSON formats and potential issues\n * from WSDOT API responses. It includes fallback mechanisms for standard JSON,\n * JSON5-compatible syntax, and severely malformed JSON.\n */\n\nimport JSON5 from \"json5\";\nimport { jsonrepair } from \"jsonrepair\";\n\n/**\n * Robust JSON parsing with fallback mechanisms\n *\n * This function attempts to parse JSON input using multiple strategies:\n * 1. Try standard JSON.parse (fastest for valid JSON)\n * 2. Try json5.parse (handles JSON5 syntax like comments, trailing commas)\n * 3. Try jsonrepair + JSON.parse (handles malformed JSON with unescaped quotes)\n *\n * @param input - The JSON string to parse\n * @returns The parsed JavaScript value or object\n * @throws The original JSON.parse error if all parsing attempts fail\n */\nexport const parseJsonWithFallback = (input: string): unknown => {\n  try {\n    return JSON.parse(input);\n  } catch (jsonError) {\n    try {\n      const result = JSON5.parse(input);\n      // Check if JSON5 parsed it as a string literal (which happens with invalid JSON)\n      if (typeof result === \"string\" && result === input) {\n        throw jsonError; // Throw the original error\n      }\n      return result;\n    } catch (json5Error) {\n      try {\n        const repaired = jsonrepair(input);\n        const parsed = JSON.parse(repaired);\n        // Check if jsonrepair just wrapped the input in quotes (making it a string)\n        if (typeof parsed === \"string\" && parsed === input) {\n          throw jsonError; // Throw the original error\n        }\n        return parsed;\n      } catch (repairError) {\n        // Throw the original JSON.parse error for consistency\n        throw jsonError;\n      }\n    }\n  }\n};\n","/**\n * @fileoverview Simplified Logging Utility for WS-Dottie\n *\n * This module provides a simplified logging interface for WS-Dottie with\n * environment-aware debug logging and specialized API call logging.\n * Focused on essential functionality used by the core library.\n */\n\nimport pc from \"picocolors\";\n\n// ============================================================================\n// SIMPLIFIED LOGGING IMPLEMENTATION\n// ============================================================================\n\n/**\n * Simple logging utility for WS-Dottie\n *\n * Provides basic logging functions with environment-aware debug logging.\n * Debug logging is automatically disabled in production environments.\n */\nexport const logger = {\n  /** Debug logging (disabled in production) */\n  debug: (message: string): void => {\n    if (process.env.NODE_ENV === \"development\") {\n      console.debug(`[WS-Dottie] ${message}`);\n    }\n  },\n\n  /** General information logging */\n  info: (message: string): void => {\n    console.info(`[WS-Dottie] ${message}`);\n  },\n\n  /** Warning message logging */\n  warn: (message: string): void => {\n    console.warn(`[WS-Dottie] ${message}`);\n  },\n\n  /** Error message logging */\n  error: (message: string): void => {\n    console.error(`[WS-Dottie] ${message}`);\n  },\n};\n\n/**\n * Logs API call information in a single line format\n *\n * Simplified API call logging for the core fetching functionality.\n * Used only by fetchCore.ts for basic API operation monitoring.\n *\n * @param endpoint - The full API endpoint path (will extract endpoint name internally)\n * @param params - Parameters being sent to the endpoint\n */\nexport const logApiCall = (endpoint: string, params?: unknown): void => {\n  const endpointName = endpoint.split(\"/\").pop() || endpoint;\n  const paramsStr = params ? JSON.stringify(params) : \"none\";\n  const message = pc.blue(\n    `Calling ${endpointName} with parameters ${paramsStr}...`\n  );\n  console.log(message);\n};\n\n/**\n * Logs API call results with performance metrics\n *\n * Simplified API result logging for the core fetching functionality.\n * Provides basic performance metrics including duration and response size.\n *\n * @param jsonData - The parsed JSON response data (will calculate object count internally)\n * @param startTime - The timestamp when the request started (will calculate duration internally)\n * @param responseSize - Response size in bytes\n */\nexport const logApiResults = (\n  jsonData: unknown,\n  startTime: number,\n  responseSize: number\n): void => {\n  const duration = Date.now() - startTime;\n  const objectCount = Array.isArray(jsonData) ? jsonData.length : 1;\n  const durationSec = (duration / 1000).toFixed(1);\n  const sizeKb = (responseSize / 1024).toFixed(1);\n  const results = pc.green(\n    ` Retrieved ${objectCount} objects in ${durationSec} sec (${sizeKb} kb).`\n  );\n  console.log(results);\n};\n","/**\n * @fileoverview URL Builder for WS-Dottie API Requests\n *\n * This module processes complete URL templates for WS-Dottie API requests,\n * including parameter encoding, template parameter replacement, and API key injection.\n * The complete URLs are pre-constructed from API definitions before being passed to this module.\n *\n * Key features:\n * - Template parameter replacement (e.g., {terminalId} -> actual value)\n * - Automatic date conversion to .NET format for WSDOT APIs\n * - API key injection with correct parameter names per service\n * - URL cleanup to remove empty parameters\n * - Support for both WSDOT (/traffic/) and WSF (/ferries/) endpoints\n */\n\nimport { configManager } from \"@/shared/utils/configManager\";\n\n/**\n * Builds a complete API URL with template parameter replacement and API key injection\n *\n * This function processes a complete URL template by splitting it into path and query parts,\n * replacing placeholders like {id} in the path with provided values, adding remaining\n * parameters as query parameters, and injecting the appropriate API key based on the service type.\n *\n * @param urlTemplate - The complete API URL template with optional placeholders (e.g., \"https://example.com/api/endpoint/{paramId}\")\n * @param params - Optional parameters for template replacement and query string construction\n * @returns Complete URL string ready for API requests\n * @example\n * ```typescript\n * buildCompleteUrl(\"https://www.wsdot.wa.gov/ferries/api/schedule/rest/schedule/{tripDate}/{routeId}\", {\n *   tripDate: \"2024-01-01\",\n *   routeId: 1,\n * });\n * // Returns: \"https://www.wsdot.wa.gov/ferries/api/schedule/rest/schedule/2024-01-01/1?apiaccesscode=YOUR_API_KEY\"\n * ```\n */\nexport const buildCompleteUrl = <TInput = never>(\n  urlTemplate: string,\n  params?: TInput\n): string => {\n  if (!params) {\n    // Check if the URL template has unfilled parameters in the PATH portion only (not query string)\n    const [pathOnly] = urlTemplate.split(\"?\");\n    const templateParams = pathOnly.match(/\\{[^}]+\\}/g);\n    if (templateParams && templateParams.length > 0) {\n      throw new Error(\n        `Missing required URL parameters: ${templateParams.join(\", \")} in URL template: ${urlTemplate}`\n      );\n    }\n    return urlTemplate;\n  }\n\n  const paramRecord = params as Record<string, unknown>;\n  const { path, query } = splitUrlIntoParts(urlTemplate);\n\n  // Process path template replacement\n  const processedPath = replacePathTemplates(path, paramRecord);\n\n  // Build query string\n  const queryString = buildQueryString(query, paramRecord);\n\n  // Combine path and query\n  const baseUrl = queryString\n    ? `${processedPath}?${queryString}`\n    : processedPath;\n\n  // Check for any remaining unfilled template parameters in the PATH portion only (not query string)\n  const [pathOnly] = baseUrl.split(\"?\");\n  const remainingPathParams = pathOnly.match(/\\{[^}]+\\}/g);\n  if (remainingPathParams && remainingPathParams.length > 0) {\n    throw new Error(\n      `Missing required URL parameters: ${remainingPathParams.join(\", \")} in URL: ${baseUrl}`\n    );\n  }\n\n  // Inject API key\n  const url = new URL(baseUrl);\n  injectApiKey(url);\n\n  return url.toString();\n};\n\n/**\n * Split URL template into base path and query string parts\n * @param urlTemplate - Complete URL template\n * @returns Object with path and query parts\n */\nconst splitUrlIntoParts = (\n  urlTemplate: string\n): { path: string; query: string } => {\n  const [path, query = \"\"] = urlTemplate.split(\"?\");\n  return { path, query };\n};\n\n/**\n * Replace template parameters in the path portion of URL\n * @param pathTemplate - Path template with {param} placeholders\n * @param params - Parameters to substitute\n * @returns Path with parameters replaced\n */\nconst replacePathTemplates = (\n  pathTemplate: string,\n  params: Record<string, unknown>\n): string => {\n  let result = pathTemplate;\n  for (const [key, value] of Object.entries(params)) {\n    const formattedValue = formatParamValue(value);\n    result = result.replace(`{${key}}`, formattedValue);\n  }\n  return result;\n};\n\n/**\n * Build query string from parameters\n * @param existingQuery - Existing query string from template\n * @param params - Parameters to add as query params\n * @returns Complete query string\n */\nconst buildQueryString = (\n  existingQuery: string,\n  params: Record<string, unknown>\n): string => {\n  // First replace template placeholders in the existing query string\n  let processedQuery = existingQuery;\n  for (const [key, value] of Object.entries(params)) {\n    if (value !== undefined && value !== null) {\n      const formattedValue = formatParamValue(value);\n      processedQuery = processedQuery.replace(\n        new RegExp(`\\\\{${key}\\\\}`, \"g\"),\n        formattedValue\n      );\n    }\n  }\n\n  // For query parameters, remove any remaining unfilled template parameters (for optional parameters)\n  const remainingTemplateParams = processedQuery.match(/\\{[^}]+\\}/g);\n  if (remainingTemplateParams && remainingTemplateParams.length > 0) {\n    // Remove template placeholders and their associated key-value pairs if the value is missing\n    for (const templateParam of remainingTemplateParams) {\n      const paramName = templateParam.slice(1, -1); // Extract parameter name from {paramName}\n\n      // Remove the entire parameter assignment (paramName={paramName}& or &paramName={paramName} or ?paramName={paramName})\n      processedQuery = processedQuery.replace(\n        new RegExp(`[&?]${paramName}=${templateParam}`, \"g\"),\n        \"\"\n      );\n      processedQuery = processedQuery.replace(\n        new RegExp(`${templateParam}=[^&]*&?`, \"g\"),\n        \"\"\n      );\n      processedQuery = processedQuery.replace(\n        new RegExp(`&${templateParam}=[^&]*`, \"g\"),\n        \"\"\n      );\n    }\n\n    // Clean up any remaining template placeholders\n    processedQuery = processedQuery.replace(/\\{[^}]+\\}/g, \"\");\n\n    // Clean up any double ampersands or trailing characters\n    processedQuery = processedQuery.replace(/&&/g, \"&\");\n    processedQuery = processedQuery.replace(/[&?]$/, \"\");\n    processedQuery = processedQuery.replace(/\\?&/, \"?\");\n  }\n\n  const searchParams = new URLSearchParams(processedQuery);\n\n  // Add new parameters that aren't already in the template\n  for (const [key, value] of Object.entries(params)) {\n    if (value !== undefined && value !== null && !searchParams.has(key)) {\n      searchParams.set(key, formatParamValue(value));\n    }\n  }\n\n  return searchParams.toString();\n};\n\n/**\n * Inject appropriate API key based on service type\n * @param url - URL object to modify\n */\nconst injectApiKey = (url: URL): void => {\n  const serviceType = getServiceType(url.toString());\n  const apiKey = configManager.getApiKey();\n  const keyParam = serviceType === \"wsdot\" ? \"AccessCode\" : \"apiaccesscode\";\n  url.searchParams.set(keyParam, apiKey);\n};\n\n/**\n * Determines the service type based on URL path patterns\n *\n * @param url - The URL string to analyze\n * @returns The detected service type\n */\nconst getServiceType = (url: string): \"wsdot\" | \"wsf\" | \"unknown\" =>\n  url.toLowerCase().includes(\"/traffic/\") ? \"wsdot\" : \"wsf\";\n\n/**\n * Format parameter value for API (handles dates, encoding, etc.)\n * @param value - Value to format\n * @returns Formatted parameter value\n */\nconst formatParamValue = (value: unknown): string =>\n  value instanceof Date ? value.toISOString() : String(value);\n","/**\n * @fileoverview Simplified Error Handling for WS-Dottie\n *\n * This module provides streamlined error handling for WS-Dottie API operations,\n * focusing on preserving actual error information while providing useful context.\n * It includes a simple ApiError class that passes through real error messages\n * while adding relevant context for debugging and logging.\n */\n\nimport type { ZodError } from \"zod\";\nimport { z } from \"zod\";\n\n/**\n * Context information for error reporting\n *\n * Contains additional context about errors that occurred during\n * API operations, useful for debugging and error reporting.\n */\nexport interface ErrorContext {\n  /** The URL that was being accessed when the error occurred */\n  url?: string;\n  /** HTTP status code if available */\n  status?: number;\n  /** The API endpoint that was being called */\n  endpoint?: string;\n  /** Timestamp when the error occurred */\n  timestamp: Date;\n}\n\n/**\n * API error type for strongly-typed error handling\n *\n * A POJO (Plain Old JavaScript Object) that represents API errors with\n * context information. This approach is more functional and aligns with\n * modern TypeScript patterns while preserving the original error messages\n * for better debugging.\n */\nexport interface ApiError {\n  /** Error name for type identification */\n  readonly name: \"ApiError\";\n  /** Human-readable error message (preserves original error) */\n  readonly message: string;\n  /** HTTP status code if available */\n  readonly status?: number;\n  /** Additional context information about the error */\n  readonly context: ErrorContext;\n}\n\n/**\n * Creates a standardized API error from various error types\n *\n * This function preserves the original error messages while adding useful\n * context information. It handles Zod validation errors, network errors,\n * and other common error scenarios by passing through the actual error\n * information rather than trying to categorize or rewrite it.\n *\n * @param error - The original error to convert\n * @param endpoint - The API endpoint where the error occurred\n * @returns Standardized ApiError POJO\n */\nexport const createApiError = (error: unknown, endpoint: string): ApiError => {\n  const { message, status } = extractErrorInfo(error);\n\n  return {\n    name: \"ApiError\",\n    message,\n    status,\n    context: {\n      timestamp: new Date(),\n      endpoint,\n      url: endpoint,\n    },\n  };\n};\n\n/**\n * Type guard to check if an error is an ApiError\n *\n * @param error - The error to check\n * @returns True if the error is an ApiError, false otherwise\n */\nexport const isApiError = (error: unknown): error is ApiError => {\n  return (\n    error !== null &&\n    typeof error === \"object\" &&\n    \"name\" in error &&\n    error.name === \"ApiError\"\n  );\n};\n\n/**\n * Extracts message and status code from various error types\n *\n * @param error - The error to analyze\n * @returns Object containing the message and optional status code\n */\nconst extractErrorInfo = (\n  error: unknown\n): { message: string; status?: number } => {\n  if (error instanceof Error && error.name === \"ZodError\") {\n    const zodError = error as ZodError;\n    const prettyError = z.prettifyError(zodError);\n    return { message: `Validation failed:\\n${prettyError}` };\n  }\n\n  if (error instanceof Error) {\n    // Extract HTTP status if available from error message\n    const statusMatch = error.message.match(/HTTP (\\d+)/);\n    const status = statusMatch ? parseInt(statusMatch[1], 10) : undefined;\n    return { message: error.message, status };\n  }\n\n  return { message: \"An unexpected error occurred\" };\n};\n","/**\n * @fileoverview Fetch Handler Implementations\n *\n * This module provides the fetch handler implementations for native fetch\n * and JSONP requests. These are pure handler functions that handle the\n * low-level details of making HTTP requests.\n */\n\nimport type { FetchHandler } from \"@/shared/types\";\n\n/**\n * Callback function type for JSONP responses\n */\ntype JSONPCallback = (data: unknown) => void;\n\n/**\n * Extended Window interface for JSONP support\n */\ntype JSONPWindow = Window & Record<string, JSONPCallback | undefined>;\n\n/**\n * Native fetch handler implementation\n *\n * Uses the standard fetch API available in Node.js and modern browsers.\n * Performs standard HTTP requests and handles response status codes appropriately.\n *\n * @param url - The URL to fetch data from\n * @returns Promise resolving to the response data as a string\n * @throws Error if the response is not ok (status >= 400)\n */\nexport const handleFetchNative: FetchHandler = async (\n  url: string\n): Promise<string> => {\n  const response = await fetch(url);\n\n  if (!response.ok) {\n    throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n  }\n\n  return response.text();\n};\n\n/**\n * JSONP fetch handler implementation\n *\n * Handles CORS restrictions by using JSONP callbacks instead of direct\n * HTTP requests. Creates a script tag with a callback parameter and\n * handles the response through a global callback function.\n *\n * @param url - The URL to fetch data from\n * @returns Promise resolving to the response data as a JSON string\n * @throws Error if the JSONP request fails or times out\n */\nexport const handleFetchJsonp: FetchHandler = async (\n  url: string\n): Promise<string> => {\n  return new Promise((resolve, reject) => {\n    // DOM availability check with optional chaining\n    if (!document?.head) {\n      reject(new Error(\"DOM environment not available\"));\n      return;\n    }\n\n    const script = document.createElement(\"script\");\n    const callbackName = `jsonp_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;\n    let cleanupDone = false;\n\n    // Centralized cleanup function to prevent duplicate operations\n    const cleanup = () => {\n      if (cleanupDone) return;\n      cleanupDone = true;\n\n      try {\n        // Safely remove script from DOM\n        script.parentNode?.removeChild(script);\n      } catch (e) {\n        // Script already removed or modified - ignore\n      }\n\n      // Clean up global callback\n      if ((window as unknown as JSONPWindow)[callbackName]) {\n        delete (window as unknown as JSONPWindow)[callbackName];\n      }\n    };\n\n    // Set up timeout mechanism (30 seconds)\n    const timeoutId = setTimeout(() => {\n      cleanup();\n      reject(new Error(\"JSONP request timed out after 30 seconds\"));\n    }, 30000);\n\n    // Add callback to window\n    (window as unknown as JSONPWindow)[callbackName] = (data: unknown) => {\n      cleanup();\n      resolve(JSON.stringify(data));\n    };\n\n    script.onerror = () => {\n      cleanup();\n      reject(new Error(\"JSONP script failed to load\"));\n    };\n\n    script.src = `${url}${url.includes(\"?\") ? \"&\" : \"?\"}callback=${encodeURIComponent(callbackName)}`;\n    document.head.appendChild(script);\n  });\n};\n","/**\n * @fileoverview Core Fetching Logic\n *\n * This module provides the core fetching orchestration logic that coordinates\n * URL building, transport selection, and logging. It eliminates duplication\n * between the four main fetch functions.\n */\n\nimport type { Endpoint, FetchStrategy, LoggingMode } from \"@/shared/types\";\nimport { parseJsonWithFallback } from \"@/shared/utils/jsonParser\";\nimport { logApiCall, logApiResults } from \"@/shared/utils/logger\";\nimport { buildCompleteUrl } from \"./buildUrl\";\nimport { createApiError } from \"./handleError\";\nimport { handleFetchJsonp, handleFetchNative } from \"./handleFetch\";\n\n/**\n * Core fetch routine that handles URL building, transport selection, and logging\n *\n * This function provides the shared orchestration logic used by all four\n * fetch functions. It handles URL building, request execution, response\n * parsing, and logging.\n *\n * @template TInput - The input parameters type\n * @template TOutput - The output response type\n * @param endpoint - The API endpoint to call\n * @param params - Optional input parameters\n * @param logMode - Logging verbosity level\n * @param strategy - Fetch strategy to use\n * @returns Promise resolving to the response data\n */\nexport const fetchCore = async <TInput = never, TOutput = unknown>(\n  endpoint: Endpoint<TInput, TOutput>,\n  params?: TInput,\n  logMode: LoggingMode = \"none\",\n  strategy: FetchStrategy = \"native\"\n): Promise<unknown> => {\n  const startTime = Date.now();\n\n  // Log the API call if needed\n  if (logMode !== \"none\") {\n    logApiCall(endpoint.endpoint, params);\n  }\n\n  try {\n    // 1. Build complete URL with parameters and API key\n    const completeUrl = buildCompleteUrl(endpoint.urlTemplate, params);\n\n    // Log the fetching URL if needed\n    if (logMode !== \"none\") {\n      console.log(`Fetching: ${completeUrl}`);\n    }\n\n    // 2. Execute request using specified fetch handler\n    const handleFetch =\n      strategy === \"jsonp\" ? handleFetchJsonp : handleFetchNative;\n    const responseData = await handleFetch(completeUrl);\n\n    // 3. Parse response JSON\n    const jsonData = parseJsonWithFallback(responseData);\n\n    // 4. Log results with performance metrics\n    if (logMode !== \"none\") {\n      logApiResults(jsonData, startTime, responseData.length);\n    }\n\n    return jsonData;\n  } catch (error) {\n    throw createApiError(error, endpoint.endpoint);\n  }\n};\n","/**\n * @fileoverview Unified Fetch Tool for WS-Dottie\n *\n * This module provides a single, unified fetch function that combines\n * transport strategy (native vs JSONP) and validation strategy (with/without Zod)\n * into one easy-to-use interface.\n */\n\nimport { convertDotNetDates } from \"@/shared/utils/dateUtils\";\nimport { fetchCore } from \"./internal/fetchCore\";\nimport { createApiError } from \"./internal/handleError\";\nimport type { FetchDottieParams } from \"./types\";\n\n/**\n * Unified fetch function for WS-Dottie APIs\n *\n * This function provides a single entry point for all API calls with clear\n * control over fetch strategy and validation approach. It replaces the four\n * separate fetch functions with a more flexible and maintainable interface.\n *\n * @template TInput - The input parameters type\n * @template TOutput - The output response type\n * @param options - Configuration object with endpoint, params, and options\n * @returns Promise resolving to response data (validated and transformed as configured)\n *\n * @example\n * ```typescript\n * // Fetch without validation\n * const data = await fetchDottie({\n *   endpoint: myEndpoint,\n *   params: { route: \"SEA-BI\" },\n *   fetchMode: \"native\",\n *   logMode: \"info\"\n * });\n *\n * // Fetch with validation\n * const validatedData = await fetchDottie({\n *   endpoint: myEndpoint,\n *   params: { route: \"SEA-BI\" },\n *   validate: true\n * });\n * ```\n */\nexport const fetchDottie = async <TInput = never, TOutput = unknown>({\n  endpoint,\n  params,\n  fetchMode = \"native\",\n  logMode = \"none\",\n  validate = false,\n}: FetchDottieParams<TInput, TOutput>): Promise<TOutput> => {\n  try {\n    // Validate input parameters if validation is enabled\n    if (validate && params) {\n      if (!endpoint.inputSchema) {\n        throw new Error(\n          `Validation requires schemas. This endpoint was built without schemas. ` +\n            `Use the full build or import schemas from the /schemas subpath.`\n        );\n      }\n      endpoint.inputSchema.parse(params);\n    }\n\n    // Get raw data using specified fetch strategy\n    const rawData = await fetchCore(endpoint, params, logMode, fetchMode);\n\n    // Handle validation and transformation based on strategy\n    if (validate) {\n      if (!endpoint.outputSchema) {\n        throw new Error(\n          `Validation requires schemas. This endpoint was built without schemas. ` +\n            `Use the full build or import schemas from the /schemas subpath.`\n        );\n      }\n      // Zod validation handles .NET date conversion internally\n      // Skip convertDotNetDates to prevent double conversion\n      return endpoint.outputSchema.parse(rawData);\n    } else {\n      // No validation - apply .NET date conversion manually and return raw data\n      return convertDotNetDates(rawData) as TOutput;\n    }\n  } catch (error) {\n    // Re-throw ApiErrors as-is, wrap other errors (including ZodErrors) in ApiError\n    if (\n      error &&\n      typeof error === \"object\" &&\n      \"name\" in error &&\n      error.name === \"ApiError\"\n    ) {\n      throw error;\n    }\n    throw createApiError(error, endpoint.endpoint);\n  }\n};\n","/**\n * @fileoverview Data Fetching for WSDOT and WSF APIs\n *\n * This module provides a unified fetch approach with the main `fetchDottie` function\n * that supports both transport strategies (native vs JSONP) and validation approaches (none vs Zod).\n */\n\n// Types\nexport type {\n  FetchStrategy,\n  LoggingMode,\n} from \"@/shared/types\";\n// Main fetch function\nexport { fetchDottie } from \"./fetchDottie\";\n// Error handling\nexport {\n  type ApiError,\n  type ErrorContext,\n  isApiError,\n} from \"./internal/handleError\";\nexport type { FetchDottieParams } from \"./types\";\n"]}