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 189 kB
{"version":3,"sources":["../src/shared/utils/configManager.ts","../node_modules/jsonrepair/src/utils/JSONRepairError.ts","../node_modules/jsonrepair/src/utils/stringUtils.ts","../node_modules/jsonrepair/src/regular/jsonrepair.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/apis/wsdot-border-crossings/borderCrossingData/shared/borderCrossingData.endpoints.ts","../src/apis/wsdot-border-crossings/api.ts","../src/apis/wsdot-bridge-clearances/bridgeClearances/shared/bridgeClearances.endpoints.ts","../src/apis/wsdot-bridge-clearances/api.ts","../src/apis/wsdot-commercial-vehicle-restrictions/cvRestrictionData/shared/cvRestrictionData.endpoints.ts","../src/apis/wsdot-commercial-vehicle-restrictions/cvRestrictionDataWithId/shared/cvRestrictionDataWithId.endpoints.ts","../src/apis/wsdot-commercial-vehicle-restrictions/api.ts","../src/apis/wsdot-highway-alerts/alertAreas/shared/alertAreas.endpoints.ts","../src/apis/wsdot-highway-alerts/eventCategories/shared/eventCategories.endpoints.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/shared/highwayAlerts.endpoints.ts","../src/apis/wsdot-highway-alerts/api.ts","../src/apis/wsdot-highway-cameras/cameras/shared/cameras.endpoints.ts","../src/apis/wsdot-highway-cameras/api.ts","../src/apis/wsdot-mountain-pass-conditions/passConditions/shared/passConditions.endpoints.ts","../src/apis/wsdot-mountain-pass-conditions/api.ts","../src/apis/wsdot-toll-rates/tollRates/shared/tollRates.endpoints.ts","../src/apis/wsdot-toll-rates/tollTripInfo/shared/tollTripInfo.endpoints.ts","../src/apis/wsdot-toll-rates/tollTripRates/shared/tollTripRates.endpoints.ts","../src/apis/wsdot-toll-rates/tollTripVersion/shared/tollTripVersion.endpoints.ts","../src/apis/wsdot-toll-rates/api.ts","../src/apis/wsdot-traffic-flow/flowData/shared/flowData.endpoints.ts","../src/apis/wsdot-traffic-flow/api.ts","../src/apis/wsdot-travel-times/travelTimeRoutes/shared/travelTimeRoutes.endpoints.ts","../src/apis/wsdot-travel-times/api.ts","../src/apis/wsdot-weather-information/weatherInfo/shared/weatherInfo.endpoints.ts","../src/apis/wsdot-weather-information/api.ts","../src/apis/wsdot-weather-readings/subSurfaceMeasurements/shared/subSurfaceMeasurements.endpoints.ts","../src/apis/wsdot-weather-readings/surfaceMeasurements/shared/surfaceMeasurements.endpoints.ts","../src/apis/wsdot-weather-readings/weatherReadings/shared/weatherReadings.endpoints.ts","../src/apis/wsdot-weather-readings/api.ts","../src/apis/wsdot-weather-stations/weatherStations/shared/weatherStations.endpoints.ts","../src/apis/wsdot-weather-stations/api.ts","../src/apis/wsf-fares/fareLineItems/shared/fareLineItems.endpoints.ts","../src/apis/wsf-fares/fareTotals/shared/fareTotals.endpoints.ts","../src/apis/wsf-fares/terminalCombo/shared/terminalCombo.endpoints.ts","../src/apis/wsf-fares/terminals/shared/terminals.endpoints.ts","../src/apis/wsf-fares/validDateRange/shared/validDateRange.endpoints.ts","../src/apis/wsf-fares/api.ts","../src/apis/wsf-schedule/activeSeasons/shared/activeSeasons.endpoints.ts","../src/apis/wsf-schedule/cacheFlushDate/shared/cacheFlushDate.endpoints.ts","../src/apis/wsf-schedule/routeDetails/shared/routeDetails.endpoints.ts","../src/apis/wsf-schedule/routes/shared/routes.endpoints.ts","../src/apis/wsf-schedule/sailings/shared/sailings.endpoints.ts","../src/apis/wsf-schedule/scheduleAlerts/shared/scheduleAlerts.endpoints.ts","../src/apis/wsf-schedule/scheduledRoutes/shared/scheduledRoutes.endpoints.ts","../src/apis/wsf-schedule/schedules/shared/schedules.endpoints.ts","../src/apis/wsf-schedule/scheduleToday/shared/scheduleToday.endpoints.ts","../src/apis/wsf-schedule/serviceDisruptions/shared/serviceDisruptions.endpoints.ts","../src/apis/wsf-schedule/terminalMates/shared/terminalMates.endpoints.ts","../src/apis/wsf-schedule/terminals/shared/terminals.endpoints.ts","../src/apis/wsf-schedule/timeAdjustments/shared/timeAdjustments.endpoints.ts","../src/apis/wsf-schedule/validDateRange/shared/validDateRange.endpoints.ts","../src/apis/wsf-schedule/api.ts","../src/apis/wsf-terminals/cacheFlushDate/shared/cacheFlushDate.endpoints.ts","../src/apis/wsf-terminals/terminalBasics/shared/terminalBasics.endpoints.ts","../src/apis/wsf-terminals/terminalBulletins/shared/terminalBulletins.endpoints.ts","../src/apis/wsf-terminals/terminalLocations/shared/terminalLocations.endpoints.ts","../src/apis/wsf-terminals/terminalSailingSpace/shared/terminalSailingSpace.endpoints.ts","../src/apis/wsf-terminals/terminalTransports/shared/terminalTransports.endpoints.ts","../src/apis/wsf-terminals/terminalVerbose/shared/terminalVerbose.endpoints.ts","../src/apis/wsf-terminals/terminalWaitTimes/shared/terminalWaitTimes.endpoints.ts","../src/apis/wsf-terminals/api.ts","../src/apis/wsf-vessels/cacheFlushDate/shared/cacheFlushDate.endpoints.ts","../src/apis/wsf-vessels/vesselAccommodations/shared/vesselAccommodations.endpoints.ts","../src/apis/wsf-vessels/vesselBasics/shared/vesselBasics.endpoints.ts","../src/apis/wsf-vessels/vesselHistories/shared/vesselHistories.endpoints.ts","../src/apis/wsf-vessels/vesselLocations/shared/vesselLocations.endpoints.ts","../src/apis/wsf-vessels/vesselStats/shared/vesselStats.endpoints.ts","../src/apis/wsf-vessels/vesselVerbose/shared/vesselVerbose.endpoints.ts","../src/apis/wsf-vessels/api.ts","../src/apis/shared/apis.ts","../src/shared/factories/buildDescriptor.ts","../src/shared/factories/createFetchFunction.ts","../src/shared/cache/cacheFlushDate.ts","../src/shared/factories/strategies.ts","../src/shared/factories/createHook.ts"],"names":["DEFAULT_BASE_URL","runtimeConfig","getApiKey","getDomain","setApiKey","apiKey","setBaseUrl","domain","configManager","JSONRepairError","Error","constructor","message","position","isHex","char","test","isDigit","isValidStringCharacter","isDelimiter","includes","isFunctionNameCharStart","isFunctionNameChar","regexUrlStart","regexUrlChar","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","controlCharacters","escapeCharacters","b","f","n","r","t","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","j","throwInvalidUnicodeCharacter","throwInvalidCharacter","atEndOfNumber","repairNumberEndingWithNumericSymbol","num","hasInvalidLeadingZero","parseKeyword","name","value","isKey","symbol","JSON","stringify","prev","chars","parseJsonWithFallback","input","jsonError","result","JSON5","repaired","parsed","logApiCall","endpoint","params","endpointName","paramsStr","pc","logApiResults","jsonData","startTime","responseSize","duration","objectCount","durationSec","sizeKb","results","buildCompleteUrl","urlTemplate","pathOnly","templateParams","paramRecord","path","query","splitUrlIntoParts","processedPath","replacePathTemplates","queryString","buildQueryString","baseUrl","remainingPathParams","url","injectApiKey","pathTemplate","key","formattedValue","formatParamValue","existingQuery","processedQuery","remainingTemplateParams","templateParam","paramName","searchParams","serviceType","getServiceType","keyParam","createApiError","error","status","extractErrorInfo","isApiError","zodError","z","statusMatch","handleFetchNative","response","handleFetchJsonp","resolve","reject","script","callbackName","cleanupDone","cleanup","data","fetchCore","logMode","strategy","completeUrl","responseData","fetchDottie","fetchMode","validate","rawData","convertDotNetDates","borderCrossingDataGroup","wsdotBorderCrossingsApi","bridgeClearancesGroup","wsdotBridgeClearancesApi","cvRestrictionDataGroup","cvRestrictionDataWithIdGroup","wsdotCommercialVehicleRestrictionsApi","alertAreasGroup","eventCategoriesGroup","highwayAlertsGroup","wsdotHighwayAlertsApi","camerasGroup","wsdotHighwayCamerasApi","passConditionsGroup","wsdotMountainPassConditionsApi","tollRatesGroup","tollTripInfoGroup","tollTripRatesGroup","tollTripVersionGroup","wsdotTollRatesApi","flowDataGroup","wsdotTrafficFlowApi","travelTimeRoutesGroup","wsdotTravelTimesApi","weatherInfoGroup","wsdotWeatherInformationApi","subSurfaceMeasurementsGroup","surfaceMeasurementsGroup","weatherReadingsGroup","wsdotWeatherReadingsApi","weatherStationsGroup","wsdotWeatherStationsApi","fareLineItemsGroup","fareTotalsGroup","terminalComboGroup","terminalsGroup","validDateRangeGroup","wsfFaresApi","cacheFlushDateFaresGroup","activeSeasonsGroup","cacheFlushDateScheduleGroup","cacheFlushDateScheduleMeta","cacheFlushDateInputSchema","cacheFlushDateOutputSchema","routeDetailsGroup","routesGroup","sailingsGroup","scheduleAlertsGroup","scheduledRoutesGroup","schedulesGroup","scheduleTodayGroup","serviceDisruptionsGroup","scheduleTerminalMatesGroup","scheduleTerminalsGroup","timeAdjustmentsGroup","scheduleValidDateRangeGroup","wsfScheduleApi","cacheFlushDateTerminalsGroup","cacheFlushDateTerminalsMeta","terminalBasicsGroup","terminalBulletinsGroup","terminalLocationsGroup","terminalSailingSpaceGroup","terminalTransportsGroup","terminalVerboseGroup","terminalWaitTimesGroup","wsfTerminalsApi","cacheFlushDateVesselsGroup","cacheFlushDateVesselsMeta","vesselAccommodationsGroup","vesselBasicsGroup","vesselHistoriesGroup","vesselLocationsGroup","vesselStatsGroup","vesselVerboseGroup","wsfVesselsApi","apis","buildDescriptor","apiDefinition","group","api","createFetchFunction","descriptor","internalFetchCacheFlushDateFares","cacheFlushDateFaresMeta","internalFetchCacheFlushDateSchedule","internalFetchCacheFlushDateTerminals","internalFetchCacheFlushDateVessels","CACHE_FLUSH_STRATEGIES","normalizeFlushDate","getCachedFetchFunction","apiName","CACHE_FLUSH_ENDPOINT_IDS","useCacheFlushDate","isCacheFlushApi","fetchFn","endpointId","useQuery","useInvalidateOnFlushChange","flushDateQuery","queryClient","useQueryClient","previousFlushDateRef","React","useEffect","currentFlushDate","cacheStrategies","shouldUseCacheFlushDate","isWsfApi","createHook","options"],"mappings":"yPAUA,IAAMA,EAAAA,CAAmB,2BAgBnBC,CAAAA,CAAgB,CACpB,OAAQ,OAAA,CAAQ,GAAA,CAAI,kBAAA,EAAsB,EAAA,CAC1C,MAAA,CAAQ,OAAA,CAAQ,IAAI,cAAA,EAAkBD,EACxC,CAAA,CAUaE,EAAAA,CAAY,IAChBD,CAAAA,CAAc,OAWVE,EAAAA,CAAY,IAChBF,CAAAA,CAAc,MAAA,CAWVG,EAAAA,CAAaC,CAAAA,EAAyB,CACjDJ,CAAAA,CAAc,MAAA,CAASI,EACzB,CAAA,CAUaC,EAAAA,CAAcC,GAAyB,CAClDN,CAAAA,CAAc,MAAA,CAASM,EACzB,CAAA,CAQaC,EAAAA,CAAgB,CAC3B,SAAA,CAAAN,EAAAA,CACA,SAAA,CAAAC,EAAAA,CACA,SAAA,CAAAC,EAAAA,CACA,WAAAE,EACF,EC1FO,IAAMG,EAAN,cAA8BC,KAAM,CAGzCC,WAAAA,CAAYC,CAAAA,CAAiB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L,CAAC,CACH,CAAA,CAGK,CACLpL,EACAoL,CAAAA,GAEOb,QAAAA,CAAS,CACd,QAAA,CAAU,CAACf,CAAAA,CAAW,EAAA,CAAIxJ,CAAAA,EAAQ,MAAA,EAAU,IAAI,CAAA,CAChD,OAAA,CAAS,IAAMqK,CAAAA,CAAQrK,CAAM,CAAA,CAC7B,GAAGgL,CAAAA,CAAgB3B,CAAAA,CAAM,aAA6C,CAAA,CACtE,oBAAA,CAAsB,MACtB,GAAG+B,CACL,CAAC,CAEL","file":"chunk-FUK6FFHJ.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","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","/**\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","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for border crossing data endpoints\n */\nexport const borderCrossingDataGroup: EndpointGroupMeta = {\n  name: \"border-crossing-data\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Current wait times for Washington border crossings into Canada by crossing and lane type.\",\n    description:\n      \"Snapshot wait-time data for I-5, SR-543, SR-539, and SR-9 crossings, covering general, Nexus, and truck lanes.\",\n    useCases: [\n      \"Plan trips into Canada based on current border wait times.\",\n      \"Compare wait times across crossings and lane types.\",\n      \"Show live wait-time information in traveler or operations dashboards.\",\n    ],\n    updateFrequency: \"1m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { borderCrossingDataGroup } from \"./borderCrossingData/shared/borderCrossingData.endpoints\";\n\nexport const wsdotBorderCrossingsApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-border-crossings\",\n    baseUrl:\n      \"https://wsdot.wa.gov/Traffic/api/BorderCrossings/BorderCrossingsREST.svc\",\n  },\n  endpointGroups: [borderCrossingDataGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for bridge clearances endpoints\n */\nexport const bridgeClearancesGroup: EndpointGroupMeta = {\n  name: \"bridge-clearances\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Vertical clearance measurements for Washington State bridges.\",\n    description:\n      \"Bridge height restrictions including location data, route associations, and clearance measurements in both feet-inches and inches formats.\",\n    useCases: [\n      \"Plan commercial vehicle routes with height restrictions.\",\n      \"Verify clearance requirements for oversize load permits.\",\n      \"Identify bridge height limitations for route planning.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { bridgeClearancesGroup } from \"./bridgeClearances/shared/bridgeClearances.endpoints\";\n\nexport const wsdotBridgeClearancesApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-bridge-clearances\",\n    baseUrl: \"https://www.wsdot.wa.gov/traffic/api/bridges/clearancerest.svc\",\n  },\n  endpointGroups: [bridgeClearancesGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for commercial vehicle restriction data endpoints\n */\nexport const cvRestrictionDataGroup: EndpointGroupMeta = {\n  name: \"cv-restriction-data\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Commercial vehicle restrictions for Washington State highways.\",\n    description:\n      \"Weight limits, height clearances, axle restrictions, and location details for bridge and road restrictions statewide.\",\n    useCases: [\n      \"Check vehicle restrictions for commercial route planning.\",\n      \"Determine route feasibility and permit requirements.\",\n      \"Identify weight and height limitations for trucking operations.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for commercial vehicle restriction data with ID endpoints\n */\nexport const cvRestrictionDataWithIdGroup: EndpointGroupMeta = {\n  name: \"cv-restriction-data-with-id\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Commercial vehicle restrictions with unique identifiers for Washington State highways.\",\n    description:\n      \"Weight limits, height clearances, axle restrictions, and location details with unique tracking IDs for bridge and road restrictions statewide.\",\n    useCases: [\n      \"Track specific restrictions using unique identifiers.\",\n      \"Monitor restriction changes over time.\",\n      \"Manage permit requirements with ID-based lookups.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { cvRestrictionDataGroup } from \"./cvRestrictionData/shared/cvRestrictionData.endpoints\";\nimport { cvRestrictionDataWithIdGroup } from \"./cvRestrictionDataWithId/shared/cvRestrictionDataWithId.endpoints\";\n\nexport const wsdotCommercialVehicleRestrictionsApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-commercial-vehicle-restrictions\",\n    baseUrl:\n      \"https://www.wsdot.wa.gov/traffic/api/cvrestrictions/cvrestrictionsrest.svc\",\n  },\n  endpointGroups: [cvRestrictionDataGroup, cvRestrictionDataWithIdGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for alert areas endpoints\n */\nexport const alertAreasGroup: EndpointGroupMeta = {\n  name: \"alertAreas\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary: \"Geographic map areas for filtering highway alerts by region.\",\n    description:\n      \"Area codes and names used to organize and filter highway alerts across Washington State geographic regions.\",\n    useCases: [\n      \"Filter highway alerts by geographic map area.\",\n      \"Obtain valid area codes for alert queries.\",\n      \"Display regional alert organization in user interfaces.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for event categories endpoints\n */\nexport const eventCategoriesGroup: EndpointGroupMeta = {\n  name: \"event-categories\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary: \"Event category classifications for highway alerts.\",\n    description:\n      \"Standardized category names used to classify and filter highway alerts by incident type, such as construction, collisions, maintenance, and weather events.\",\n    useCases: [\n      \"Filter highway alerts by event category type.\",\n      \"Obtain valid category names for alert searches.\",\n      \"Categorize alerts in user interfaces by incident type.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for highway alerts endpoints\n */\nexport const highwayAlertsGroup: EndpointGroupMeta = {\n  name: \"highwayAlerts\",\n  // Using FREQUENT strategy because highway alerts can change every few minutes as incidents occur\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Real-time highway alerts for traffic incidents and road conditions.\",\n    description:\n      \"Traffic incidents, construction, maintenance, and other events affecting Washington State highways, including location details, impact levels, timestamps, and event classifications.\",\n    useCases: [\n      \"Monitor real-time traffic incidents and road conditions.\",\n      \"Plan alternate routes based on current highway alerts.\",\n      \"Display active alerts filtered by location, region, or category.\",\n      \"Track alert status and estimated resolution times.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { alertAreasGroup } from \"./alertAreas/shared/alertAreas.endpoints\";\nimport { eventCategoriesGroup } from \"./eventCategories/shared/eventCategories.endpoints\";\nimport { highwayAlertsGroup } from \"./highwayAlerts/shared/highwayAlerts.endpoints\";\n\nexport const wsdotHighwayAlertsApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-highway-alerts\",\n    baseUrl:\n      \"https://www.wsdot.wa.gov/traffic/api/highwayalerts/highwayalertsrest.svc\",\n  },\n  endpointGroups: [highwayAlertsGroup, alertAreasGroup, eventCategoriesGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for cameras endpoints\n */\nexport const camerasGroup: EndpointGroupMeta = {\n  name: \"cameras\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Traffic monitoring cameras on Washington state highways.\",\n    description:\n      \"Camera locations, image URLs, status, and metadata for real-time traffic condition visibility.\",\n    useCases: [\n      \"Display live camera feeds in traffic monitoring applications.\",\n      \"Show road conditions and weather impacts for route planning.\",\n      \"Provide visual traffic status in traveler information systems.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { camerasGroup } from \"./cameras/shared/cameras.endpoints\";\n\nexport const wsdotHighwayCamerasApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-highway-cameras\",\n    baseUrl:\n      \"https://www.wsdot.wa.gov/traffic/api/highwaycameras/highwaycamerasrest.svc\",\n  },\n  endpointGroups: [camerasGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for pass conditions endpoints\n */\nexport const passConditionsGroup: EndpointGroupMeta = {\n  name: \"pass-conditions\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Real-time mountain pass conditions including weather, road status, and travel restrictions.\",\n    description:\n      \"Current conditions for 15 monitored mountain passes statewide, including temperature, elevation, weather, road surface conditions, and direction-specific travel restrictions.\",\n    useCases: [\n      \"Assess pass conditions for winter travel planning.\",\n      \"Monitor weather and road conditions for route decisions.\",\n      \"Check travel restrictions and advisories before mountain travel.\",\n    ],\n    updateFrequency: \"15m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { passConditionsGroup } from \"./passConditions/shared/passConditions.endpoints\";\n\nexport const wsdotMountainPassConditionsApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-mountain-pass-conditions\",\n    baseUrl:\n      \"https://www.wsdot.wa.gov/traffic/api/mountainpassconditions/mountainpassconditionsrest.svc\",\n  },\n  endpointGroups: [passConditionsGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for toll rates endpoints\n */\nexport const tollRatesGroup: EndpointGroupMeta = {\n  name: \"toll-rates\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Current toll rates for high occupancy vehicle (HOV) toll lanes statewide.\",\n    description:\n      \"Real-time toll pricing data including trip locations, current toll amounts, route associations, and update timestamps for congestion management.\",\n    useCases: [\n      \"Calculate travel costs for HOV toll lane usage.\",\n      \"Display current toll amounts in navigation apps.\",\n      \"Make informed routing decisions based on toll pricing.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for toll trip info endpoints\n */\nexport const tollTripInfoGroup: EndpointGroupMeta = {\n  name: \"toll-trip-info\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Trip route information for HOV toll lanes including locations, mileposts, and geometry.\",\n    description:\n      \"Reference data for toll trip routes including start and end locations, coordinates, mileposts, travel direction, and optional geometry data for mapping.\",\n    useCases: [\n      \"Display toll trip routes on maps.\",\n      \"Look up trip information by location or route.\",\n      \"Build trip selection interfaces for toll rate queries.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for toll trip rates endpoints\n */\nexport const tollTripRatesGroup: EndpointGroupMeta = {\n  name: \"toll-trip-rates\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Comprehensive toll rate data for all trips including pricing, messages, and version tracking.\",\n    description:\n      \"Container for toll trip rates supporting current data, historical date ranges, and version-specific queries. Includes pricing details, informational messages, and version tracking for transportation planning.\",\n    useCases: [\n      \"Retrieve current toll rates for all trips.\",\n      \"Analyze historical toll pricing trends.\",\n      \"Access version-specific rate data for change tracking.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for toll trip version endpoints\n */\nexport const tollTripVersionGroup: EndpointGroupMeta = {\n  name: \"toll-trip-version\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary: \"Version and timestamp information for toll trip data.\",\n    description:\n      \"Current version number and timestamp for toll trip rates data, enabling cache management and data freshness tracking.\",\n    useCases: [\n      \"Check data freshness before fetching toll rates.\",\n      \"Determine when to invalidate cached toll rate data.\",\n      \"Track version changes for toll trip rates.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { tollRatesGroup } from \"./tollRates/shared/tollRates.endpoints\";\nimport { tollTripInfoGroup } from \"./tollTripInfo/shared/tollTripInfo.endpoints\";\nimport { tollTripRatesGroup } from \"./tollTripRates/shared/tollTripRates.endpoints\";\nimport { tollTripVersionGroup } from \"./tollTripVersion/shared/tollTripVersion.endpoints\";\n\nexport const wsdotTollRatesApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-toll-rates\",\n    baseUrl: \"https://www.wsdot.wa.gov/traffic/api/tollrates/tollratesrest.svc\",\n  },\n  endpointGroups: [\n    tollRatesGroup,\n    tollTripInfoGroup,\n    tollTripRatesGroup,\n    tollTripVersionGroup,\n  ],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for flow data endpoints\n */\nexport const flowDataGroup: EndpointGroupMeta = {\n  name: \"flow-data\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Real-time traffic flow conditions from sensor stations across Washington state.\",\n    description:\n      \"Current traffic flow readings, station locations, and timestamps for traffic monitoring and congestion detection.\",\n    useCases: [\n      \"Monitor real-time traffic flow conditions across Washington highways.\",\n      \"Detect congestion and traffic patterns for route planning.\",\n      \"Display current traffic status in traveler information systems.\",\n    ],\n    updateFrequency: \"90s\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { flowDataGroup } from \"./flowData/shared/flowData.endpoints\";\n\nexport const wsdotTrafficFlowApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-traffic-flow\",\n    baseUrl:\n      \"https://www.wsdot.wa.gov/traffic/api/trafficflow/trafficflowrest.svc\",\n  },\n  endpointGroups: [flowDataGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for travel time routes endpoints\n */\nexport const travelTimeRoutesGroup: EndpointGroupMeta = {\n  name: \"travel-time-routes\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Current and average travel times for major Washington State highway routes.\",\n    description:\n      \"Travel time data for routes in Seattle, Tacoma, and Snoqualmie Pass areas, including distance, start/end points, and comparison of current vs. average times.\",\n    useCases: [\n      \"Plan travel routes and estimate arrival times.\",\n      \"Compare current conditions against historical averages to identify delays.\",\n      \"Optimize departure times based on real-time traffic conditions.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { travelTimeRoutesGroup } from \"./travelTimeRoutes/shared/travelTimeRoutes.endpoints\";\n\nexport const wsdotTravelTimesApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-travel-times\",\n    baseUrl:\n      \"https://www.wsdot.wa.gov/traffic/api/traveltimes/traveltimesrest.svc\",\n  },\n  endpointGroups: [travelTimeRoutesGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for weather information endpoints\n */\nexport const weatherInfoGroup: EndpointGroupMeta = {\n  name: \"weather-info\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Current atmospheric conditions from WSDOT Road Weather Information System stations.\",\n    description:\n      \"Real-time temperature, humidity, wind conditions, visibility, barometric pressure, and precipitation data for transportation operations.\",\n    useCases: [\n      \"Assess road weather conditions for transportation management.\",\n      \"Monitor atmospheric data for traveler safety decisions.\",\n      \"Display current weather conditions at specific stations.\",\n      \"Query historical weather data by station and time range.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { weatherInfoGroup } from \"./weatherInfo/shared/weatherInfo.endpoints\";\n\nexport const wsdotWeatherInformationApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-weather-information\",\n    baseUrl:\n      \"https://wsdot.wa.gov/traffic/api/WeatherInformation/WeatherInformationREST.svc\",\n  },\n  endpointGroups: [weatherInfoGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for sub-surface measurements endpoints\n */\nexport const subSurfaceMeasurementsGroup: EndpointGroupMeta = {\n  name: \"sub-surface-measurements\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Subsurface temperature measurements from sensors embedded below road pavement.\",\n    description:\n      \"Ground temperature data from sensors embedded 12-18 inches below road pavement surfaces for monitoring ground temperature conditions.\",\n    useCases: [\n      \"Monitor ground temperature conditions for winter maintenance operations.\",\n      \"Predict road surface conditions based on subsurface temperature trends.\",\n      \"Assess travel safety by understanding ground temperature patterns.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for surface measurements endpoints\n */\nexport const surfaceMeasurementsGroup: EndpointGroupMeta = {\n  name: \"surface-measurements\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Surface sensor measurements from WSDOT weather stations statewide.\",\n    description:\n      \"Pavement surface temperature, road freezing temperature, and road surface condition codes from sensors embedded in or mounted on road surfaces.\",\n    useCases: [\n      \"Monitor road surface conditions for winter maintenance operations.\",\n      \"Assess pavement temperature and freezing risk.\",\n      \"Evaluate travel safety based on surface condition codes.\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for weather readings endpoints\n */\nexport const weatherReadingsGroup: EndpointGroupMeta = {\n  name: \"weather-readings\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Comprehensive weather readings from all WSDOT weather stations statewide.\",\n    description:\n      \"Complete weather data including air temperature, humidity, wind conditions, visibility, precipitation across multiple time periods, barometric pressure, snow depth, and surface/subsurface sensor measurements.\",\n    useCases: [\n      \"Access complete weather station data for comprehensive analysis.\",\n      \"Monitor atmospheric and surface conditions for transportation operations.\",\n      \"Track precipitation across multiple time periods (1h, 3h, 6h, 12h, 24h).\",\n    ],\n    updateFrequency: \"5m\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { subSurfaceMeasurementsGroup } from \"./subSurfaceMeasurements/shared/subSurfaceMeasurements.endpoints\";\nimport { surfaceMeasurementsGroup } from \"./surfaceMeasurements/shared/surfaceMeasurements.endpoints\";\nimport { weatherReadingsGroup } from \"./weatherReadings/shared/weatherReadings.endpoints\";\n\nexport const wsdotWeatherReadingsApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-weather-readings\",\n    baseUrl: \"https://www.wsdot.wa.gov/traffic/api/api\",\n  },\n  endpointGroups: [\n    weatherReadingsGroup,\n    surfaceMeasurementsGroup,\n    subSurfaceMeasurementsGroup,\n  ],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for weather stations endpoints\n */\nexport const weatherStationsGroup: EndpointGroupMeta = {\n  name: \"weather-stations\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary:\n      \"Weather station metadata and location information for WSDOT Road Weather Information System stations statewide.\",\n    description:\n      \"Station identifiers, names, and location coordinates for weather stations that collect atmospheric and pavement condition data.\",\n    useCases: [\n      \"Discover weather stations by location for weather data queries.\",\n      \"Identify station identifiers and names for weather data lookups.\",\n      \"Support location-based weather station searches.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { weatherStationsGroup } from \"./weatherStations/shared/weatherStations.endpoints\";\n\nexport const wsdotWeatherStationsApi: ApiDefinition = {\n  api: {\n    name: \"wsdot-weather-stations\",\n    baseUrl:\n      \"https://wsdot.wa.gov/traffic/api/WeatherStations/WeatherStationsREST.svc\",\n  },\n  endpointGroups: [weatherStationsGroup],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for fare line items endpoints\n */\nexport const fareLineItemsGroup: EndpointGroupMeta = {\n  name: \"fare-line-items\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Individual fare components for WSF routes by passenger and vehicle types.\",\n    description:\n      \"Fare line items represent pricing components for different passenger categories, vehicle types, and route combinations. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display fare options for different passenger and vehicle types.\",\n      \"Calculate journey costs based on route and demographics.\",\n      \"Build fare selection interfaces for ticket purchasing.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for fare totals endpoints\n */\nexport const fareTotalsGroup: EndpointGroupMeta = {\n  name: \"fare-totals\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Calculated fare totals for WSF journeys by selected line items and quantities.\",\n    description:\n      \"Fare totals combine individual fare line items with quantities to provide complete pricing breakdowns including departing, return, direction-independent, and grand totals. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Calculate complete journey costs for ticket pricing.\",\n      \"Display fare breakdowns by leg and total amount.\",\n      \"Process payment amounts for ferry trips.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal combo endpoints\n */\nexport const terminalComboGroup: EndpointGroupMeta = {\n  name: \"terminal-combo\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Valid terminal pairings with fare collection procedures for WSF routes.\",\n    description:\n      \"Terminal combinations define which terminals are connected and describe where and how fares are collected for each route. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Determine route availability between terminal pairs.\",\n      \"Understand fare collection procedures for specific routes.\",\n      \"Build journey planning interfaces with fare collection details.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminals endpoints\n */\nexport const terminalsGroup: EndpointGroupMeta = {\n  name: \"terminals\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"WSF terminal facilities serving as departure and arrival points for ferry routes.\",\n    description:\n      \"Terminals represent port facilities with unique identifiers and names. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display terminal options for trip planning interfaces.\",\n      \"Determine valid terminal pairs for route selection.\",\n      \"Build terminal lookup and navigation features.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for valid date range endpoints\n */\nexport const validDateRangeGroup: EndpointGroupMeta = {\n  name: \"valid-date-range\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Validity period for published WSF fare data.\",\n    description:\n      \"Returns the start and end dates between which fare information is accurate and available for all ferry routes. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Determine valid trip dates for fare queries.\",\n      \"Validate trip date inputs before calling other endpoints.\",\n      \"Display available date ranges in booking interfaces.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { cacheFlushDateFaresGroup } from \"./cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport { fareLineItemsGroup } from \"./fareLineItems/shared/fareLineItems.endpoints\";\nimport { fareTotalsGroup } from \"./fareTotals/shared/fareTotals.endpoints\";\nimport { terminalComboGroup } from \"./terminalCombo/shared/terminalCombo.endpoints\";\nimport { terminalsGroup } from \"./terminals/shared/terminals.endpoints\";\nimport { validDateRangeGroup } from \"./validDateRange/shared/validDateRange.endpoints\";\n\nexport const wsfFaresApi: ApiDefinition = {\n  api: {\n    name: \"wsf-fares\",\n    baseUrl: \"https://www.wsdot.wa.gov/ferries/api/fares/rest\",\n  },\n  endpointGroups: [\n    cacheFlushDateFaresGroup,\n    validDateRangeGroup,\n    terminalsGroup,\n    terminalComboGroup,\n    fareLineItemsGroup,\n    fareTotalsGroup,\n  ],\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for active seasons endpoints\n */\nexport const activeSeasonsGroup: EndpointGroupMeta = {\n  name: \"active-seasons\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Active schedule seasons for WSF routes.\",\n    description:\n      \"Scheduling periods defining when specific ferry schedules are active, including season dates, names, and PDF URLs.\",\n    useCases: [\n      \"Identify which schedule seasons are currently active.\",\n      \"Determine valid date ranges for schedule queries.\",\n      \"Access printable schedule PDF documents.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import {\n  type CacheFlushDateInput,\n  type CacheFlushDateOutput,\n  cacheFlushDateInputSchema,\n  cacheFlushDateOutputSchema,\n} from \"@/apis/shared/cacheFlushDate\";\nimport type { EndpointGroupMeta, EndpointMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for cache flush date endpoints\n */\nexport const cacheFlushDateScheduleGroup: EndpointGroupMeta = {\n  name: \"cache-flush-date-schedule\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Cache invalidation timestamp for wsf-schedule static data.\",\n    description:\n      \"Timestamp indicating when static endpoint data for the wsf-schedule API was last updated. Use to determine when to invalidate cached schedule information.\",\n    useCases: [\n      \"Poll periodically to detect when static schedule data has changed.\",\n      \"Invalidate application cache when timestamp changes.\",\n      \"Optimize cache refresh strategy for schedule endpoints.\",\n    ],\n    updateFrequency: \"on-change\",\n  },\n};\n\nexport const cacheFlushDateScheduleMeta = {\n  functionName: \"fetchCacheFlushDateSchedule\",\n  endpoint: \"/cacheflushdate\",\n  inputSchema: cacheFlushDateInputSchema,\n  outputSchema: cacheFlushDateOutputSchema,\n  sampleParams: {},\n  endpointDescription: \"Get cache flush timestamp for static schedule data.\",\n} satisfies EndpointMeta<CacheFlushDateInput, CacheFlushDateOutput>;\n\nexport const cacheFlushDateScheduleEndpoints = {\n  cacheFlushDate: cacheFlushDateScheduleMeta,\n} as const;\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for route details endpoints\n */\nexport const routeDetailsGroup: EndpointGroupMeta = {\n  name: \"route-details\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Detailed ferry route information with service details.\",\n    description:\n      \"Comprehensive route data including terminals, crossing times, vessel assignments, alerts, and route-specific notes for trip planning.\",\n    useCases: [\n      \"Display detailed route information for trip planning.\",\n      \"Show route alerts and service disruptions.\",\n      \"Access route-specific notes and accessibility information.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for routes endpoints\n */\nexport const routesGroup: EndpointGroupMeta = {\n  name: \"routes\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Basic ferry route information between terminals.\",\n    description:\n      \"Route identification including route IDs, abbreviations, descriptions, region associations, and service disruptions.\",\n    useCases: [\n      \"Discover available routes for a trip date.\",\n      \"Identify routes by terminal combinations.\",\n      \"Check for active service disruptions on routes.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for sailings endpoints\n */\nexport const sailingsGroup: EndpointGroupMeta = {\n  name: \"sailings\",\n  cacheStrategy: \"FREQUENT\",\n  documentation: {\n    summary: \"Scheduled ferry sailings organized by route and direction.\",\n    description:\n      \"Departure times organized by direction, days of operation, and date ranges, mirroring printed PDF schedule groupings.\",\n    useCases: [\n      \"Display schedule structure with sailing groups.\",\n      \"Show departure times by direction and day type.\",\n      \"Access journey details with vessel assignments and terminal stops.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for schedule alerts endpoints\n */\nexport const scheduleAlertsGroup: EndpointGroupMeta = {\n  name: \"schedule-alerts\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Service alerts and notifications for ferry schedules.\",\n    description:\n      \"Important notifications about ferry service including delays, cancellations, terminal updates, and service-related announcements. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display service alerts and notifications in rider apps.\",\n      \"Monitor schedule changes and disruptions.\",\n      \"Show route-specific and system-wide announcements.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for scheduled routes endpoints\n */\nexport const scheduledRoutesGroup: EndpointGroupMeta = {\n  name: \"scheduled-routes\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Ferry routes active for specific schedule seasons.\",\n    description:\n      \"Predefined routes with schedule identifiers, contingency adjustments, and service disruptions. Routes must be scheduled to run during a season to be included. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Discover routes active for a specific schedule season.\",\n      \"Filter routes by season using schedule IDs.\",\n      \"Identify contingency routes and service disruptions.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for schedules endpoints\n */\nexport const schedulesGroup: EndpointGroupMeta = {\n  name: \"schedules\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Complete sailing timetables for ferry routes.\",\n    description:\n      \"Sailing schedules including departure times, arrival times, vessel assignments, and route-specific information. Accounts for contingencies, sailing date ranges, and time adjustments. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Plan ferry travel with complete sailing timetables.\",\n      \"Look up departure and arrival times for specific dates.\",\n      \"View vessel assignments and loading rules for sailings.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for schedule today endpoints\n */\nexport const scheduleTodayGroup: EndpointGroupMeta = {\n  name: \"schedule-today\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Today's sailing schedule for ferry routes.\",\n    description:\n      \"Current day sailing information with option to show only remaining departures. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Show today's remaining sailings in real-time apps.\",\n      \"Display current day schedule with all departures.\",\n      \"Filter to only upcoming sailings for today.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for service disruptions endpoints\n */\nexport const serviceDisruptionsGroup: EndpointGroupMeta = {\n  name: \"service-disruptions\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Service disruptions affecting ferry routes.\",\n    description:\n      \"Planned or unplanned interruptions to normal ferry service including cancellations, delays, and route changes. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Identify routes with service disruptions for a specific date.\",\n      \"Plan alternative travel arrangements when disruptions occur.\",\n      \"Display disruption information to passengers.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for schedule terminal mates endpoints\n */\nexport const scheduleTerminalMatesGroup: EndpointGroupMeta = {\n  name: \"schedule-terminal-mates\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Arriving terminals that can be reached from a given departing terminal.\",\n    description:\n      \"Terminal mates represent valid destination terminals for a specific origin terminal and trip date. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Find valid destination terminals for trip planning interfaces.\",\n      \"Build terminal selection workflows for route queries.\",\n      \"Determine available terminal pairs for schedule lookups.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for schedule terminals endpoints\n */\nexport const scheduleTerminalsGroup: EndpointGroupMeta = {\n  name: \"schedule-terminals\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Ferry terminal facilities serving as departure and arrival points.\",\n    description:\n      \"Terminals represent dock locations where passengers board and disembark. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display terminal options for trip planning interfaces.\",\n      \"Determine valid terminal pairs for route selection.\",\n      \"Build terminal lookup and navigation features.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for time adjustments endpoints\n */\nexport const timeAdjustmentsGroup: EndpointGroupMeta = {\n  name: \"time-adjustments\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Modifications to scheduled sailing times for specific dates.\",\n    description:\n      \"Time adjustments include additions, cancellations, and timing changes that deviate from published schedules, such as tidal cancellations. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display schedule deviations and special date modifications.\",\n      \"Identify tidal adjustments and event-based cancellations.\",\n      \"Show accurate sailing times that differ from published schedules.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for schedule valid date range endpoints\n */\nexport const scheduleValidDateRangeGroup: EndpointGroupMeta = {\n  name: \"schedule-valid-date-range\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Validity period for published WSF schedule data.\",\n    description:\n      \"Returns the start and end dates between which schedule information is accurate and available for all ferry routes. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Determine valid trip dates for schedule queries.\",\n      \"Validate trip date inputs before calling other endpoints.\",\n      \"Display available date ranges in booking interfaces.\",\n    ],\n    updateFrequency: \"daily\",\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { activeSeasonsGroup } from \"./activeSeasons/shared/activeSeasons.endpoints\";\nimport { cacheFlushDateScheduleGroup } from \"./cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport { routeDetailsGroup } from \"./routeDetails/shared/routeDetails.endpoints\";\nimport { routesGroup } from \"./routes/shared/routes.endpoints\";\nimport { sailingsGroup } from \"./sailings/shared/sailings.endpoints\";\nimport { scheduleAlertsGroup } from \"./scheduleAlerts/shared/scheduleAlerts.endpoints\";\nimport { scheduledRoutesGroup } from \"./scheduledRoutes/shared/scheduledRoutes.endpoints\";\nimport { schedulesGroup } from \"./schedules/shared/schedules.endpoints\";\nimport { scheduleTodayGroup } from \"./scheduleToday/shared/scheduleToday.endpoints\";\nimport { serviceDisruptionsGroup } from \"./serviceDisruptions/shared/serviceDisruptions.endpoints\";\nimport { scheduleTerminalMatesGroup } from \"./terminalMates/shared/terminalMates.endpoints\";\nimport { scheduleTerminalsGroup } from \"./terminals/shared/terminals.endpoints\";\nimport { timeAdjustmentsGroup } from \"./timeAdjustments/shared/timeAdjustments.endpoints\";\nimport { scheduleValidDateRangeGroup } from \"./validDateRange/shared/validDateRange.endpoints\";\n\nexport const wsfScheduleApi: ApiDefinition = {\n  api: {\n    name: \"wsf-schedule\",\n    baseUrl: \"https://www.wsdot.wa.gov/ferries/api/schedule/rest\",\n  },\n  endpointGroups: [\n    activeSeasonsGroup,\n    sailingsGroup,\n    cacheFlushDateScheduleGroup,\n    routeDetailsGroup,\n    routesGroup,\n    serviceDisruptionsGroup,\n    scheduleAlertsGroup,\n    schedulesGroup,\n    scheduledRoutesGroup,\n    scheduleTodayGroup,\n    scheduleValidDateRangeGroup,\n    scheduleTerminalMatesGroup,\n    scheduleTerminalsGroup,\n    timeAdjustmentsGroup,\n  ],\n};\n","import type { EndpointGroupMeta, EndpointMeta } from \"@/apis/types\";\nimport {\n  type CacheFlushDateInput,\n  cacheFlushDateInputSchema,\n} from \"./cacheFlushDate.input\";\nimport {\n  type CacheFlushDateOutput,\n  cacheFlushDateOutputSchema,\n} from \"./cacheFlushDate.output\";\n\n/**\n * Endpoint group metadata for cache flush date terminals endpoints\n */\nexport const cacheFlushDateTerminalsGroup: EndpointGroupMeta = {\n  name: \"cache-flush-date-terminals\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Cache invalidation timestamp for static wsf-terminals data.\",\n    description:\n      \"Timestamp indicating when static endpoint data for the wsf-terminals API was last updated. Use this endpoint to determine when to invalidate cached terminal information. When the returned date changes, refresh your cached data. Polled automatically by ws-dottie useQuery hooks.\",\n    useCases: [\n      \"Detect when static terminal data has changed and invalidate caches.\",\n      \"Poll periodically to refresh cached terminal information.\",\n      \"Coordinate cache invalidation across multiple terminal endpoints.\",\n    ],\n  },\n};\n\nexport const cacheFlushDateTerminalsMeta = {\n  functionName: \"fetchCacheFlushDateTerminals\",\n  endpoint: \"/cacheflushdate\",\n  inputSchema: cacheFlushDateInputSchema,\n  outputSchema: cacheFlushDateOutputSchema,\n  sampleParams: {},\n  endpointDescription: \"Get cache flush timestamp for static terminals data.\",\n} satisfies EndpointMeta<CacheFlushDateInput, CacheFlushDateOutput>;\n\nexport const cacheFlushDateTerminalsEndpoints = {\n  cacheFlushDate: cacheFlushDateTerminalsMeta,\n} as const;\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal basics endpoints\n */\nexport const terminalBasicsGroup: EndpointGroupMeta = {\n  name: \"terminal-basics\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Essential terminal details including identification, amenities, and regional assignments.\",\n    description:\n      \"Basic terminal information for Washington State Ferry terminals including IDs, names, abbreviations, amenities (overhead passenger loading, elevator, waiting room, food service, restrooms), and sort order. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display terminal lists with basic identification and amenities.\",\n      \"Plan ferry trips with accessibility and facility information.\",\n      \"Filter terminals by region or amenities.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal bulletins endpoints\n */\nexport const terminalBulletinsGroup: EndpointGroupMeta = {\n  name: \"terminal-bulletins\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Service alerts and notifications for ferry terminals.\",\n    description:\n      \"Important notices and alerts associated with Washington State Ferry terminals including service updates, travel advisories, and critical announcements. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display terminal alerts and service notices in rider apps.\",\n      \"Show travel advisories and critical announcements.\",\n      \"Monitor terminal-specific and system-wide notifications.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal locations endpoints\n */\nexport const terminalLocationsGroup: EndpointGroupMeta = {\n  name: \"terminal-locations\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Geographical location data for ferry terminals.\",\n    description:\n      \"Location information for Washington State Ferry terminals including coordinates, addresses, map links, driving directions, and GIS zoom-level coordinates. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display terminal locations on maps and navigation systems.\",\n      \"Provide driving directions and address information.\",\n      \"Integrate with GIS mapping applications.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal sailing space endpoints\n */\nexport const terminalSailingSpaceGroup: EndpointGroupMeta = {\n  name: \"terminal-sailing-space\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Real-time sailing space availability for upcoming departures.\",\n    description:\n      \"Terminal condition data including drive-up and reservation spaces available for select departures, vessel information, and cancellation status. Data changes frequently (potentially every 5 seconds). Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group. Do not cache results for extended periods.\",\n    useCases: [\n      \"Display real-time space availability for upcoming sailings.\",\n      \"Show drive-up and reservation space counts with color indicators.\",\n      \"Monitor vessel assignments and departure cancellations.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal transports endpoints\n */\nexport const terminalTransportsGroup: EndpointGroupMeta = {\n  name: \"terminal-transports\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Transportation options and parking information for terminals.\",\n    description:\n      \"Commuter information for Washington State Ferry terminals including parking details, vehicle-specific tips (motorcycle, truck, bike), airport information, transit links, and HOV/carpool information. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display parking information and rates for terminal planning.\",\n      \"Provide vehicle-specific tips for motorcycles, trucks, and bicycles.\",\n      \"Show transit links and airport connection information.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal verbose endpoints\n */\nexport const terminalVerboseGroup: EndpointGroupMeta = {\n  name: \"terminal-verbose\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Comprehensive terminal information combining all terminal data types.\",\n    description:\n      \"Complete terminal information combining data from terminalBasics, terminalBulletins, terminalLocations, terminalTransports, and terminalWaitTimes endpoints. Includes identification, amenities, bulletins, locations, transportation info, sailing space, wait times, and additional details. Use when you need to reduce API calls and don't mind larger payloads. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Retrieve all terminal information in a single API call.\",\n      \"Reduce application chattiness when comprehensive data is needed.\",\n      \"Build integrated terminal information displays.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for terminal wait times endpoints\n */\nexport const terminalWaitTimesGroup: EndpointGroupMeta = {\n  name: \"terminal-wait-times\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Wait time conditions and travel tips for vehicles and passengers.\",\n    description:\n      \"Current wait conditions and travel recommendations for both vehicles and walk-on passengers at Washington State Ferry terminals including wait time notes, IVR notes, route information, and update dates. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display wait time information and arrival recommendations.\",\n      \"Provide travel tips for optimal departure timing.\",\n      \"Show route-specific wait time conditions.\",\n    ],\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { cacheFlushDateTerminalsGroup } from \"./cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport { terminalBasicsGroup } from \"./terminalBasics/shared/terminalBasics.endpoints\";\nimport { terminalBulletinsGroup } from \"./terminalBulletins/shared/terminalBulletins.endpoints\";\nimport { terminalLocationsGroup } from \"./terminalLocations/shared/terminalLocations.endpoints\";\nimport { terminalSailingSpaceGroup } from \"./terminalSailingSpace/shared/terminalSailingSpace.endpoints\";\nimport { terminalTransportsGroup } from \"./terminalTransports/shared/terminalTransports.endpoints\";\nimport { terminalVerboseGroup } from \"./terminalVerbose/shared/terminalVerbose.endpoints\";\nimport { terminalWaitTimesGroup } from \"./terminalWaitTimes/shared/terminalWaitTimes.endpoints\";\n\nexport const wsfTerminalsApi: ApiDefinition = {\n  api: {\n    name: \"wsf-terminals\",\n    baseUrl: \"https://www.wsdot.wa.gov/ferries/api/terminals/rest\",\n  },\n  endpointGroups: [\n    cacheFlushDateTerminalsGroup,\n    terminalBasicsGroup,\n    terminalBulletinsGroup,\n    terminalLocationsGroup,\n    terminalSailingSpaceGroup,\n    terminalTransportsGroup,\n    terminalVerboseGroup,\n    terminalWaitTimesGroup,\n  ],\n};\n","import type { EndpointGroupMeta, EndpointMeta } from \"@/apis/types\";\nimport {\n  type CacheFlushDateInput,\n  cacheFlushDateInputSchema,\n} from \"./cacheFlushDate.input\";\nimport {\n  type CacheFlushDateOutput,\n  cacheFlushDateOutputSchema,\n} from \"./cacheFlushDate.output\";\n\n/**\n * Endpoint group metadata for cache flush date endpoints\n */\nexport const cacheFlushDateVesselsGroup: EndpointGroupMeta = {\n  name: \"cache-flush-date-vessels\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Cache invalidation timestamp for static wsf-vessels data.\",\n    description:\n      \"Timestamp indicating when any static endpoint data for the wsf-vessels API was last updated. Use this endpoint to determine when to invalidate cached vessel information. When the returned date changes, refresh cached data from static endpoints.\",\n    useCases: [\n      \"Poll periodically to detect when static vessel data has changed.\",\n      \"Invalidate application cache when timestamp changes.\",\n      \"Coordinate cache refresh across multiple static endpoints.\",\n    ],\n  },\n};\n\nexport const cacheFlushDateVesselsMeta = {\n  functionName: \"fetchCacheFlushDateVessels\",\n  endpoint: \"/cacheflushdate\",\n  inputSchema: cacheFlushDateInputSchema,\n  outputSchema: cacheFlushDateOutputSchema,\n  sampleParams: {},\n  endpointDescription: \"Get cache flush timestamp for static wsf-vessels data.\",\n} satisfies EndpointMeta<CacheFlushDateInput, CacheFlushDateOutput>;\n\nexport const cacheFlushDateVesselsEndpoints = {\n  cacheFlushDate: cacheFlushDateVesselsMeta,\n} as const;\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for vessel accommodations endpoints\n */\nexport const vesselAccommodationsGroup: EndpointGroupMeta = {\n  name: \"vessel-accommodations\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Passenger amenities and accessibility features for WSF vessels.\",\n    description:\n      \"Amenity and accessibility information including ADA compliance, restrooms, food service, elevators, and connectivity. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display vessel amenities in passenger information systems.\",\n      \"Plan accessible travel for passengers with disabilities.\",\n      \"Compare vessel features for trip planning.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for vessel basics endpoints\n */\nexport const vesselBasicsGroup: EndpointGroupMeta = {\n  name: \"vessel-basics\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Essential vessel identification and operational status.\",\n    description:\n      \"Basic vessel information including names, IDs, classifications, and operational status. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display vessel lists and status in passenger information systems.\",\n      \"Track fleet operational status and availability.\",\n      \"Provide foundation data for vessel selection.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for vessel histories endpoints\n */\nexport const vesselHistoriesGroup: EndpointGroupMeta = {\n  name: \"vessel-histories\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Historical sailing records for WSF vessels.\",\n    description:\n      \"Historical voyage data including departure and arrival terminals, scheduled and actual departure times, and estimated arrival times. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Analyze on-time performance and voyage patterns.\",\n      \"Track historical vessel movements and routes.\",\n      \"Generate reports on operational history.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for vessel locations endpoints\n */\nexport const vesselLocationsGroup: EndpointGroupMeta = {\n  name: \"vessel-locations\",\n  cacheStrategy: \"REALTIME\",\n  documentation: {\n    summary: \"Real-time vessel positions and status for WSF fleet.\",\n    description:\n      \"Current GPS coordinates, speed, heading, terminal assignments, and ETAs. This endpoint is real-time; cacheFlushDate is not used for cache invalidation.\",\n    useCases: [\n      \"Show live vessel positions and ETAs in rider apps.\",\n      \"Monitor fleet operations in internal dashboards.\",\n      \"Calculate arrival times and voyage progress.\",\n    ],\n    updateFrequency: \"5s\",\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for vessel stats endpoints\n */\nexport const vesselStatsGroup: EndpointGroupMeta = {\n  name: \"vessel-stats\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary: \"Technical specifications and capacity data for WSF vessels.\",\n    description:\n      \"Physical dimensions, engine details, passenger and vehicle capacity, and construction information. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Compare vessel capabilities and specifications.\",\n      \"Plan capacity and route assignments.\",\n      \"Support maintenance and technical reference.\",\n    ],\n  },\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\n\n/**\n * Endpoint group metadata for vessel verbose endpoints\n */\nexport const vesselVerboseGroup: EndpointGroupMeta = {\n  name: \"vessel-verbose\",\n  cacheStrategy: \"STATIC\",\n  documentation: {\n    summary:\n      \"Complete vessel information combining basics, stats, and accommodations.\",\n    description:\n      \"Comprehensive vessel profiles combining identification, operational status, technical specifications, and amenities in a single response. Use the cacheFlushDate endpoint for this API to determine when to invalidate cached data for this group.\",\n    useCases: [\n      \"Display complete vessel profiles in passenger information systems.\",\n      \"Reduce API calls by fetching all vessel data at once.\",\n      \"Support comprehensive vessel comparison and selection.\",\n    ],\n  },\n};\n","import type { ApiDefinition } from \"@/apis/types\";\nimport { cacheFlushDateVesselsGroup } from \"./cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport { vesselAccommodationsGroup } from \"./vesselAccommodations/shared/vesselAccommodations.endpoints\";\nimport { vesselBasicsGroup } from \"./vesselBasics/shared/vesselBasics.endpoints\";\nimport { vesselHistoriesGroup } from \"./vesselHistories/shared/vesselHistories.endpoints\";\nimport { vesselLocationsGroup } from \"./vesselLocations/shared/vesselLocations.endpoints\";\nimport { vesselStatsGroup } from \"./vesselStats/shared/vesselStats.endpoints\";\nimport { vesselVerboseGroup } from \"./vesselVerbose/shared/vesselVerbose.endpoints\";\n\nexport const wsfVesselsApi: ApiDefinition = {\n  api: {\n    name: \"wsf-vessels\",\n    baseUrl: \"https://www.wsdot.wa.gov/ferries/api/vessels/rest\",\n  },\n  endpointGroups: [\n    cacheFlushDateVesselsGroup,\n    vesselAccommodationsGroup,\n    vesselBasicsGroup,\n    vesselHistoriesGroup,\n    vesselLocationsGroup,\n    vesselStatsGroup,\n    vesselVerboseGroup,\n  ],\n};\n","/**\n * @fileoverview API Registry\n *\n * This module serves as the single source of truth for all API definitions.\n * It imports and exports all API definitions from their respective api.ts files,\n * providing a centralized registry for consumers.\n *\n * IMPORTANT: This module imports zod-openapi-init FIRST to ensure Zod schemas\n * have `.openapi()` method available before any API modules are imported.\n */\n\n// Import Zod OpenAPI initialization FIRST, before any schema creation\n// This ensures all schemas imported from API modules have .openapi() method\nimport \"@/shared/zod\";\n\nimport type { ApiDefinition } from \"@/apis/types\";\n\n// Import all API definitions\nimport { wsdotBorderCrossingsApi } from \"@/apis/wsdot-border-crossings/api\";\nimport { wsdotBridgeClearancesApi } from \"@/apis/wsdot-bridge-clearances/api\";\nimport { wsdotCommercialVehicleRestrictionsApi } from \"@/apis/wsdot-commercial-vehicle-restrictions/api\";\nimport { wsdotHighwayAlertsApi } from \"@/apis/wsdot-highway-alerts/api\";\nimport { wsdotHighwayCamerasApi } from \"@/apis/wsdot-highway-cameras/api\";\nimport { wsdotMountainPassConditionsApi } from \"@/apis/wsdot-mountain-pass-conditions/api\";\nimport { wsdotTollRatesApi } from \"@/apis/wsdot-toll-rates/api\";\nimport { wsdotTrafficFlowApi } from \"@/apis/wsdot-traffic-flow/api\";\nimport { wsdotTravelTimesApi } from \"@/apis/wsdot-travel-times/api\";\nimport { wsdotWeatherInformationApi } from \"@/apis/wsdot-weather-information/api\";\nimport { wsdotWeatherReadingsApi } from \"@/apis/wsdot-weather-readings/api\";\nimport { wsdotWeatherStationsApi } from \"@/apis/wsdot-weather-stations/api\";\nimport { wsfFaresApi } from \"@/apis/wsf-fares/api\";\nimport { wsfScheduleApi } from \"@/apis/wsf-schedule/api\";\nimport { wsfTerminalsApi } from \"@/apis/wsf-terminals/api\";\nimport { wsfVesselsApi } from \"@/apis/wsf-vessels/api\";\n\n/**\n * All APIs with their endpoint groups\n *\n * This object provides access to APIs grouped by name for structured\n * access when needed by consumers that need to work with specific APIs.\n */\nexport const apis = {\n  [wsdotBorderCrossingsApi.api.name]: wsdotBorderCrossingsApi,\n  [wsdotBridgeClearancesApi.api.name]: wsdotBridgeClearancesApi,\n  [wsdotCommercialVehicleRestrictionsApi.api.name]:\n    wsdotCommercialVehicleRestrictionsApi,\n  [wsdotHighwayAlertsApi.api.name]: wsdotHighwayAlertsApi,\n  [wsdotHighwayCamerasApi.api.name]: wsdotHighwayCamerasApi,\n  [wsdotMountainPassConditionsApi.api.name]: wsdotMountainPassConditionsApi,\n  [wsdotTollRatesApi.api.name]: wsdotTollRatesApi,\n  [wsdotTrafficFlowApi.api.name]: wsdotTrafficFlowApi,\n  [wsdotTravelTimesApi.api.name]: wsdotTravelTimesApi,\n  [wsdotWeatherInformationApi.api.name]: wsdotWeatherInformationApi,\n  [wsdotWeatherReadingsApi.api.name]: wsdotWeatherReadingsApi,\n  [wsdotWeatherStationsApi.api.name]: wsdotWeatherStationsApi,\n  [wsfFaresApi.api.name]: wsfFaresApi,\n  [wsfScheduleApi.api.name]: wsfScheduleApi,\n  [wsfTerminalsApi.api.name]: wsfTerminalsApi,\n  [wsfVesselsApi.api.name]: wsfVesselsApi,\n} as const satisfies Record<string, ApiDefinition>;\n\n// Re-export type for convenience\nexport type { ApiDefinition };\n","/**\n * @fileoverview Endpoint Descriptor Builder\n *\n * Builds complete endpoint descriptors from metadata objects.\n * Combines API, group, and endpoint metadata into a single descriptor.\n */\n\nimport type {\n  ApiDefinition,\n  EndpointGroupMeta,\n  EndpointMeta,\n} from \"@/apis/types\";\nimport type { Endpoint } from \"@/shared/types\";\n\n/**\n * Builds a complete endpoint descriptor from three metadata objects.\n */\nexport function buildDescriptor<I, O>(\n  apiDefinition: ApiDefinition,\n  group: EndpointGroupMeta,\n  endpoint: EndpointMeta<I, O>\n): Endpoint<I, O> {\n  const api = apiDefinition.api;\n  return {\n    api,\n    group,\n    endpoint: endpoint.endpoint,\n    functionName: endpoint.functionName,\n    inputSchema: endpoint.inputSchema,\n    outputSchema: endpoint.outputSchema,\n    sampleParams: endpoint.sampleParams,\n    endpointDescription: endpoint.endpointDescription,\n    cacheStrategy: group.cacheStrategy,\n    urlTemplate: `${api.baseUrl}${endpoint.endpoint}`,\n    id: `${api.name}:${endpoint.functionName}`,\n  };\n}\n","/**\n * @fileoverview Fetch Function Factory\n *\n * Creates strongly-typed fetch functions from metadata objects.\n * This is a pure factory with no React Query dependencies.\n */\n\nimport type {\n  ApiDefinition,\n  EndpointGroupMeta,\n  EndpointMeta,\n} from \"@/apis/types\";\nimport { fetchDottie } from \"@/shared/fetching\";\nimport { buildDescriptor } from \"./buildDescriptor\";\nimport type { FetchFunctionParams } from \"./types\";\n\n/**\n * Creates a strongly-typed fetch function from three metadata objects.\n */\nexport function createFetchFunction<I, O>(\n  apiDefinition: ApiDefinition,\n  group: EndpointGroupMeta,\n  endpoint: EndpointMeta<I, O>\n): (params?: FetchFunctionParams<I>) => Promise<O> {\n  const descriptor = buildDescriptor(apiDefinition, group, endpoint);\n\n  return (params?: FetchFunctionParams<I>): Promise<O> => {\n    return fetchDottie<I, O>({\n      endpoint: descriptor,\n      ...params,\n    });\n  };\n}\n","/**\n * @fileoverview Cache Flush Date Hooks for WS-Dottie\n *\n * Provides React Query hooks for polling cache flush dates and invalidating\n * queries when flush dates change. This is specifically for WSF APIs that\n * use cache flush dates to indicate when static data has been updated.\n *\n * Uses internal fetch functions created with createFetchFunction to break\n * circular dependencies. These are separate from the public-facing fetch\n * functions exported from API modules.\n */\n\nimport type { UseQueryResult } from \"@tanstack/react-query\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport React, { useEffect } from \"react\";\nimport { apis } from \"@/apis/shared/apis\";\nimport type { CacheFlushDateOutput } from \"@/apis/shared/cacheFlushDate\";\nimport {\n  cacheFlushDateFaresGroup,\n  cacheFlushDateFaresMeta,\n} from \"@/apis/wsf-fares/cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport {\n  cacheFlushDateScheduleGroup,\n  cacheFlushDateScheduleMeta,\n} from \"@/apis/wsf-schedule/cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport {\n  cacheFlushDateTerminalsGroup,\n  cacheFlushDateTerminalsMeta,\n} from \"@/apis/wsf-terminals/cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport {\n  cacheFlushDateVesselsGroup,\n  cacheFlushDateVesselsMeta,\n} from \"@/apis/wsf-vessels/cacheFlushDate/shared/cacheFlushDate.endpoints\";\nimport { createFetchFunction } from \"@/shared/factories/createFetchFunction\";\n\ntype CacheFlushApiName =\n  | \"wsf-fares\"\n  | \"wsf-schedule\"\n  | \"wsf-terminals\"\n  | \"wsf-vessels\";\n\ntype CacheFlushFetchFn = () => Promise<string>;\n\n// Internal fetch functions created using createFetchFunction\n// These are separate from the public-facing functions exported from API modules\n// This breaks the circular dependency because createFetchFunction has no\n// dependencies on cache or React hooks\nconst internalFetchCacheFlushDateFares = createFetchFunction(\n  apis[\"wsf-fares\"],\n  cacheFlushDateFaresGroup,\n  cacheFlushDateFaresMeta\n);\n\nconst internalFetchCacheFlushDateSchedule = createFetchFunction(\n  apis[\"wsf-schedule\"],\n  cacheFlushDateScheduleGroup,\n  cacheFlushDateScheduleMeta\n);\n\nconst internalFetchCacheFlushDateTerminals = createFetchFunction(\n  apis[\"wsf-terminals\"],\n  cacheFlushDateTerminalsGroup,\n  cacheFlushDateTerminalsMeta\n);\n\nconst internalFetchCacheFlushDateVessels = createFetchFunction(\n  apis[\"wsf-vessels\"],\n  cacheFlushDateVesselsGroup,\n  cacheFlushDateVesselsMeta\n);\n\n// Strategy pattern: map API names to fetch functions\n// Now accepts fetchMode parameter to match the underlying hook configuration\nconst CACHE_FLUSH_STRATEGIES: Record<\n  CacheFlushApiName,\n  (fetchMode?: \"native\" | \"jsonp\") => CacheFlushFetchFn\n> = {\n  \"wsf-fares\":\n    (fetchMode = \"native\") =>\n    async () => {\n      const result = await internalFetchCacheFlushDateFares({\n        fetchMode,\n        validate: false,\n        logMode: \"none\",\n      });\n      return normalizeFlushDate(result);\n    },\n  \"wsf-schedule\":\n    (fetchMode = \"native\") =>\n    async () => {\n      const result = await internalFetchCacheFlushDateSchedule({\n        fetchMode,\n        validate: false,\n        logMode: \"none\",\n      });\n      return normalizeFlushDate(result);\n    },\n  \"wsf-terminals\":\n    (fetchMode = \"native\") =>\n    async () => {\n      const result = await internalFetchCacheFlushDateTerminals({\n        fetchMode,\n        validate: false,\n        logMode: \"none\",\n      });\n      return normalizeFlushDate(result);\n    },\n  \"wsf-vessels\":\n    (fetchMode = \"native\") =>\n    async () => {\n      const result = await internalFetchCacheFlushDateVessels({\n        fetchMode,\n        validate: false,\n        logMode: \"none\",\n      });\n      return normalizeFlushDate(result);\n    },\n} as const;\n\n// Getter that retrieves the fetch function from the strategy map\nconst getCachedFetchFunction = (\n  apiName: CacheFlushApiName,\n  fetchMode?: \"native\" | \"jsonp\"\n): CacheFlushFetchFn => {\n  const strategy = CACHE_FLUSH_STRATEGIES[apiName];\n  if (!strategy) {\n    throw new Error(`No cache flush strategy found for API: ${apiName}`);\n  }\n  return strategy(fetchMode);\n};\n\nconst CACHE_FLUSH_ENDPOINT_IDS: Record<CacheFlushApiName, string> = {\n  \"wsf-fares\": \"wsf-fares:fetchCacheFlushDateFares\",\n  \"wsf-schedule\": \"wsf-schedule:fetchCacheFlushDateSchedule\",\n  \"wsf-terminals\": \"wsf-terminals:fetchCacheFlushDateTerminals\",\n  \"wsf-vessels\": \"wsf-vessels:fetchCacheFlushDateVessels\",\n} as const;\n\nconst normalizeFlushDate = (value: CacheFlushDateOutput): string => {\n  if (!value) {\n    return \"\";\n  }\n  return value instanceof Date ? value.toISOString() : String(value);\n};\n\n/**\n * Hook to poll cache flush date endpoint\n *\n * @param apiName - The name of the API (e.g., \"wsf-vessels\")\n * @param fetchMode - Optional fetch mode to use (\"native\" or \"jsonp\").\n *                    Defaults to \"native\". Should match the fetchMode used\n *                    by the underlying hook to ensure consistent behavior.\n */\nexport const useCacheFlushDate = (\n  apiName: string,\n  fetchMode?: \"native\" | \"jsonp\"\n): UseQueryResult<string, Error> => {\n  const isCacheFlushApi: boolean =\n    apiName === \"wsf-fares\" ||\n    apiName === \"wsf-schedule\" ||\n    apiName === \"wsf-terminals\" ||\n    apiName === \"wsf-vessels\";\n\n  const fetchFn = isCacheFlushApi\n    ? getCachedFetchFunction(apiName as CacheFlushApiName, fetchMode)\n    : undefined;\n\n  const endpointId =\n    CACHE_FLUSH_ENDPOINT_IDS[apiName as CacheFlushApiName] || \"no-cache-flush\";\n\n  return useQuery({\n    queryKey: [endpointId, fetchMode], // Include fetchMode in query key\n    queryFn: fetchFn ?? (() => Promise.resolve(\"\")),\n    refetchInterval: isCacheFlushApi ? 5 * 60 * 1000 : undefined,\n    staleTime: isCacheFlushApi ? 5 * 60 * 1000 : undefined,\n    refetchOnWindowFocus: false,\n  });\n};\n\n/**\n * Hook to handle cache invalidation when flush date changes\n */\nexport const useInvalidateOnFlushChange = (\n  endpointId: string,\n  flushDateQuery?: UseQueryResult<string, Error>\n): void => {\n  const queryClient = useQueryClient();\n  const previousFlushDateRef = React.useRef<string | null>(null);\n\n  useEffect(() => {\n    if (!flushDateQuery?.data) {\n      return;\n    }\n\n    const currentFlushDate = flushDateQuery.data;\n    if (\n      previousFlushDateRef.current !== null &&\n      previousFlushDateRef.current !== currentFlushDate\n    ) {\n      queryClient.invalidateQueries({ queryKey: [endpointId] });\n    }\n    previousFlushDateRef.current = currentFlushDate;\n  }, [flushDateQuery?.data, queryClient, endpointId]);\n};\n","/**\n * @fileoverview Cache Strategy Configurations\n *\n * Cache strategy configurations for different data update frequencies.\n * These are used by React Query hooks to determine caching behavior.\n */\n\nexport const cacheStrategies = {\n  REALTIME: {\n    staleTime: 5 * 1000, // 5 seconds\n    gcTime: 60 * 60 * 1000, // 1 hour\n    refetchInterval: 5 * 1000, // 5 seconds\n    retry: 2,\n    retryDelay: 5 * 1000, // 5 seconds\n  },\n  FREQUENT: {\n    staleTime: 5 * 60 * 1000, // 5 minutes\n    gcTime: 60 * 60 * 1000, // 1 hour\n    refetchInterval: 5 * 60 * 1000, // 5 minutes\n    retry: 3,\n    retryDelay: 5 * 1000, // 5 seconds\n  },\n  MODERATE: {\n    staleTime: 60 * 60 * 1000, // 1 hour\n    gcTime: 2 * 24 * 60 * 60 * 1000, // 2 days\n    refetchInterval: 60 * 60 * 1000, // 1 hour\n    retry: 3,\n    retryDelay: 60 * 1000, // 1 minute\n  },\n  STATIC: {\n    staleTime: 24 * 60 * 60 * 1000, // 1 day\n    gcTime: 2 * 24 * 60 * 60 * 1000, // 2 days\n    refetchInterval: 24 * 60 * 60 * 1000, // 1 day\n    retry: 2,\n    retryDelay: 5 * 1000, // 5 seconds\n  },\n} as const;\n","/**\n * @fileoverview React Query Hook Factory\n *\n * Creates strongly-typed React Query hooks from metadata objects.\n * Handles both regular hooks and cache-flush-date-aware hooks.\n */\n\nimport type { UseQueryResult } from \"@tanstack/react-query\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n  ApiDefinition,\n  EndpointGroupMeta,\n  EndpointMeta,\n} from \"@/apis/types\";\nimport { useCacheFlushDate, useInvalidateOnFlushChange } from \"@/shared/cache\";\nimport { buildDescriptor } from \"./buildDescriptor\";\nimport { createFetchFunction } from \"./createFetchFunction\";\nimport { cacheStrategies } from \"./strategies\";\nimport type { FetchFunctionParams, QueryHookOptions } from \"./types\";\n\n/**\n * Determines if an endpoint should use cache flush date invalidation.\n */\nfunction shouldUseCacheFlushDate(\n  apiDefinition: ApiDefinition,\n  group: EndpointGroupMeta\n): boolean {\n  const isWsfApi = apiDefinition.api.name.startsWith(\"wsf-\");\n\n  if (\n    group.name === \"cache-flush-date\" ||\n    group.name === \"schedule-cache-flush-date\"\n  ) {\n    return false;\n  }\n\n  return isWsfApi && group.cacheStrategy === \"STATIC\";\n}\n\n/**\n * Creates a strongly-typed React Query hook from three metadata objects.\n */\nexport function createHook<I, O>(\n  apiDefinition: ApiDefinition,\n  group: EndpointGroupMeta,\n  endpoint: EndpointMeta<I, O>\n): (\n  params?: FetchFunctionParams<I>,\n  options?: QueryHookOptions<O>\n) => UseQueryResult<O, Error> {\n  const descriptor = buildDescriptor(apiDefinition, group, endpoint);\n  const fetchFn = createFetchFunction(apiDefinition, group, endpoint);\n  const useCacheFlush = shouldUseCacheFlushDate(apiDefinition, group);\n\n  if (useCacheFlush) {\n    return (\n      params?: FetchFunctionParams<I>,\n      options?: QueryHookOptions<O>\n    ): UseQueryResult<O, Error> => {\n      const flushDateQuery = useCacheFlushDate(\n        apiDefinition.api.name,\n        params?.fetchMode\n      );\n      useInvalidateOnFlushChange(descriptor.id, flushDateQuery);\n\n      return useQuery({\n        queryKey: [descriptor.id, params?.params ?? null],\n        queryFn: () => fetchFn(params),\n        ...cacheStrategies.STATIC,\n        refetchOnWindowFocus: false,\n        ...options,\n      });\n    };\n  }\n\n  return (\n    params?: FetchFunctionParams<I>,\n    options?: QueryHookOptions<O>\n  ): UseQueryResult<O, Error> => {\n    return useQuery({\n      queryKey: [descriptor.id, params?.params ?? null],\n      queryFn: () => fetchFn(params),\n      ...cacheStrategies[group.cacheStrategy as keyof typeof cacheStrategies],\n      refetchOnWindowFocus: false,\n      ...options,\n    });\n  };\n}\n"]}