{
  "version": 3,
  "sources": ["../src/index.ts", "../src/lib/parsers/csw/parse-csw-capabilities.ts", "../src/lib/parsers/csw/parse-exception-report.ts", "../src/csw-capabilities-loader.ts", "../src/lib/parsers/csw/parse-csw-domain.ts", "../src/csw-domain-loader.ts", "../src/lib/parsers/csw/parse-csw-records.ts", "../src/csw-records-loader.ts", "../src/lib/parsers/wms/parse-wms-error.ts", "../src/wms-error-loader.ts", "../src/lib/parsers/wms/parse-wms-capabilities.ts", "../src/lib/parsers/xml/parse-xml-helpers.ts", "../src/wms-capabilities-loader.ts", "../src/lib/parsers/wms/parse-wms-features.ts", "../src/wip/wms-feature-info-loader.ts", "../src/lib/parsers/wms/parse-wms-layer-description.ts", "../src/wip/wms-layer-description-loader.ts", "../src/lib/parsers/wfs/parse-wfs-capabilities.ts", "../src/wfs-capabilities-loader.ts", "../src/lib/parsers/gml/parse-gml.ts", "../src/lib/parsers/gml/deep-strict-equal.ts", "../src/gml-loader.ts", "../src/wms-source.ts", "../src/arcgis/arcgis-server.ts", "../src/arcgis/arcgis-image-source.ts", "../src/lib/deprecated/create-image-source.ts"],
  "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// CSW - Catalog Service for the Web\n\nexport type {CSWLoaderOptions} from './csw-capabilities-loader';\n\nexport type {CSWCapabilities} from './csw-capabilities-loader';\nexport {CSWCapabilitiesLoader} from './csw-capabilities-loader';\n\nexport type {CSWDomain} from './csw-domain-loader';\nexport {CSWDomainLoader} from './csw-domain-loader';\n\nexport type {CSWRecords} from './csw-records-loader';\nexport {CSWRecordsLoader} from './csw-records-loader';\n\n// WMS - Web Map Service\n\nexport {WMSErrorLoader} from './wms-error-loader';\n\nexport type {\n  WMSCapabilities,\n  WMSLayer,\n  WMSBoundingBox,\n  WMSDimension\n} from './wms-capabilities-loader';\nexport type {WMSCapabilitiesLoaderOptions} from './wms-capabilities-loader';\nexport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\n\nexport type {WMSFeatureInfo as _WMSFeatureInfo} from './wip/wms-feature-info-loader';\nexport {WMSFeatureInfoLoader as _WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\n\nexport type {WMSLayerDescription as _WMSLayerDescription} from './wip/wms-layer-description-loader';\nexport {WMSLayerDescriptionLoader as _WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\n// WMTS - Web Map Tile Service\n\n// export type {WMTSLoaderOptions as _WMTSLoaderOptions} from './wip/wmts-capabilities-loader';\n// export type {WMTSCapabilities as _WMTSCapabilities} from './wip/wmts-capabilities-loader';\n// export {WMTSCapabilitiesLoader as _WMTSCapabilitiesLoader} from './wip/wmts-capabilities-loader';\n\n// WFS - Web Feature Service\n\nexport type {WFSLoaderOptions as _WFSLoaderOptions} from './wfs-capabilities-loader';\nexport type {WFSCapabilities as _WFSCapabilities} from './wfs-capabilities-loader';\nexport {WFSCapabilitiesLoader as _WFSCapabilitiesLoader} from './wfs-capabilities-loader';\n\n// GML - Geographic Markup Language\n\nexport type {GeoJSON as _GeoJSON} from '@loaders.gl/schema';\nexport type {GMLLoaderOptions as _GMLLoaderOptions} from './gml-loader';\nexport {GMLLoader as _GMLLoader} from './gml-loader';\n\n// EXPERIMENTAL: DATA SOURCES\n\n// OGC Services\n\n// export {CSWSource} from './csw-source';\nexport {WMSSource, WMSImageSource} from './wms-source';\n\n// ArcGIS SourceLoaders\n\nexport {getArcGISServices as _getArcGISServices} from './arcgis/arcgis-server';\nexport {ArcGISImageServerSource as _ArcGISImageServerSource} from './arcgis/arcgis-image-source';\n\nexport {ImageSource} from '@loaders.gl/loader-utils';\nexport type {ImageType} from '@loaders.gl/images';\nexport {createImageSource} from './lib/deprecated/create-image-source';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\n// CSW:GetCapabilitiesResponse\n\n/** All capabilities of a CSW service - response to a CSW `GetCapabilities` data structure extracted from XML */\nexport type CSWCapabilities = {\n  serviceIdentification: {\n    title: string;\n    serviceTypeVersion: string;\n    serviceType: string;\n  };\n\n  serviceProvider: {\n    providerName: string;\n    providerSite: string;\n    serviceContact: {\n      individualName: string;\n      positionName: string;\n      contactInfo: {\n        address: {\n          administrativeArea: string;\n          city: string;\n          country: string;\n          deliveryPoint: string;\n          electronicMailAddress: string;\n          postalCode: string;\n        };\n        phone: {\n          voice: string;\n        };\n      };\n    };\n  };\n\n  operationsMetadata: {\n    GetCapabilities: any;\n    GetFeatureInfo: any;\n    GetTile: any;\n  };\n\n  contents: {\n    layers: {\n      abstract: string;\n      identifier: string;\n      title: string;\n      formats: string[];\n      styles: {\n        identifier: string;\n        isDefault: string;\n        title: string;\n        abstract?: string;\n      }[];\n      bounds: {\n        left: number;\n        right: number;\n        bottom: number;\n        top: number;\n      };\n      tileMatrixSetLinks: {\n        tileMatrixSet: string;\n      }[];\n      tileMatrixSets: {\n        identifier: string;\n        matrixIds: {\n          identifier: string;\n          matrixHeight: number;\n          matrixWidth: number;\n          scaleDenominator: number;\n          tileWidth: number;\n          tileHeight: number;\n          topLeftCorner: {\n            lon: number;\n            lat: number;\n          };\n        }[];\n      };\n    }[];\n  };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWCapabilities(text: string, options?: XMLLoaderOptions): CSWCapabilities {\n  const parsedXML = XMLLoader.parseTextSync?.(text, {\n    ...options,\n    xml: {\n      ...options?.xml,\n      removeNSPrefix: true,\n      uncapitalizeKeys: true\n    }\n  });\n\n  parseExceptionReport(parsedXML);\n\n  const xmlCapabilities: any = parsedXML.capabilities || parsedXML;\n  return xmlCapabilities;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import type {XMLLoaderOptions} from '@loaders.gl/xml';\n// import {XMLLoader} from '@loaders.gl/xml';\n\n/**\n * Parses a typed data structure from raw XML for `GetDomain` response\n * @note Error handlings is fairly weak\n */\nexport function parseExceptionReport(parsedXML: any): void {\n  // const parsedXML = XMLLoader.parseTextSync?.(text, {\n  //   ...options,\n  //   xml: {\n  //     ...options?.xml,\n  //     removeNSPrefix: true,\n  //     uncapitalizeKeys: true\n  //   }\n  // });\n\n  const exceptionReport: any = parsedXML.exceptionReport;\n  if (!exceptionReport) {\n    return;\n  }\n  const errorMessage =\n    exceptionReport.exception?.exceptionText ||\n    exceptionReport.exception?.exceptionCode ||\n    exceptionReport.exception?.locator ||\n    'server error';\n\n  throw new Error(`Catalog Server: ${errorMessage}`);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport type {CSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';\nimport {parseCSWCapabilities} from './lib/parsers/csw/parse-csw-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// parsed data type\nexport type {CSWCapabilities};\n\n/** CSW loader options */\nexport type CSWLoaderOptions = XMLLoaderOptions & {\n  csw?: {};\n};\n\n/**\n * Loader for the response to the CSW GetCapability request\n */\nexport const CSWCapabilitiesLoader = {\n  dataType: null as unknown as CSWCapabilities,\n  batchType: null as never,\n\n  id: 'csw-capabilities',\n  name: 'CSW Capabilities',\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    csw: {}\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>\n    parseCSWCapabilities(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWCapabilities(text, options)\n} as const satisfies LoaderWithParser<CSWCapabilities, never, CSWLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\n/** Describes the values of resource */\nexport type CSWDomain = {\n  domainValues: {\n    type: string;\n    propertyName: string;\n    values: {\n      [key: string]: unknown;\n    }[];\n  }[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetDomain` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWDomain(text: string, options?: XMLLoaderOptions): CSWDomain {\n  const parsedXML = XMLLoader.parseTextSync?.(text, {\n    ...options,\n    xml: {\n      ...options?.xml,\n      removeNSPrefix: true,\n      uncapitalizeKeys: true,\n      arrayPaths: [\n        'GetDomainResponse.DomainValues',\n        'GetDomainResponse.DomainValues.ListOfValues.value'\n      ]\n    }\n  });\n\n  parseExceptionReport(parsedXML);\n\n  const xmlDomain: any = parsedXML.getDomainResponse;\n  for (const domainValue of xmlDomain.domainValues) {\n    // Drop the nested <listOfValues><value><value><listOfValues>  => values[]\n    domainValue.values = domainValue.listOfValues?.value;\n    delete domainValue.listOfValues;\n  }\n  return xmlDomain as CSWDomain;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport type {CSWDomain} from './lib/parsers/csw/parse-csw-domain';\nimport {parseCSWDomain} from './lib/parsers/csw/parse-csw-domain';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type {CSWDomain};\n\nexport type CSWLoaderOptions = XMLLoaderOptions & {\n  csw?: {};\n};\n\n/**\n * Loader for the response to the CSW GetCapability request\n */\nexport const CSWDomainLoader = {\n  dataType: null as unknown as CSWDomain,\n  batchType: null as never,\n\n  id: 'csw-domain',\n  name: 'CSW Domain',\n\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    csw: {}\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>\n    parseCSWDomain(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWDomain(text, options)\n} as const satisfies LoaderWithParser<CSWDomain, never, CSWLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoaderOptions, convertXMLFieldToArrayInPlace, XMLLoader} from '@loaders.gl/xml';\nimport {parseExceptionReport} from './parse-exception-report';\n\nexport type CSWRecords = {\n  searchStatus: {\n    timestamp?: string;\n  };\n  searchResults: {\n    numberOfRecordsMatched: number;\n    numberOfRecordsReturned: number;\n    elementSet: string;\n    nextRecord: number;\n  };\n  records: {\n    type: string;\n    title: string;\n    abstract: string;\n    subject: string[];\n    boundingBoxes: {\n      crs: string;\n      value: [number, number, number, number];\n    }[];\n    references: {\n      value: string;\n      scheme: string;\n    }[];\n  }[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetRecords` response\n * @note Error handlings is fairly weak\n */\nexport function parseCSWRecords(text: string, options?: XMLLoaderOptions): CSWRecords {\n  const parsedXML = XMLLoader.parseTextSync?.(text, {\n    ...options,\n    xml: {\n      ...options?.xml,\n      removeNSPrefix: true,\n      uncapitalizeKeys: true,\n      arrayPaths: [],\n      _fastXML: {\n        ...options?.xml?._fastXML,\n        parseAttributeValue: true\n      }\n    }\n  });\n\n  parseExceptionReport(parsedXML);\n\n  const xmlRecords: any = parsedXML.getRecordsResponse;\n\n  // Move results to top\n  const elementSet = xmlRecords.searchResults.elementSet;\n  const recordsFieldName = `${elementSet}Record`;\n  xmlRecords.records = xmlRecords.searchResults[recordsFieldName];\n  delete xmlRecords.searchResults[recordsFieldName];\n\n  convertXMLFieldToArrayInPlace(xmlRecords, 'records');\n\n  for (const record of xmlRecords.records) {\n    record.boundingBoxes = record.boundingBox;\n    delete record.boundingBox;\n\n    convertXMLFieldToArrayInPlace(record, 'boundingBoxes');\n\n    for (const boundingBox of record.boundingBoxes) {\n      boundingBox.value = [\n        boundingBox.upperCorner[0],\n        boundingBox.upperCorner[1],\n        boundingBox.lowerCorner[0],\n        boundingBox.lowerCorner[1]\n      ];\n      delete boundingBox.upperCorner;\n      delete boundingBox.lowerCorner;\n    }\n  }\n\n  return xmlRecords as CSWRecords;\n}\n\nexport function renameXMLTags(xml: any, renameKeys: Record<string, string>): void {\n  for (const [oldKey, newKey] of Object.entries(renameKeys)) {\n    xml[newKey] = xml[oldKey];\n    delete xml[oldKey];\n  }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport type {CSWRecords} from './lib/parsers/csw/parse-csw-records';\nimport {parseCSWRecords} from './lib/parsers/csw/parse-csw-records';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {CSWRecords};\n\nexport type CSWLoaderOptions = XMLLoaderOptions & {\n  csw?: {};\n};\n\n/**\n * Loader for the response to the CSW GetCapability request\n */\nexport const CSWRecordsLoader = {\n  dataType: null as unknown as CSWRecords,\n  batchType: null as never,\n\n  id: 'csw-records',\n  name: 'CSW Records',\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.csw_xml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    csw: {}\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: CSWLoaderOptions) =>\n    parseCSWRecords(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: CSWLoaderOptions) => parseCSWRecords(text, options)\n} as const satisfies LoaderWithParser<CSWRecords, never, CSWLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/**\n * Extract an error message from WMS error response XML\n * @param text\n * @param options\n * @returns a string with a human readable message\n */\nexport function parseWMSError(text: string, options): string {\n  const parsedXML = XMLLoader.parseTextSync?.(text, options);\n  const serviceExceptionXML =\n    parsedXML?.ServiceExceptionReport?.ServiceException ||\n    parsedXML?.['ogc:ServiceExceptionReport']?.['ogc:ServiceException'];\n  // Sigh, can be either a string or an object\n  const message =\n    typeof serviceExceptionXML === 'string'\n      ? serviceExceptionXML\n      : serviceExceptionXML.value || serviceExceptionXML.code || 'Unknown error';\n  return message;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport {parseWMSError} from './lib/parsers/wms/parse-wms-error';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type WMSLoaderOptions = LoaderOptions & {\n  wms?: {\n    /** By default the error loader will throw an error with the parsed error message */\n    throwOnError?: boolean;\n    /** Do not add any text to errors */\n    minimalErrors?: boolean;\n  };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSErrorLoader = {\n  dataType: null as unknown as string,\n  batchType: null as never,\n\n  id: 'wms-error',\n  name: 'WMS Error',\n\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.se_xml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    wms: {\n      throwOnError: false\n    }\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): Promise<string> =>\n    parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n  parseSync: (arrayBuffer: ArrayBuffer, options?: WMSLoaderOptions): string =>\n    parseTextSync(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: WMSLoaderOptions): string => parseTextSync(text, options)\n} as const satisfies LoaderWithParser<string, never, WMSLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n\nfunction parseTextSync(text: string, options?: WMSLoaderOptions): string {\n  const wmsOptions: WMSLoaderOptions['wms'] = {...WMSErrorLoader.options.wms, ...options?.wms};\n  const error = parseWMSError(text, wmsOptions);\n  const message = wmsOptions.minimalErrors ? error : `WMS Service error: ${error}`;\n  if (wmsOptions.throwOnError) {\n    throw new Error(message);\n  }\n  return message;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {\n  getXMLArray,\n  getXMLStringArray,\n  getXMLInteger,\n  getXMLFloat,\n  getXMLBoolean\n} from '../xml/parse-xml-helpers';\n\n/** All capabilities of a WMS service - response to a WMS `GetCapabilities` data structure extracted from XML */\nexport type WMSCapabilities = {\n  /** Version of the WMS service */\n  version?: string; // '1.3.0' | '1.1.1' | '1.1.0' | '1.0.0'\n  /** A short name for the service */\n  name: string;\n  /** A human readable name for the service */\n  title?: string;\n  /** A more extensive description of the service */\n  abstract?: string;\n  /** A set of keywords e.g. for searching services */\n  keywords: string[];\n  /** A field of unspecified format, if present describes any access constraints required to use the service. */\n  accessConstraints?: string;\n  /** A field of unspecified format, if present describes any fees associated with the use of the service */\n  fees?: string;\n  /** If present, the max number of layers that can be rendered by the service */\n  layerLimit?: number;\n  /** If present, the widest image that can be rendered by the service */\n  maxWidth?: number;\n  /** If present, the tallest image that can be rendered by the service */\n  maxHeight?: number;\n  /** Hierarchical list of layers. */\n  layers: WMSLayer[];\n  /** A map with information about supported WMS requests. If a record is present, the request is supported by the service */\n  requests: Record<string, WMSRequest>;\n  /** Information about any exceptions that the service will report (HTTP status != 2xx) */\n  exceptions?: WMSExceptions;\n  /** Only if `options.json`: raw untyped JSON parsed from XML. Can include information not extracted in the typed response. */\n  json?: Record<string, unknown>;\n  /** Only if `options.xml`, the unparsed XML string can be requested */\n  xml?: string;\n};\n\n/**\n * Metadata about a layer\n * Layers inherit many properties from their parent layers, see description of individual props for details.\n * @see https://www.ogc.org/standard/wms/ 7.2.4.6\n */\nexport type WMSLayer = {\n  /** The title is a human readable name. It is mandatory on each layer. Not inherited.  */\n  title: string;\n  /** A layer is renderable if it has a name. A named parent layer will render all its sublayers. Not inherited. */\n  name?: string;\n  /** A narrative description of the map layer. */\n  abstract?: string;\n  /** A set of keywords e.g. for searching layers */\n  keywords: string[];\n  /** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations.  Defined or inherited. */\n  geographicBoundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];\n  /** Supported CRS. Either defined or inherited. */\n  crs?: string[];\n  /** Bounding boxes in specific CRS:es */\n  boundingBoxes?: WMSBoundingBox[];\n\n  // minScale: number;\n  // maxScale: number;\n  // dimensions: ?? 7.2.4.6.10\n  // MetadataURL\n  // Attribution\n  // Identifier and AuthorityURL\n  // FeatureListURL\n  // DataURL\n\n  /** any extra dimension such as time */\n  dimensions?: WMSDimension[];\n\n  /** Whether queries can be performed on the layer */\n  queryable?: boolean;\n  /** `false` if layer has significant no-data areas that the client can display as transparent. */\n  opaque?: boolean;\n  /** WMS cascading allows server to expose layers coming from other WMS servers as if they were local layers */\n  cascaded?: boolean;\n  // noSubsets: boolean\n  // fixedWith: number\n  // fixedHeight: number\n\n  /** A list of styles. @note not yet supported by WMSCapabilitiesLoader */\n  styles?: unknown[];\n\n  /** Sublayers - these inherit crs and boundingBox) if not overridden) */\n  layers?: WMSLayer[];\n};\n\n/**\n * A bounding box specifies the coordinate range for data in the layer.\n * No data is available outside the bounding box.\n */\nexport type WMSBoundingBox = {\n  /** CRS indicates the Layer CRS that applies to this bounding box. */\n  crs: string;\n  /** `[[w, s], [e, n]]`, indicates the limits of the bounding box using the axis units and order of the specified CRS. */\n  boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n  /** Spatial horizontal resolution of data in same units as bounding box */\n  xResolution?: number;\n  /** Spatial vertical resolution of data in same units as bounding box */\n  yResolution?: number;\n};\n\n/**\n * An optional dimension that can be queried using the `name=...` parameter\n * Note that layers that have at least one dimension without `default` value\n * become unrenderable unless the dimension value is supplied to GetMap requests.\n */\nexport type WMSDimension = {\n  /** name of dimension, becomes a valid parameter key for this layer */\n  name: string;\n  /** Textual units for this dimensional axis */\n  units: string;\n  /** Unit symbol for this dimensional axis */\n  unitSymbol?: string;\n  /** Default value if no value is supplied. If dimension lacks defaultValue, requests fail if no value is supplied */\n  defaultValue?: string;\n  /** Can multiple values of the dimension be requested? */\n  multipleValues?: boolean;\n  /* Will nearest values will be substituted when out of range, if false exact values are required */\n  nearestValue?: boolean;\n  /** A special value \"current\" is supported, typically for time dimension */\n  current?: boolean;\n  /** Text content indicating available values for dimension */\n  extent: string;\n};\n\n/** Metadata about a supported WMS request  */\nexport type WMSRequest = {\n  /** MIMEtypes that can be returned by this request. */\n  mimeTypes: string[];\n};\n\nexport type WMSExceptions = {\n  /** MIME types for exception response payloads. */\n  mimeTypes: string[];\n};\n\nexport type ParseWMSCapabilitiesOptions = {\n  /** Add inherited layer information to sub layers */\n  inheritedLayerProps?: boolean;\n  /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n  includeRawJSON?: boolean;\n  /** Include the original XML document text. May contain additional information. */\n  includeXMLText?: boolean;\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSCapabilities(\n  xmlText: string,\n  options?: ParseWMSCapabilitiesOptions\n): WMSCapabilities {\n  const parsedXML = XMLLoader.parseTextSync?.(xmlText, options);\n  const xmlCapabilities: any =\n    parsedXML.WMT_MS_Capabilities || parsedXML.WMS_Capabilities || parsedXML;\n  const capabilities = extractCapabilities(xmlCapabilities);\n  // In case the processed, normalized capabilities do not contain everything,\n  // the user can get the parsed XML structure.\n  if (options?.inheritedLayerProps) {\n    // Traverse layers and inject missing props from parents\n    for (const layer of capabilities.layers) {\n      addInheritedLayerProps(layer, null);\n    }\n    // Not yet implemented\n  }\n\n  if (options?.includeRawJSON) {\n    capabilities.json = xmlCapabilities;\n  }\n\n  if (options?.includeXMLText) {\n    capabilities.xml = xmlText;\n  }\n\n  return capabilities;\n}\n\n/** Extract typed capability data from XML */\nfunction extractCapabilities(xml: any): WMSCapabilities {\n  const capabilities: WMSCapabilities = {\n    version: String(xml.version || ''),\n    name: String(xml.Service?.Name || 'unnamed'),\n    title: xml.Service?.Title ? String(xml.Service?.Title) : undefined,\n    abstract: xml.Service?.Abstract ? String(xml.Service?.Abstract) : undefined,\n    keywords: getXMLStringArray(xml.Service?.KeywordList?.Keyword),\n    fees: xml.Service?.Fees ? JSON.stringify(xml.Service?.Fees) : undefined,\n    accessConstraints: xml.Service?.AccessConstraints\n      ? JSON.stringify(xml.Service?.AccessConstraints)\n      : undefined,\n    layerLimit: getXMLInteger(xml.Service?.LayerLimit),\n    maxWidth: getXMLInteger(xml.Service?.maxWidth),\n    maxHeight: getXMLInteger(xml.Service?.maxHeight),\n    layers: [],\n    requests: extractRequests(xml.Capability?.Request),\n    exceptions: extractExceptions(xml.Exception)\n    // contact field is a mess of largely irrelevant information, put it last\n    // contact: xml.Service?.Contact ? JSON.stringify(xml.Service?.Contact) : undefined,\n  };\n\n  // LAYERS\n  const xmlLayers = getXMLArray(xml.Capability?.Layer);\n  for (const xmlSubLayer of xmlLayers) {\n    capabilities.layers.push(extractLayer(xmlSubLayer));\n  }\n\n  // Clean up object\n  for (const [key, value] of Object.entries(capabilities)) {\n    if (value === undefined) {\n      delete capabilities[key];\n    }\n  }\n\n  return capabilities;\n}\n\n/** Extract typed request metadata from XML requests field */\nfunction extractRequests(xmlRequests: any): Record<string, WMSRequest> {\n  const requests: Record<string, WMSRequest> = {};\n  for (const [name, xmlRequest] of Object.entries(xmlRequests || {}) as any) {\n    const mimeTypes = getXMLStringArray(xmlRequest?.Format);\n    requests[name] = {mimeTypes};\n  }\n  return requests;\n}\n\nfunction extractExceptions(xmlException: any): WMSExceptions | undefined {\n  const xmlExceptionFormats = getXMLArray(xmlException?.Format);\n  if (xmlExceptionFormats.length > 0) {\n    return {\n      mimeTypes: getXMLStringArray(xmlException)\n    };\n  }\n  return undefined;\n}\n\n/** Extract request data */\n// eslint-disable-next-line complexity, max-statements\nfunction extractLayer(xmlLayer: any): WMSLayer {\n  const layer: WMSLayer = {\n    // All layers must have a title\n    title: String(xmlLayer?.Title || ''),\n    // Name is required only if renderable\n    name: xmlLayer?.Name && String(xmlLayer?.Name),\n    abstract: xmlLayer?.Name && String(xmlLayer?.Abstract),\n    keywords: getXMLStringArray(xmlLayer.KeywordList?.Keyword)\n  };\n\n  // WMS 1.3.0 changes SRS to CRS\n  const crs = xmlLayer?.CRS || xmlLayer?.SRS;\n  if (crs && Array.isArray(crs) && crs.every((_) => typeof _ === 'string')) {\n    layer.crs = crs;\n  }\n\n  // v1.3.0 extract simple geographic bounding box\n  let geographicBoundingBox =\n    xmlLayer?.EX_GeographicBoundingBox && extractEXBoundingBox(xmlLayer?.EX_GeographicBoundingBox);\n  if (geographicBoundingBox) {\n    layer.geographicBoundingBox = geographicBoundingBox;\n  }\n\n  // v1.1.1 extract simple geographic bounding box\n  geographicBoundingBox =\n    xmlLayer?.LatLonBoundingBox && extractLatLonBoundingBox(xmlLayer?.LatLonBoundingBox);\n  if (geographicBoundingBox) {\n    layer.geographicBoundingBox = geographicBoundingBox;\n  }\n\n  // Extract per-CRS bounding boxes\n  const boundingBoxes = xmlLayer?.BoundingBox && extractWMSBoundingBoxes(xmlLayer?.BoundingBox);\n  if (boundingBoxes && boundingBoxes.length > 0) {\n    layer.boundingBoxes = boundingBoxes;\n  }\n\n  // Extract dimensions\n  const xmlDimensions = getXMLArray(xmlLayer?.Dimension);\n  const dimensions = xmlDimensions.map((xml) => extractDimension(xml));\n  if (dimensions.length) {\n    layer.dimensions = dimensions;\n  }\n\n  if (xmlLayer?.opaque) {\n    layer.opaque = getXMLBoolean(xmlLayer?.opaque);\n  }\n  if (xmlLayer?.cascaded) {\n    layer.cascaded = getXMLBoolean(xmlLayer?.cascaded);\n  }\n  if (xmlLayer?.queryable) {\n    layer.queryable = getXMLBoolean(xmlLayer?.queryable);\n  }\n\n  // Single layer is not represented as array in XML\n  const xmlLayers = getXMLArray(xmlLayer?.Layer);\n  const layers: WMSLayer[] = [];\n\n  for (const xmlSubLayer of xmlLayers) {\n    layers.push(extractLayer(xmlSubLayer));\n  }\n\n  if (layers.length > 0) {\n    layer.layers = layers;\n  }\n\n  // Clean up object\n  for (const [key, value] of Object.entries(layer)) {\n    if (value === undefined) {\n      delete layer[key];\n    }\n  }\n\n  return layer;\n}\n\n/** WMS 1.3.0 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractEXBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n  const {\n    westBoundLongitude: w,\n    northBoundLatitude: n,\n    eastBoundLongitude: e,\n    southBoundLatitude: s\n  } = xmlBoundingBox;\n  return [\n    [w, s],\n    [e, n]\n  ];\n}\n\n/** WMS 1.1.1 Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractLatLonBoundingBox(xmlBoundingBox: any): [[number, number], [number, number]] {\n  const {minx, miny, maxx, maxy} = xmlBoundingBox;\n  return [\n    [minx, miny],\n    [maxx, maxy]\n  ];\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBoxes(xmlBoundingBoxes: any): WMSBoundingBox[] {\n  const xmlBoxes = getXMLArray(xmlBoundingBoxes);\n  return xmlBoxes.map((xmlBox) => extractWMSBoundingBox(xmlBox));\n}\n\n/** Loosely defined geospatial bounding box in unspecified CRS for quick content searches */\nfunction extractWMSBoundingBox(xmlBoundingBox: any): WMSBoundingBox {\n  const {CRS, SRS, minx, miny, maxx, maxy, resx, resy} = xmlBoundingBox;\n  const boundingBox: WMSBoundingBox = {\n    // CRS in 1.3.0, SRS in 1.1.1\n    crs: CRS || SRS,\n    boundingBox: [\n      [getXMLFloat(minx) as number, getXMLFloat(miny) as number],\n      [getXMLFloat(maxx) as number, getXMLFloat(maxy) as number]\n    ]\n  };\n  if (resx) {\n    boundingBox.xResolution = resx;\n  }\n  if (resy) {\n    boundingBox.yResolution = resy;\n  }\n  return boundingBox;\n}\n\n/**\n * Extracts optional WMS Dimension layer field\n * @param xmlDimension\n * @example <Dimension name=\"time\" units=\"ISO8601\" default=\"2018-01-01\" nearestValue=\"0\">2001-01-01/2018-01-01/P1Y</Dimension>\n * @see https://mapserver.org/ogc/wms_dimension.html\n */\nfunction extractDimension(xmlDimension: any): WMSDimension {\n  const {name, units, value: extent} = xmlDimension;\n\n  const dimension: WMSDimension = {name, units, extent};\n\n  if (xmlDimension.unitSymbol) {\n    dimension.unitSymbol = xmlDimension.unitSymbol;\n  }\n  if (xmlDimension.default) {\n    dimension.defaultValue = xmlDimension.default;\n  }\n  if (xmlDimension.multipleValues) {\n    dimension.multipleValues = getXMLBoolean(xmlDimension.multipleValues);\n  }\n  if (xmlDimension.nearestValue) {\n    dimension.nearestValue = getXMLBoolean(xmlDimension.nearestValue);\n  }\n  if (xmlDimension.current) {\n    dimension.current = getXMLBoolean(xmlDimension.current);\n  }\n\n  return dimension;\n}\n\n/** Traverse layers and inject missing props from parents */\n// eslint-disable-next-line complexity\nfunction addInheritedLayerProps(layer: WMSLayer, parent: WMSLayer | null): void {\n  if (parent?.geographicBoundingBox && !layer.geographicBoundingBox) {\n    layer.geographicBoundingBox = [...parent.geographicBoundingBox];\n  }\n\n  if (parent?.crs && !layer.crs) {\n    layer.crs = [...parent.crs];\n  }\n\n  if (parent?.boundingBoxes && !layer.boundingBoxes) {\n    layer.boundingBoxes = [...parent.boundingBoxes];\n  }\n\n  if (parent?.dimensions && !layer.dimensions) {\n    layer.dimensions = [...parent.dimensions];\n  }\n\n  for (const subLayer of layer.layers || []) {\n    addInheritedLayerProps(subLayer, layer);\n  }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/** A single element of an array is not represented as an array in XML */\nexport function getXMLArray(xmlValue: any): any[] {\n  // Already an array, return as is\n  if (Array.isArray(xmlValue)) {\n    return xmlValue;\n  }\n  // Single value, wrap in array\n  if (xmlValue) {\n    return [xmlValue];\n  }\n  // nullish, return empty array\n  return [];\n}\n\n/** Get a list of strings from XML */\nexport function getXMLStringArray(xmlValue: any): string[] {\n  const xmlArray = getXMLArray(xmlValue);\n  if (xmlArray.length > 0 && xmlArray.every((_) => typeof _ === 'string')) {\n    return xmlArray;\n  }\n  // TODO - error handling?\n  return [];\n}\n\n/** Get XML float */\nexport function getXMLFloat(xmlValue: any, defaultValue = undefined): number | undefined {\n  switch (typeof xmlValue) {\n    case 'number':\n      return xmlValue;\n    case 'string':\n      return parseFloat(xmlValue);\n    default:\n      return undefined;\n  }\n}\n\n/** Get XML integer */\nexport function getXMLInteger(xmlValue: any, defaultValue = undefined): number | undefined {\n  switch (typeof xmlValue) {\n    case 'number':\n      return xmlValue;\n    case 'string':\n      return parseInt(xmlValue, 10);\n    default:\n      return undefined;\n  }\n}\n\n/** Somewhat arbitrary boolean parsing */\nexport function getXMLBoolean(xmlValue: any): boolean {\n  switch (xmlValue) {\n    case 'true':\n      return true;\n    case 'false':\n      return false;\n    case '1':\n      return true;\n    case '0':\n      return false;\n    default:\n      return false;\n  }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilities, parseWMSCapabilities} from './lib/parsers/wms/parse-wms-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// Parsed data types\nexport type {\n  WMSCapabilities,\n  WMSLayer,\n  WMSBoundingBox,\n  WMSDimension,\n  WMSRequest,\n  WMSExceptions\n} from './lib/parsers/wms/parse-wms-capabilities';\n\nexport type WMSCapabilitiesLoaderOptions = XMLLoaderOptions & {\n  wms?: {\n    /** Add inherited layer information to sub layers */\n    inheritedLayerProps?: boolean;\n    /** Include the \"raw\" JSON (parsed but untyped, unprocessed XML). May contain additional fields */\n    includeRawJSON?: boolean;\n    /** Include the original XML document text. May contain additional information. */\n    includeXMLText?: boolean;\n  };\n};\n\n/**\n * Loader for the response to the WMS GetCapability request\n */\nexport const WMSCapabilitiesLoader = {\n  dataType: null as unknown as WMSCapabilities,\n  batchType: null as never,\n\n  id: 'wms-capabilities',\n  name: 'WMS Capabilities',\n\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.wms_xml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    wms: {}\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: WMSCapabilitiesLoaderOptions) =>\n    // TODO pass in XML options\n    parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options?.wms),\n  parseTextSync: (text: string, options?: WMSCapabilitiesLoaderOptions) =>\n    // TODO pass in XML options\n    parseWMSCapabilities(text, options?.wms)\n} as const satisfies LoaderWithParser<WMSCapabilities, never, WMSCapabilitiesLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** WMS Feature info - response to a WMS `GetFeatureInfo` request */\nexport type WMSFeatureInfo = {\n  features: WMSFeature[];\n};\n\nexport type WMSFeature = {\n  attributes: Record<string, number | string>;\n  type: string;\n  bounds: {top: number; bottom: number; left: number; right: number};\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSFeatureInfo(text: string, options): WMSFeatureInfo {\n  const parsedXML = XMLLoader.parseTextSync?.(text, options);\n  const xmlFeatureInfo: any = parsedXML.FeatureInfoResponse?.FIELDS || [];\n\n  const xmlFeatures = Array.isArray(xmlFeatureInfo) ? xmlFeatureInfo : [xmlFeatureInfo];\n\n  return {\n    features: xmlFeatures.map((xmlFeature) => extractFeature(xmlFeature))\n  };\n}\n\nfunction extractFeature(xmlFeature: any) {\n  const xmlFields = xmlFeature || {};\n  // TODO - not correct\n  return {\n    attributes: xmlFields,\n    type: '',\n    bounds: {bottom: 0, top: 0, left: 0, right: 0}\n  };\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\nimport {parseWMSFeatureInfo} from '../lib/parsers/wms/parse-wms-features';\n\nexport {WMSFeatureInfo};\n\n/**\n * Loader for the response to the WMS GetFeatureInfo request\n */\nexport const WMSFeatureInfoLoader = {\n  ...WMSCapabilitiesLoader,\n  dataType: null as unknown as WMSFeatureInfo,\n\n  id: 'wms-feature-info',\n  name: 'WMS FeatureInfo',\n\n  parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>\n    parseWMSFeatureInfo(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSFeatureInfo(text, options)\n} as const satisfies LoaderWithParser<WMSFeatureInfo, never, XMLLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** Layer description - response to a WMS `DescribeLayer` request  */\nexport type WMSLayerDescription = {\n  layers: {}[];\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetFeatureInfo` response\n * @note Error handlings is fairly weak\n */\nexport function parseWMSLayerDescription(\n  text: string,\n  options?: XMLLoaderOptions\n): WMSLayerDescription {\n  const parsedXML = XMLLoader.parseTextSync?.(text, options);\n  // TODO - implement parser\n  return parsedXML as unknown as WMSLayerDescription;\n}\n", "// loaders.gl, MIT license\n\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {XMLLoaderOptions} from '@loaders.gl/xml';\nimport {WMSCapabilitiesLoader} from '../wms-capabilities-loader';\n\nimport type {WMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\nimport {parseWMSLayerDescription} from '../lib/parsers/wms/parse-wms-layer-description';\n\nexport {WMSLayerDescription};\n\n/**\n * Loader for the response to the WMS DescribeLayer request\n */\nexport const WMSLayerDescriptionLoader = {\n  ...WMSCapabilitiesLoader,\n  dataType: null as unknown as WMSLayerDescription,\n\n  id: 'wms-layer-description',\n  name: 'WMS DescribeLayer',\n\n  parse: async (arrayBuffer: ArrayBuffer, options?: XMLLoaderOptions) =>\n    parseWMSLayerDescription(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: XMLLoaderOptions) => parseWMSLayerDescription(text, options)\n} as const satisfies LoaderWithParser<WMSLayerDescription, never, XMLLoaderOptions>;\n", "// loaders.gl, MIT license\n\nimport {XMLLoader} from '@loaders.gl/xml';\n\n/** All capabilities of a WFS service - response to a WFS `GetCapabilities` data structure extracted from XML */\nexport type WFSCapabilities = {\n  serviceIdentification: {\n    title: string;\n    serviceTypeVersion: string;\n    serviceType: string;\n  };\n\n  serviceProvider: {\n    providerName: string;\n    providerSite: string;\n    serviceContact: {\n      individualName: string;\n      positionName: string;\n      contactInfo: {\n        address: {\n          administrativeArea: string;\n          city: string;\n          country: string;\n          deliveryPoint: string;\n          electronicMailAddress: string;\n          postalCode: string;\n        };\n        phone: {\n          voice: string;\n        };\n      };\n    };\n  };\n\n  operationsMetadata: {\n    GetCapabilities: any;\n    GetFeatureInfo: any;\n    GetTile: any;\n  };\n\n  contents: {\n    layers: {\n      abstract: string;\n      identifier: string;\n      title: string;\n      formats: string[];\n      styles: {\n        identifier: string;\n        isDefault: string;\n        title: string;\n        abstract?: string;\n      }[];\n      bounds: {\n        left: number;\n        right: number;\n        bottom: number;\n        top: number;\n      };\n      tileMatrixSetLinks: {\n        tileMatrixSet: string;\n      }[];\n      tileMatrixSets: {\n        identifier: string;\n        matrixIds: {\n          identifier: string;\n          matrixHeight: number;\n          matrixWidth: number;\n          scaleDenominator: number;\n          tileWidth: number;\n          tileHeight: number;\n          topLeftCorner: {\n            lon: number;\n            lat: number;\n          };\n        }[];\n      };\n    }[];\n  };\n};\n\n/**\n * Parses a typed data structure from raw XML for `GetCapabilities` response\n * @note Error handlings is fairly weak\n */\nexport function parseWFSCapabilities(text: string, options): WFSCapabilities {\n  const parsedXML = XMLLoader.parseTextSync?.(text, {\n    ...options,\n    xml: {\n      ...options?.xml,\n      removeNSPrefix: true,\n      uncapitalizeKeys: true\n    }\n  });\n\n  const xmlCapabilities: any = parsedXML.Capabilities || parsedXML;\n  return xmlCapabilities;\n}\n", "// loaders.gl, MIT license\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {WFSCapabilities} from './lib/parsers/wfs/parse-wfs-capabilities';\nimport {parseWFSCapabilities} from './lib/parsers/wfs/parse-wfs-capabilities';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type {WFSCapabilities};\n\nexport type WFSLoaderOptions = LoaderOptions & {\n  wfs?: {};\n};\n\n/**\n * Loader for the response to the WFS GetCapability request\n * @deprecated Warning: this loader is still experimental and incomplete\n */\nexport const WFSCapabilitiesLoader = {\n  dataType: null as unknown as WFSCapabilities,\n  batchType: null as never,\n\n  id: 'wfs-capabilities',\n  name: 'WFS Capabilities',\n\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.wfs_xml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    wfs: {}\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: WFSLoaderOptions) =>\n    parseWFSCapabilities(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: WFSLoaderOptions) => parseWFSCapabilities(text, options)\n} as const satisfies LoaderWithParser<WFSCapabilities, never, WFSLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n\nexport const _typecheckWFSCapabilitiesLoader: LoaderWithParser = WFSCapabilitiesLoader;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Forked from https://github.com/derhuerst/parse-gml-polygon/blob/master/index.js\n// under ISC license\n\n/* eslint-disable no-continue, default-case */\n\nimport type {\n  // GeoJSON,\n  // Feature,\n  // FeatureCollection,\n  Geometry,\n  Position\n  // GeoJsonProperties,\n  // Point,\n  // MultiPoint,\n  // LineString,\n  // MultiLineString,\n  // Polygon,\n  // MultiPolygon,\n  // GeometryCollection\n} from '@loaders.gl/schema';\n\nimport {XMLLoader} from '@loaders.gl/xml';\nimport {deepStrictEqual} from './deep-strict-equal';\nimport rewind from '@turf/rewind';\n\nfunction noTransform(...coords) {\n  return coords;\n}\n\nexport type {Geometry};\n\nexport type ParseGMLOptions = {\n  transformCoords?: Function;\n  stride?: 2 | 3 | 4;\n};\n\nexport type ParseGMLContext = {\n  srsDimension?: number;\n  [key: string]: any;\n};\n\n/**\n * Parses a typed data structure from raw XML for GML features\n * @note Error handlings is fairly weak\n */\nexport function parseGML(text: string, options) {\n  // GeoJSON | null {\n  const parsedXML = XMLLoader.parseTextSync?.(text, options);\n\n  options = {transformCoords: noTransform, stride: 2, ...options};\n  const context = createChildContext(parsedXML, options, {});\n\n  return parseGMLToGeometry(parsedXML, options, context);\n}\n\n/** Parse a GeoJSON geometry from GML XML */\nexport function parseGMLToGeometry(\n  inputXML: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Geometry | null {\n  const childContext = createChildContext(inputXML, options, context);\n\n  let geometry: Geometry | null = null;\n\n  const [name, xml] = getFirstKeyValue(inputXML);\n\n  switch (name) {\n    // case 'gml:MultiPoint':\n    //   geometry = {\n    //     type: 'MultiPoint',\n    //     coordinates: parseMultiPoint(xml, options, childContext)\n    //   };\n    //   break;\n\n    case 'gml:LineString':\n      geometry = {\n        type: 'LineString',\n        coordinates: parseLinearRingOrLineString(xml, options, childContext)\n      };\n      break;\n\n      // case 'gml:MultiLineString':\n      //   geometry = {\n      //     type: 'MultiLineString',\n      //     coordinates: parseMultiLineString(xml, options, childContext)\n      //   };\n      //   break;\n\n    case 'gml:Polygon':\n    case 'gml:Rectangle':\n      geometry = {\n        type: 'Polygon',\n        coordinates: parsePolygonOrRectangle(xml, options, childContext)\n      };\n      break;\n    case 'gml:Surface':\n      geometry = {\n        type: 'MultiPolygon',\n        coordinates: parseSurface(xml, options, childContext)\n      };\n      break;\n    case 'gml:MultiSurface':\n      geometry = {\n        type: 'MultiPolygon',\n        coordinates: parseMultiSurface(xml, options, childContext)\n      };\n      break;\n\n    default:\n      return null;\n  }\n\n  // todo\n  return rewind(geometry, {mutate: true});\n}\n\n/** Parse a list of coordinates from a string */\nfunction parseCoords(s: string, options: ParseGMLOptions, context: ParseGMLContext): Position[] {\n  const stride = context.srsDimension || options.stride || 2;\n\n  // Handle white space\n  const coords = s.replace(/\\s+/g, ' ').trim().split(' ');\n\n  if (coords.length === 0 || coords.length % stride !== 0) {\n    throw new Error(`invalid coordinates list (stride ${stride})`);\n  }\n\n  const points: Position[] = [];\n  for (let i = 0; i < coords.length - 1; i += stride) {\n    const point = coords.slice(i, i + stride).map(parseFloat);\n    points.push(options.transformCoords?.(...point) || point);\n  }\n\n  return points;\n}\n\nexport function parsePosList(xml: any, options: ParseGMLOptions, context: ParseGMLContext) {\n  const childContext = createChildContext(xml, options, context);\n\n  const coords = textOf(xml);\n  if (!coords) {\n    throw new Error('invalid gml:posList element');\n  }\n\n  return parseCoords(coords, options, childContext);\n}\n\nexport function parsePos(xml: any, options: ParseGMLOptions, context: ParseGMLContext): Position {\n  const childContext = createChildContext(xml, options, context);\n\n  const coords = textOf(xml);\n  if (!coords) {\n    throw new Error('invalid gml:pos element');\n  }\n\n  const points = parseCoords(coords, options, childContext);\n  if (points.length !== 1) {\n    throw new Error('gml:pos must have 1 point');\n  }\n  return points[0];\n}\n\nexport function parsePoint(xml: any, options: ParseGMLOptions, context: ParseGMLContext): number[] {\n  const childContext = createChildContext(xml, options, context);\n\n  // TODO AV: Parse other gml:Point options\n  const pos = findIn(xml, 'gml:pos');\n  if (!pos) {\n    throw new Error('invalid gml:Point element, expected a gml:pos subelement');\n  }\n  return parsePos(pos, options, childContext);\n}\n\nexport function parseLinearRingOrLineString(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[] {\n  // or a LineStringSegment\n  const childContext = createChildContext(xml, options, context);\n\n  let points: Position[] = [];\n\n  const posList = findIn(xml, 'gml:posList');\n  if (posList) {\n    points = parsePosList(posList, options, childContext);\n  } else {\n    for (const [childName, childXML] of Object.entries(xml)) {\n      switch (childName) {\n        case 'gml:Point':\n          points.push(parsePoint(childXML, options, childContext));\n          break;\n        case 'gml:pos':\n          points.push(parsePos(childXML, options, childContext));\n          break;\n        default:\n          continue;\n      }\n    }\n  }\n\n  if (points.length === 0) {\n    throw new Error(`${xml.name} must have > 0 points`);\n  }\n  return points;\n}\n\nexport function parseCurveSegments(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[] {\n  const points: Position[] = [];\n\n  for (const [childName, childXML] of Object.entries(xml)) {\n    switch (childName) {\n      case 'gml:LineStringSegment':\n        const points2 = parseLinearRingOrLineString(childXML, options, context);\n\n        // remove overlapping\n        const end = points[points.length - 1];\n        const start = points2[0];\n        if (end && start && deepStrictEqual(end, start)) {\n          points2.shift();\n        }\n\n        points.push(...points2);\n        break;\n      default:\n        continue;\n    }\n  }\n\n  if (points.length === 0) {\n    throw new Error('gml:Curve > gml:segments must have > 0 points');\n  }\n  return points;\n}\n\nexport function parseRing(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[] {\n  const childContext = createChildContext(xml, options, context);\n\n  const points: Position[] = [];\n\n  for (const [childName, childXML] of Object.entries(xml)) {\n    switch (childName) {\n      case 'gml:curveMember':\n        let points2;\n\n        const lineString = findIn(childXML, 'gml:LineString');\n        if (lineString) {\n          points2 = parseLinearRingOrLineString(lineString, options, childContext);\n        } else {\n          const segments = findIn(childXML, 'gml:Curve', 'gml:segments');\n          if (!segments) {\n            throw new Error(`invalid ${childName} element`);\n          }\n\n          points2 = parseCurveSegments(segments, options, childContext);\n        }\n\n        // remove overlapping\n        const end = points[points.length - 1];\n        const start = points2[0];\n        if (end && start && deepStrictEqual(end, start)) {\n          points2.shift();\n        }\n\n        points.push(...points2);\n\n        break;\n    }\n  }\n\n  if (points.length < 4) {\n    throw new Error(`${xml.name} must have >= 4 points`);\n  }\n  return points;\n}\n\nexport function parseExteriorOrInterior(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[] {\n  const linearRing = findIn(xml, 'gml:LinearRing');\n  if (linearRing) {\n    return parseLinearRingOrLineString(linearRing, options, context);\n  }\n\n  const ring = findIn(xml, 'gml:Ring');\n  if (!ring) {\n    throw new Error(`invalid ${xml.name} element`);\n  }\n\n  return parseRing(ring, options, context);\n}\n\nexport function parsePolygonOrRectangle(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[][] {\n  // or PolygonPatch\n  const childContext = createChildContext(xml, options, context);\n\n  const exterior = findIn(xml, 'gml:exterior');\n  if (!exterior) {\n    throw new Error(`invalid ${xml.name} element`);\n  }\n\n  const pointLists: Position[][] = [parseExteriorOrInterior(exterior, options, childContext)];\n\n  for (const [childName, childXML] of Object.entries(xml)) {\n    switch (childName) {\n      case 'gml:interior':\n        pointLists.push(parseExteriorOrInterior(childXML, options, childContext));\n        break;\n    }\n  }\n\n  return pointLists;\n}\n\nexport function parseSurface(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[][][] {\n  const childContext = createChildContext(xml, options, context);\n\n  const patches = findIn(xml, 'gml:patches');\n  if (!patches) {\n    throw new Error(`invalid ${xml.name} element`);\n  }\n\n  const polygons: Position[][][] = [];\n  for (const [childName, childXML] of Object.entries(xml)) {\n    switch (childName) {\n      case 'gml:PolygonPatch':\n      case 'gml:Rectangle':\n        polygons.push(parsePolygonOrRectangle(childXML, options, childContext));\n        break;\n\n      default:\n        continue;\n    }\n  }\n\n  if (polygons.length === 0) {\n    throw new Error(`${xml.name} must have > 0 polygons`);\n  }\n\n  return polygons;\n}\n\nexport function parseCompositeSurface(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[][][] {\n  const childContext = createChildContext(xml, options, context);\n\n  const polygons: Position[][][] = [];\n  for (const [childName, childXML] of Object.entries(xml)) {\n    switch (childName) {\n      case 'gml:surfaceMember':\n      case 'gml:surfaceMembers':\n        const [c2Name, c2Xml] = getFirstKeyValue(childXML);\n        switch (c2Name) {\n          case 'gml:Surface':\n            polygons.push(...parseSurface(c2Xml, options, childContext));\n            break;\n          case 'gml:Polygon':\n            polygons.push(parsePolygonOrRectangle(c2Xml, options, childContext));\n            break;\n        }\n        break;\n    }\n  }\n\n  if (polygons.length === 0) {\n    throw new Error(`${xml.name} must have > 0 polygons`);\n  }\n  return polygons;\n}\n\nexport function parseMultiSurface(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[][][] {\n  let el = xml;\n\n  const surfaceMembers = findIn(xml, 'gml:LinearRing');\n  if (surfaceMembers) {\n    el = surfaceMembers;\n  }\n\n  const polygons: Position[][][] = [];\n  for (const [childName, childXML] of Object.entries(el)) {\n    switch (childName) {\n      case 'gml:Surface':\n        const polygons2 = parseSurface(childXML, options, context);\n        polygons.push(...polygons2);\n        break;\n      case 'gml:surfaceMember':\n        const polygons3 = parseSurfaceMember(childXML, options, context);\n        polygons.push(...polygons3);\n        break;\n\n      case 'gml:surfaceMembers':\n        const polygonXML = findIn(childXML, 'gml:Polygon');\n        for (const surfaceMemberXML of polygonXML as []) {\n          const polygons3 = parseSurfaceMember(surfaceMemberXML, options, context);\n          polygons.push(...polygons3);\n        }\n        break;\n    }\n  }\n\n  if (polygons.length === 0) {\n    throw new Error(`${xml.name} must have > 0 polygons`);\n  }\n\n  return polygons;\n}\n\nfunction parseSurfaceMember(\n  xml: any,\n  options: ParseGMLOptions,\n  context: ParseGMLContext\n): Position[][][] {\n  const [childName, childXml] = getFirstKeyValue(xml);\n  switch (childName) {\n    case 'gml:CompositeSurface':\n      return parseCompositeSurface(childXml, options, context);\n    case 'gml:Surface':\n      return parseSurface(childXml, options, context);\n    case 'gml:Polygon':\n      return [parsePolygonOrRectangle(childXml, options, context)];\n  }\n  throw new Error(`${childName} must have polygons`);\n}\n\n// Helpers\n\nfunction textOf(el: any): string {\n  if (typeof el !== 'string') {\n    throw new Error('expected string');\n  }\n  return el;\n}\n\nfunction findIn(root: any, ...tags: string[]): any {\n  let el = root;\n  for (const tag of tags) {\n    const child = el[tag];\n    if (!child) {\n      return null;\n    }\n    el = child;\n  }\n  return el;\n}\n\n/** @returns the first [key, value] pair in an object, or ['', null] if empty object */\nfunction getFirstKeyValue(object: any): [string, any] {\n  if (object && typeof object === 'object') {\n    for (const [key, value] of Object.entries(object)) {\n      return [key, value];\n    }\n  }\n  return ['', null];\n}\n\n/** A bit heavyweight for just tracking dimension? */\nfunction createChildContext(xml, options, context): ParseGMLContext {\n  const srsDimensionAttribute = xml.attributes && xml.attributes.srsDimension;\n\n  if (srsDimensionAttribute) {\n    const srsDimension = parseInt(srsDimensionAttribute);\n    if (Number.isNaN(srsDimension) || srsDimension <= 0) {\n      throw new Error(\n        `invalid srsDimension attribute value \"${srsDimensionAttribute}\", expected a positive integer`\n      );\n    }\n\n    const childContext = Object.create(context);\n    childContext.srsDimension = srsDimension;\n    return childContext;\n  }\n\n  return context;\n}\n", "// https://github.com/nodejs/node/commit/c1d82ac2ff15594840e2a1b9531b506ae067ed27;\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** @todo replace this ridiculous choice of deepStrictEqual */\n// eslint-disable-next-line complexity\nexport function deepStrictEqual(actual: unknown, expected: unknown, strict?: boolean) {\n  // 7.1. All identical values are equivalent, as determined by ===.\n  if (actual === expected) {\n    return true;\n    // } else if (actual instanceof Buffer && expected instanceof Buffer) {\n    //   return compare(actual, expected) === 0;\n\n    // // 7.2. If the expected value is a Date object, the actual value is\n    // // equivalent if it is also a Date object that refers to the same time.\n  } else if (actual instanceof Date && expected instanceof Date) {\n    return actual.getTime() === expected.getTime();\n\n    // 7.3 If the expected value is a RegExp object, the actual value is\n    // equivalent if it is also a RegExp object with the same source and\n    // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n  } else if (actual instanceof RegExp && expected instanceof RegExp) {\n    return (\n      actual.source === expected.source &&\n      actual.global === expected.global &&\n      actual.multiline === expected.multiline &&\n      actual.lastIndex === expected.lastIndex &&\n      actual.ignoreCase === expected.ignoreCase\n    );\n\n    // 7.4. Other pairs that do not both pass typeof value == 'object',\n    // equivalence is determined by ==.\n  } else if (\n    (actual === null || typeof actual !== 'object') &&\n    (expected === null || typeof expected !== 'object')\n  ) {\n    // eslint-disable-next-line eqeqeq\n    return strict ? actual === expected : actual == expected;\n\n    // 7.5 For all other Object pairs, including Array objects, equivalence is\n    // determined by having the same number of owned properties (as verified\n    // with Object.prototype.hasOwnProperty.call), the same set of keys\n    // (although not necessarily the same order), equivalent values for every\n    // corresponding key, and an identical 'prototype' property. Note: this\n    // accounts for both named and indexed properties on Arrays.\n  }\n  return objEquiv(actual, expected, strict);\n}\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst pSlice = Array.prototype.slice;\n\nfunction isPrimitive(arg) {\n  return arg === null || (typeof arg !== 'object' && typeof arg !== 'function');\n}\n\nfunction isArguments(object) {\n  // eslint-disable-next-line eqeqeq\n  return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\n// eslint-disable-next-line complexity\nfunction objEquiv(a: unknown, b: unknown, strict) {\n  if (a === null || a === undefined || b === null || b === undefined) return false;\n  // if one is a primitive, the other must be same\n  if (isPrimitive(a) || isPrimitive(b)) return a === b;\n  if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;\n  const aIsArgs = isArguments(a);\n  const bIsArgs = isArguments(b);\n  if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false;\n  if (aIsArgs) {\n    a = pSlice.call(a);\n    b = pSlice.call(b);\n    return deepStrictEqual(a, b, strict);\n  }\n  const ka = Object.keys(a as object);\n  const kb = Object.keys(b as object);\n  let key;\n  let i;\n  // having the same number of owned properties (keys incorporates\n  // hasOwnProperty)\n  if (ka.length !== kb.length) return false;\n  // the same set of keys (although not necessarily the same order),\n  ka.sort();\n  kb.sort();\n  // ~~~cheap key test\n  for (i = ka.length - 1; i >= 0; i--) {\n    if (ka[i] !== kb[i]) return false;\n  }\n  // equivalent values for every corresponding key, and\n  // ~~~possibly expensive deep test\n  for (i = ka.length - 1; i >= 0; i--) {\n    key = ka[i];\n    // @ts-ignore\n    if (!deepStrictEqual(a[key], b[key], strict)) return false;\n  }\n  return true;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {Geometry} from './lib/parsers/gml/parse-gml';\nimport {parseGML} from './lib/parsers/gml/parse-gml';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GMLLoaderOptions = LoaderOptions & {\n  gml?: {};\n};\n\n/**\n * Loader for the response to the GML GetCapability request\n */\nexport const GMLLoader = {\n  dataType: null as unknown as Geometry | null,\n  batchType: null as never,\n\n  name: 'GML',\n  id: 'gml',\n\n  module: 'wms',\n  version: VERSION,\n  worker: false,\n  extensions: ['xml'],\n  mimeTypes: ['application/vnd.ogc.gml', 'application/xml', 'text/xml'],\n  testText: testXMLFile,\n  options: {\n    gml: {}\n  },\n  parse: async (arrayBuffer: ArrayBuffer, options?: GMLLoaderOptions) =>\n    parseGML(new TextDecoder().decode(arrayBuffer), options),\n  parseTextSync: (text: string, options?: GMLLoaderOptions) => parseGML(text, options)\n} as const satisfies LoaderWithParser<Geometry | null, never, GMLLoaderOptions>;\n\nfunction testXMLFile(text: string): boolean {\n  // TODO - There could be space first.\n  return text.startsWith('<?xml');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* eslint-disable camelcase */\nimport type {\n  Source,\n  DataSourceOptions,\n  ImageSourceMetadata,\n  GetImageParameters\n} from '@loaders.gl/loader-utils';\nimport {DataSource, ImageSource, mergeOptions} from '@loaders.gl/loader-utils';\n\nimport type {ImageType} from '@loaders.gl/images';\nimport {ImageLoader} from '@loaders.gl/images';\n\nimport type {WMSCapabilities} from './wms-capabilities-loader';\nimport type {WMSFeatureInfo} from './wip/wms-feature-info-loader';\nimport type {WMSLayerDescription} from './wip/wms-layer-description-loader';\n\nimport {WMSCapabilitiesLoader} from './wms-capabilities-loader';\nimport {WMSFeatureInfoLoader} from './wip/wms-feature-info-loader';\nimport {WMSLayerDescriptionLoader} from './wip/wms-layer-description-loader';\n\nimport type {WMSLoaderOptions} from './wms-error-loader';\nimport {WMSErrorLoader} from './wms-error-loader';\n\n/** Properties for creating a enw WMS service */\nexport type WMSSourceOptions = DataSourceOptions & {\n  wms?: {\n    // TODO - move parameters inside WMS scope\n    /** In 1.3.0, replaces references to EPSG:4326 with CRS:84 */\n    substituteCRS84?: boolean;\n    /** Default WMS parameters. If not provided here, must be provided in the various request */\n    wmsParameters?: WMSParameters;\n    /** Any additional service specific parameters */\n    vendorParameters?: Record<string, unknown>;\n  };\n};\n\nexport const WMSSource = {\n  name: 'Web Map Service (OGC WMS)',\n  id: 'wms',\n  module: 'wms',\n  version: '0.0.0',\n  extensions: [],\n  mimeTypes: [],\n  type: 'wms',\n  fromUrl: true,\n  fromBlob: false,\n\n  defaultOptions: {\n    wms: {\n      // TODO - add options here\n    }\n  },\n\n  testURL: (url: string): boolean => url.toLowerCase().includes('wms'),\n  createDataSource: (url, options: WMSSourceOptions) => new WMSImageSource(url as string, options)\n} as const satisfies Source<WMSImageSource>;\n\n// PARAMETER TYPES FOR WMS SOURCE\n\n/**\n * \"Static\" WMS parameters (not viewport or selected pixel dependent)\n * These can be provided as defaults in the WMSImageSource constructor\n */\nexport type WMSParameters = {\n  /** WMS version (all requests) */\n  version?: '1.3.0' | '1.1.1';\n  /** Layers to render (GetMap, GetFeatureInfo) */\n  layers?: string[];\n  /** list of layers to query.. (GetFeatureInfo) */\n  query_layers?: string[];\n\n  /** Coordinate Reference System (CRS) for the image (not the bounding box) */\n  crs?: string;\n  /** Requested format for the return image (GetMap, GetLegendGraphic) */\n  format?: 'image/png';\n  /** Requested MIME type of returned feature info (GetFeatureInfo) */\n  info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n  /** Styling - Not yet supported */\n  styles?: unknown;\n  /** Any additional parameters specific to this WMSImageSource (GetMap) */\n  transparent?: boolean;\n  /** If layer supports time dimension */\n  time?: string;\n  /** If layer supports elevation dimension */\n  elevation?: string;\n};\n\n/** Parameters for GetCapabilities */\nexport type WMSGetCapabilitiesParameters = {\n  /** In case the endpoint supports multiple WMS versions */\n  version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetMap */\nexport type WMSGetMapParameters = {\n  /** In case the endpoint supports multiple WMS versions */\n  version?: '1.3.0' | '1.1.1';\n  /** bounding box of the requested map image `[[w, s], [e, n]]`  */\n  // boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];\n  /** bounding box of the requested map image @deprecated Use .boundingBox */\n  bbox: [number, number, number, number];\n  /** pixel width of returned image */\n  width: number;\n  /** pixels */\n  height: number;\n  /** requested format for the return image. can be provided in service constructor */\n  format?: 'image/png';\n  /** Layers to render - can be provided in service constructor */\n  layers?: string | string[];\n  /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n  crs?: string;\n  /** Styling. can be provided in service constructor */\n  styles?: unknown;\n  /** Don't render background when no data. can be provided in service constructor */\n  transparent?: boolean;\n  /** If layer supports time dimension */\n  time?: string;\n  /** If layer supports elevation dimension */\n  elevation?: string;\n};\n\n// /** GetMap parameters that are specific to the current view */\n// export type WMSGetMapViewParameters = {\n//   /** pixel width of returned image */\n//   width: number;\n//   /** pixels */\n//   height: number;\n//   /** bounding box of the requested map image */\n//   bbox: [number, number, number, number];\n//   /** Coordinate Reference System for the image (not bounding box). can be provided in service constructor. */\n//   crs?: string;\n// };\n\n/**\n * Parameters for GetFeatureInfo\n * @see https://imagery.pasda.psu.edu/arcgis/services/pasda/UrbanTreeCanopy_Landcover/MapServer/WmsServer?SERVICE=WMS&\n */\nexport type WMSGetFeatureInfoParameters = {\n  /** In case the endpoint supports multiple WMS versions */\n  version?: '1.3.0' | '1.1.1';\n  /** x coordinate for the feature info request */\n  x: number;\n  /** y coordinate for the feature info request */\n  y: number;\n  /** MIME type of returned feature info. Can be specified in service constructor */\n  info_format?: 'text/plain' | 'application/geojson' | 'application/vnd.ogc.gml';\n  /** list of layers to query. Required but can be specified in service constructor. */\n  query_layers?: string[];\n  /** Layers to render. Required, but can be specified in service constructor */\n  layers?: string[];\n  /** Styling */\n  styles?: unknown;\n  /** bounding box of the requested map image */\n  bbox: [number, number, number, number];\n  /** pixel width of returned image */\n  width: number;\n  /** pixels */\n  height: number;\n  /** srs for the image (not the bounding box) */\n  crs?: string;\n};\n\n/** GetMap parameters that are specific to the current view */\nexport type WMSGetFeatureInfoViewParameters = {\n  /** x coordinate for the feature info request */\n  x: number;\n  /** y coordinate for the feature info request */\n  y: number;\n  /** pixel width of returned image */\n  width: number;\n  /** pixels */\n  height: number;\n  /** bounding box of the requested map image */\n  bbox: [number, number, number, number];\n  /** srs for the image (not the bounding box) */\n  crs?: string;\n};\n\n/** Parameters for DescribeLayer */\nexport type WMSDescribeLayerParameters = {\n  /** In case the endpoint supports multiple WMS versions */\n  version?: '1.3.0' | '1.1.1';\n};\n\n/** Parameters for GetLegendGraphic */\nexport type WMSGetLegendGraphicParameters = {\n  /** In case the endpoint supports multiple WMS versions */\n  version?: '1.3.0' | '1.1.1';\n};\n\n//\n\n/**\n * The WMSImageSource class provides\n * - provides type safe methods to form URLs to a WMS service\n * - provides type safe methods to query and parse results (and errors) from a WMS service\n * - implements the ImageSource interface\n * @note Only the URL parameter conversion is supported. XML posts are not supported.\n */\nexport class WMSImageSource extends DataSource<string, WMSSourceOptions> implements ImageSource {\n  /** In WMS 1.3.0, replaces references to EPSG:4326 with CRS:84. But not always supported. Default: false */\n  substituteCRS84: boolean;\n  /** In WMS 1.3.0, flips x,y (lng, lat) coordinates for the supplied coordinate systems. Default: ['ESPG:4326'] */\n  flipCRS: string[];\n\n  /** Default static WMS parameters */\n  wmsParameters: Required<WMSParameters>;\n  /** Default static vendor parameters */\n  vendorParameters?: Record<string, unknown>;\n\n  capabilities: WMSCapabilities | null = null;\n\n  /** Create a WMSImageSource */\n  constructor(url: string, options: WMSSourceOptions) {\n    super(url, options, WMSSource.defaultOptions);\n\n    // TODO - defaults such as version, layers etc could be extracted from a base URL with parameters\n    // This would make pasting in any WMS URL more likely to make this class just work.\n    // const {baseUrl, parameters} = this._parseWMSUrl(options.url);\n\n    this.substituteCRS84 = options.wms?.substituteCRS84 ?? false;\n    this.flipCRS = ['EPSG:4326'];\n\n    this.wmsParameters = {\n      layers: undefined!,\n      query_layers: undefined!,\n      styles: undefined,\n      version: '1.3.0',\n      crs: 'EPSG:4326',\n      format: 'image/png',\n      info_format: 'text/plain',\n      transparent: undefined!,\n      time: undefined!,\n      elevation: undefined!,\n      ...options.wmsParameters, // deprecated\n      ...options.wms?.wmsParameters\n    };\n\n    this.vendorParameters = options.wms?.vendorParameters || options.vendorParameters || {};\n  }\n\n  // ImageSource implementation\n  async getMetadata(): Promise<ImageSourceMetadata> {\n    const capabilities = await this.getCapabilities();\n    return this.normalizeMetadata(capabilities);\n  }\n\n  async getImage(parameters: GetImageParameters): Promise<ImageType> {\n    // Replace the GetImage `boundingBox` parameter with the WMS flat `bbox` parameter.\n    const {boundingBox, bbox, ...rest} = parameters;\n    const wmsParameters: WMSGetMapParameters = {\n      bbox: boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox!,\n      ...rest\n    };\n    return await this.getMap(wmsParameters);\n  }\n\n  normalizeMetadata(capabilities: WMSCapabilities): ImageSourceMetadata {\n    return capabilities;\n  }\n\n  // WMS Service API Stubs\n\n  /** Get Capabilities */\n  async getCapabilities(\n    wmsParameters?: WMSGetCapabilitiesParameters,\n    vendorParameters?: Record<string, unknown>\n  ): Promise<WMSCapabilities> {\n    const url = this.getCapabilitiesURL(wmsParameters, vendorParameters);\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    const capabilities = await WMSCapabilitiesLoader.parse(arrayBuffer, this.loadOptions);\n    this.capabilities = capabilities;\n    return capabilities;\n  }\n\n  /** Get a map image */\n  async getMap(\n    wmsParameters: WMSGetMapParameters,\n    vendorParameters?: Record<string, unknown>\n  ): Promise<ImageType> {\n    const url = this.getMapURL(wmsParameters, vendorParameters);\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    try {\n      return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n    } catch {\n      throw this._parseError(arrayBuffer);\n    }\n  }\n\n  /** Get Feature Info for a coordinate */\n  async getFeatureInfo(\n    wmsParameters: WMSGetFeatureInfoParameters,\n    vendorParameters?: Record<string, unknown>\n  ): Promise<WMSFeatureInfo> {\n    const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    return await WMSFeatureInfoLoader.parse(arrayBuffer, this.loadOptions);\n  }\n\n  /** Get Feature Info for a coordinate */\n  async getFeatureInfoText(\n    wmsParameters: WMSGetFeatureInfoParameters,\n    vendorParameters?: Record<string, unknown>\n  ): Promise<string> {\n    const url = this.getFeatureInfoURL(wmsParameters, vendorParameters);\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    return new TextDecoder().decode(arrayBuffer);\n  }\n\n  /** Get more information about a layer */\n  async describeLayer(\n    wmsParameters: WMSDescribeLayerParameters,\n    vendorParameters?: Record<string, unknown>\n  ): Promise<WMSLayerDescription> {\n    const url = this.describeLayerURL(wmsParameters, vendorParameters);\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    return await WMSLayerDescriptionLoader.parse(arrayBuffer, this.loadOptions);\n  }\n\n  /** Get an image with a semantic legend */\n  async getLegendGraphic(\n    wmsParameters: WMSGetLegendGraphicParameters,\n    vendorParameters?: Record<string, unknown>\n  ): Promise<ImageType> {\n    const url = this.getLegendGraphicURL(wmsParameters, vendorParameters);\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    try {\n      return await ImageLoader.parse(arrayBuffer, this.loadOptions);\n    } catch {\n      throw this._parseError(arrayBuffer);\n    }\n  }\n\n  // Typed URL creators\n  // For applications that want full control of fetching and parsing\n\n  /** Generate a URL for the GetCapabilities request */\n  getCapabilitiesURL(\n    wmsParameters?: WMSGetCapabilitiesParameters,\n    vendorParameters?: Record<string, unknown>\n  ): string {\n    const options: Required<WMSGetCapabilitiesParameters> = {\n      version: this.wmsParameters.version,\n      ...wmsParameters\n    };\n    return this._getWMSUrl('GetCapabilities', options, vendorParameters);\n  }\n\n  /** Generate a URL for the GetMap request */\n  getMapURL(\n    wmsParameters: WMSGetMapParameters,\n    vendorParameters?: Record<string, unknown>\n  ): string {\n    wmsParameters = this._getWMS130Parameters(wmsParameters);\n    const options: Required<WMSGetMapParameters> = {\n      version: this.wmsParameters.version,\n      format: this.wmsParameters.format,\n      transparent: this.wmsParameters.transparent,\n      time: this.wmsParameters.time,\n      elevation: this.wmsParameters.elevation,\n      layers: this.wmsParameters.layers,\n      styles: this.wmsParameters.styles,\n      crs: this.wmsParameters.crs,\n      // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n      // width: 1200,\n      // height: 900,\n      ...wmsParameters\n    };\n    return this._getWMSUrl('GetMap', options, vendorParameters);\n  }\n\n  /** Generate a URL for the GetFeatureInfo request */\n  getFeatureInfoURL(\n    wmsParameters: WMSGetFeatureInfoParameters,\n    vendorParameters?: Record<string, unknown>\n  ): string {\n    wmsParameters = this._getWMS130Parameters(wmsParameters);\n\n    // Replace the GetImage `boundingBox` parameter with the WMS flat `bbox` parameter.\n    const {boundingBox, bbox} = wmsParameters as any;\n    wmsParameters.bbox = boundingBox ? [...boundingBox[0], ...boundingBox[1]] : bbox!;\n\n    const options: Required<WMSGetFeatureInfoParameters> = {\n      version: this.wmsParameters.version,\n      // query_layers: [],\n      // format: this.wmsParameters.format,\n      info_format: this.wmsParameters.info_format,\n      layers: this.wmsParameters.layers,\n      query_layers: this.wmsParameters.query_layers,\n      styles: this.wmsParameters.styles,\n      crs: this.wmsParameters.crs,\n      // bbox: [-77.87304, 40.78975, -77.85828, 40.80228],\n      // width: 1200,\n      // height: 900,\n      // x: undefined!,\n      // y: undefined!,\n      ...wmsParameters\n    };\n    return this._getWMSUrl('GetFeatureInfo', options, vendorParameters);\n  }\n\n  /** Generate a URL for the GetFeatureInfo request */\n  describeLayerURL(\n    wmsParameters: WMSDescribeLayerParameters,\n    vendorParameters?: Record<string, unknown>\n  ): string {\n    const options: Required<WMSDescribeLayerParameters> = {\n      version: this.wmsParameters.version,\n      ...wmsParameters\n    };\n    return this._getWMSUrl('DescribeLayer', options, vendorParameters);\n  }\n\n  getLegendGraphicURL(\n    wmsParameters: WMSGetLegendGraphicParameters,\n    vendorParameters?: Record<string, unknown>\n  ): string {\n    const options: Required<WMSGetLegendGraphicParameters> = {\n      version: this.wmsParameters.version,\n      // format?\n      ...wmsParameters\n    };\n    return this._getWMSUrl('GetLegendGraphic', options, vendorParameters);\n  }\n\n  // INTERNAL METHODS\n\n  _parseWMSUrl(url: string): {url: string; parameters: Record<string, unknown>} {\n    const [baseUrl, search] = url.split('?');\n    const searchParams = search.split('&');\n\n    const parameters: Record<string, unknown> = {};\n    for (const parameter of searchParams) {\n      const [key, value] = parameter.split('=');\n      parameters[key] = value;\n    }\n\n    return {url: baseUrl, parameters};\n  }\n\n  /**\n   * Generate a URL with parameters\n   * @note case _getWMSUrl may need to be overridden to handle certain backends?\n   * @note at the moment, only URLs with parameters are supported (no XML payloads)\n   * */\n  protected _getWMSUrl(\n    request: string,\n    wmsParameters: {version?: '1.3.0' | '1.1.1'; [key: string]: unknown},\n    vendorParameters?: Record<string, unknown>\n  ): string {\n    let url = this.url;\n    let first = true;\n\n    // Add any vendor searchParams\n    const allParameters = {\n      service: 'WMS',\n      version: wmsParameters.version,\n      request,\n      ...wmsParameters,\n      ...this.vendorParameters,\n      ...vendorParameters\n    };\n\n    // Encode the keys\n    const IGNORE_EMPTY_KEYS = ['transparent', 'time', 'elevation'];\n    for (const [key, value] of Object.entries(allParameters)) {\n      // hack to preserve test cases. Not super clear if keys should be included when values are undefined\n      if (!IGNORE_EMPTY_KEYS.includes(key) || value) {\n        url += first ? '?' : '&';\n        first = false;\n        url += this._getURLParameter(key, value, wmsParameters);\n      }\n    }\n\n    return encodeURI(url);\n  }\n\n  _getWMS130Parameters<ParametersT extends {crs?: string; srs?: string}>(\n    wmsParameters: ParametersT\n  ): ParametersT {\n    const newParameters = {...wmsParameters};\n    if (newParameters.srs) {\n      newParameters.crs = newParameters.crs || newParameters.srs;\n      delete newParameters.srs;\n    }\n    return newParameters;\n  }\n\n  // eslint-disable-next-line complexity\n  _getURLParameter(key: string, value: unknown, wmsParameters: WMSParameters): string {\n    // Substitute by key\n    switch (key) {\n      case 'crs':\n        // CRS was called SRS before WMS 1.3.0\n        if (wmsParameters.version !== '1.3.0') {\n          key = 'srs';\n        } else if (this.substituteCRS84 && value === 'EPSG:4326') {\n          /** In 1.3.0, replaces references to 'EPSG:4326' with the new backwards compatible CRS:84 */\n          // Substitute by value\n          value = 'CRS:84';\n        }\n        break;\n\n      case 'srs':\n        // CRS was called SRS before WMS 1.3.0\n        if (wmsParameters.version === '1.3.0') {\n          key = 'crs';\n        }\n        break;\n\n      case 'bbox':\n        // Coordinate order is flipped for certain CRS in WMS 1.3.0\n        const bbox = this._flipBoundingBox(value, wmsParameters);\n        if (bbox) {\n          value = bbox;\n        }\n        break;\n\n      case 'x':\n        // i is the parameter used in WMS 1.3\n        // TODO - change parameter to `i` and convert to `x` if not 1.3\n        if (wmsParameters.version === '1.3.0') {\n          key = 'i';\n        }\n        break;\n\n      case 'y':\n        // j is the parameter used in WMS 1.3\n        // TODO - change parameter to `j` and convert to `y` if not 1.3\n        if (wmsParameters.version === '1.3.0') {\n          key = 'j';\n        }\n        break;\n\n      default:\n      // do nothing\n    }\n\n    key = key.toUpperCase();\n\n    return Array.isArray(value)\n      ? `${key}=${value.join(',')}`\n      : `${key}=${value ? String(value) : ''}`;\n  }\n\n  /** Coordinate order is flipped for certain CRS in WMS 1.3.0 */\n  _flipBoundingBox(\n    bboxValue: unknown,\n    wmsParameters: WMSParameters\n  ): [number, number, number, number] | null {\n    // Sanity checks\n    if (!Array.isArray(bboxValue) || bboxValue.length !== 4) {\n      return null;\n    }\n\n    const flipCoordinates =\n      // Only affects WMS 1.3.0\n      wmsParameters.version === '1.3.0' &&\n      // Flip if we are dealing with a CRS that was flipped in 1.3.0\n      this.flipCRS.includes(wmsParameters.crs || '') &&\n      // Don't flip if we are substituting EPSG:4326 with CRS:84\n      !(this.substituteCRS84 && wmsParameters.crs === 'EPSG:4326');\n\n    const bbox = bboxValue as [number, number, number, number];\n    return flipCoordinates ? [bbox[1], bbox[0], bbox[3], bbox[2]] : bbox;\n  }\n\n  /** Fetches an array buffer and checks the response (boilerplate reduction) */\n  protected async _fetchArrayBuffer(url: string): Promise<ArrayBuffer> {\n    const response = await this.fetch(url);\n    const arrayBuffer = await response.arrayBuffer();\n    this._checkResponse(response, arrayBuffer);\n    return arrayBuffer;\n  }\n\n  /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n  protected _checkResponse(response: Response, arrayBuffer: ArrayBuffer): void {\n    const contentType = response.headers['content-type'];\n    if (!response.ok || WMSErrorLoader.mimeTypes.includes(contentType)) {\n      // We want error responses to throw exceptions, the WMSErrorLoader can do this\n      const loadOptions = mergeOptions<WMSLoaderOptions>(this.loadOptions, {\n        wms: {throwOnError: true}\n      });\n      const error = WMSErrorLoader.parseSync?.(arrayBuffer, loadOptions);\n      throw new Error(error);\n    }\n  }\n\n  /** Error situation detected */\n  protected _parseError(arrayBuffer: ArrayBuffer): Error {\n    const error = WMSErrorLoader.parseSync?.(arrayBuffer, this.options.core?.loadOptions);\n    return new Error(error);\n  }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type Service = {name: string; type: string; url: string};\n\ntype FetchLike = typeof fetch;\n\n/**\n * (Recursively) load the service directory from an ArcGIS Server URL\n * @param url\n * @param fetchFile= Optional fetch function override\n * @returns\n */\nexport async function getArcGISServices(\n  url: string,\n  fetchFile: FetchLike = fetch\n): Promise<Service[] | null> {\n  if (url.includes('rest/services')) {\n    const serverUrl = url.replace(/rest\\/services.*$/i, 'rest/services');\n    return loadServiceDirectory(serverUrl, fetchFile, []);\n  }\n  return null;\n}\n\nasync function loadServiceDirectory(\n  serverUrl: string,\n  fetch: FetchLike,\n  path: string[]\n): Promise<Service[]> {\n  const serviceUrl = `${serverUrl}/${path.join('/')}`;\n\n  const response = await fetch(`${serviceUrl}?f=pjson`);\n  const directory = await response.json();\n\n  const services = extractServices(directory, serviceUrl);\n\n  const folders = (directory.folders || []) as string[];\n  const promises = folders.map((folder) =>\n    loadServiceDirectory(`${serverUrl}`, fetch, [...path, folder])\n  );\n\n  for (const folderServices of await Promise.all(promises)) {\n    services.push(...folderServices);\n  }\n\n  return services;\n}\n\nfunction extractServices(directory: unknown, url: string): Service[] {\n  const arcgisServices = ((directory as any).services || []) as {name: string; type: string}[];\n  const services: Service[] = [];\n  for (const service of arcgisServices) {\n    services.push({\n      name: service.name,\n      type: `arcgis-${service.type.toLocaleLowerCase().replace('server', '-server')}`,\n      url: `${url}${service.name}/${service.type}`\n    });\n  }\n  return services;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {ImageType} from '@loaders.gl/images';\nimport type {\n  Source,\n  DataSourceOptions,\n  ImageSourceMetadata,\n  GetImageParameters\n} from '@loaders.gl/loader-utils';\nimport {DataSource, ImageSource} from '@loaders.gl/loader-utils';\n\nexport type ArcGISImageSourceProps = DataSourceOptions & {\n  'arcgis-image-server'?: {\n    // TODO - add options here\n  };\n};\n\nexport const ArcGISImageServerSource = {\n  name: 'ArcGISImageServer',\n  id: 'arcgis-image-server',\n  module: 'wms',\n  version: '0.0.0',\n  extensions: [],\n  mimeTypes: [],\n  type: 'arcgis-image-server',\n  fromUrl: true,\n  fromBlob: false,\n\n  defaultOptions: {\n    'arcgis-image-server': {\n      // TODO - add options here\n    }\n  },\n\n  testURL: (url: string): boolean => url.toLowerCase().includes('ImageServer'),\n  createDataSource: (url, props: ArcGISImageSourceProps): ArcGISImageSource =>\n    new ArcGISImageSource(url as string, props)\n} as const satisfies Source<ArcGISImageSource>;\n\n/**\n * ArcGIS ImageServer\n * Note - exports a big API, that could be exposed here if there is a use case\n * @see https://developers.arcgis.com/rest/services-reference/enterprise/image-service.htm\n */\nexport class ArcGISImageSource\n  extends DataSource<string, ArcGISImageSourceProps>\n  implements ImageSource\n{\n  constructor(url: string, props: ArcGISImageSourceProps) {\n    super(url, props, ArcGISImageServerSource.defaultOptions);\n  }\n\n  // ImageSource (normalized endpoints)\n\n  async getMetadata(): Promise<ImageSourceMetadata> {\n    return (await this.metadata()) as ImageSourceMetadata;\n    // TODO - normalize metadata\n  }\n\n  async getImage(parameters: GetImageParameters): Promise<ImageType> {\n    throw new Error('not implemented');\n    // TODO - Map generic parameters to ArcGIS specific parameters\n    // return await this.exportImage(parameters);\n  }\n\n  // ImageServer endpoints\n\n  async metadata(): Promise<unknown> {\n    // We just need a JSON parsing...\n    // return this.getUrl({path: '', ...options});\n    throw new Error('not implemented');\n  }\n\n  /** \n   * Form a URL to an ESRI ImageServer\n   // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&compressionQuality=&bandIds=&mosaicRule=&renderingRule=&f=image`,\n   */\n  exportImage(options: {\n    boundingBox: [number, number, number, number];\n    boundingBoxSR?: string;\n    width: number;\n    height: number;\n    imageSR?: string;\n    time?: never;\n    format?: 'jpgpng';\n    pixelType?: 'U8';\n    noData?: never;\n    noDataInterpretation?: 'esriNoDataMatchAny';\n    interpolation?: '+RSP_NearestNeighbor';\n    compression?: never;\n    compressionQuality?: never;\n    bandIds?: never;\n    mosaicRule?: never;\n    renderingRule?: never;\n    f?: 'image';\n  }): Promise<ImageType> {\n    // See WMSService.getMap()\n    throw new Error('not implemented');\n  }\n\n  // URL creators\n\n  metadataURL(options: {parameters?: Record<string, unknown>}): string {\n    return `${this.url}?f=pjson`;\n  }\n\n  /** \n   * Form a URL to an ESRI ImageServer\n   // https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/exportImage?\n   //   bbox=${bounds[0]},${bounds[1]},${bounds[2]},${bounds[3]}&bboxSR=4326&\n   //   size=${width},${height}&imageSR=102100&time=&format=jpgpng&pixelType=U8&\n   //   noData=&noDataInterpretation=esriNoDataMatchAny&interpolation=+RSP_NearestNeighbor&compression=&\n   //   compressionQuality=&bandIds=&mosaicRule=&renderingRule=&\n   //   f=image\n   */\n  exportImageURL(options: {\n    bbox: [number, number, number, number];\n    boxSR?: string;\n    width: number;\n    height: number;\n    imageSR?: string;\n    time?: never;\n    format?: 'jpgpng';\n    pixelType?: 'U8';\n    noData?: never;\n    noDataInterpretation?: 'esriNoDataMatchAny';\n    interpolation?: '+RSP_NearestNeighbor';\n    compression?: never;\n    compressionQuality?: never;\n    bandIds?: never;\n    mosaicRule?: never;\n    renderingRule?: never;\n    f?: 'image';\n  }): string {\n    const bbox = `bbox=${options.bbox[0]},${options.bbox[1]},${options.bbox[2]},${options.bbox[3]}`;\n    const size = `size=${options.width},${options.height}`;\n    const arcgisOptions = {...options, bbox, size};\n    // @ts-expect-error\n    delete arcgisOptions.width;\n    // @ts-expect-error\n    delete arcgisOptions.height;\n    return this.getUrl('exportImage', arcgisOptions);\n  }\n\n  // INTERNAL METHODS\n\n  /**\n   * @note protected, since perhaps getWMSUrl may need to be overridden to handle certain backends?\n   * @note if override is common, maybe add a callback prop?\n   * */\n  protected getUrl(\n    path: string,\n    options: Record<string, unknown>,\n    extra?: Record<string, unknown>\n  ): string {\n    let url = `${this.url}/${path}`;\n    let first = true;\n    for (const [key, value] of Object.entries(options)) {\n      url += first ? '?' : '&';\n      first = false;\n      if (Array.isArray(value)) {\n        url += `${key.toUpperCase()}=${value.join(',')}`;\n      } else {\n        url += `${key.toUpperCase()}=${value ? String(value) : ''}`;\n      }\n    }\n    return url;\n  }\n\n  /** Checks for and parses a WMS XML formatted ServiceError and throws an exception */\n  protected async checkResponse(response: Response) {\n    if (!response.ok) {\n      // } || response.headers['content-type'] === WMSErrorLoader.mimeTypes[0]) {\n      // const arrayBuffer = await response.arrayBuffer();\n      // const error = await WMSErrorLoader.parse(arrayBuffer, this.loadOptions);\n      throw new Error('error');\n    }\n  }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Source, SourceArrayDataSourceType, DataSourceOptions} from '@loaders.gl/loader-utils';\nimport type {WMSSourceOptions} from '../../wms-source';\nimport {WMSSource} from '../../wms-source';\nimport {ArcGISImageServerSource} from '../../arcgis/arcgis-image-source';\n\nexport type ImageSourceType = 'wms' | 'arcgis-image-server' | 'template';\n\nconst SOURCES = [WMSSource, ArcGISImageServerSource] as const;\n\n/**\n * * @deprecated Use createDataSource from @loaders.gl/core\n */\ntype CreateImageSourceOptions = DataSourceOptions &\n  WMSSourceOptions & {\n    type?: ImageSourceType | 'auto';\n  };\n\n/**\n * Creates an image source\n * If type is not supplied, will try to automatically detect the the\n * @param url URL to the image source\n * @param type type of source. if not known, set to 'auto'\n * @returns an ImageSource instance\n *\n * @deprecated Use createDataSource from @loaders.gl/core\n */\nexport function createImageSource<SourceArrayT extends Source[]>(options: {\n  url: string;\n  type: string;\n  loadOptions: any;\n  options: Readonly<CreateImageSourceOptions>; // Readonly<SourceArrayOptionsType<SourceArrayT>>,\n  sources: Readonly<Source[]>;\n}): SourceArrayDataSourceType<SourceArrayT> {\n  const {type = 'auto', url, sources = SOURCES, loadOptions} = options;\n  const source: SourceArrayT[number] | null =\n    type === 'auto' ? guessSourceType(url, sources) : getSourceOfType(type, sources);\n\n  if (!source) {\n    throw new Error('Not a valid image source type');\n  }\n  return source.createDataSource(url, {core: {loadOptions}});\n}\n\n/** Guess service type from URL */\nfunction getSourceOfType(type: string, sources: Readonly<Source[]>): Source | null {\n  // if (type === 'template') {\n  //   return ImageSource;\n  // }\n\n  for (const source of sources) {\n    if (source.type === type) {\n      return source;\n    }\n  }\n\n  return null;\n}\n\n/** Guess source type from URL */\nfunction guessSourceType(url: string, sources: Readonly<Source[]>): Source | null {\n  for (const source of sources) {\n    if (source.testURL && source.testURL(url)) {\n      return source;\n    }\n  }\n\n  return null;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;ACKA,iBAAwB;;;ACMlB,SAAU,qBAAqB,WAAc;AAXnD;AAqBE,QAAM,kBAAuB,UAAU;AACvC,MAAI,CAAC,iBAAiB;AACpB;EACF;AACA,QAAM,iBACJ,qBAAgB,cAAhB,mBAA2B,oBAC3B,qBAAgB,cAAhB,mBAA2B,oBAC3B,qBAAgB,cAAhB,mBAA2B,YAC3B;AAEF,QAAM,IAAI,MAAM,mBAAmB,cAAc;AACnD;;;AD0DM,SAAU,qBAAqB,MAAc,SAA0B;AA1F7E;AA2FE,QAAM,aAAY,iCAAU,kBAAV,4BAA0B,MAAM;IAChD,GAAG;IACH,KAAK;MACH,GAAG,mCAAS;MACZ,gBAAgB;MAChB,kBAAkB;;;AAItB,uBAAqB,SAAS;AAE9B,QAAM,kBAAuB,UAAU,gBAAgB;AACvD,SAAO;AACT;;;AE7FA,IAAM,UAAU,OAAoC,UAAe;AAa5D,IAAM,wBAAwB;EACnC,UAAU;EACV,WAAW;EAEX,IAAI;EACJ,MAAM;EACN,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAAY,CAAC,KAAK;EAClB,WAAW,CAAC,+BAA+B,mBAAmB,UAAU;EACxE,UAAU;EACV,SAAS;IACP,KAAK,CAAA;;EAEP,OAAO,OAAO,aAA0B,YACtC,qBAAqB,IAAI,YAAW,EAAG,OAAO,WAAW,GAAG,OAAO;EACrE,eAAe,CAAC,MAAc,YAA+B,qBAAqB,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MAC/C,OAAO;AACL,eAAO,GAAG,IAAI,YAAW,KAAM,QAAQ,OAAO,KAAK,IAAI;MACzD;IACF;AACA,WAAO;EACT;;EAGU,MAAM,cAAc,UAAkB;AAC9C,QAAI,CAAC,SAAS,IAAI;AAIhB,YAAM,IAAI,MAAM,OAAO;IACzB;EACF;;;;AxBjHF,IAAAC,uBAA0B;;;AyBvD1B,IAAM,UAAU,CAAC,WAAW,uBAAuB;AAmB7C,SAAU,kBAAiD,SAMhE;AACC,QAAM,EAAC,OAAO,QAAQ,KAAK,UAAU,SAAS,YAAW,IAAI;AAC7D,QAAM,SACJ,SAAS,SAAS,gBAAgB,KAAK,OAAO,IAAI,gBAAgB,MAAM,OAAO;AAEjF,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,+BAA+B;EACjD;AACA,SAAO,OAAO,iBAAiB,KAAK,EAAC,MAAM,EAAC,YAAW,EAAC,CAAC;AAC3D;AAGA,SAAS,gBAAgB,MAAc,SAA2B;AAKhE,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,SAAS,MAAM;AACxB,aAAO;IACT;EACF;AAEA,SAAO;AACT;AAGA,SAAS,gBAAgB,KAAa,SAA2B;AAC/D,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,WAAW,OAAO,QAAQ,GAAG,GAAG;AACzC,aAAO;IACT;EACF;AAEA,SAAO;AACT;",
  "names": ["import_xml", "VERSION", "testXMLFile", "import_xml", "VERSION", "testXMLFile", "import_xml", "VERSION", "testXMLFile", "import_xml", "VERSION", "testXMLFile", "import_xml", "import_xml", "import_xml", "VERSION", "testXMLFile", "import_xml", "rewind", "polygons3", "VERSION", "testXMLFile", "fetch", "import_loader_utils", "import_loader_utils"]
}
