{"version":3,"file":"dereekb-dbx-web-mapbox.mjs","sources":["../../../../packages/dbx-web/mapbox/src/lib/mapbox.longpress.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.service.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.util.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.rxjs.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.store.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.change.service.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.circle.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.circle.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.injection.store.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.injection.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.injection.store.provide.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.store.map.directive.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.layout.drawer.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.layout.drawer.component.html","../../../../packages/dbx-web/mapbox/src/lib/mapbox.layout.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.layout.component.html","../../../../packages/dbx-web/mapbox/src/lib/mapbox.menu.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.store.provide.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.marker.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.markers.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.layout.resize.sync.directive.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.popup.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.popup.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.module.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.worker.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.providers.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.marker.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.popup.item.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.popup.item.component.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.popup.item.controller.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.static.ts","../../../../packages/dbx-web/mapbox/src/lib/mapbox.ts","../../../../packages/dbx-web/mapbox/src/dereekb-dbx-web-mapbox.ts"],"sourcesContent":["import { type Getter, type Maybe, type Milliseconds, type Pixels, type Vector } from '@dereekb/util';\nimport type * as MapboxGl from 'mapbox-gl';\n\n// MARK: Config\n/**\n * Default time the pointer must be held still for a long press to fire.\n */\nexport const DEFAULT_MAPBOX_LONG_PRESS_DURATION: Milliseconds = 2000;\n\n/**\n * Default distance the pointer may drift from where the press started before the press is cancelled.\n *\n * Larger than mapbox's 3px click tolerance, since a held finger drifts more than a clicked mouse.\n */\nexport const DEFAULT_MAPBOX_LONG_PRESS_TOLERANCE: Pixels = 10;\n\n/**\n * How long after touch activity mouse events are ignored.\n *\n * Browsers send compatibility (\"ghost\") mouse events after a touch, which must not start a second, mouse press.\n */\nexport const DBX_MAPBOX_LONG_PRESS_TOUCH_MOUSE_GUARD_TIME: Milliseconds = 1000;\n\n/**\n * The {@link DbxMapboxLongPressEvent} type value.\n */\nexport const DBX_MAPBOX_LONG_PRESS_EVENT_TYPE = 'longpress';\n\n/**\n * What the long press was made with.\n */\nexport type DbxMapboxLongPressSource = 'touch' | 'mouse';\n\n/**\n * Configures the long press that opens the map's right-click menu.\n */\nexport interface DbxMapboxLongPressConfig {\n  /**\n   * How long the pointer must be held still. Defaults to {@link DEFAULT_MAPBOX_LONG_PRESS_DURATION}.\n   */\n  readonly duration?: Maybe<Milliseconds>;\n  /**\n   * How far the pointer may move from where the press started. Defaults to {@link DEFAULT_MAPBOX_LONG_PRESS_TOLERANCE}.\n   */\n  readonly tolerance?: Maybe<Pixels>;\n  /**\n   * Whether holding the left mouse button also counts, not only a touch. Defaults to true.\n   */\n  readonly mouse?: Maybe<boolean>;\n}\n\n/**\n * A {@link DbxMapboxLongPressConfig}, or false to turn the long press off.\n */\nexport type DbxMapboxLongPressConfigInput = Maybe<DbxMapboxLongPressConfig | false>;\n\n/**\n * A {@link DbxMapboxLongPressConfig} with every default applied.\n */\nexport interface DbxMapboxResolvedLongPressConfig {\n  readonly duration: Milliseconds;\n  readonly tolerance: Pixels;\n  readonly mouse: boolean;\n}\n\nexport interface ResolveDbxMapboxLongPressConfigInput {\n  /**\n   * Config that takes precedence, such as one set on a single map's store.\n   *\n   * False turns the long press off. A config is merged over the base, and turns the long press on even when the base is false. Unset falls back to the base.\n   */\n  readonly override?: DbxMapboxLongPressConfigInput;\n  /**\n   * The app-wide config. False turns the long press off; unset uses the defaults.\n   */\n  readonly base?: DbxMapboxLongPressConfigInput;\n}\n\n/**\n * Resolves the long press config to use, applying the defaults.\n *\n * @param input - The override and base configs.\n * @returns The resolved config, or undefined when the long press is off.\n */\nexport function resolveDbxMapboxLongPressConfig(input: ResolveDbxMapboxLongPressConfigInput): Maybe<DbxMapboxResolvedLongPressConfig> {\n  const { override, base } = input;\n  let config: Maybe<DbxMapboxLongPressConfig>;\n\n  if (override != null) {\n    config = override === false ? undefined : { ...(base || undefined), ...override };\n  } else if (base !== false) {\n    config = base ?? {};\n  }\n\n  return config\n    ? {\n        duration: config.duration ?? DEFAULT_MAPBOX_LONG_PRESS_DURATION,\n        tolerance: config.tolerance ?? DEFAULT_MAPBOX_LONG_PRESS_TOLERANCE,\n        mouse: config.mouse ?? true\n      }\n    : undefined;\n}\n\n// MARK: Event\n/**\n * Emitted when the pointer is held still on the map for the configured duration.\n *\n * Also emitted by the store's rightClickEvent$, so a long press opens the same menu a right-click does.\n */\nexport interface DbxMapboxLongPressEvent {\n  readonly type: typeof DBX_MAPBOX_LONG_PRESS_EVENT_TYPE;\n  /**\n   * The map the press was made on.\n   */\n  readonly target: MapboxGl.Map;\n  readonly source: DbxMapboxLongPressSource;\n  /**\n   * The DOM event that started the press.\n   */\n  readonly originalEvent: MouseEvent | TouchEvent;\n  /**\n   * Position of the pointer on the map canvas when the press fired.\n   */\n  readonly point: MapboxGl.Point;\n  /**\n   * Map coordinates of the pointer when the press fired.\n   */\n  readonly lngLat: MapboxGl.LngLat;\n  /**\n   * How long the pointer was held.\n   */\n  readonly duration: Milliseconds;\n}\n\n/**\n * Returns true if the event is a {@link DbxMapboxLongPressEvent}, as opposed to a mapbox mouse event.\n *\n * @param event - The event to check.\n * @returns True for a long press event.\n */\nexport function isDbxMapboxLongPressEvent(event: Maybe<{ readonly type: string }>): event is DbxMapboxLongPressEvent {\n  return event?.type === DBX_MAPBOX_LONG_PRESS_EVENT_TYPE;\n}\n\n/**\n * Returns true if a mouse event (such as contextmenu) was produced by a touch or pen rather than a mouse.\n *\n * Chromium sends contextmenu as a PointerEvent with a pointerType; sourceCapabilities covers the rest.\n *\n * @param event - The mouse event.\n * @returns True if the event came from a touch or pen.\n */\nexport function isTouchSourcedMouseEvent(event: MouseEvent): boolean {\n  const pointerType = (event as Partial<PointerEvent>).pointerType;\n  const firesTouchEvents = (event as { readonly sourceCapabilities?: Maybe<{ readonly firesTouchEvents?: boolean }> }).sourceCapabilities?.firesTouchEvents;\n  return pointerType === 'touch' || pointerType === 'pen' || firesTouchEvents === true;\n}\n\n/**\n * Stops the next click event, if it happens in the current task.\n *\n * Used after the mouse is released on a press that already fired, so the release does not also click the map. Same approach as mapbox's own click suppression after a drag.\n */\nexport function suppressNextClickEvent(): void {\n  const suppressClick = (event: MouseEvent) => {\n    event.preventDefault();\n    event.stopPropagation();\n    window.removeEventListener('click', suppressClick, true);\n  };\n\n  window.addEventListener('click', suppressClick, true);\n  setTimeout(() => window.removeEventListener('click', suppressClick, true), 0);\n}\n\n// MARK: Tracker\nexport type DbxMapboxLongPressTrackerState = 'idle' | 'pending' | 'fired';\n\nexport interface DbxMapboxLongPressTrackerStart {\n  readonly source: DbxMapboxLongPressSource;\n  /**\n   * Client (viewport) position of the pointer.\n   */\n  readonly position: Vector;\n  /**\n   * The DOM event that started the press.\n   */\n  readonly event: MouseEvent | TouchEvent;\n}\n\nexport interface DbxMapboxLongPressTrackerResult {\n  readonly source: DbxMapboxLongPressSource;\n  /**\n   * Latest client (viewport) position of the pointer.\n   */\n  readonly position: Vector;\n  /**\n   * The DOM event that started the press.\n   */\n  readonly startEvent: MouseEvent | TouchEvent;\n  readonly duration: Milliseconds;\n}\n\nexport interface DbxMapboxLongPressTrackerConfig {\n  /**\n   * Returns the config to use. Read when each press starts, so a changed config applies from the next press. Undefined turns the long press off.\n   */\n  readonly getConfig: Getter<Maybe<DbxMapboxResolvedLongPressConfig>>;\n  /**\n   * Called when a press has been held for the configured duration.\n   */\n  readonly onLongPress: (result: DbxMapboxLongPressTrackerResult) => void;\n}\n\n/**\n * Tracks presses on the map and reports the ones held still for the configured duration.\n *\n * It only tracks positions and time; the caller feeds it pointer events and decides what a long press does.\n */\nexport interface DbxMapboxLongPressTracker {\n  readonly state: DbxMapboxLongPressTrackerState;\n  /**\n   * What the current press was made with, if a press is pending or fired.\n   */\n  readonly source: Maybe<DbxMapboxLongPressSource>;\n  /**\n   * Starts a press, replacing any current one.\n   *\n   * @param input - The pointer position and the event that started the press.\n   * @returns True if a press was started. False when the long press is off, the source is a mouse and mouse presses are off, or the mouse event came right after a touch.\n   */\n  start(input: DbxMapboxLongPressTrackerStart): boolean;\n  /**\n   * Updates the pointer position. Cancels the pending press if the pointer moved farther than the tolerance from where it started.\n   */\n  move(source: DbxMapboxLongPressSource, position: Vector): void;\n  /**\n   * Ends the press when the pointer is released.\n   *\n   * @returns True if the press had already fired.\n   */\n  end(source: DbxMapboxLongPressSource): boolean;\n  /**\n   * Cancels the current press, such as when the user starts zooming.\n   */\n  cancel(): void;\n  /**\n   * Whether a touch is down, or was recently, so mouse events are likely touch compatibility events.\n   */\n  isTouchInteraction(): boolean;\n  /**\n   * Whether the next click should be ignored because it ends a press that fired.\n   */\n  shouldSuppressClick(): boolean;\n  destroy(): void;\n}\n\ninterface DbxMapboxLongPressTrackerPress {\n  readonly source: DbxMapboxLongPressSource;\n  readonly startPosition: Vector;\n  readonly position: Vector;\n  readonly startEvent: MouseEvent | TouchEvent;\n  readonly duration: Milliseconds;\n  readonly tolerance: Pixels;\n}\n\n/**\n * Creates a {@link DbxMapboxLongPressTracker}.\n *\n * @param config - The config getter and the long press callback.\n * @returns A new tracker.\n */\nexport function dbxMapboxLongPressTracker(config: DbxMapboxLongPressTrackerConfig): DbxMapboxLongPressTracker {\n  const { getConfig, onLongPress } = config;\n\n  let state: DbxMapboxLongPressTrackerState = 'idle';\n  let press: Maybe<DbxMapboxLongPressTrackerPress>;\n  let timeout: Maybe<ReturnType<typeof setTimeout>>;\n  let isTouchDown = false;\n  let lastTouchTime: Maybe<number>;\n  let suppressClick = false;\n\n  function reset() {\n    if (timeout != null) {\n      clearTimeout(timeout);\n      timeout = undefined;\n    }\n\n    state = 'idle';\n    press = undefined;\n  }\n\n  function isWithinTouchGuard() {\n    return lastTouchTime != null && Date.now() - lastTouchTime < DBX_MAPBOX_LONG_PRESS_TOUCH_MOUSE_GUARD_TIME;\n  }\n\n  function fire() {\n    timeout = undefined;\n\n    if (press && state === 'pending') {\n      state = 'fired';\n      suppressClick = true;\n      onLongPress({ source: press.source, position: press.position, startEvent: press.startEvent, duration: press.duration });\n    }\n  }\n\n  return {\n    get state() {\n      return state;\n    },\n    get source() {\n      return press?.source;\n    },\n    start(input: DbxMapboxLongPressTrackerStart) {\n      const { source, position, event } = input;\n      const isGhostMouse = source === 'mouse' && isWithinTouchGuard();\n      let started = false;\n\n      if (source === 'touch') {\n        isTouchDown = true;\n        lastTouchTime = Date.now();\n      }\n\n      // a ghost mouse event is part of a touch that already happened, so it must not reset that touch's state\n      if (!isGhostMouse) {\n        suppressClick = false;\n        const resolved = getConfig();\n\n        if (resolved && (source === 'touch' || resolved.mouse)) {\n          reset();\n          press = { source, startPosition: position, position, startEvent: event, duration: resolved.duration, tolerance: resolved.tolerance };\n          state = 'pending';\n          timeout = setTimeout(fire, resolved.duration);\n          started = true;\n        }\n      }\n\n      return started;\n    },\n    move(source: DbxMapboxLongPressSource, position: Vector) {\n      if (source === 'touch') {\n        lastTouchTime = Date.now();\n      }\n\n      if (press && state === 'pending' && press.source === source) {\n        const distance = Math.hypot(position.x - press.startPosition.x, position.y - press.startPosition.y);\n\n        if (distance > press.tolerance) {\n          reset();\n        } else {\n          press = { ...press, position };\n        }\n      }\n    },\n    end(source: DbxMapboxLongPressSource) {\n      let fired = false;\n\n      if (source === 'touch') {\n        isTouchDown = false;\n        lastTouchTime = Date.now();\n      }\n\n      if (press?.source === source) {\n        fired = state === 'fired';\n        reset();\n      }\n\n      return fired;\n    },\n    cancel() {\n      reset();\n    },\n    isTouchInteraction() {\n      return isTouchDown || isWithinTouchGuard();\n    },\n    shouldSuppressClick() {\n      return suppressClick;\n    },\n    destroy() {\n      reset();\n    }\n  };\n}\n","import { Injectable, inject } from '@angular/core';\nimport { latLngPoint, type LatLngPointInput, type Maybe, type Milliseconds } from '@dereekb/util';\nimport { type MapOptions } from 'mapbox-gl';\nimport { type KnownMapboxStyle, type MapboxZoomLevel } from './mapbox';\nimport { type DbxMapboxLongPressConfigInput, type DbxMapboxResolvedLongPressConfig, resolveDbxMapboxLongPressConfig } from './mapbox.longpress';\n\nexport class DbxMapboxConfig {\n  readonly defaultStyle?: MapOptions['style'];\n  readonly defaultZoom?: MapboxZoomLevel;\n  readonly defaultCenter?: LatLngPointInput;\n  readonly defaultStoreRefreshPeriod?: number;\n  /**\n   * Width to use for the mapbox layout drawer (mat-sidenav).\n   *\n   * Overrides the `--mat-sidenav-container-width` CSS token on the layout component.\n   * Defaults to 'auto' so the drawer width is determined by its content rather than\n   * the M3 default of 360px.\n   */\n  readonly drawerWidth?: string;\n  /**\n   * Long press that opens the map's right-click menu, for users that cannot right-click (touch screens).\n   *\n   * On by default with the default duration and tolerance. Set to false to turn it off.\n   */\n  readonly longPress?: DbxMapboxLongPressConfigInput;\n}\n\nexport const DEFAULT_MAPBOX_STYLE: KnownMapboxStyle = 'mapbox://styles/mapbox/streets-v12';\nexport const DEFAULT_MAPBOX_CENTER: LatLngPointInput = [30.2690138665, -97.7408297965];\nexport const DEFAULT_MAPBOX_ZOOM: MapboxZoomLevel = 8;\nexport const DEFAULT_MAPBOX_LAYOUT_DRAWER_WIDTH = 'auto';\nexport const DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD: Milliseconds = 200;\n\n@Injectable()\nexport class DbxMapboxService {\n  private readonly _config = inject(DbxMapboxConfig, { optional: true }) ?? {};\n\n  get defaultStyle() {\n    return this._config.defaultStyle ?? DEFAULT_MAPBOX_STYLE;\n  }\n\n  get defaultZoom(): MapboxZoomLevel {\n    return this._config.defaultZoom ?? DEFAULT_MAPBOX_ZOOM;\n  }\n\n  get defaultCenter(): LatLngPointInput {\n    return this._config.defaultCenter ?? DEFAULT_MAPBOX_CENTER;\n  }\n\n  get drawerWidth(): string {\n    return this._config.drawerWidth ?? DEFAULT_MAPBOX_LAYOUT_DRAWER_WIDTH;\n  }\n\n  /**\n   * The app-wide long press config, or undefined when the long press is off.\n   *\n   * @returns The resolved config.\n   */\n  get longPressConfig(): Maybe<DbxMapboxResolvedLongPressConfig> {\n    return resolveDbxMapboxLongPressConfig({ base: this._config.longPress });\n  }\n\n  get mapboxMapStoreTimerRefreshPeriod(): number {\n    return this._config.defaultStoreRefreshPeriod ?? DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD;\n  }\n\n  initializationOptions(): Partial<MapOptions> {\n    return {\n      style: this.defaultStyle,\n      zoom: this.defaultZoom,\n      center: latLngPoint(this.defaultCenter)\n    };\n  }\n}\n","import { type LatLngBound, type LatLngPoint, type Vector, type VectorTuple } from '@dereekb/util';\nimport { bounds } from '@placemarkio/geo-viewport';\nimport { type DbxMapboxRightClickEvent, type MapboxTileSize, type MapboxZoomLevel } from './mapbox';\n\nexport interface MapboxViewportBoundFunctionConfig {\n  readonly mapCanvasSize: Vector;\n  /**\n   * Mapbox tilesize being used. Defaults to 512x512.\n   */\n  readonly tileSize?: MapboxTileSize;\n}\n\n/**\n * Input for MapboxViewportBoundFunction.\n */\nexport interface MapboxViewportBoundFunctionInput {\n  /**\n   * Center of the viewport\n   */\n  readonly center: LatLngPoint;\n  /**\n   * Zoom level\n   */\n  readonly zoom: MapboxZoomLevel;\n}\n\n/**\n * Used to calculate the bounds of a view/object given the input MapboxViewportBoundFunctionInput.\n */\nexport type MapboxViewportBoundFunction = (input: MapboxViewportBoundFunctionInput) => LatLngBound;\n\n/**\n * Creates a function that calculates the geographic bounds of a Mapbox viewport given a center point and zoom level.\n *\n * @param config - Configuration specifying the map canvas size and optional tile size.\n * @returns Accepts a center point and zoom level and returns the corresponding {@link LatLngBound}.\n */\nexport function mapboxViewportBoundFunction(config: MapboxViewportBoundFunctionConfig): MapboxViewportBoundFunction {\n  const { mapCanvasSize, tileSize = 512 } = config;\n  const dimensions: VectorTuple = [mapCanvasSize.x, mapCanvasSize.y];\n  return ({ center, zoom }) => {\n    const boundingBox = bounds([center.lng, center.lat], zoom, dimensions, tileSize);\n    const [swLng, swLat, neLng, neLat] = boundingBox;\n\n    return {\n      sw: { lat: swLat, lng: swLng },\n      ne: { lat: neLat, lng: neLng }\n    };\n  };\n}\n\n// MARK: Client Points\n/**\n * The parts of the map's canvas container used to convert between client (viewport) and map canvas positions.\n */\nexport type MapboxCanvasContainerLike = Pick<HTMLElement, 'getBoundingClientRect' | 'offsetWidth'>;\n\nexport interface MapboxCanvasContainerPointInput {\n  readonly container: MapboxCanvasContainerLike;\n  readonly point: Vector;\n}\n\n/**\n * Returns the container's CSS scaling, the same way mapbox computes it for mouse positions. It is 1 unless the map is inside a CSS transform.\n *\n * @param container - The map's canvas container.\n * @param rect - The container's bounding client rect.\n * @returns The scaling from client pixels to map canvas pixels.\n */\nfunction mapboxCanvasContainerScaling(container: MapboxCanvasContainerLike, rect: DOMRect): number {\n  return container.offsetWidth === rect.width || !rect.width ? 1 : container.offsetWidth / rect.width;\n}\n\n/**\n * Converts a client (viewport) position, such as a touch's clientX/clientY, to a position on the map canvas.\n *\n * @param input - The canvas container and the client position.\n * @returns The map canvas position, which map.unproject() turns into coordinates.\n */\nexport function mapboxClientPointToMapPoint(input: MapboxCanvasContainerPointInput): Vector {\n  const { container, point } = input;\n  const rect = container.getBoundingClientRect();\n  const scaling = mapboxCanvasContainerScaling(container, rect);\n  return { x: (point.x - rect.left) * scaling, y: (point.y - rect.top) * scaling };\n}\n\n/**\n * Converts a position on the map canvas, such as a map event's point, to a client (viewport) position.\n *\n * @param input - The canvas container and the map canvas position.\n * @returns The client position.\n */\nexport function mapboxMapPointToClientPoint(input: MapboxCanvasContainerPointInput): Vector {\n  const { container, point } = input;\n  const rect = container.getBoundingClientRect();\n  const scaling = mapboxCanvasContainerScaling(container, rect);\n  return { x: rect.left + point.x / scaling, y: rect.top + point.y / scaling };\n}\n\n/**\n * Returns the client (viewport) position of a right-click or long press event, for positioning a menu at it.\n *\n * @param event - The right-click or long press event.\n * @returns The client position.\n */\nexport function dbxMapboxRightClickEventClientPosition(event: DbxMapboxRightClickEvent): Vector {\n  return mapboxMapPointToClientPoint({ container: event.target.getCanvasContainer(), point: event.point });\n}\n","import { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { LAT_LONG_10M_PRECISION, type LatLngPointInput, type LatLngBound, type LatLngBoundCheckFunction, latLngPointFunction, roundNumberToStepFunction, type RoundNumberToStepFunctionInput, type LatLngPrecision, type Maybe } from '@dereekb/util';\nimport { combineLatestWith, map, type Observable, type OperatorFunction, switchMap, shareReplay, distinctUntilChanged } from 'rxjs';\nimport { type MapboxZoomLevel } from './mapbox';\nimport { type MapboxViewportBoundFunction } from './mapbox.util';\n\nexport type FilterMapboxBoundReadItemValueFunction<T> = (value: T) => MapboxViewportBoundFunctionItemValue;\n\nexport interface FilterMapboxBoundConfig<T> {\n  readonly boundFunctionObs: ObservableOrValue<MapboxViewportBoundFunction>;\n  readonly boundDecisionObs: ObservableOrValue<LatLngBoundCheckFunction>;\n  /**\n   * Reads the value from the input item.\n   */\n  readonly readValue: FilterMapboxBoundReadItemValueFunction<T>;\n  /**\n   * Minimum precision to retain. Defaults to LAT_LONG_10M_PRECISION\n   */\n  readonly precision?: LatLngPrecision;\n  /**\n   * Amount of zoom rounding to use. By default rounds to 0.5 steps using \"floor\" in order to \"round up\" since zoom values are inversely proportional to bounds area.\n   */\n  readonly zoomRounding?: RoundNumberToStepFunctionInput;\n  /**\n   * Default zoom level for item values that do not have an explicit zoom, or a zoom of 0.\n   *\n   * Defaults to 17, which can produce a viewport/bounds about the size of a park.\n   */\n  readonly defaultZoom?: MapboxZoomLevel;\n}\n\nexport interface MapboxViewportBoundFunctionItemValue {\n  readonly center: LatLngPointInput;\n  readonly zoom?: Maybe<MapboxZoomLevel>;\n}\n\nexport interface MapboxViewportBoundFunctionItem<T> {\n  readonly value: T;\n  readonly bound: LatLngBound;\n}\n\n/**\n * Filters the input objects based on their center and zoom values.\n *\n * This function caches the bounds computations for each of the input values.\n *\n * @param config\n * @returns\n */\nexport function filterByMapboxViewportBound<T>(config: FilterMapboxBoundConfig<T>): OperatorFunction<T[], T[]> {\n  const { boundDecisionObs: inputBoundDecisionObs, boundFunctionObs: inputBoundFunctionObs, defaultZoom: inputDefaultZoom = 17, readValue, zoomRounding, precision = LAT_LONG_10M_PRECISION } = config;\n  const _latLngPoint = latLngPointFunction({ wrap: false, validate: false, precision });\n  const _roundZoom = roundNumberToStepFunction(zoomRounding || { step: 0.5, round: 'floor' });\n\n  const boundDecisionObs = asObservable(inputBoundDecisionObs);\n  const boundFunctionObs = asObservable(inputBoundFunctionObs);\n\n  return (input: Observable<T[]>) => {\n    return boundFunctionObs.pipe(\n      distinctUntilChanged(),\n      switchMap((viewportBoundFunction) => {\n        const cache = new Map<string, LatLngBound>();\n\n        return input.pipe(\n          map((values: T[]) => {\n            return values.map((value: T) => {\n              const item: MapboxViewportBoundFunctionItemValue = readValue(value);\n              const centerLatLng = _latLngPoint(item.center);\n              const zoomStep = _roundZoom(item.zoom || inputDefaultZoom);\n              const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;\n\n              const cachedValue = cache.get(cacheKey);\n              let bound: LatLngBound;\n\n              if (cachedValue) {\n                bound = cachedValue;\n              } else {\n                bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });\n                cache.set(cacheKey, bound);\n              }\n\n              return {\n                value,\n                bound\n              };\n            });\n          }),\n          combineLatestWith(boundDecisionObs),\n          map(([items, boundFunction]) => {\n            const valuesInBounds: T[] = [];\n\n            items.forEach((item) => {\n              if (boundFunction(item.bound)) {\n                valuesInBounds.push(item.value);\n              }\n            });\n\n            return valuesInBounds;\n          })\n        );\n      }),\n      shareReplay(1)\n    );\n  };\n}\n","import { cleanup, filterMaybe, onTrueToFalse } from '@dereekb/rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport {\n  isSameLatLngBound,\n  isSameLatLngPoint,\n  type IsWithinLatLngBoundFunction,\n  isWithinLatLngBoundFunction,\n  type LatLngBound,\n  latLngBoundFunction,\n  type LatLngPointInput,\n  type LatLngPoint,\n  latLngPointFunction,\n  type Maybe,\n  type OverlapsLatLngBoundFunction,\n  overlapsLatLngBoundFunction,\n  diffLatLngBoundPoints,\n  latLngBoundCenterPoint,\n  addLatLngPoints,\n  isDefaultLatLngPoint,\n  swMostLatLngPoint,\n  neMostLatLngPoint,\n  latLngBoundWrapsMap,\n  type Vector,\n  filterUndefinedValues,\n  latLngBoundFromInput,\n  vectorMinimumSizeResizeFunction,\n  isSameVector,\n  type ZoomLevel\n} from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type MapService } from 'ngx-mapbox-gl';\nimport { defaultIfEmpty, distinctUntilChanged, filter, map, shareReplay, switchMap, tap, NEVER, type Observable, of, Subscription, startWith, interval, first, combineLatest, EMPTY, type OperatorFunction, throttleTime, fromEvent } from 'rxjs';\nimport { LngLatBounds, Point, type MapEventType, type MapEvents, type Map } from 'mapbox-gl';\nimport {\n  type DbxMapboxClickEvent,\n  type DbxMapboxRightClickEvent,\n  type KnownMapboxStyle,\n  type MapboxBearing,\n  type MapboxEaseTo,\n  type MapboxEventData,\n  type MapboxFitBounds,\n  type MapboxFitPositions,\n  type MapboxFlyTo,\n  type MapboxJumpTo,\n  type MapboxResetNorth,\n  type MapboxResetNorthPitch,\n  type MapboxRotateTo,\n  type MapboxSnapToNorth,\n  type MapboxStyleConfig,\n  type MapboxZoomLevel,\n  type MapboxZoomLevelRange\n} from './mapbox';\nimport { DbxMapboxService } from './mapbox.service';\nimport { type DbxInjectionComponentConfig } from '@dereekb/dbx-core';\nimport { mapboxClientPointToMapPoint, mapboxViewportBoundFunction, type MapboxViewportBoundFunction } from './mapbox.util';\nimport { DBX_MAPBOX_LONG_PRESS_EVENT_TYPE, type DbxMapboxLongPressConfigInput, type DbxMapboxLongPressEvent, dbxMapboxLongPressTracker, isTouchSourcedMouseEvent, resolveDbxMapboxLongPressConfig, suppressNextClickEvent } from './mapbox.longpress';\nimport { type FilterMapboxBoundConfig, type FilterMapboxBoundReadItemValueFunction, filterByMapboxViewportBound } from './mapbox.rxjs';\n\nexport type MapboxMapLifecycleState = 'init' | 'load' | 'render' | 'idle';\nexport type MapboxMapMoveState = 'init' | 'idle' | 'moving';\nexport type MapboxMapZoomState = 'init' | 'idle' | 'zooming';\nexport type MapboxMapRotateState = 'init' | 'idle' | 'rotating';\n\nexport interface StringMapboxListenerPair {\n  type: string;\n  listener: (ev: MapboxEventData) => void;\n}\n\nexport interface TypedMapboxListenerPair<T extends keyof MapEventType> {\n  type: T;\n  listener: (ev: MapEventType[T] & MapboxEventData) => void;\n}\n\nexport interface DbxMapboxMarginCalculationSizing {\n  leftMargin: number;\n  rightMargin: number;\n  fullWidth: number;\n}\n\nexport type DbxMapboxStoreBoundRefreshType = 'always' | 'when_not_rendering' | 'only_after_render_finishes';\n\nexport interface DbxMapboxStoreBoundRefreshSettings {\n  /**\n   * Max bound refresh interval.\n   */\n  throttle: number;\n  /**\n   * Whether or not to wait to update the bound until after it has finished rendering.\n   */\n  refreshType: DbxMapboxStoreBoundRefreshType;\n}\n\nexport interface DbxMapboxStoreState {\n  /**\n   * Current MapService being utilized.\n   */\n  readonly mapService?: Maybe<MapService>;\n  readonly lifecycleState: MapboxMapLifecycleState;\n  readonly moveState: MapboxMapMoveState;\n  readonly zoomState: MapboxMapZoomState;\n  readonly rotateState: MapboxMapRotateState;\n  /**\n   * Visual container size of the map.\n   */\n  readonly mapCanvasSize?: Maybe<Vector>;\n  /**\n   * Latest click event\n   */\n  readonly clickEvent?: Maybe<DbxMapboxClickEvent>;\n  /**\n   * Latest double-click event\n   */\n  readonly doubleClickEvent?: Maybe<DbxMapboxClickEvent>;\n  /**\n   * Latest right-click: a contextmenu event, or a long press.\n   */\n  readonly rightClickEvent?: Maybe<DbxMapboxRightClickEvent>;\n  /**\n   * Latest long press event.\n   */\n  readonly longPressEvent?: Maybe<DbxMapboxLongPressEvent>;\n  /**\n   * Long press config for this map, over the app-wide DbxMapboxConfig.longPress. False turns the long press off for this map.\n   */\n  readonly longPressConfig?: DbxMapboxLongPressConfigInput;\n  /**\n   * Whether or not to retain content between resets.\n   *\n   * True by default.\n   */\n  readonly retainContent: boolean;\n  /**\n   * Custom drawer content configuration.\n   */\n  readonly drawerContent?: Maybe<DbxInjectionComponentConfig<unknown>>;\n  /**\n   * Latest error\n   */\n  readonly error?: Maybe<Error>;\n  /**\n   * Map margin/offset\n   */\n  readonly margin?: Maybe<DbxMapboxMarginCalculationSizing>;\n  /**\n   * Minimum vector size to use for the viewportBoundFunction$. If not defined there is no minimum.\n   */\n  readonly minimumVirtualViewportSize?: Maybe<Partial<Vector>>;\n  /**\n   * Bound refresh settings\n   */\n  readonly boundRefreshSettings: DbxMapboxStoreBoundRefreshSettings;\n  /**\n   * Whether or not to use the virtual bound (vs raw bound) for all bound-related observables.\n   *\n   * Defaults to true.\n   */\n  readonly useVirtualBound: boolean;\n}\n\n/**\n * Store used for retrieving information.\n */\n@Injectable()\nexport class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreState> {\n  private readonly dbxMapboxService = inject(DbxMapboxService);\n\n  private safeLatLngPoint = latLngPointFunction({ wrap: true });\n  private latLngPoint = latLngPointFunction({ wrap: false, validate: false });\n  private latLngBound = latLngBoundFunction({ pointFunction: this.latLngPoint });\n\n  constructor() {\n    super({\n      lifecycleState: 'init',\n      moveState: 'init',\n      zoomState: 'init',\n      rotateState: 'init',\n      retainContent: true,\n      useVirtualBound: true,\n      boundRefreshSettings: {\n        throttle: 300,\n        refreshType: 'always'\n      }\n    });\n  }\n\n  // MARK: Effects\n  readonly setMapService = this.effect((input: Observable<Maybe<MapService>>) => {\n    return input.pipe(\n      switchMap((service: Maybe<MapService>) => {\n        this._setMapService(service);\n        let result: Observable<any> = NEVER;\n\n        if (service) {\n          result = service.mapLoaded$.pipe(\n            defaultIfEmpty(undefined),\n            map(() => {\n              this._setLifecycleState('idle');\n              this._setMoveState('idle');\n              this._setZoomState('idle');\n              this._setRotateState('idle');\n\n              const map = service.mapInstance;\n\n              const listenerPairs: StringMapboxListenerPair[] = [];\n\n              function addListener<T extends keyof MapEvents>(type: T, listener: Parameters<typeof map.on<T>>[2]) {\n                map.on<T>(type, listener);\n                listenerPairs.push({ type, listener } as StringMapboxListenerPair);\n              }\n\n              addListener('idle', () => this._setLifecycleState('idle'));\n              addListener('render', () => this._setLifecycleState('render'));\n              addListener('error', (x) => {\n                this._setError(x.error);\n              });\n\n              addListener('movestart', () => this._setMoveState('moving'));\n              addListener('moveend', () => this._setMoveState('idle'));\n\n              // MARK: Long Press\n              const canvasContainer = map.getCanvasContainer();\n              const getLongPressConfig = () => resolveDbxMapboxLongPressConfig({ override: this.get().longPressConfig, base: this.dbxMapboxService.longPressConfig ?? false });\n\n              const longPressTracker = dbxMapboxLongPressTracker({\n                getConfig: getLongPressConfig,\n                onLongPress: (result) => {\n                  const mapPoint = mapboxClientPointToMapPoint({ container: canvasContainer, point: result.position });\n                  const point = new Point(mapPoint.x, mapPoint.y);\n\n                  // stop the pan the held pointer started, so the map does not move under the menu that opens\n                  map.stop();\n\n                  this._setLongPressEvent({\n                    type: DBX_MAPBOX_LONG_PRESS_EVENT_TYPE,\n                    target: map,\n                    source: result.source,\n                    originalEvent: result.startEvent,\n                    point,\n                    lngLat: map.unproject(point),\n                    duration: result.duration\n                  });\n                }\n              });\n\n              /**\n               * With the long press on, a contextmenu made by a touch (Android fires one after about half a second) is left to the long press, so the configured duration applies on every device.\n               *\n               * @param event - The contextmenu event.\n               * @returns True if the contextmenu should not open the right-click menu.\n               */\n              const isLongPressTouchContextMenu = (event: MouseEvent) => getLongPressConfig() != null && (longPressTracker.isTouchInteraction() || isTouchSourcedMouseEvent(event));\n              const touchClientPosition = (event: TouchEvent) => ({ x: event.touches[0].clientX, y: event.touches[0].clientY });\n\n              /**\n               * Cancels the pending long press when the user starts zooming, rotating or pitching. Only user gestures carry an originalEvent.\n               *\n               * @param event - The map event.\n               */\n              const cancelLongPressOnUserGesture = (event: { readonly type: string; readonly originalEvent?: unknown }) => {\n                if (event.originalEvent) {\n                  longPressTracker.cancel();\n                }\n              };\n\n              addListener('touchstart', (x) => {\n                const { originalEvent } = x;\n\n                if (originalEvent.touches.length === 1) {\n                  longPressTracker.start({ source: 'touch', position: touchClientPosition(originalEvent), event: originalEvent });\n                } else {\n                  longPressTracker.cancel();\n                }\n              });\n\n              addListener('touchmove', (x) => {\n                const { originalEvent } = x;\n\n                if (originalEvent.touches.length === 1) {\n                  longPressTracker.move('touch', touchClientPosition(originalEvent));\n                } else {\n                  longPressTracker.cancel();\n                }\n              });\n\n              addListener('touchend', (x) => {\n                const { originalEvent } = x;\n\n                // stops the lift of a press that fired from clicking the menu's backdrop, which would close the menu that just opened\n                if (originalEvent.touches.length === 0 && longPressTracker.end('touch') && originalEvent.cancelable) {\n                  originalEvent.preventDefault();\n                }\n              });\n\n              addListener('touchcancel', () => longPressTracker.end('touch'));\n\n              /**\n               * Removes the window mousemove listener of a pending mouse press.\n               */\n              let stopTrackingMouseMoves: Maybe<() => void>;\n\n              /**\n               * Feeds mouse moves to the tracker while a mouse press is pending.\n               *\n               * Mapbox sends no mousemove while a held left button drags the map, so the moves come from the window. The listener only exists during a press, and is added from the map's mousedown handler, which runs outside of Angular's zone.\n               */\n              const trackMouseMoves = () => {\n                stopTrackingMouseMoves?.();\n\n                const onMouseMove = (event: MouseEvent) => {\n                  if (longPressTracker.state === 'pending' && longPressTracker.source === 'mouse') {\n                    longPressTracker.move('mouse', { x: event.clientX, y: event.clientY });\n                  } else {\n                    stopTrackingMouseMoves?.();\n                  }\n                };\n\n                window.addEventListener('mousemove', onMouseMove, { passive: true });\n\n                stopTrackingMouseMoves = () => {\n                  window.removeEventListener('mousemove', onMouseMove);\n                  stopTrackingMouseMoves = undefined;\n                };\n              };\n\n              addListener('mousedown', (x) => {\n                const { originalEvent } = x;\n                // other buttons and modifier keys rotate, pitch, box zoom, or right-click on a Mac\n                const isPlainLeftButton = originalEvent.button === 0 && !originalEvent.ctrlKey && !originalEvent.metaKey && !originalEvent.altKey && !originalEvent.shiftKey;\n\n                if (!isPlainLeftButton) {\n                  longPressTracker.cancel();\n                } else if (longPressTracker.start({ source: 'mouse', position: { x: originalEvent.clientX, y: originalEvent.clientY }, event: originalEvent })) {\n                  trackMouseMoves();\n                }\n              });\n\n              addListener('pitchstart', cancelLongPressOnUserGesture);\n\n              addListener('zoomstart', (x) => {\n                this._setZoomState('zooming');\n                cancelLongPressOnUserGesture(x);\n              });\n              addListener('zoomend', () => this._setZoomState('idle'));\n\n              addListener('rotatestart', (x) => {\n                this._setRotateState('rotating');\n                cancelLongPressOnUserGesture(x);\n              });\n              addListener('rotateend', () => this._setRotateState('idle'));\n\n              addListener('click', (x) => {\n                // the click that ends a press that fired is not a click on the map\n                if (!longPressTracker.shouldSuppressClick()) {\n                  this._setClickEvent(x);\n                }\n              });\n              addListener('dblclick', (x) => this._setDoubleClickEvent(x));\n              addListener('contextmenu', (x) => {\n                if (!isLongPressTouchContextMenu(x.originalEvent)) {\n                  this._setRightClickEvent(x);\n                }\n              });\n\n              const refreshForResize = () => {\n                const { clientWidth: x, clientHeight: y } = map.getCanvas();\n                this._setMapCanvasSize({ x, y });\n              };\n\n              addListener('resize', refreshForResize);\n              refreshForResize();\n\n              // stops iOS from showing its callout (the link/image menu) under a held finger\n              const previousTouchCallout = canvasContainer.style.getPropertyValue('-webkit-touch-callout');\n              canvasContainer.style.setProperty('-webkit-touch-callout', 'none');\n\n              const subs: Subscription[] = [\n                // the mouse may be released over the menu that opened, outside the map, where mapbox does not send mouseup\n                fromEvent<MouseEvent>(window, 'mouseup', { capture: true }).subscribe(() => {\n                  stopTrackingMouseMoves?.();\n\n                  if (longPressTracker.end('mouse')) {\n                    suppressNextClickEvent();\n                  }\n                }),\n                fromEvent(window, 'blur').subscribe(() => longPressTracker.cancel()),\n                // mapbox only blocks the browser's own menu in some configurations, so block a touch's contextmenu here too\n                fromEvent<MouseEvent>(canvasContainer, 'contextmenu').subscribe((event) => {\n                  if (isLongPressTouchContextMenu(event)) {\n                    event.preventDefault();\n                  } else {\n                    longPressTracker.cancel();\n                  }\n                }),\n                new Subscription(() => {\n                  stopTrackingMouseMoves?.();\n                  longPressTracker.destroy();\n                  canvasContainer.style.setProperty('-webkit-touch-callout', previousTouchCallout);\n                })\n              ];\n\n              return {\n                service,\n                listenerPairs,\n                subs\n              };\n            })\n          );\n        }\n\n        return result;\n      }),\n      cleanup((state: unknown) => {\n        const { service, listenerPairs, subs } = state as { service: MapService; listenerPairs: StringMapboxListenerPair[]; subs: Subscription[] };\n        const map = service.mapInstance;\n\n        if (map) {\n          listenerPairs.forEach((x) => {\n            map.off(x.type, x.listener);\n          });\n        }\n\n        subs.forEach((sub) => sub.unsubscribe());\n      })\n    );\n  });\n\n  readonly setStyle = this.effect((input: Observable<MapboxStyleConfig | KnownMapboxStyle | string>) => {\n    return input.pipe(\n      switchMap((style) => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            if (typeof style === 'string') {\n              map.setStyle(style);\n            } else {\n              map.setStyle(style.style, style.options);\n            }\n          })\n        );\n      })\n    );\n  });\n\n  readonly setCenter = this.effect((input: Observable<LatLngPointInput>) => {\n    return input.pipe(\n      switchMap((center: LatLngPointInput) => {\n        const centerPoint = this.safeLatLngPoint(center);\n        return this.mapInstance$.pipe(tap((map) => map.setCenter(centerPoint)));\n      })\n    );\n  });\n\n  readonly setZoom = this.effect((input: Observable<MapboxZoomLevel>) => {\n    return input.pipe(\n      switchMap((zoom: MapboxZoomLevel) => {\n        return this.mapInstance$.pipe(tap((map) => map.setZoom(zoom)));\n      })\n    );\n  });\n\n  readonly setZoomRange = this.effect((input: Observable<Partial<MapboxZoomLevelRange>>) => {\n    return input.pipe(\n      switchMap((zoomRange: Partial<MapboxZoomLevelRange>) => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            map.setMinZoom(zoomRange.min || null);\n            map.setMaxZoom(zoomRange.max || null);\n          })\n        );\n      })\n    );\n  });\n\n  readonly setMinZoom = this.effect((input: Observable<MapboxZoomLevel>) => {\n    return input.pipe(\n      switchMap((zoom: MapboxZoomLevel) => {\n        return this.mapInstance$.pipe(tap((map) => map.setMinZoom(zoom)));\n      })\n    );\n  });\n\n  readonly setMaxZoom = this.effect((input: Observable<MapboxZoomLevel>) => {\n    return input.pipe(\n      switchMap((zoom: MapboxZoomLevel) => {\n        return this.mapInstance$.pipe(tap((map) => map.setMaxZoom(zoom)));\n      })\n    );\n  });\n\n  readonly setKeyboardDisabled = this.effect((input: Observable<Maybe<boolean> | void>) => {\n    return input.pipe(\n      switchMap((disabled: Maybe<boolean> | void) => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            if (disabled === false) {\n              map.keyboard.enable();\n            } else {\n              map.keyboard.disable();\n            }\n          })\n        );\n      })\n    );\n  });\n\n  readonly setDragRotateDisabled = this.effect((input: Observable<Maybe<boolean> | void>) => {\n    return input.pipe(\n      switchMap((disabled: Maybe<boolean> | void) => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            if (disabled === false) {\n              map.dragRotate.enable();\n            } else {\n              map.dragRotate.disable();\n            }\n          })\n        );\n      })\n    );\n  });\n\n  readonly setDragPanDisabled = this.effect((input: Observable<Maybe<boolean> | void>) => {\n    return input.pipe(\n      switchMap((disabled: Maybe<boolean> | void) => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            if (disabled === false) {\n              map.dragPan.enable();\n            } else {\n              map.dragPan.disable();\n            }\n          })\n        );\n      })\n    );\n  });\n\n  readonly setZoomDisabled = this.effect((input: Observable<Maybe<boolean> | void>) => {\n    return input.pipe(\n      switchMap((disabled: Maybe<boolean> | void) => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            if (disabled === false) {\n              map.scrollZoom.enable();\n              map.doubleClickZoom.enable();\n            } else {\n              map.scrollZoom.disable();\n              map.doubleClickZoom.disable();\n            }\n          })\n        );\n      })\n    );\n  });\n\n  readonly setPitch = this.effect((input: Observable<number>) => {\n    return input.pipe(\n      switchMap((pitch) => {\n        return this.mapInstance$.pipe(tap((map) => map.setPitch(pitch)));\n      })\n    );\n  });\n\n  readonly setMinPitch = this.effect((input: Observable<number>) => {\n    return input.pipe(\n      switchMap((pitch: number) => {\n        return this.mapInstance$.pipe(tap((map) => map.setMinPitch(pitch)));\n      })\n    );\n  });\n\n  readonly setMaxPitch = this.effect((input: Observable<number>) => {\n    return input.pipe(\n      switchMap((pitch: number) => {\n        return this.mapInstance$.pipe(tap((map) => map.setMaxPitch(pitch)));\n      })\n    );\n  });\n\n  readonly setBearing = this.effect((input: Observable<number>) => {\n    return input.pipe(\n      switchMap((bearing) => {\n        return this.mapInstance$.pipe(tap((map) => map.setBearing(bearing)));\n      })\n    );\n  });\n\n  readonly rotateTo = this.effect((input: Observable<MapboxBearing | MapboxRotateTo>) => {\n    return input.pipe(\n      switchMap((rotateInput: MapboxBearing | MapboxRotateTo) => {\n        const rotate: MapboxRotateTo = typeof rotateInput === 'number' ? { bearing: rotateInput } : rotateInput;\n        return this.mapInstance$.pipe(tap((map) => map.rotateTo(rotate.bearing, rotate.options, rotate?.eventData)));\n      })\n    );\n  });\n\n  readonly resetNorth = this.effect((input: Observable<Maybe<MapboxResetNorth> | void>) => {\n    return input.pipe(\n      switchMap((reset: Maybe<MapboxResetNorth> | void) => {\n        return this.mapInstance$.pipe(tap((map) => map.resetNorth(reset?.options, reset?.eventData)));\n      })\n    );\n  });\n\n  readonly resetNorthPitch = this.effect((input: Observable<Maybe<MapboxResetNorthPitch> | void>) => {\n    return input.pipe(\n      switchMap((reset: Maybe<MapboxResetNorthPitch> | void) => {\n        return this.mapInstance$.pipe(tap((map) => map.resetNorthPitch(reset?.options, reset?.eventData)));\n      })\n    );\n  });\n\n  readonly snapToNorth = this.effect((input: Observable<Maybe<MapboxSnapToNorth> | void>) => {\n    return input.pipe(\n      switchMap((snap: Maybe<MapboxSnapToNorth> | void) => {\n        return this.mapInstance$.pipe(tap((map) => map.snapToNorth(snap?.options, snap?.eventData)));\n      })\n    );\n  });\n\n  readonly fitPositions = this.effect((input: Observable<MapboxFitPositions>) => {\n    return input.pipe(\n      switchMap((x) => {\n        const boundFromInput = latLngBoundFromInput(x.positions);\n        let result: Observable<any> = EMPTY;\n\n        if (boundFromInput) {\n          const bound = this.latLngBound(boundFromInput);\n          result = this.mapInstance$.pipe(tap((map) => map.fitBounds(new LngLatBounds(bound.sw, bound.ne), x.options, x.eventData)));\n        }\n\n        return result;\n      })\n    );\n  });\n\n  readonly fitBounds = this.effect((input: Observable<MapboxFitBounds>) => {\n    return input.pipe(\n      switchMap((x) => {\n        const bound = this.latLngBound(x.bounds);\n        return this.mapInstance$.pipe(tap((map) => map.fitBounds(new LngLatBounds(bound.sw, bound.ne), x.options, x.eventData)));\n      })\n    );\n  });\n\n  readonly jumpTo = this.effect((input: Observable<MapboxJumpTo>) => {\n    return input.pipe(\n      switchMap((x) => {\n        const inputCenter = x.center ?? x.to?.center;\n        const center = inputCenter ? this.safeLatLngPoint(inputCenter) : undefined;\n        return this.mapInstance$.pipe(tap((map) => map.jumpTo(filterUndefinedValues({ ...x.to, center }), x.eventData)));\n      })\n    );\n  });\n\n  readonly easeTo = this.effect((input: Observable<MapboxEaseTo>) => {\n    return input.pipe(\n      switchMap((x) => {\n        const inputCenter = x.center ?? x.to?.center;\n        const center = inputCenter ? this.safeLatLngPoint(inputCenter) : undefined;\n        return this.mapInstance$.pipe(tap((map) => map.easeTo(filterUndefinedValues({ ...x.to, center }), x.eventData)));\n      })\n    );\n  });\n\n  readonly flyTo = this.effect((input: Observable<MapboxFlyTo>) => {\n    return input.pipe(\n      switchMap((x) => {\n        const inputCenter = x.center ?? x.to?.center;\n        const center = inputCenter ? this.safeLatLngPoint(inputCenter) : undefined;\n        return this.mapInstance$.pipe(tap((map) => map.flyTo(filterUndefinedValues({ ...x.to, center }), x.eventData)));\n      })\n    );\n  });\n\n  readonly resetPitchAndBearing = this.effect((input: Observable<void>) => {\n    return input.pipe(\n      switchMap(() => {\n        return this.mapInstance$.pipe(\n          tap((map) => {\n            map.setPitch(0);\n            map.setBearing(0);\n          })\n        );\n      })\n    );\n  });\n\n  // MARK: Accessors\n  get timerRefreshPeriod() {\n    return this.dbxMapboxService.mapboxMapStoreTimerRefreshPeriod;\n  }\n\n  movingTimer(period = this.timerRefreshPeriod) {\n    return this.moveState$.pipe(\n      switchMap((x) => {\n        return x === 'moving' ? interval(period) : of(0);\n      }),\n      shareReplay(1)\n    );\n  }\n\n  lifecycleRenderTimer(period = this.timerRefreshPeriod) {\n    return this.lifecycleState$.pipe(\n      switchMap((x) => {\n        return x === 'render' ? interval(period) : of(0);\n      }),\n      shareReplay(1)\n    );\n  }\n\n  atNextIdle(): Observable<boolean> {\n    return this.moveState$.pipe(\n      map((x) => x === 'idle'),\n      first()\n    );\n  }\n\n  calculateNextCenterWithOffset(inputOffset: LatLngPointInput): Observable<LatLngPoint> {\n    const offset = this.latLngPoint(inputOffset);\n\n    return this.atNextIdle().pipe(\n      switchMap(() =>\n        this.center$.pipe(\n          first(),\n          map((center) => {\n            return {\n              lat: offset.lat + center.lat,\n              lng: offset.lng + center.lng\n            };\n          })\n        )\n      )\n    );\n  }\n\n  calculateNextCenterOffsetWithScreenMarginChange(sizing: DbxMapboxMarginCalculationSizing): Observable<LatLngPoint> {\n    // TODO: Consider calculating this using the viewport() function from @placemarkio/geo-viewport\n    return this.atNextIdle().pipe(\n      switchMap(() =>\n        this.bound$.pipe(\n          first(),\n          map((bounds) => {\n            const diff = diffLatLngBoundPoints(bounds, true);\n            const center = latLngBoundCenterPoint(bounds);\n\n            const offsetWidth = sizing.leftMargin + sizing.rightMargin; // 300 + 0\n            const newWidth = sizing.fullWidth - offsetWidth; // 1000 - 300 - 0\n            const newWidthRatio = newWidth / sizing.fullWidth; // 700 / 1000\n            const newCenterLongitudeWidth = diff.lng * newWidthRatio; // 70% offset\n\n            const effectiveOffset: LatLngPoint = {\n              lat: 0,\n              lng: newCenterLongitudeWidth / 2\n            };\n\n            const newCenter = addLatLngPoints(bounds.sw, effectiveOffset);\n            newCenter.lat = center.lat; // retain center position\n\n            // console.log({ sizing, bounds, effectiveOffset, newWidth, offsetWidth, diff, center, newCenter });\n\n            return newCenter;\n          })\n        )\n      )\n    );\n  }\n\n  filterByViewportBound<T>(input: FilterMapboxBoundReadItemValueFunction<T> | Omit<FilterMapboxBoundConfig<T>, 'boundFunctionObs' | 'boundDecisionObs'>): OperatorFunction<T[], T[]> {\n    const config = typeof input === 'function' ? { readValue: input } : input;\n\n    return filterByMapboxViewportBound({\n      ...config,\n      boundFunctionObs: this.viewportBoundFunction$,\n      boundDecisionObs: this.overlapsBoundFunction$\n    });\n  }\n\n  readonly currentMapService$ = this.state$.pipe(\n    map((x) => x.mapService),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly mapService$ = this.currentMapService$.pipe(filterMaybe());\n\n  readonly currentMapInstance$: Observable<Maybe<Map>> = this.currentMapService$.pipe(\n    switchMap((currentMapService: Maybe<MapService>) => {\n      return currentMapService\n        ? currentMapService.mapLoaded$.pipe(\n            defaultIfEmpty(undefined),\n            map(() => currentMapService.mapInstance)\n          )\n        : of(undefined);\n    }),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly mapInstance$ = this.currentMapInstance$.pipe(filterMaybe());\n\n  readonly boundRefreshSettings$ = this.state$.pipe(\n    map((x) => x.boundRefreshSettings),\n    shareReplay(1)\n  );\n\n  readonly moveState$ = this.state$.pipe(\n    map((x) => x.moveState),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly lifecycleState$ = this.state$.pipe(\n    map((x) => x.lifecycleState),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly zoomState$ = this.state$.pipe(\n    map((x) => x.zoomState),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly rotateState$ = this.state$.pipe(\n    map((x) => x.rotateState),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly isInitialized$ = this.currentMapInstance$.pipe(\n    switchMap((x) => {\n      let result: Observable<boolean> = of(false);\n\n      if (x) {\n        result = combineLatest([this.moveState$.pipe(map((x) => x === 'idle')), this.lifecycleState$.pipe(map((x) => x === 'idle'))]).pipe(\n          filter(([m, l]) => m && l),\n          first(),\n          map(() => true)\n        );\n      }\n\n      return result;\n    }),\n    shareReplay(1)\n  );\n\n  readonly whenInitialized$ = this.isInitialized$.pipe(\n    filter(() => true),\n    shareReplay(1)\n  );\n\n  readonly isRendering$ = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.lifecycleState$.pipe(\n        map((x) => x === 'render'),\n        distinctUntilChanged(),\n        shareReplay(1)\n      )\n    )\n  );\n\n  readonly isMoving$ = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.moveState$.pipe(\n        map((x) => x === 'moving'),\n        distinctUntilChanged(),\n        shareReplay(1)\n      )\n    )\n  );\n\n  readonly isZooming$ = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.zoomState$.pipe(\n        map((x) => x === 'zooming'),\n        distinctUntilChanged(),\n        shareReplay(1)\n      )\n    )\n  );\n\n  readonly isRotating$ = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.rotateState$.pipe(\n        map((x) => x === 'rotating'),\n        distinctUntilChanged(),\n        shareReplay(1)\n      )\n    )\n  );\n\n  private readonly _movingTimer = this.movingTimer();\n  private readonly _renderingTimer = this.lifecycleRenderTimer();\n\n  readonly centerNow$: Observable<LatLngPoint> = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.mapInstance$.pipe(\n        switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))),\n        shareReplay(1)\n      )\n    ),\n    shareReplay(1)\n  );\n\n  readonly center$: Observable<LatLngPoint> = this.whenInitialized$.pipe(\n    switchMap(() => {\n      return this.isMoving$.pipe(\n        onTrueToFalse(),\n        startWith(undefined),\n        switchMap(() => this.centerNow$.pipe(first())),\n        distinctUntilChanged<LatLngPoint>(isSameLatLngPoint),\n        shareReplay(1)\n      );\n    }),\n    shareReplay(1)\n  );\n\n  readonly minimumVirtualViewportSize$ = this.state$.pipe(\n    map((x) => x.minimumVirtualViewportSize),\n    distinctUntilChanged(isSameVector),\n    shareReplay(1)\n  );\n\n  readonly currentMapCanvasSize$ = this.state$.pipe(\n    map((x) => x.mapCanvasSize),\n    distinctUntilChanged<Maybe<Vector>>(isSameVector),\n    shareReplay(1)\n  );\n\n  /**\n   * The map canvas size with consideration to the virtual viewport size.\n   */\n  readonly mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());\n\n  minimumMapCanvasSize(minVector: Partial<Vector>): Observable<Vector> {\n    const resizeFn = vectorMinimumSizeResizeFunction(minVector);\n    return this.mapCanvasSize$.pipe(\n      map((x) => resizeFn(x)),\n      distinctUntilChanged<Vector>(isSameVector),\n      shareReplay(1)\n    );\n  }\n\n  /**\n   * The map canvas size with consideration to the virtual viewport size.\n   */\n  readonly virtualMapCanvasSize$ = this.minimumVirtualViewportSize$.pipe(\n    switchMap((minimumVirtualViewportSize) => {\n      return minimumVirtualViewportSize ? this.minimumMapCanvasSize(minimumVirtualViewportSize) : this.mapCanvasSize$;\n    }),\n    distinctUntilChanged<Vector>(isSameVector),\n    shareReplay(1)\n  );\n\n  readonly rawViewportBoundFunction$: Observable<MapboxViewportBoundFunction> = this.mapCanvasSize$.pipe(\n    map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })),\n    shareReplay(1)\n  );\n\n  /**\n   * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.\n   *\n   * @param minVector\n   * @returns\n   */\n  viewportBoundFunctionWithMinimumSize(minVector: Partial<Vector>): Observable<MapboxViewportBoundFunction> {\n    const resizeFn = vectorMinimumSizeResizeFunction(minVector);\n    return this.mapCanvasSize$.pipe(\n      map((x) => resizeFn(x)),\n      distinctUntilChanged<Vector>(isSameVector),\n      map((mapCanvasSize) => mapboxViewportBoundFunction({ mapCanvasSize })),\n      shareReplay(1)\n    );\n  }\n\n  readonly viewportBoundFunction$: Observable<MapboxViewportBoundFunction> = this.minimumVirtualViewportSize$.pipe(\n    switchMap((minimumVirtualViewportSize) => {\n      return minimumVirtualViewportSize ? this.viewportBoundFunctionWithMinimumSize(minimumVirtualViewportSize) : this.rawViewportBoundFunction$;\n    }),\n    shareReplay(1)\n  );\n\n  readonly virtualBound$: Observable<LatLngBound> = this.viewportBoundFunction$.pipe(\n    switchMap((fn) => {\n      return this.boundRefreshSettings$.pipe(\n        switchMap((settings) => {\n          const { throttle: throttleMs, refreshType } = settings;\n\n          let obs: Observable<[LatLngPoint, ZoomLevel]>;\n\n          switch (refreshType) {\n            case 'always':\n              obs = combineLatest([this.centerNow$, this.zoomNow$]);\n              break;\n            case 'when_not_rendering':\n            case 'only_after_render_finishes':\n              obs = this.bound$.pipe(switchMap(() => combineLatest([this.centerNow$, this.zoomNow$]))); // refresh whenever the bound refreshes\n              break;\n          }\n\n          return obs.pipe(\n            throttleTime(throttleMs, undefined, { leading: true, trailing: true }),\n            map(([center, zoom]) =>\n              fn({\n                center,\n                zoom\n              })\n            )\n          );\n        })\n      );\n    }),\n    distinctUntilChanged(isSameLatLngBound),\n    shareReplay(1)\n  );\n\n  readonly margin$ = this.state$.pipe(\n    map((x) => x.margin),\n    distinctUntilChanged((a, b) => a != null && a.fullWidth === b?.fullWidth && a.leftMargin === b.leftMargin && a.rightMargin === b.rightMargin),\n    shareReplay(1)\n  );\n\n  readonly reverseMargin$ = this.margin$.pipe(\n    map((x) => {\n      return x ? { leftMargin: -x.leftMargin, rightMargin: -x.rightMargin, fullWidth: x.fullWidth } : x;\n    })\n  );\n\n  readonly centerGivenMargin$: Observable<LatLngPoint> = this.whenInitialized$.pipe(\n    switchMap(() => {\n      return this.reverseMargin$.pipe(\n        switchMap((x) => {\n          return x\n            ? this.center$.pipe(switchMap((_) => this.calculateNextCenterOffsetWithScreenMarginChange(x)))\n            : this.isMoving$.pipe(\n                filter((x) => !x),\n                switchMap(() => this.center$)\n              );\n        })\n      );\n    }),\n    shareReplay(1)\n  );\n\n  readonly rawBoundNow$: Observable<LatLngBound> = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.mapInstance$.pipe(\n        switchMap((x) =>\n          this._renderingTimer.pipe(\n            map(() => {\n              const bound = x.getBounds();\n              let result: Maybe<LatLngBound> = null;\n\n              if (bound != null) {\n                const boundSw = bound.getSouthWest();\n                const boundNe = bound.getNorthEast();\n\n                const sw = isDefaultLatLngPoint(boundSw) ? swMostLatLngPoint() : { lat: boundSw.lat, lng: boundSw.lng };\n                const ne = isDefaultLatLngPoint(boundNe) ? neMostLatLngPoint() : { lat: boundNe.lat, lng: boundNe.lng };\n\n                result = this.latLngBound(sw, ne);\n              }\n\n              return result;\n            }),\n            filterMaybe()\n          )\n        )\n      )\n    ),\n    distinctUntilChanged(isSameLatLngBound),\n    shareReplay(1)\n  );\n\n  readonly rawBound$: Observable<LatLngBound> = this.whenInitialized$.pipe(\n    switchMap(() => {\n      return this.boundRefreshSettings$.pipe(\n        switchMap((settings) => {\n          const { throttle: throttleMs, refreshType } = settings;\n\n          let obs: Observable<LatLngBound>;\n\n          switch (refreshType) {\n            case 'always':\n              obs = this.rawBoundNow$;\n              break;\n            case 'when_not_rendering':\n              obs = this.isRendering$.pipe(switchMap((x) => (x ? EMPTY : this.rawBoundNow$)));\n              break;\n            case 'only_after_render_finishes':\n              obs = this.isRendering$.pipe(\n                onTrueToFalse(),\n                switchMap(() => this.rawBoundNow$.pipe(first()))\n              );\n              break;\n          }\n\n          return obs.pipe(throttleTime(throttleMs, undefined, { leading: true, trailing: true }));\n        })\n      );\n    }),\n    distinctUntilChanged(isSameLatLngBound),\n    shareReplay(1)\n  );\n\n  readonly useVirtualBound$: Observable<boolean> = this.state$.pipe(\n    map((x) => x.useVirtualBound),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly bound$: Observable<LatLngBound> = this.useVirtualBound$.pipe(\n    switchMap((useVirtualBound) => {\n      return useVirtualBound ? this.virtualBound$ : this.rawBound$;\n    }),\n    shareReplay(1)\n  );\n\n  readonly boundSizing$: Observable<LatLngPoint> = this.bound$.pipe(\n    map((x) => diffLatLngBoundPoints(x)),\n    shareReplay(1)\n  );\n\n  readonly boundWrapsAroundWorld$: Observable<boolean> = this.bound$.pipe(\n    map((x) => latLngBoundWrapsMap(x)),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly isWithinBoundFunction$: Observable<IsWithinLatLngBoundFunction> = this.bound$.pipe(\n    map((x) => isWithinLatLngBoundFunction(x)),\n    shareReplay(1)\n  );\n\n  readonly overlapsBoundFunction$: Observable<OverlapsLatLngBoundFunction> = this.virtualBound$.pipe(\n    map((x) => overlapsLatLngBoundFunction(x)),\n    shareReplay(1)\n  );\n\n  readonly zoomNow$: Observable<MapboxZoomLevel> = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.mapInstance$.pipe(\n        switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom()))),\n        shareReplay(1)\n      )\n    )\n  );\n\n  readonly zoom$: Observable<MapboxZoomLevel> = this.whenInitialized$.pipe(\n    switchMap(() => {\n      return this.isZooming$.pipe(\n        onTrueToFalse(),\n        startWith(undefined),\n        switchMap(() => this.zoomNow$.pipe(first())),\n        distinctUntilChanged(),\n        shareReplay(1)\n      );\n    })\n  );\n\n  readonly pitchNow$ = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.mapInstance$.pipe(\n        switchMap((x) => this._movingTimer.pipe(map(() => x.getPitch()))),\n        shareReplay(1)\n      )\n    )\n  );\n\n  readonly pitch$ = this.whenInitialized$.pipe(\n    switchMap(() => {\n      return this.isRotating$.pipe(\n        onTrueToFalse(),\n        startWith(undefined),\n        switchMap(() => this.pitchNow$.pipe(first())),\n        distinctUntilChanged(),\n        shareReplay(1)\n      );\n    })\n  );\n\n  readonly bearingNow$ = this.whenInitialized$.pipe(\n    switchMap(() =>\n      this.mapInstance$.pipe(\n        switchMap((x) => this._movingTimer.pipe(map(() => x.getBearing()))),\n        shareReplay(1)\n      )\n    )\n  );\n\n  readonly bearing$ = this.whenInitialized$.pipe(\n    switchMap(() => {\n      return this.isRotating$.pipe(\n        onTrueToFalse(),\n        startWith(undefined),\n        switchMap(() => this.bearingNow$.pipe(first())),\n        distinctUntilChanged(),\n        shareReplay(1)\n      );\n    })\n  );\n\n  readonly drawerContent$ = this.state$.pipe(\n    map((x) => x.drawerContent),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly hasDrawerContent$ = this.drawerContent$.pipe(\n    map((x) => x != null),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly clickEvent$ = this.state$.pipe(\n    map((x) => x.clickEvent),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly doubleClickEvent$ = this.state$.pipe(\n    map((x) => x.doubleClickEvent),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  /**\n   * Latest right-click: a contextmenu event, or a long press. Use isDbxMapboxLongPressEvent() to tell them apart.\n   */\n  readonly rightClickEvent$: Observable<Maybe<DbxMapboxRightClickEvent>> = this.state$.pipe(\n    map((x) => x.rightClickEvent),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  readonly longPressEvent$: Observable<Maybe<DbxMapboxLongPressEvent>> = this.state$.pipe(\n    map((x) => x.longPressEvent),\n    distinctUntilChanged(),\n    shareReplay(1)\n  );\n\n  // MARK: State Changes\n  readonly setMargin = this.updater((state, margin: Maybe<DbxMapboxMarginCalculationSizing>) => ({ ...state, margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined }));\n  readonly setMinimumVirtualViewportSize = this.updater((state, minimumVirtualViewportSize: Maybe<Partial<Vector>>) => ({ ...state, minimumVirtualViewportSize }));\n  readonly setUseVirtualBound = this.updater((state, useVirtualBound: boolean) => ({ ...state, useVirtualBound }));\n  /**\n   * Sets the long press config for this map, over the app-wide DbxMapboxConfig.longPress. False turns the long press off for this map; undefined uses the app-wide config.\n   *\n   * Applies from the next press.\n   */\n  readonly setLongPressConfig = this.updater((state, longPressConfig: DbxMapboxLongPressConfigInput) => ({ ...state, longPressConfig }));\n  readonly setBoundRefreshSettings = this.updater((state, boundRefreshSettings: Partial<DbxMapboxStoreBoundRefreshSettings>) => ({ ...state, boundRefreshSettings: { ...state.boundRefreshSettings, ...boundRefreshSettings } }));\n\n  private readonly _setMapService = this.updater((state, mapService: Maybe<MapService>) => ({\n    mapService,\n    moveState: 'init',\n    lifecycleState: 'init',\n    zoomState: 'init',\n    rotateState: 'init',\n    retainContent: state.retainContent,\n    drawerContent: state.retainContent ? state.drawerContent : undefined,\n    useVirtualBound: state.useVirtualBound,\n    boundRefreshSettings: state.boundRefreshSettings,\n    longPressConfig: state.longPressConfig\n  }));\n  private readonly _setLifecycleState = this.updater((state, lifecycleState: MapboxMapLifecycleState) => ({ ...state, lifecycleState }));\n  private readonly _setMoveState = this.updater((state, moveState: MapboxMapMoveState) => ({ ...state, moveState }));\n  private readonly _setZoomState = this.updater((state, zoomState: MapboxMapZoomState) => ({ ...state, zoomState }));\n  private readonly _setRotateState = this.updater((state, rotateState: MapboxMapRotateState) => ({ ...state, rotateState }));\n\n  private readonly _setMapCanvasSize = this.updater((state, mapCanvasSize: Vector) => ({ ...state, mapCanvasSize }));\n  private readonly _setClickEvent = this.updater((state, clickEvent: DbxMapboxClickEvent) => ({ ...state, clickEvent }));\n  private readonly _setDoubleClickEvent = this.updater((state, doubleClickEvent: DbxMapboxClickEvent) => ({ ...state, doubleClickEvent }));\n  private readonly _setRightClickEvent = this.updater((state, rightClickEvent: DbxMapboxClickEvent) => ({ ...state, rightClickEvent }));\n  private readonly _setLongPressEvent = this.updater((state, longPressEvent: DbxMapboxLongPressEvent) => ({ ...state, longPressEvent, rightClickEvent: longPressEvent }));\n\n  private readonly _setError = this.updater((state, error: Error) => ({ ...state, error }));\n\n  readonly clearDrawerContent = this.updater((state) => setDrawerContent(state, undefined));\n  readonly setDrawerContent = this.updater(setDrawerContent);\n}\n\nfunction setDrawerContent(state: DbxMapboxStoreState, drawerContent: Maybe<DbxInjectionComponentConfig<unknown>>) {\n  return { ...state, drawerContent };\n}\n","import { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { switchMap, tap, merge, Subject, throttleTime } from 'rxjs';\nimport { DbxMapboxMapStore } from './mapbox.store';\n\n/**\n * Provided in the parent component that allows children to emit events related to their lifecycles.\n */\n@Injectable({\n  providedIn: null\n})\nexport class DbxMapboxChangeService implements OnDestroy {\n  readonly dbxMapboxMapStore = inject(DbxMapboxMapStore);\n\n  private readonly _markerDestroyed = new Subject<void>();\n  private readonly _applyChanges = new Subject<void>();\n\n  readonly markerDestroyed$ = this._markerDestroyed;\n  readonly applyChanges$ = merge(this._applyChanges, this.markerDestroyed$).pipe(throttleTime(100, undefined, { leading: false, trailing: true }));\n\n  private readonly _applyChangesSub = new SubscriptionObject(\n    this.dbxMapboxMapStore.mapService$\n      .pipe(\n        switchMap((mapService) =>\n          this.applyChanges$.pipe(\n            tap(() => {\n              mapService.applyChanges();\n            })\n          )\n        )\n      )\n      .subscribe()\n  );\n\n  applyChanges() {\n    this._applyChanges.next();\n  }\n\n  emitMarkerDestroyed() {\n    this._markerDestroyed.next();\n  }\n\n  ngOnDestroy(): void {\n    this._markerDestroyed.complete();\n    this._applyChanges.complete();\n    this._applyChangesSub.destroy();\n  }\n}\n","import { type LatLngInputRef, type LatLngPoint, type Maybe, type UniqueModel } from '@dereekb/util';\n\n// MARK: Radius\n/**\n * Unit a {@link DbxMapboxCircle} radius is measured in.\n *\n * - m: meters\n * - km: kilometers\n * - mi: miles\n */\nexport type DbxMapboxCircleRadiusUnit = 'm' | 'km' | 'mi';\n\n/**\n * Number of meters in one of each {@link DbxMapboxCircleRadiusUnit}.\n */\nexport const DBX_MAPBOX_CIRCLE_METERS_PER_RADIUS_UNIT: Readonly<Record<DbxMapboxCircleRadiusUnit, number>> = {\n  m: 1,\n  km: 1000,\n  mi: 1609.344\n};\n\n/**\n * Mean radius of the Earth in meters, used to trace a circle's ring on the globe.\n */\nexport const DBX_MAPBOX_EARTH_RADIUS_METERS = 6371008.8;\n\n/**\n * Number of points {@link dbxMapboxCircleRing} places around a circle.\n */\nexport const DBX_MAPBOX_CIRCLE_RING_STEPS = 64;\n\n/**\n * Default color of a {@link DbxMapboxCircle}'s fill, outline, and label.\n */\nexport const DEFAULT_DBX_MAPBOX_CIRCLE_COLOR = '#1a73e8';\n\n/**\n * Default opacity of a {@link DbxMapboxCircle}'s fill.\n */\nexport const DEFAULT_DBX_MAPBOX_CIRCLE_FILL_OPACITY = 0.1;\n\n/**\n * Default opacity of a {@link DbxMapboxCircle}'s outline.\n */\nexport const DEFAULT_DBX_MAPBOX_CIRCLE_LINE_OPACITY = 1;\n\n/**\n * Default opacity of a {@link DbxMapboxCircle}'s label.\n */\nexport const DEFAULT_DBX_MAPBOX_CIRCLE_LABEL_OPACITY = 1;\n\n/**\n * Converts a radius to meters.\n *\n * @param radius - The radius.\n * @param unit - The unit the radius is in. Defaults to meters.\n * @returns The radius in meters.\n */\nexport function dbxMapboxCircleRadiusInMeters(radius: number, unit?: Maybe<DbxMapboxCircleRadiusUnit>): number {\n  return radius * DBX_MAPBOX_CIRCLE_METERS_PER_RADIUS_UNIT[unit ?? 'm'];\n}\n\n// MARK: Circle\nexport interface DbxMapboxCircleDisplayConfig {\n  /**\n   * Radius of the circle, in {@link radiusUnit}.\n   */\n  readonly radius: number;\n  /**\n   * Unit the radius is in. Defaults to meters.\n   */\n  readonly radiusUnit?: Maybe<DbxMapboxCircleRadiusUnit>;\n  /**\n   * Text repeated along the circle's edge, such as \"5 mile radius\".\n   */\n  readonly label?: Maybe<string>;\n  /**\n   * Color of the fill, outline, and label. Defaults to {@link DEFAULT_DBX_MAPBOX_CIRCLE_COLOR}.\n   */\n  readonly color?: Maybe<string>;\n  /**\n   * Opacity of the fill, from 0 to 1. Defaults to {@link DEFAULT_DBX_MAPBOX_CIRCLE_FILL_OPACITY}.\n   */\n  readonly fillOpacity?: Maybe<number>;\n  /**\n   * Opacity of the outline, from 0 to 1. Defaults to {@link DEFAULT_DBX_MAPBOX_CIRCLE_LINE_OPACITY}.\n   */\n  readonly lineOpacity?: Maybe<number>;\n  /**\n   * Opacity of the label, from 0 to 1. Defaults to {@link DEFAULT_DBX_MAPBOX_CIRCLE_LABEL_OPACITY}.\n   */\n  readonly labelOpacity?: Maybe<number>;\n}\n\n/**\n * A circle drawn on the map at a real-world radius around its center, so it grows and shrinks with the zoom.\n */\nexport type DbxMapboxCircle = UniqueModel & LatLngInputRef & DbxMapboxCircleDisplayConfig;\n\n/**\n * Properties of the feature {@link dbxMapboxCircleFeature} creates, read by the circle's label layer.\n */\nexport interface DbxMapboxCircleFeatureProperties {\n  readonly label: string;\n}\n\n/**\n * Builds a closed ring of points that trace the circle of `radiusInMeters` around `center`.\n *\n * Each point is the great-circle destination from the center at an evenly spaced bearing, starting due north. The last point repeats the first to close the ring.\n * Longitudes are not wrapped, so a ring that crosses the antimeridian stays continuous.\n *\n * @param center - The center of the circle.\n * @param radiusInMeters - The radius of the circle in meters.\n * @returns The ring's {@link DBX_MAPBOX_CIRCLE_RING_STEPS} points, with the first point repeated at the end.\n */\nexport function dbxMapboxCircleRing(center: LatLngPoint, radiusInMeters: number): LatLngPoint[] {\n  const radiansPerDegree = Math.PI / 180;\n  const lat1 = center.lat * radiansPerDegree;\n  const lng1 = center.lng * radiansPerDegree;\n  const angularDistance = radiusInMeters / DBX_MAPBOX_EARTH_RADIUS_METERS;\n  const sinLat1 = Math.sin(lat1);\n  const cosLat1 = Math.cos(lat1);\n  const sinDistance = Math.sin(angularDistance);\n  const cosDistance = Math.cos(angularDistance);\n\n  const ring: LatLngPoint[] = [];\n\n  for (let i = 0; i < DBX_MAPBOX_CIRCLE_RING_STEPS; i += 1) {\n    const bearing = (2 * Math.PI * i) / DBX_MAPBOX_CIRCLE_RING_STEPS;\n    const lat2 = Math.asin(sinLat1 * cosDistance + cosLat1 * sinDistance * Math.cos(bearing));\n    const lng2 = lng1 + Math.atan2(Math.sin(bearing) * sinDistance * cosLat1, cosDistance - sinLat1 * Math.sin(lat2));\n    ring.push({ lat: lat2 / radiansPerDegree, lng: lng2 / radiansPerDegree });\n  }\n\n  ring.push(ring[0]);\n\n  return ring;\n}\n\n/**\n * Creates the GeoJSON polygon feature that draws a circle on the map.\n *\n * @param center - The center of the circle.\n * @param circle - The circle's radius and label.\n * @returns A polygon feature whose `label` property is the circle's label, or an empty string.\n */\nexport function dbxMapboxCircleFeature(center: LatLngPoint, circle: Pick<DbxMapboxCircleDisplayConfig, 'radius' | 'radiusUnit' | 'label'>): GeoJSON.Feature<GeoJSON.Polygon, DbxMapboxCircleFeatureProperties> {\n  const ring = dbxMapboxCircleRing(center, dbxMapboxCircleRadiusInMeters(circle.radius, circle.radiusUnit));\n\n  return {\n    type: 'Feature',\n    properties: { label: circle.label ?? '' },\n    geometry: {\n      type: 'Polygon',\n      coordinates: [ring.map((x) => [x.lng, x.lat])]\n    }\n  };\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { latLngPointFunction, type Maybe } from '@dereekb/util';\nimport { GeoJSONSourceComponent, LayerComponent } from 'ngx-mapbox-gl';\nimport { type DbxMapboxCircle, dbxMapboxCircleFeature, DEFAULT_DBX_MAPBOX_CIRCLE_COLOR, DEFAULT_DBX_MAPBOX_CIRCLE_FILL_OPACITY, DEFAULT_DBX_MAPBOX_CIRCLE_LABEL_OPACITY, DEFAULT_DBX_MAPBOX_CIRCLE_LINE_OPACITY } from './mapbox.circle';\n\nlet dbxMapboxCircleComponentCount = 0;\n\n/**\n * Value of an mgl-layer's [paint] input.\n */\nexport type DbxMapboxLayerPaint = ReturnType<LayerComponent['paint']>;\n\n/**\n * Value of an mgl-layer's [layout] input.\n */\nexport type DbxMapboxLayerLayout = ReturnType<LayerComponent['layout']>;\n\n/**\n * Layout of the label repeated along a circle's edge.\n */\nexport const DBX_MAPBOX_CIRCLE_LABEL_LAYOUT: DbxMapboxLayerLayout = {\n  'symbol-placement': 'line',\n  'text-field': ['get', 'label'],\n  'text-size': 12,\n  'text-offset': [0, -0.8]\n};\n\n/**\n * Draws a {@link DbxMapboxCircle} on the parent mgl-map as a filled polygon with an outline and an optional label along its edge.\n *\n * The circle is sized in real-world units, so it grows and shrinks with the zoom. Draws nothing while the circle is unset.\n */\n@Component({\n  selector: 'dbx-mapbox-circle',\n  template: `\n    <mgl-geojson-source [id]=\"sourceId\" [data]=\"featureSignal()\"></mgl-geojson-source>\n    <mgl-layer [id]=\"sourceId + '-fill'\" type=\"fill\" [source]=\"sourceId\" [paint]=\"fillPaintSignal()\"></mgl-layer>\n    <mgl-layer [id]=\"sourceId + '-line'\" type=\"line\" [source]=\"sourceId\" [paint]=\"linePaintSignal()\"></mgl-layer>\n    <mgl-layer [id]=\"sourceId + '-label'\" type=\"symbol\" [source]=\"sourceId\" [layout]=\"labelLayout\" [paint]=\"labelPaintSignal()\"></mgl-layer>\n  `,\n  imports: [GeoJSONSourceComponent, LayerComponent],\n  changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxMapboxCircleComponent {\n  private static readonly _latLngPoint = latLngPointFunction({ wrap: true });\n\n  readonly circle = input<Maybe<DbxMapboxCircle>>();\n\n  readonly sourceId = `dbx-mapbox-circle-${(dbxMapboxCircleComponentCount += 1)}`;\n  readonly labelLayout = DBX_MAPBOX_CIRCLE_LABEL_LAYOUT;\n\n  readonly featureSignal = computed<GeoJSON.GeoJSON>(() => {\n    const circle = this.circle();\n    return circle ? dbxMapboxCircleFeature(DbxMapboxCircleComponent._latLngPoint(circle.latLng), circle) : { type: 'FeatureCollection', features: [] };\n  });\n\n  readonly colorSignal = computed(() => this.circle()?.color ?? DEFAULT_DBX_MAPBOX_CIRCLE_COLOR);\n\n  readonly fillPaintSignal = computed<DbxMapboxLayerPaint>(() => ({\n    'fill-color': this.colorSignal(),\n    'fill-opacity': this.circle()?.fillOpacity ?? DEFAULT_DBX_MAPBOX_CIRCLE_FILL_OPACITY\n  }));\n\n  readonly linePaintSignal = computed<DbxMapboxLayerPaint>(() => ({\n    'line-color': this.colorSignal(),\n    'line-opacity': this.circle()?.lineOpacity ?? DEFAULT_DBX_MAPBOX_CIRCLE_LINE_OPACITY,\n    'line-width': 2\n  }));\n\n  readonly labelPaintSignal = computed<DbxMapboxLayerPaint>(() => ({\n    'text-color': this.colorSignal(),\n    'text-opacity': this.circle()?.labelOpacity ?? DEFAULT_DBX_MAPBOX_CIRCLE_LABEL_OPACITY,\n    'text-halo-color': '#ffffff',\n    'text-halo-width': 1.5\n  }));\n}\n","import { map, type Observable, shareReplay } from 'rxjs';\nimport { Injectable } from '@angular/core';\nimport { type DbxInjectionComponentConfigWithoutInjector } from '@dereekb/dbx-core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { distinctUntilMapHasDifferentKeys, type ObservableOrValueGetter } from '@dereekb/rxjs';\n\nexport type DbxMapboxInjectionKey = string;\n\nexport interface DbxMapboxInjectionConfig {\n  /**\n   * Unique key that identifies this config specifically.\n   *\n   * Keys should all be unique. The system does not expect duplicate keys. Modifications to injectionConfig should occur through the observable value.\n   */\n  readonly key: DbxMapboxInjectionKey;\n  /**\n   * Arbitrary injection type. Is used for filtering on configurations.\n   */\n  readonly type?: string;\n  /**\n   * Injection configuration. The injector is disallowed, as the parent injector must include the mapbox component.\n   */\n  readonly injectionConfig: ObservableOrValueGetter<DbxInjectionComponentConfigWithoutInjector>;\n}\n\nexport interface DbxMapboxMapInjectionStoreState {\n  /**\n   * Current map of injection keys and configurations.\n   */\n  readonly map: Map<DbxMapboxInjectionKey, DbxMapboxInjectionConfig>;\n\n  // TODO: Add filters for showing/hiding elements of different types.\n}\n\n/**\n * Store used for storing injectable content into the map.\n */\n@Injectable()\nexport class DbxMapboxInjectionStore extends ComponentStore<DbxMapboxMapInjectionStoreState> {\n  constructor() {\n    super({\n      map: new Map<DbxMapboxInjectionKey, DbxMapboxInjectionConfig>()\n    });\n  }\n\n  readonly map$: Observable<Map<DbxMapboxInjectionKey, DbxMapboxInjectionConfig>> = this.state$.pipe(\n    map((x) => x.map),\n    distinctUntilMapHasDifferentKeys(),\n    shareReplay(1)\n  );\n\n  readonly allInjectionConfigs$: Observable<DbxMapboxInjectionConfig[]> = this.map$.pipe(\n    map((x) => Array.from(x.values())),\n    shareReplay(1)\n  );\n\n  // MARK: State Changes\n  readonly addInjectionConfig = this.updater(updateDbxMapboxMapInjectionStoreStateWithInjectionConfig);\n  readonly removeInjectionConfigWithKey = this.updater(updateDbxMapboxMapInjectionStoreStateWithRemovedKey);\n}\n\n/**\n * Returns an updated store state with the given injection config added or replaced in the map, keyed by its unique key.\n *\n * @param state - The current mapbox injection store state.\n * @param config - The injection configuration to add or update.\n * @returns The updated store state containing the new or replaced config.\n */\nexport function updateDbxMapboxMapInjectionStoreStateWithInjectionConfig(state: DbxMapboxMapInjectionStoreState, config: DbxMapboxInjectionConfig) {\n  const map = new Map(state.map).set(config.key, config);\n  return { ...state, map };\n}\n\n/**\n * Returns an updated store state with the injection config for the given key removed. If the key does not exist, returns the state unchanged.\n *\n * @param state - The current mapbox injection store state.\n * @param key - The injection key to remove from the map.\n * @returns The updated store state with the key removed, or the original state if the key was not present.\n */\nexport function updateDbxMapboxMapInjectionStoreStateWithRemovedKey(state: DbxMapboxMapInjectionStoreState, key: DbxMapboxInjectionKey) {\n  // only create a new state if the key is going to get removed\n  if (state.map.has(key)) {\n    const map = new Map(state.map);\n    map.delete(key);\n    state = { ...state, map };\n  }\n\n  return state;\n}\n","import { Component, inject } from '@angular/core';\nimport { DbxInjectionArrayComponent } from '@dereekb/dbx-core';\nimport { DbxMapboxInjectionStore } from './mapbox.injection.store';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\n/**\n * Injects the components configured in the DbxMapboxInjectionStore into the view.\n */\n@Component({\n  selector: 'dbx-mapbox-injection',\n  template: `\n    <dbx-injection-array [entries]=\"entriesSignal()\"></dbx-injection-array>\n  `,\n  imports: [DbxInjectionArrayComponent]\n})\nexport class DbxMapboxInjectionComponent {\n  readonly dbxMapboxMapKeyInjectionStore = inject(DbxMapboxInjectionStore);\n  readonly entriesSignal = toSignal(this.dbxMapboxMapKeyInjectionStore.allInjectionConfigs$);\n}\n","import { Directive, Injectable, Injector, Optional, type Provider, SkipSelf, inject } from '@angular/core';\nimport { DbxMapboxInjectionStore } from './mapbox.injection.store';\n\n/**\n * Token used by provideMapboxInjectionStoreIfDoesNotExist() to prevent injecting a parent DbxMapboxInjectionStore into the child view.\n */\n@Injectable()\nexport class DbxMapboxInjectionStoreProviderBlock {\n  readonly dbxMapboxInjectionStore = inject(DbxMapboxInjectionStore, { skipSelf: true });\n}\n\n@Directive({\n  selector: '[dbxMapboxInjectionStoreParentBlocker]',\n  providers: [DbxMapboxInjectionStoreProviderBlock]\n})\nexport class DbxMapboxInjectionStoreInjectionBlockDirective {}\n\n/**\n * Creates a Provider that initializes a new DbxMapboxInjectionStore if a parent does not exist.\n *\n * If a DbxMapboxInjectionStoreInjectionBlock is available in the context, and references the same dbxMapboxInjectionStore that is attempting to be injected, a new DbxMapboxInjectionStore is created.\n *\n * @returns\n */\nexport function provideMapboxInjectionStoreIfParentIsUnavailable(): Provider {\n  return {\n    provide: DbxMapboxInjectionStore,\n    useFactory: (dbxMapboxInjectionStoreInjectionBlock?: DbxMapboxInjectionStoreProviderBlock, dbxMapboxInjectionStore?: DbxMapboxInjectionStore) => {\n      if (!dbxMapboxInjectionStore || (dbxMapboxInjectionStore && dbxMapboxInjectionStoreInjectionBlock?.dbxMapboxInjectionStore === dbxMapboxInjectionStore)) {\n        // create a new dbxMapboxInjectionStore to use\n        const parentInjector = inject(Injector);\n        const injector = Injector.create({ providers: [{ provide: DbxMapboxInjectionStore }], parent: parentInjector });\n        dbxMapboxInjectionStore = injector.get(DbxMapboxInjectionStore);\n      }\n\n      return dbxMapboxInjectionStore;\n    },\n    deps: [\n      [new Optional(), DbxMapboxInjectionStoreProviderBlock],\n      [new Optional(), new SkipSelf(), DbxMapboxInjectionStore]\n    ]\n  };\n}\n","import { DbxMapboxService } from './mapbox.service';\nimport { DbxMapboxMapStore } from './mapbox.store';\nimport { Directive, inject } from '@angular/core';\nimport { MAP_COMPONENT_INITIALIZATION_OPTIONS, MapComponent, MapService } from 'ngx-mapbox-gl';\n\n/**\n * Directive that configures a MapComponent with content from DbxMapboxService. Connects a host MapService to a parent DbxMapboxMapStore if available.\n */\n@Directive({\n  selector: '[dbxMapboxMap]',\n  providers: [\n    {\n      provide: MAP_COMPONENT_INITIALIZATION_OPTIONS,\n      useFactory: (dbxMapboxService: DbxMapboxService) => dbxMapboxService.initializationOptions(),\n      deps: [DbxMapboxService]\n    }\n  ]\n})\nexport class DbxMapboxMapDirective {\n  readonly mapService = inject(MapService, { host: true });\n  readonly mapboxMap = inject(MapComponent, { host: true });\n\n  readonly dbxMapboxService = inject(DbxMapboxService);\n  readonly dbxMapboxMapStore = inject(DbxMapboxMapStore, { optional: true });\n\n  constructor() {\n    if (this.dbxMapboxMapStore) {\n      this.dbxMapboxMapStore.setMapService(this.mapService);\n    }\n  }\n}\n","import { Component, inject } from '@angular/core';\nimport { DbxMapboxMapStore } from './mapbox.store';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { DbxInjectionComponent } from '@dereekb/dbx-core';\n\n/**\n * Content drawer that connects with DbxMapboxMapStore to show the content.\n */\n@Component({\n  selector: 'dbx-mapbox-layout-drawer',\n  templateUrl: './mapbox.layout.drawer.component.html',\n  host: {\n    class: 'dbx-mapbox-layout-drawer'\n  },\n  imports: [DbxInjectionComponent]\n})\nexport class DbxMapboxLayoutDrawerComponent {\n  readonly dbxMapboxMapStore = inject(DbxMapboxMapStore);\n  readonly drawerConfigSignal = toSignal(this.dbxMapboxMapStore.drawerContent$);\n}\n","<div>\n  <dbx-injection [config]=\"drawerConfigSignal()\"></dbx-injection>\n</div>\n","import { tap, switchMap, first, startWith, throttleTime, map, distinctUntilChanged, combineLatest, Subject, type Observable, delay } from 'rxjs';\nimport { Component, ElementRef, type OnInit, inject, signal, computed, input, output, viewChild, type Signal, effect } from '@angular/core';\nimport { toSignal, toObservable } from '@angular/core/rxjs-interop';\nimport { DbxMapboxMapStore } from './mapbox.store';\nimport { DbxMapboxService } from './mapbox.service';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxColorDirective, type DbxColorInput, DbxResizedDirective, type ResizedEvent } from '@dereekb/dbx-web';\nimport { MatDrawer, MatDrawerContainer, MatDrawerContent } from '@angular/material/sidenav';\nimport { type MapboxEaseTo } from './mapbox';\nimport { NgClass } from '@angular/common';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { DbxMapboxLayoutDrawerComponent } from './mapbox.layout.drawer.component';\nimport { completeOnDestroy, cleanSubscription } from '@dereekb/dbx-core';\n\nexport type DbxMapboxLayoutSide = 'left' | 'right';\n\nexport type DbxMapboxLayoutMode = 'side' | 'push';\n\n/**\n * Responsive component meant to split a left and right column.\n *\n * The left column is smaller than the right column, which contains the primary content.\n *\n * Requires a TwoColumnsContextStore to be provided.\n */\n@Component({\n  selector: 'dbx-mapbox-layout',\n  templateUrl: './mapbox.layout.component.html',\n  styleUrls: ['./mapbox.layout.component.scss'],\n  imports: [DbxResizedDirective, NgClass, DbxMapboxLayoutDrawerComponent, MatDrawer, MatDrawerContainer, MatDrawerContent, MatIconModule, MatIconButton, DbxColorDirective],\n  host: {\n    '[style.--mat-sidenav-container-width]': 'dbxMapboxService.drawerWidth'\n  }\n})\nexport class DbxMapboxLayoutComponent implements OnInit {\n  readonly dbxMapboxService = inject(DbxMapboxService);\n  readonly dbxMapboxMapStore = inject(DbxMapboxMapStore);\n\n  private readonly _viewResized = completeOnDestroy(new Subject<ResizedEvent>());\n  private readonly _refreshContentMargins = completeOnDestroy(new Subject<void>());\n\n  readonly drawerOpenedChange = output<boolean>();\n\n  readonly drawerContainer = viewChild.required<MatDrawerContainer>(MatDrawerContainer);\n  readonly drawerContainerElement = viewChild.required<MatDrawerContainer, ElementRef<HTMLElement>>(MatDrawerContainer, { read: ElementRef<HTMLElement> });\n  readonly drawerContent = viewChild.required<ElementRef<HTMLElement>>('drawerContent');\n\n  readonly side = input<DbxMapboxLayoutSide, Maybe<DbxMapboxLayoutSide>>('right', { transform: (x) => x || 'right' });\n  readonly mode = input<DbxMapboxLayoutMode, Maybe<DbxMapboxLayoutMode>>('side', { transform: (x) => x || 'side' });\n\n  /**\n   * Forces the drawer to assume the drawer has content if true, or assume it has no content if false.\n   */\n  readonly forceHasDrawerContent = input<Maybe<boolean>>(undefined);\n  readonly drawerButtonColor = input<DbxColorInput, Maybe<DbxColorInput>>('default', { transform: (x) => x ?? 'default' });\n\n  readonly openDrawer = input<Maybe<boolean>>(undefined); // input open/close drawer config\n  readonly isDrawerOpenSignal = signal<Maybe<boolean>>(undefined); // Signal to toggle the drawer\n\n  protected readonly _openDrawerEffect = effect(() => {\n    this.isDrawerOpenSignal.set(this.openDrawer());\n  });\n\n  readonly storeHasDrawerContent = toSignal(this.dbxMapboxMapStore.hasDrawerContent$);\n  readonly drawerHasContentSignal = computed(() => {\n    const storeHasDrawerContent = this.storeHasDrawerContent();\n    return this.forceHasDrawerContent() ?? storeHasDrawerContent;\n  });\n\n  readonly refreshContentMargins$ = this._refreshContentMargins;\n\n  readonly isOpenAndHasContentSignal = computed(() => {\n    const isDrawerOpen = this.isDrawerOpenSignal();\n    return this.drawerHasContentSignal() && isDrawerOpen;\n  });\n\n  readonly viewResized$ = this._viewResized.asObservable();\n  readonly side$ = toObservable(this.side);\n  readonly mode$ = toObservable(this.mode);\n  readonly drawerHasContent$ = toObservable(this.drawerHasContentSignal);\n  readonly isOpenAndHasContent$ = toObservable(this.isOpenAndHasContentSignal);\n\n  readonly positionSignal: Signal<'start' | 'end'> = computed(() => {\n    return this.side() === 'right' ? 'end' : 'start';\n  });\n\n  readonly drawerClassesSignal = computed(() => {\n    const side = this.side();\n    const hasContent = this.drawerHasContentSignal();\n    const isOpen = this.isDrawerOpenSignal(); // NOTE: isOpenAndHasContentSignal is not used here\n\n    return (hasContent ? 'has-drawer-content' : 'no-drawer-content') + ` ${side}-drawer ` + (isOpen ? 'open-drawer' : '');\n  });\n\n  readonly buttonIconSignal = computed(() => {\n    const side = this.side();\n    const opened = this.isDrawerOpenSignal(); // NOTE: isOpenAndHasContentSignal is not used here\n\n    let icons = ['chevron_right', 'chevron_left'];\n\n    if (side === 'left') {\n      icons = icons.reverse();\n    }\n\n    return opened ? icons[0] : icons[1];\n  });\n\n  private readonly _reszieSyncSub = cleanSubscription();\n  private readonly _toggleSyncSub = cleanSubscription();\n\n  ngOnInit(): void {\n    this._reszieSyncSub.subscription = (\n      this.side$.pipe(\n        switchMap(() =>\n          this._viewResized.pipe(\n            throttleTime(80, undefined, { leading: true, trailing: true }),\n            map(() => 'r'),\n            startWith('s')\n          )\n        )\n      ) as Observable<'s' | 'r'>\n    ).subscribe((reason) => {\n      this.dbxMapboxMapStore.mapInstance$.subscribe((x) => {\n        x.resize();\n\n        // side changed\n        if (reason === 's') {\n          this._refreshContentMargins.next();\n        }\n      });\n    });\n\n    let init = false;\n\n    this._toggleSyncSub.subscription = this.mode$\n      .pipe(\n        switchMap((mode) => {\n          let obs: Observable<unknown>;\n\n          if (mode === 'push') {\n            obs = combineLatest([this.isOpenAndHasContent$.pipe(distinctUntilChanged()), this.refreshContentMargins$]).pipe(\n              tap(([opened]) => {\n                const drawerContainer = this.drawerContainer();\n\n                let { right } = drawerContainer._contentMargins;\n\n                drawerContainer.updateContentMargins();\n\n                setTimeout(() => {\n                  const flip = opened ? 1 : -1;\n\n                  if (opened) {\n                    right = drawerContainer._contentMargins.right;\n                  }\n\n                  right = (right || 0) * flip;\n\n                  const element: HTMLElement = this.drawerContent().nativeElement;\n                  const width = element.clientWidth;\n\n                  const margin = {\n                    leftMargin: 0,\n                    rightMargin: right,\n                    fullWidth: width\n                  };\n\n                  const easeTo: Observable<MapboxEaseTo> = this.dbxMapboxMapStore.calculateNextCenterOffsetWithScreenMarginChange(margin).pipe(\n                    first(),\n                    map((center) => ({ to: { center, duration: 3200, essential: false } }))\n                  );\n\n                  this.dbxMapboxMapStore.setMargin(opened ? margin : undefined);\n\n                  if (init) {\n                    init = true;\n                  } else {\n                    this.dbxMapboxMapStore.easeTo(easeTo);\n                  }\n                });\n              })\n            );\n          } else {\n            obs = combineLatest([this.isOpenAndHasContent$.pipe(distinctUntilChanged()), this._refreshContentMargins.pipe(delay(0))]).pipe(\n              switchMap((_) => this.dbxMapboxMapStore.mapInstance$),\n              tap((map) => {\n                this.drawerContainer().updateContentMargins();\n                map.triggerRepaint();\n              })\n            );\n          }\n\n          return obs;\n        })\n      )\n      .subscribe();\n  }\n\n  viewResized(event: ResizedEvent): void {\n    this._viewResized.next(event);\n  }\n\n  drawerOpened(opened: boolean) {\n    const currentToggleState = this.isDrawerOpenSignal();\n\n    if (currentToggleState !== opened) {\n      this.toggleDrawer(opened); // sync with drawer toggling\n      this.drawerOpenedChange.emit(opened);\n    }\n  }\n\n  toggleDrawer(open?: Maybe<boolean>) {\n    open ??= !this.isDrawerOpenSignal();\n    this.isDrawerOpenSignal.set(open);\n  }\n}\n","<mat-drawer-container #containerElement class=\"dbx-mapbox-layout-container\" [ngClass]=\"drawerClassesSignal()\" [hasBackdrop]=\"false\">\n  <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer (openedChange)=\"drawerOpened($event)\" [opened]=\"isOpenAndHasContentSignal()\" [mode]=\"mode()\" [position]=\"positionSignal()\">\n    <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"drawerClassesSignal()\">\n      <ng-content select=\"[drawer]\"></ng-content>\n      <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n    </div>\n  </mat-drawer>\n  <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (dbxResized)=\"viewResized($event)\">\n    <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [dbxColor]=\"drawerButtonColor()\">\n      <mat-icon>{{ buttonIconSignal() }}</mat-icon>\n    </button>\n    <ng-content></ng-content>\n  </mat-drawer-content>\n</mat-drawer-container>\n","import { filter, switchMap, of } from 'rxjs';\nimport { DbxMapboxMapStore } from './mapbox.store';\nimport { Component, inject, signal, input } from '@angular/core';\nimport { type Maybe, DestroyFunctionObject, isNotFalse } from '@dereekb/util';\nimport { MatMenuTrigger } from '@angular/material/menu';\nimport { clean, cleanSubscription } from '@dereekb/dbx-core';\nimport { disableRightClickInCdkBackdrop } from '@dereekb/dbx-web';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { dbxMapboxRightClickEventClientPosition } from './mapbox.util';\nimport { isTouchSourcedMouseEvent } from './mapbox.longpress';\n\n/**\n * Directive that connects a host MatMenuTrigger to a DbxMapboxMapStore and opens the menu on a right-click, or a long press, on the map.\n *\n * The map dissapears if the mouse scrolls anywhere else on the map.\n */\n@Component({\n  selector: 'dbx-mapbox-menu',\n  template: '',\n  host: {\n    style: 'visibility: hidden; position: fixed',\n    '[style.top]': 'posSignal().y',\n    '[style.left]': 'posSignal().x'\n  }\n})\nexport class DbxMapboxMenuComponent {\n  readonly dbxMapboxMapStore = inject(DbxMapboxMapStore);\n  readonly matMenuTrigger = inject(MatMenuTrigger, { host: true });\n\n  readonly active = input<boolean, Maybe<boolean>>(true, { transform: isNotFalse });\n\n  readonly posSignal = signal<{ x: string; y: string }>({ x: `0`, y: `0` });\n\n  readonly active$ = toObservable(this.active);\n\n  private readonly _preventRightClick = new DestroyFunctionObject();\n\n  constructor() {\n    cleanSubscription(\n      this.active$\n        .pipe(\n          switchMap((active) => {\n            return active ? this.dbxMapboxMapStore.rightClickEvent$ : of();\n          }),\n          filter(Boolean)\n        )\n        .subscribe((event) => {\n          const menu = this.matMenuTrigger.menu;\n\n          if (menu) {\n            // update position of this component for menu to open at\n            const { x, y } = dbxMapboxRightClickEventClientPosition(event);\n\n            this.posSignal.set({\n              x: `${x}px`,\n              y: `${y}px`\n            });\n\n            // open menu\n            this.matMenuTrigger.openMenu();\n\n            // prevent right clicks in the cdkOverlay while the menu is open. A touch's contextmenu (sent while or after a finger is held) must not close the menu it just opened.\n            this._preventRightClick.destroy = disableRightClickInCdkBackdrop(undefined, (contextMenuEvent) => {\n              if (!isTouchSourcedMouseEvent(contextMenuEvent)) {\n                this.matMenuTrigger.closeMenu();\n              }\n            });\n          }\n        })\n    );\n\n    cleanSubscription(\n      this.matMenuTrigger.menuClosed.subscribe(() => {\n        // destroy prevention when the menu is closed.\n        this._preventRightClick.destroy();\n      })\n    );\n\n    clean(() => {\n      if (this.matMenuTrigger) {\n        this.matMenuTrigger.closeMenu();\n      }\n    });\n  }\n}\n","import { Directive, Injectable, Injector, Optional, type Provider, SkipSelf, inject } from '@angular/core';\nimport { DbxMapboxMapStore } from './mapbox.store';\n\n/**\n * Token used by provideMapboxStoreIfDoesNotExist() to prevent injecting a parent DbxMapboxMapStore into the child view.\n */\n@Injectable()\nexport class DbxMapboxMapStoreProviderBlock {\n  readonly dbxMapboxMapStore = inject(DbxMapboxMapStore, { skipSelf: true });\n}\n\n@Directive({\n  selector: '[dbxMapboxStoreParentBlocker]',\n  providers: [DbxMapboxMapStoreProviderBlock]\n})\nexport class DbxMapboxMapStoreInjectionBlockDirective {}\n\n/**\n * Creates a Provider that initializes a new DbxMapboxMapStore if a parent does not exist.\n *\n * If a DbxMapboxMapStoreInjectionBlock is available in the context, and references the same dbxMapboxMapStore that is attempting to be injected, a new DbxMapboxMapStore is created.\n *\n * @returns\n */\nexport function provideMapboxStoreIfParentIsUnavailable(): Provider {\n  return {\n    provide: DbxMapboxMapStore,\n    useFactory: (dbxMapboxMapStoreInjectionBlock?: DbxMapboxMapStoreProviderBlock, dbxMapboxMapStore?: DbxMapboxMapStore) => {\n      if (!dbxMapboxMapStore || (dbxMapboxMapStore && dbxMapboxMapStoreInjectionBlock?.dbxMapboxMapStore === dbxMapboxMapStore)) {\n        const parentInjector = inject(Injector);\n        // create a new dbxMapboxMapStore to use\n        const injector = Injector.create({ providers: [{ provide: DbxMapboxMapStore }], parent: parentInjector });\n        dbxMapboxMapStore = injector.get(DbxMapboxMapStore);\n      }\n\n      return dbxMapboxMapStore;\n    },\n    deps: [\n      [new Optional(), DbxMapboxMapStoreProviderBlock],\n      [new Optional(), new SkipSelf(), DbxMapboxMapStore]\n    ]\n  };\n}\n","import { Component, type OnDestroy, computed, inject, input } from '@angular/core';\nimport { type CssClassesArray, getValueFromGetter, latLngPointFunction, spaceSeparatedCssClasses, type Maybe, pushItemOrArrayItemsIntoArray } from '@dereekb/util';\nimport { DbxMapboxChangeService } from './mapbox.change.service';\nimport { type DbxMapboxMarker } from './mapbox.marker';\nimport { MarkerComponent } from 'ngx-mapbox-gl';\nimport { DbxAnchorComponent } from '@dereekb/dbx-web';\nimport { MatIconModule } from '@angular/material/icon';\nimport { NgClass, NgStyle } from '@angular/common';\n\n@Component({\n  selector: 'dbx-mapbox-marker',\n  template: `\n    <mgl-marker [lngLat]=\"latLngSignal()\">\n      <dbx-anchor [anchor]=\"marker()?.anchor\">\n        <div class=\"dbx-mapbox-marker\" [ngClass]=\"presentationCssClassSignal()\">\n          <div class=\"dbx-mapbox-marker-icon-content\" [ngStyle]=\"styleSignal()\">\n            @if (marker()?.icon) {\n              <mat-icon>{{ marker()?.icon }}</mat-icon>\n            }\n          </div>\n          @if (marker()?.label) {\n            <div class=\"dbx-mapbox-marker-label dbx-outlined-text\">{{ marker()?.label }}</div>\n          }\n        </div>\n      </dbx-anchor>\n    </mgl-marker>\n  `,\n  styleUrls: ['./mapbox.marker.component.scss'],\n  imports: [MarkerComponent, DbxAnchorComponent, MatIconModule, NgStyle, NgClass]\n})\nexport class DbxMapboxMarkerComponent implements OnDestroy {\n  private readonly _dbxMapboxChangeService = inject(DbxMapboxChangeService, { optional: true });\n\n  private static _latLngPoint = latLngPointFunction({ wrap: true });\n\n  readonly marker = input.required<Maybe<DbxMapboxMarker>>();\n\n  readonly latLngSignal = computed(() => {\n    const marker = this.marker();\n    return marker?.latLng ? DbxMapboxMarkerComponent._latLngPoint(marker.latLng) : undefined;\n  });\n\n  readonly presentationSignal = computed(() => this.marker()?.presentation ?? 'normal');\n\n  readonly styleSignal = computed(() => {\n    const marker = this.marker();\n\n    let width = 0;\n    let height = 0;\n\n    const size = marker?.size || 'medium';\n\n    switch (marker?.presentation) {\n      case 'normal':\n        if (typeof size === 'number') {\n          width = size;\n        } else {\n          switch (size) {\n            case 'small':\n              width = 18;\n              break;\n            case 'medium':\n              width = 24;\n              break;\n            case 'large':\n              width = 32;\n              break;\n            case 'tall':\n              width = 24;\n              height = 32;\n              break;\n            default:\n              break;\n          }\n          break;\n        }\n        break;\n      default:\n        break;\n    }\n\n    if (!height) {\n      height = width;\n    }\n\n    const imageInput = marker?.image;\n    const image = imageInput ? (typeof imageInput === 'string' ? imageInput : getValueFromGetter(imageInput, width)) : undefined;\n\n    const style: Record<string, unknown> = {\n      ...marker?.style,\n      'background-image': image\n    };\n\n    if (width && height) {\n      style['width'] = width + 'px';\n      style['height'] = height + 'px';\n      style['font-size'] = width + 'px';\n    }\n\n    return style;\n  });\n\n  readonly presentationCssClassSignal = computed(() => {\n    const marker = this.marker();\n    const presentation = this.presentationSignal();\n    const markerClasses = marker?.markerClasses;\n\n    let cssClasses: CssClassesArray = [];\n\n    switch (presentation) {\n      case 'chip':\n      case 'chip-small':\n        cssClasses = ['dbx-mapbox-marker-chip', 'dbx-chip', 'dbx-default-bg', 'dbx-color-bg'];\n\n        if (presentation === 'chip-small') {\n          cssClasses.push('dbx-chip-small');\n        }\n\n        break;\n      default:\n        break;\n    }\n\n    if (!marker?.icon) {\n      cssClasses.push('dbx-mapbox-marker-no-icon');\n    }\n\n    if (markerClasses) {\n      pushItemOrArrayItemsIntoArray(cssClasses, markerClasses);\n    }\n\n    return spaceSeparatedCssClasses(cssClasses);\n  });\n\n  ngOnDestroy(): void {\n    this._dbxMapboxChangeService?.emitMarkerDestroyed();\n  }\n}\n","import { type Maybe } from '@dereekb/util';\nimport { Component, computed, input } from '@angular/core';\nimport { type DbxMapboxMarker, type DbxMapboxMarkerFactory } from './mapbox.marker';\nimport { DbxMapboxMarkerComponent } from './mapbox.marker.component';\n\n/**\n * Component used to render a set of DbxMapboxMarker values from the input data and marker factory.\n */\n@Component({\n  selector: 'dbx-mapbox-markers',\n  template: `\n    @for (marker of markersSignal(); track trackMarkerById($index, marker)) {\n      <dbx-mapbox-marker [marker]=\"marker\"></dbx-mapbox-marker>\n    }\n  `,\n  imports: [DbxMapboxMarkerComponent]\n})\nexport class DbxMapboxMarkersComponent<T> {\n  readonly data = input.required<Maybe<T[]>>();\n  readonly markerFactory = input.required<Maybe<DbxMapboxMarkerFactory<T>>>();\n\n  readonly markersSignal = computed(() => {\n    const data = this.data();\n    const markerFactory = this.markerFactory();\n\n    return data?.length && markerFactory ? data.map(markerFactory) : [];\n  });\n\n  trackMarkerById(index: number, marker: DbxMapboxMarker) {\n    return marker.id ?? `__MID__${index}_`;\n  }\n}\n","import { shareReplay, map, distinctUntilChanged, type Subscription } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { isSameVector } from '@dereekb/util';\nimport { DbxMapboxLayoutComponent } from './mapbox.layout.component';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Directive that synchronizes a map's virtual size with the size of the element.\n */\n@Directive({\n  selector: '[dbxMapboxLayoutVirtualResizeSync]'\n})\nexport class DbxMapboxLayoutVirtualResizeSyncComponent {\n  readonly dbxMapboxLayoutComponent = inject(DbxMapboxLayoutComponent, { host: true });\n\n  readonly resizedVector$ = this.dbxMapboxLayoutComponent.viewResized$.pipe(\n    map(() => {\n      const element = this.dbxMapboxLayoutComponent.drawerContainerElement()?.nativeElement;\n      const { clientWidth, clientHeight } = element;\n\n      return {\n        x: clientWidth,\n        y: clientHeight\n      };\n    }),\n    distinctUntilChanged(isSameVector),\n    shareReplay(1)\n  );\n\n  constructor() {\n    cleanSubscription(this.dbxMapboxLayoutComponent.dbxMapboxMapStore.setMinimumVirtualViewportSize(this.resizedVector$) as Subscription);\n  }\n}\n","import { type Pixels, type PixelsString } from '@dereekb/util';\nimport { type Anchor, type PointLike } from 'mapbox-gl';\n\n/**\n * Screen-space box, in the same shape as a DOMRect.\n */\nexport interface DbxMapboxScreenRect {\n  readonly left: Pixels;\n  readonly top: Pixels;\n  readonly right: Pixels;\n  readonly bottom: Pixels;\n}\n\n/**\n * Offset of a popup from its anchor point. Same shape as the mapbox-gl Popup offset option.\n *\n * Use a per-anchor record when the popup's tail should keep a different distance from the marker depending on which side of the marker the popup opens.\n */\nexport type DbxMapboxPopupOffset = Pixels | PointLike | Record<Anchor, [Pixels, Pixels]>;\n\n/**\n * Max width of a popup. Same shape as the mapbox-gl Popup maxWidth option.\n */\nexport type DbxMapboxPopupMaxWidth = PixelsString | 'none';\n\n/**\n * Input for mapboxPopupAnchorOffset().\n */\nexport interface MapboxPopupAnchorOffsetConfig {\n  /**\n   * Horizontal distance between the popup's tail and the anchor point, used when the popup opens beside the marker.\n   */\n  readonly x: Pixels;\n  /**\n   * Vertical distance between the popup's tail and the anchor point, used when the popup opens above or below the marker.\n   */\n  readonly y: Pixels;\n}\n\n/**\n * Creates the offset for every anchor mapbox-gl may pick.\n *\n * When no fixed anchor is set, mapbox-gl places the popup on whichever side of the anchor point fits in the map, so each side needs its own offset.\n *\n * @param config - Distances to keep from the anchor point.\n * @returns The offset for each anchor.\n */\nexport function mapboxPopupAnchorOffset(config: MapboxPopupAnchorOffsetConfig): Record<Anchor, [Pixels, Pixels]> {\n  const { x, y } = config;\n\n  return {\n    center: [0, 0],\n    top: [0, y],\n    'top-left': [0, y],\n    'top-right': [0, y],\n    bottom: [0, -y],\n    'bottom-left': [0, -y],\n    'bottom-right': [0, -y],\n    left: [x, 0],\n    right: [-x, 0]\n  };\n}\n\n/**\n * Default popup offset. Fits a chip or small marker, which is wider than it is tall.\n */\nexport const DEFAULT_DBX_MAPBOX_POPUP_OFFSET = mapboxPopupAnchorOffset({ x: 36, y: 18 });\n\n/**\n * Default space kept between a popup and the edge of the visible map when the map pans to fit the popup.\n */\nexport const DEFAULT_DBX_MAPBOX_POPUP_VIEW_PADDING: Pixels = 12;\n\n/**\n * Returns the overlap of two boxes, e.g. the map's box clipped to the browser window.\n *\n * @param a - The first box.\n * @param b - The second box.\n * @returns The overlapping box.\n */\nexport function mapboxScreenRectIntersection(a: DbxMapboxScreenRect, b: DbxMapboxScreenRect): DbxMapboxScreenRect {\n  return {\n    left: Math.max(a.left, b.left),\n    top: Math.max(a.top, b.top),\n    right: Math.min(a.right, b.right),\n    bottom: Math.min(a.bottom, b.bottom)\n  };\n}\n\n/**\n * Returns the part of the element the user can actually see: its box clipped by the browser window and by every ancestor that hides its overflow (a rounded map container, a drawer, the page).\n *\n * @param element - The element to measure, e.g. the map.\n * @returns The visible box, in screen space.\n */\nexport function mapboxVisibleElementScreenRect(element: Element): DbxMapboxScreenRect {\n  let rect: DbxMapboxScreenRect = mapboxScreenRectIntersection(element.getBoundingClientRect(), {\n    left: 0,\n    top: 0,\n    right: document.documentElement.clientWidth,\n    bottom: document.documentElement.clientHeight\n  });\n\n  let ancestor = element.parentElement;\n\n  while (ancestor && ancestor !== document.body && ancestor !== document.documentElement) {\n    const { overflowX, overflowY } = getComputedStyle(ancestor);\n\n    if (overflowX !== 'visible' || overflowY !== 'visible') {\n      rect = mapboxScreenRectIntersection(rect, ancestor.getBoundingClientRect());\n    }\n\n    ancestor = ancestor.parentElement;\n  }\n\n  return rect;\n}\n\n/**\n * Input for mapboxPopupPanIntoViewOffset().\n */\nexport interface MapboxPopupPanIntoViewOffsetInput {\n  /**\n   * Where the popup currently sits on screen.\n   */\n  readonly popup: DbxMapboxScreenRect;\n  /**\n   * The part of the map the user can actually see.\n   */\n  readonly view: DbxMapboxScreenRect;\n  /**\n   * Space to keep between the popup and the edge of the view.\n   */\n  readonly padding: Pixels;\n}\n\n/**\n * Pixel offset to pass to the map's panBy() so the popup ends up fully inside the view.\n *\n * A positive x/y pans the camera right/down, which moves the popup left/up. When the popup is larger than the view on an axis, its top/left edge is kept visible.\n *\n * @param input - The popup box, the visible box, and the padding to keep.\n * @returns The [x, y] pan offset. [0, 0] when the popup already fits.\n */\nexport function mapboxPopupPanIntoViewOffset(input: MapboxPopupPanIntoViewOffsetInput): [Pixels, Pixels] {\n  const { popup, view, padding } = input;\n\n  function axisOffset(popupRange: readonly [Pixels, Pixels], viewRange: readonly [Pixels, Pixels]): Pixels {\n    const [popupStart, popupEnd] = popupRange;\n    const start = viewRange[0] + padding;\n    const end = viewRange[1] - padding;\n    let offset = 0;\n\n    if (popupStart < start || popupEnd - popupStart > end - start) {\n      offset = popupStart - start;\n    } else if (popupEnd > end) {\n      offset = popupEnd - end;\n    }\n\n    return Math.round(offset);\n  }\n\n  return [axisOffset([popup.left, popup.right], [view.left, view.right]), axisOffset([popup.top, popup.bottom], [view.top, view.bottom])];\n}\n","import { ChangeDetectionStrategy, Component, type ElementRef, Injector, afterNextRender, computed, effect, inject, input, output, viewChild } from '@angular/core';\nimport { latLngPointFunction, type LatLngPointInput, type Maybe, type Pixels } from '@dereekb/util';\nimport { type Anchor, type LngLatLike, type Map as MapboxMap } from 'mapbox-gl';\nimport { MapService, PopupComponent } from 'ngx-mapbox-gl';\nimport { DbxResizedDirective, type ResizedEvent } from '@dereekb/dbx-web';\nimport { DEFAULT_DBX_MAPBOX_POPUP_OFFSET, DEFAULT_DBX_MAPBOX_POPUP_VIEW_PADDING, type DbxMapboxPopupMaxWidth, type DbxMapboxPopupOffset, mapboxPopupPanIntoViewOffset, mapboxVisibleElementScreenRect } from './mapbox.popup';\n\n/**\n * CSS class added to every popup rendered by DbxMapboxPopupComponent.\n */\nexport const DBX_MAPBOX_POPUP_CSS_CLASS = 'dbx-mapbox-popup';\n\n/**\n * Display configuration for a DbxMapboxPopupComponent.\n */\nexport interface DbxMapboxPopupComponentConfig {\n  /**\n   * Offset from the anchor point. Defaults to DEFAULT_DBX_MAPBOX_POPUP_OFFSET.\n   */\n  readonly offset?: Maybe<DbxMapboxPopupOffset>;\n  /**\n   * Fixed side of the anchor point to open on. When unset mapbox-gl picks the side that fits in the map.\n   */\n  readonly anchor?: Maybe<Anchor>;\n  /**\n   * Additional CSS classes to add to the popup element.\n   */\n  readonly popupClass?: Maybe<string>;\n  /**\n   * Max width of the popup. Defaults to 'none', so the width comes from the content and the dbx-mapbox-popup styles.\n   */\n  readonly maxWidth?: Maybe<DbxMapboxPopupMaxWidth>;\n  /**\n   * Whether to pan the map so the whole popup is visible each time it opens or moves. Defaults to true.\n   */\n  readonly autoPanIntoView?: Maybe<boolean>;\n  /**\n   * Space to keep between the popup and the edge of the visible map when panning. Defaults to DEFAULT_DBX_MAPBOX_POPUP_VIEW_PADDING.\n   */\n  readonly panIntoViewPadding?: Maybe<Pixels>;\n}\n\n/**\n * Popup anchored to a point on the map. Renders the projected content in a mapbox-gl popup.\n *\n * The popup adds no surface of its own: the content provides it, typically a mat-card. The popup's tail takes the mat-card surface color. It has no close button and does not close when the map is clicked, so the owner decides when it closes; a dbx-dialog-content-close placed in the content floats in its top-right corner.\n *\n * When it opens, moves to another point, or its content changes size, the map pans so the whole popup is visible, measured against the part of the map the user can actually see.\n *\n * Must be placed within a mgl-map, e.g. through the DbxMapboxInjectionStore. Use dbxMapboxItemPopupController() to open a popup for a clicked marker.\n *\n * @dbxWebComponent\n * @dbxWebSlug mapbox-popup\n * @dbxWebCategory overlay\n * @dbxWebRelated popover, dialog-content\n * @dbxWebMinimalExample ```html\n * <dbx-mapbox-popup [latLng]=\"latLng\">Content</dbx-mapbox-popup>\n * ```\n *\n * @example\n * ```html\n * <mgl-map dbxMapboxMap>\n *   <dbx-mapbox-popup [latLng]=\"place.latLng\" popupClass=\"my-place-popup\" (popupClose)=\"closePlace()\">\n *     <mat-card>\n *       <dbx-dialog-content-close [padded]=\"false\" (close)=\"closePlace()\"></dbx-dialog-content-close>\n *       <mat-card-header>\n *         <mat-card-title>{{ place.name }}</mat-card-title>\n *       </mat-card-header>\n *       <mat-card-content>{{ place.description }}</mat-card-content>\n *     </mat-card>\n *   </dbx-mapbox-popup>\n * </mgl-map>\n * ```\n */\n@Component({\n  selector: 'dbx-mapbox-popup',\n  template: `\n    <mgl-popup [lngLat]=\"lngLatSignal()\" [offset]=\"offsetSignal()\" [anchor]=\"anchorSignal()\" [closeButton]=\"false\" [closeOnClick]=\"false\" [focusAfterOpen]=\"false\" [maxWidth]=\"maxWidthSignal()\" [className]=\"classNameSignal()\" (popupClose)=\"popupClose.emit()\">\n      <div #content class=\"dbx-mapbox-popup-content\" (dbxResized)=\"onContentResized($event)\">\n        <ng-content></ng-content>\n      </div>\n    </mgl-popup>\n  `,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [PopupComponent, DbxResizedDirective]\n})\nexport class DbxMapboxPopupComponent {\n  private static readonly _latLngPoint = latLngPointFunction({ wrap: true });\n\n  private readonly _mapService = inject(MapService);\n  private readonly _injector = inject(Injector);\n\n  /**\n   * Point the popup is anchored to.\n   */\n  readonly latLng = input.required<LatLngPointInput>();\n\n  readonly config = input<Maybe<DbxMapboxPopupComponentConfig>>();\n  readonly offset = input<Maybe<DbxMapboxPopupOffset>>();\n  readonly anchor = input<Maybe<Anchor>>();\n  readonly popupClass = input<Maybe<string>>();\n  readonly maxWidth = input<Maybe<DbxMapboxPopupMaxWidth>>();\n  readonly autoPanIntoView = input<Maybe<boolean>>();\n  readonly panIntoViewPadding = input<Maybe<Pixels>>();\n\n  /**\n   * Emitted when mapbox-gl closes the popup.\n   */\n  readonly popupClose = output<void>();\n\n  readonly contentElement = viewChild.required<ElementRef<HTMLElement>>('content');\n\n  readonly lngLatSignal = computed<LngLatLike>(() => {\n    const { lat, lng } = DbxMapboxPopupComponent._latLngPoint(this.latLng());\n    return [lng, lat];\n  });\n\n  readonly offsetSignal = computed(() => {\n    const offset = this.offset();\n    const config = this.config();\n    return offset ?? config?.offset ?? DEFAULT_DBX_MAPBOX_POPUP_OFFSET;\n  });\n\n  readonly anchorSignal = computed(() => {\n    const anchor = this.anchor();\n    const config = this.config();\n    return anchor ?? config?.anchor ?? undefined;\n  });\n\n  readonly maxWidthSignal = computed(() => {\n    const maxWidth = this.maxWidth();\n    const config = this.config();\n    return maxWidth ?? config?.maxWidth ?? 'none';\n  });\n\n  readonly autoPanIntoViewSignal = computed(() => {\n    const autoPanIntoView = this.autoPanIntoView();\n    const config = this.config();\n    return autoPanIntoView ?? config?.autoPanIntoView ?? true;\n  });\n\n  readonly panIntoViewPaddingSignal = computed(() => {\n    const panIntoViewPadding = this.panIntoViewPadding();\n    const config = this.config();\n    return panIntoViewPadding ?? config?.panIntoViewPadding ?? DEFAULT_DBX_MAPBOX_POPUP_VIEW_PADDING;\n  });\n\n  readonly classNameSignal = computed(() => {\n    const popupClassInput = this.popupClass();\n    const config = this.config();\n    const popupClass = popupClassInput ?? config?.popupClass;\n    return popupClass ? `${DBX_MAPBOX_POPUP_CSS_CLASS} ${popupClass}` : DBX_MAPBOX_POPUP_CSS_CLASS;\n  });\n\n  constructor() {\n    // each time the popup opens or moves to another point, pan the map if any part of the popup landed outside the visible map\n    effect(() => {\n      this.lngLatSignal();\n\n      if (this.autoPanIntoViewSignal()) {\n        // mapbox-gl places the popup as soon as it is added or moved, so it can be measured right after the render\n        afterNextRender(() => this.panIntoView(), { injector: this._injector });\n      }\n    });\n  }\n\n  /**\n   * Re-checks the popup's position when its content changes size, e.g. when an image or async content finishes loading.\n   *\n   * @param event - The resize of the popup's content.\n   */\n  onContentResized(event: ResizedEvent): void {\n    if (!event.isFirst && this.autoPanIntoViewSignal()) {\n      this.panIntoView();\n    }\n  }\n\n  /**\n   * Pans the map so the whole popup is visible.\n   *\n   * mapbox-gl already picks the side of the anchor point with the most room, but it only knows the size of the map element. The part of the map the user sees can be smaller: clipped by its container, the window, or a drawer.\n   *\n   * Runs automatically when the popup opens, moves, or its content changes size.\n   */\n  panIntoView(): void {\n    const content = this.contentElement().nativeElement;\n    const popupElement = content.closest('.mapboxgl-popup');\n    const mapElement = content.closest('.mapboxgl-map');\n    const mapInstance: Maybe<MapboxMap> = this._mapService.mapInstance;\n\n    if (popupElement && mapElement && mapInstance) {\n      const [x, y] = mapboxPopupPanIntoViewOffset({\n        popup: popupElement.getBoundingClientRect(),\n        view: mapboxVisibleElementScreenRect(mapElement),\n        padding: this.panIntoViewPaddingSignal()\n      });\n\n      if (x !== 0 || y !== 0) {\n        mapInstance.panBy([x, y]);\n      }\n    }\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxMapboxMapDirective } from './mapbox.store.map.directive';\nimport { DbxMapboxLayoutComponent } from './mapbox.layout.component';\nimport { DbxMapboxLayoutDrawerComponent } from './mapbox.layout.drawer.component';\nimport { DbxMapboxMenuComponent } from './mapbox.menu.component';\nimport { DbxMapboxMapStoreInjectionBlockDirective } from './mapbox.store.provide';\nimport { DbxMapboxMarkerComponent } from './mapbox.marker.component';\nimport { DbxMapboxMarkersComponent } from './mapbox.markers.component';\nimport { DbxMapboxCircleComponent } from './mapbox.circle.component';\nimport { DbxMapboxInjectionComponent } from './mapbox.injection.component';\nimport { DbxMapboxLayoutVirtualResizeSyncComponent } from './mapbox.layout.resize.sync.directive';\nimport { DbxMapboxPopupComponent } from './mapbox.popup.component';\nimport { MapComponent, MarkerComponent } from 'ngx-mapbox-gl';\n\nconst importsAndExports = [\n  //\n  DbxMapboxLayoutVirtualResizeSyncComponent,\n  DbxMapboxMapDirective,\n  DbxMapboxLayoutComponent,\n  DbxMapboxLayoutDrawerComponent,\n  DbxMapboxInjectionComponent,\n  DbxMapboxMenuComponent,\n  DbxMapboxMarkerComponent,\n  DbxMapboxMarkersComponent,\n  DbxMapboxCircleComponent,\n  DbxMapboxPopupComponent,\n  DbxMapboxMapStoreInjectionBlockDirective,\n  // ngx-mapbox-gl\n  MapComponent,\n  MarkerComponent\n];\n\n@NgModule({\n  imports: importsAndExports,\n  exports: importsAndExports\n})\nexport class DbxMapboxModule {}\n","import mapboxgl from 'mapbox-gl';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Relative url the mapbox-gl CSP web worker asset is expected to be served from.\n *\n * The asset itself is copied out of `node_modules/mapbox-gl/dist/mapbox-gl-csp-worker.js`\n * by the consuming app's build configuration, which keeps it in version lockstep with the\n * `mapbox-gl` the app actually bundles.\n */\nexport const DEFAULT_DBX_MAPBOX_WORKER_URL = 'assets/mapbox-gl/mapbox-gl-csp-worker.js';\n\n/**\n * Configuration for {@link configureDbxMapboxWorker}.\n */\nexport interface DbxMapboxWorkerConfig {\n  /**\n   * Whether or not to load mapbox-gl's web worker from a self-hosted asset instead of the\n   * default blob url.\n   *\n   * True by default. Set to false only to restore mapbox-gl's stock blob worker, which is\n   * broken in Angular/esbuild apps on mapbox-gl 3.26.0 and up.\n   */\n  readonly enabled?: Maybe<boolean>;\n  /**\n   * Url the mapbox-gl CSP web worker asset is served from.\n   *\n   * Defaults to {@link DEFAULT_DBX_MAPBOX_WORKER_URL}.\n   */\n  readonly workerUrl?: Maybe<string>;\n}\n\n/**\n * Result of {@link configureDbxMapboxWorker}.\n */\nexport interface DbxMapboxWorkerConfigurationResult {\n  /**\n   * Whether or not the self-hosted worker was configured on mapbox-gl.\n   */\n  readonly configured: boolean;\n  /**\n   * Url that was configured, if any.\n   */\n  readonly workerUrl: Maybe<string>;\n  /**\n   * Whether or not the configured worker asset could be retrieved.\n   *\n   * Null when no check was performed.\n   */\n  readonly available: Maybe<boolean>;\n}\n\n/**\n * Checks whether the mapbox-gl web worker asset is actually served from the given url.\n *\n * @param workerUrl - Url the worker asset is expected at.\n * @returns True when the asset responds successfully.\n */\nexport async function isDbxMapboxWorkerAssetAvailable(workerUrl: string): Promise<boolean> {\n  let available: boolean;\n\n  try {\n    const response = await fetch(workerUrl, { method: 'HEAD' });\n    available = response.ok;\n  } catch {\n    available = false;\n  }\n\n  return available;\n}\n\n/**\n * Configures mapbox-gl to load its web worker from a self-hosted copy of mapbox's prebuilt\n * CSP worker rather than from the blob url it generates itself.\n *\n * mapbox-gl's default worker is built by stringifying two of its own functions into a blob.\n * Only those function bodies are serialized, so any helper the bundler hoists to module\n * scope is missing at runtime. `@angular/build` unconditionally disables esbuild's\n * `object-rest-spread` support, which rewrites every object spread in mapbox-gl 3.26.0+ into\n * exactly such a hoisted helper, and the worker then dies with a `ReferenceError` while\n * loading tiles. Pointing `workerUrl` at a real file — mapbox's own documented CSP escape\n * hatch — sidesteps the bug entirely, at any mapbox-gl version.\n *\n * Must be applied before the first `Map` is constructed.\n *\n * @param inputConfig - Configuration. Optional.\n * @returns The applied configuration.\n */\nexport async function configureDbxMapboxWorker(inputConfig?: Maybe<DbxMapboxWorkerConfig>): Promise<DbxMapboxWorkerConfigurationResult> {\n  const config = inputConfig ?? {};\n  let result: DbxMapboxWorkerConfigurationResult;\n\n  if (config.enabled === false || typeof window === 'undefined') {\n    result = { configured: false, workerUrl: null, available: null };\n  } else {\n    const workerUrl = config.workerUrl || DEFAULT_DBX_MAPBOX_WORKER_URL;\n\n    mapboxgl.workerUrl = workerUrl;\n\n    const available = await isDbxMapboxWorkerAssetAvailable(workerUrl);\n\n    if (!available) {\n      console.error(\n        `dbx-web/mapbox: the mapbox-gl web worker asset was not found at \"${workerUrl}\", so the map will fail to load tiles. Copy it into your app's assets by adding this entry to the build target's \"assets\" in project.json: { \"input\": \"node_modules/mapbox-gl/dist\", \"glob\": \"mapbox-gl-csp-worker.js\", \"output\": \"assets/mapbox-gl\" }`\n      );\n    }\n\n    result = { configured: true, workerUrl, available };\n  }\n\n  return result;\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxMapboxConfig, DbxMapboxService } from './mapbox.service';\nimport { type DbxMapboxWorkerConfig, configureDbxMapboxWorker } from './mapbox.worker';\nimport { provideMapboxGL } from 'ngx-mapbox-gl';\n\n/**\n * Configuration for provideDbxMapbox().\n */\nexport interface ProvideDbxMapboxConfig {\n  readonly dbxMapboxConfig: DbxMapboxConfig;\n  readonly ngxMapboxGLModuleConfig: Parameters<typeof provideMapboxGL>[0];\n  /**\n   * Configuration for the self-hosted mapbox-gl web worker.\n   *\n   * Enabled by default. See {@link configureDbxMapboxWorker} for why it is needed and\n   * which build asset the app must copy.\n   */\n  readonly worker?: Maybe<DbxMapboxWorkerConfig>;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxMapboxConfig and configuring the NgxMapboxGLModule.\n *\n * Also registers an app initializer that points mapbox-gl at the self-hosted CSP web worker\n * asset before any map is created.\n *\n * @param config - Configuration.\n * @returns EnvironmentProviders.\n */\nexport function provideDbxMapbox(config: ProvideDbxMapboxConfig): EnvironmentProviders {\n  const { dbxMapboxConfig, ngxMapboxGLModuleConfig, worker } = config;\n\n  const providers: (Provider | EnvironmentProviders)[] = [\n    // config\n    {\n      provide: DbxMapboxConfig,\n      useValue: dbxMapboxConfig\n    },\n    // service\n    DbxMapboxService,\n    // worker: must be configured before the first Map is constructed\n    provideAppInitializer(() => configureDbxMapboxWorker(worker)),\n    // ngxMapboxGL\n    provideMapboxGL(ngxMapboxGLModuleConfig)\n  ];\n\n  return makeEnvironmentProviders(providers);\n}\n","import { type ClickableAnchor } from '@dereekb/dbx-core';\nimport { type Pixels, type FactoryWithRequiredInput, type LatLngInputRef, type UniqueModel, type CssClassesArray, type Maybe, type CssStyleObject } from '@dereekb/util';\n\n/**\n * DbxMapboxMarkerSize. Numbers are converted to pixels.\n */\nexport type DbxMapboxMarkerSize = 'small' | 'medium' | 'large' | 'tall' | Pixels;\n\n/**\n * Presentation style.\n *\n * - normal: Text under dot with optional icon within dot\n * - chip: \"dbx-chip\"-like presentation\n */\nexport type DbxMapboxMarkerPresentation = 'normal' | 'chip' | 'chip-small';\n\nexport interface DbxMapboxMarkerDisplayConfig {\n  /**\n   * Presentation style. Defaults to \"normal\"\n   */\n  readonly presentation?: DbxMapboxMarkerPresentation;\n  /**\n   * Additional classes to add to the marker.\n   */\n  readonly markerClasses?: Maybe<CssClassesArray>;\n  /**\n   * Marker icon to display.\n   */\n  readonly icon?: Maybe<string>;\n  /**\n   * Marker label to display.\n   */\n  readonly label?: Maybe<string>;\n  /**\n   * Image URL or Factory that returns an image URL.\n   */\n  readonly image?: Maybe<string | FactoryWithRequiredInput<string, Pixels>>;\n  /**\n   * Size of the marker.\n   */\n  readonly size?: Maybe<DbxMapboxMarkerSize>;\n  /**\n   * ClickableAnchor for the marker.\n   */\n  readonly anchor?: Maybe<ClickableAnchor>;\n  /**\n   * Additional icon content styling. Style is not applied to the entire marker. Use markerClasses instead.\n   */\n  readonly style?: Maybe<CssStyleObject>;\n}\n\nexport type DbxMapboxMarker = UniqueModel & LatLngInputRef & DbxMapboxMarkerDisplayConfig;\n\n/**\n * MapFunction that converts the input data to a DbxMapboxMarker.\n */\nexport type DbxMapboxMarkerFactory<T> = (value: T, index: number) => DbxMapboxMarker;\n\n/**\n * Creates the styling for rendering a dot.\n *\n * @param background\n * @param color\n * @returns\n */\nexport function dbxMapboxColoredDotStyle(background: string, color?: string) {\n  return {\n    background,\n    padding: '2px',\n    color: (color ?? background) ? 'white' : undefined,\n    'border-radius': '50%'\n  };\n}\n","import { type Signal } from '@angular/core';\nimport { type DbxInjectionComponentConfigWithoutInjector } from '@dereekb/dbx-core';\nimport { type Destroyable, type LatLngPointInput, type Maybe } from '@dereekb/util';\nimport { type DbxMapboxInjectionKey } from './mapbox.injection.store';\nimport { type DbxMapboxPopupComponentConfig } from './mapbox.popup.component';\n\n/**\n * Default DbxMapboxInjectionStore key used by dbxMapboxItemPopupController().\n */\nexport const DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEY: DbxMapboxInjectionKey = 'dbxMapboxItemPopup';\n\n/**\n * Default selector for map click targets that keep the item popup open.\n *\n * A click on a marker belongs to the marker (which typically moves the popup to its own item), and a click inside a popup belongs to the popup.\n */\nexport const DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEEP_OPEN_CLICK_SELECTOR = '.mapboxgl-marker, .mapboxgl-popup';\n\n/**\n * Returns where on the map the popup for the input item is anchored.\n */\nexport type DbxMapboxItemPopupLatLngFunction<T> = (item: T) => LatLngPointInput;\n\n/**\n * Context provided to the content component of an item popup.\n *\n * Inject it in the content component to read the item and to close the popup.\n */\nexport abstract class DbxMapboxItemPopupContext<T = unknown> {\n  /**\n   * The item the popup is showing. Changes when the popup moves to another item.\n   */\n  abstract readonly item: Signal<T>;\n  /**\n   * Closes the popup.\n   */\n  abstract close(): void;\n  /**\n   * Pans the map so the whole popup is visible. Call it after the content changes size, e.g. after it finishes loading.\n   */\n  abstract panIntoView(): void;\n}\n\n/**\n * dbxMapboxItemPopupController() configuration.\n */\nexport interface DbxMapboxItemPopupControllerConfig<T> {\n  /**\n   * DbxMapboxInjectionStore key for the popup. Only one popup per key is open at a time.\n   *\n   * Defaults to DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEY.\n   */\n  readonly key?: Maybe<DbxMapboxInjectionKey>;\n  /**\n   * Returns where on the map the popup for an item is anchored.\n   */\n  readonly latLng: DbxMapboxItemPopupLatLngFunction<T>;\n  /**\n   * Component rendered inside the popup. It can inject DbxMapboxItemPopupContext to read the item.\n   */\n  readonly content: DbxInjectionComponentConfigWithoutInjector;\n  /**\n   * Display configuration for the popup.\n   */\n  readonly popup?: Maybe<DbxMapboxPopupComponentConfig>;\n  /**\n   * Whether to close the popup when the map is clicked away from any marker or popup.\n   *\n   * Requires a DbxMapboxMapStore. Defaults to true.\n   */\n  readonly closeOnMapClick?: Maybe<boolean>;\n  /**\n   * Selector for map click targets that keep the popup open.\n   *\n   * Defaults to DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEEP_OPEN_CLICK_SELECTOR.\n   */\n  readonly keepOpenClickSelector?: Maybe<string>;\n}\n\n/**\n * Opens a single popup for one item at a time, e.g. the item whose marker was clicked.\n */\nexport interface DbxMapboxItemPopupController<T> extends Destroyable {\n  /**\n   * DbxMapboxInjectionStore key the popup is added with.\n   */\n  readonly key: DbxMapboxInjectionKey;\n  /**\n   * The item the open popup is showing, if a popup is open.\n   */\n  readonly item: Signal<Maybe<T>>;\n  /**\n   * Whether the popup is open.\n   */\n  readonly isOpen: Signal<boolean>;\n  /**\n   * Opens the popup for the input item. When the popup is already open it moves to the input item right away, so the user can click from marker to marker.\n   *\n   * @param item - The item to show.\n   */\n  open(item: T): void;\n  /**\n   * Closes the popup, if open.\n   */\n  close(): void;\n}\n\n/**\n * Data passed to DbxMapboxItemPopupComponent through the DbxMapboxInjectionStore. Created by dbxMapboxItemPopupController().\n */\nexport interface DbxMapboxItemPopupComponentData<T> {\n  readonly item: Signal<T>;\n  readonly latLng: DbxMapboxItemPopupLatLngFunction<T>;\n  readonly content: DbxInjectionComponentConfigWithoutInjector;\n  readonly popup?: Maybe<DbxMapboxPopupComponentConfig>;\n  /**\n   * Closes this popup. Does nothing when the controller has since closed it and opened a new one.\n   */\n  readonly close: () => void;\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, viewChild } from '@angular/core';\nimport { DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponent } from '@dereekb/dbx-core';\nimport { DbxMapboxPopupComponent } from './mapbox.popup.component';\nimport { type DbxMapboxItemPopupComponentData, DbxMapboxItemPopupContext } from './mapbox.popup.item';\n\n/**\n * Popup for a single item, added to the map by dbxMapboxItemPopupController().\n *\n * Renders the controller's content component inside a DbxMapboxPopupComponent anchored to the item, and provides DbxMapboxItemPopupContext to that content.\n */\n@Component({\n  selector: 'dbx-mapbox-item-popup',\n  template: `\n    <dbx-mapbox-popup [latLng]=\"latLngSignal()\" [config]=\"popupConfig\" (popupClose)=\"close()\">\n      <dbx-injection [config]=\"content\"></dbx-injection>\n    </dbx-mapbox-popup>\n  `,\n  providers: [\n    {\n      provide: DbxMapboxItemPopupContext,\n      useExisting: DbxMapboxItemPopupComponent\n    }\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  imports: [DbxMapboxPopupComponent, DbxInjectionComponent]\n})\nexport class DbxMapboxItemPopupComponent<T = unknown> extends DbxMapboxItemPopupContext<T> {\n  private readonly _data = inject<DbxMapboxItemPopupComponentData<T>>(DBX_INJECTION_COMPONENT_DATA);\n\n  readonly popupComponent = viewChild.required(DbxMapboxPopupComponent);\n\n  readonly item = this._data.item;\n  readonly content = this._data.content;\n  readonly popupConfig = this._data.popup;\n\n  readonly latLngSignal = computed(() => this._data.latLng(this.item()));\n\n  close(): void {\n    this._data.close();\n  }\n\n  panIntoView(): void {\n    this.popupComponent().panIntoView();\n  }\n}\n","import { computed, inject, signal, type WritableSignal } from '@angular/core';\nimport { clean } from '@dereekb/dbx-core';\nimport { filterMaybe, SubscriptionObject } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { filter, skip } from 'rxjs';\nimport { DbxMapboxInjectionStore } from './mapbox.injection.store';\nimport { DbxMapboxMapStore } from './mapbox.store';\nimport { type DbxMapboxItemPopupComponentData, type DbxMapboxItemPopupController, type DbxMapboxItemPopupControllerConfig, DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEEP_OPEN_CLICK_SELECTOR, DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEY } from './mapbox.popup.item';\nimport { DbxMapboxItemPopupComponent } from './mapbox.popup.item.component';\n\n/**\n * Creates a DbxMapboxItemPopupController that shows one item at a time in a popup on the map, e.g. the item whose marker was clicked.\n *\n * The popup is added through the DbxMapboxInjectionStore, so the map must render a dbx-mapbox-injection. Opening another item while the popup is open moves the same popup to that item instead of closing and reopening it. By default the popup closes when the map is clicked away from any marker or popup.\n *\n * Must be run within an Angular injection context. The popup is closed when the context is destroyed.\n *\n * @param config - Which content to show and where to anchor it.\n * @returns The controller.\n *\n * @example\n * ```ts\n * readonly placePopup = dbxMapboxItemPopupController<Place>({\n *   latLng: (place) => place.latLng,\n *   content: { componentClass: PlacePopupContentComponent }\n * });\n *\n * readonly markerFactory: DbxMapboxMarkerFactory<Place> = (place) => ({\n *   latLng: place.latLng,\n *   label: place.name,\n *   anchor: { onClick: () => this.placePopup.open(place) }\n * });\n * ```\n */\nexport function dbxMapboxItemPopupController<T>(config: DbxMapboxItemPopupControllerConfig<T>): DbxMapboxItemPopupController<T> {\n  const { latLng, content, popup } = config;\n  const key = config.key ?? DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEY;\n  const closeOnMapClick = config.closeOnMapClick ?? true;\n  const keepOpenClickSelector = config.keepOpenClickSelector ?? DEFAULT_DBX_MAPBOX_ITEM_POPUP_KEEP_OPEN_CLICK_SELECTOR;\n\n  const dbxMapboxInjectionStore = inject(DbxMapboxInjectionStore);\n  const dbxMapboxMapStore = inject(DbxMapboxMapStore, { optional: true });\n\n  const itemSignal = signal<Maybe<T>>(undefined);\n  const isOpenSignal = computed(() => itemSignal() != null);\n\n  /**\n   * Item signal of the open popup. Each opened popup gets its own signal so a popup that is closing never sees the item go away.\n   */\n  let openPopupItem: Maybe<WritableSignal<T>>;\n\n  function close() {\n    if (openPopupItem) {\n      openPopupItem = undefined;\n      itemSignal.set(undefined);\n      dbxMapboxInjectionStore.removeInjectionConfigWithKey(key);\n    }\n  }\n\n  function open(item: T) {\n    itemSignal.set(item);\n\n    if (openPopupItem) {\n      openPopupItem.set(item);\n    } else {\n      const popupItem = signal(item);\n      openPopupItem = popupItem;\n\n      const data: DbxMapboxItemPopupComponentData<T> = {\n        item: popupItem.asReadonly(),\n        latLng,\n        content,\n        popup,\n        close: () => {\n          // mapbox-gl reports a removed popup as closed after a delay, by which time a new popup may be open\n          if (openPopupItem === popupItem) {\n            close();\n          }\n        }\n      };\n\n      dbxMapboxInjectionStore.addInjectionConfig({\n        key,\n        injectionConfig: {\n          componentClass: DbxMapboxItemPopupComponent,\n          data\n        }\n      });\n    }\n  }\n\n  const mapClickSub = new SubscriptionObject();\n\n  if (closeOnMapClick && dbxMapboxMapStore) {\n    mapClickSub.subscription = dbxMapboxMapStore.clickEvent$\n      .pipe(\n        skip(1), // the store replays its last click\n        filterMaybe(),\n        filter((x) => !(x.originalEvent?.target as Maybe<Element>)?.closest?.(keepOpenClickSelector))\n      )\n      .subscribe(() => close());\n  }\n\n  const controller: DbxMapboxItemPopupController<T> = {\n    key,\n    item: itemSignal.asReadonly(),\n    isOpen: isOpenSignal,\n    open,\n    close,\n    destroy: () => {\n      mapClickSub.destroy();\n      close();\n    }\n  };\n\n  clean(controller);\n  return controller;\n}\n","import { latLngPoint, type LatLngPointInput, type Pixels, type WebsiteUrlWithPrefix } from '@dereekb/util';\nimport { type KnownMapboxStyle, type MapboxBearing, type MapboxPitch, type MapboxZoomLevel } from './mapbox';\n\n/**\n * Default style used by mapboxStaticImageUrl().\n */\nexport const DEFAULT_MAPBOX_STATIC_IMAGE_STYLE: KnownMapboxStyle = 'mapbox://styles/mapbox/satellite-streets-v12';\n\n/**\n * Input for mapboxStaticImageUrl().\n */\nexport interface MapboxStaticImageUrlConfig {\n  /**\n   * Center of the image.\n   */\n  readonly latLng: LatLngPointInput;\n  /**\n   * Zoom level of the image.\n   */\n  readonly zoom: MapboxZoomLevel;\n  /**\n   * Image width. The Static Images API allows up to 1280.\n   */\n  readonly width: Pixels;\n  /**\n   * Image height. The Static Images API allows up to 1280.\n   */\n  readonly height: Pixels;\n  /**\n   * Mapbox access token used to request the image.\n   */\n  readonly accessToken: string;\n  /**\n   * Style to render, either as a style URL (mapbox://styles/username/style_id) or as \"username/style_id\".\n   *\n   * Defaults to DEFAULT_MAPBOX_STATIC_IMAGE_STYLE.\n   */\n  readonly style?: KnownMapboxStyle | string;\n  readonly bearing?: MapboxBearing;\n  readonly pitch?: MapboxPitch;\n  /**\n   * Whether to request the image at double resolution for high density screens.\n   *\n   * Defaults to true.\n   */\n  readonly retina?: boolean;\n  /**\n   * Whether to draw the Mapbox logo on the image.\n   *\n   * Defaults to false, for images shown next to a map that already displays it.\n   */\n  readonly logo?: boolean;\n  /**\n   * Whether to draw the attribution on the image.\n   *\n   * Defaults to false, for images shown next to a map that already displays it.\n   */\n  readonly attribution?: boolean;\n}\n\n/**\n * Creates a Mapbox Static Images API URL for an image of the map centered on a point.\n *\n * Useful as a placeholder picture of a place, e.g. the hero image of a map popup.\n *\n * @param config - What to render and how.\n * @returns The image URL.\n * @see https://docs.mapbox.com/api/maps/static-images/\n */\nexport function mapboxStaticImageUrl(config: MapboxStaticImageUrlConfig): WebsiteUrlWithPrefix {\n  const { zoom, width, height, accessToken, style = DEFAULT_MAPBOX_STATIC_IMAGE_STYLE, bearing = 0, pitch = 0, retina = true, logo = false, attribution = false } = config;\n  const { lat, lng } = latLngPoint(config.latLng);\n  const styleId = style.replace(/^mapbox:\\/\\/styles\\//, '');\n  const size = `${Math.round(width)}x${Math.round(height)}${retina ? '@2x' : ''}`;\n  const query = new URLSearchParams({ attribution: String(attribution), logo: String(logo), access_token: accessToken });\n  return `https://api.mapbox.com/styles/v1/${styleId}/static/${lng},${lat},${zoom},${bearing},${pitch}/${size}?${query.toString()}`;\n}\n","import { type LatLngPointInput, type LatLngBoundInput, type ZoomLevel, type ZoomLevelRange, type ExtendLatLngBoundInput } from '@dereekb/util';\nimport type * as MapboxGl from 'mapbox-gl';\nimport { type DbxMapboxLongPressEvent } from './mapbox.longpress';\n\n/**\n * List of styles that are defined here:\n *\n * https://docs.mapbox.com/api/maps/styles/\n */\nexport type KnownMapboxStyle =\n  | 'mapbox://styles/mapbox/standard'\n  | 'mapbox://styles/mapbox/streets-v12'\n  | 'mapbox://styles/mapbox/outdoors-v12'\n  | 'mapbox://styles/mapbox/light-v11'\n  | 'mapbox://styles/mapbox/dark-v11'\n  | 'mapbox://styles/mapbox/satellite-v9'\n  | 'mapbox://styles/mapbox/satellite-streets-v12'\n  | 'mapbox://styles/mapbox/navigation-day-v1'\n  | 'mapbox://styles/mapbox/navigation-night-v1';\n\nexport const KNOWN_MAPBOX_STYLES: KnownMapboxStyle[] = [\n  // standard\n  'mapbox://styles/mapbox/standard',\n  // classic\n  'mapbox://styles/mapbox/streets-v12',\n  'mapbox://styles/mapbox/outdoors-v12',\n  'mapbox://styles/mapbox/light-v11',\n  'mapbox://styles/mapbox/dark-v11',\n  'mapbox://styles/mapbox/satellite-v9',\n  'mapbox://styles/mapbox/satellite-streets-v12',\n  'mapbox://styles/mapbox/navigation-day-v1',\n  'mapbox://styles/mapbox/navigation-night-v1'\n];\n\nexport type MapboxEventData = object;\n\nexport type MapboxZoomLevel = ZoomLevel;\nexport type MapboxZoomLevelRange = ZoomLevelRange;\n\nexport const MAPBOX_MIN_ZOOM_LEVEL: MapboxZoomLevel = 0;\nexport const MAPBOX_MAX_ZOOM_LEVEL: MapboxZoomLevel = 22;\n\n/**\n * Clamps a numeric value to the valid Mapbox zoom level range (0 to 22).\n *\n * @param input - The raw zoom level number to clamp.\n * @returns The zoom level clamped between {@link MAPBOX_MIN_ZOOM_LEVEL} and {@link MAPBOX_MAX_ZOOM_LEVEL}.\n */\nexport function mapboxZoomLevel(input: number): MapboxZoomLevel {\n  return Math.min(Math.max(input, MAPBOX_MIN_ZOOM_LEVEL), MAPBOX_MAX_ZOOM_LEVEL);\n}\n\nexport type MapboxPitch = number;\nexport type MapboxBearing = number;\n\n/**\n * Size of the tiles. Vector-based tiles used by the web are generally 512x512, and legacy ones are 256x256.\n *\n * https://blog.mapbox.com/512-map-tiles-cb5bfd6e72ba\n */\nexport type MapboxTileSize = 512 | 256;\n\nexport type DbxMapboxClickEvent = MapboxGl.MapMouseEvent & MapboxEventData;\n\n/**\n * The event that opens the map's right-click menu: a mouse contextmenu event, or a long press on the map.\n *\n * Use isDbxMapboxLongPressEvent() to tell them apart.\n */\nexport type DbxMapboxRightClickEvent = DbxMapboxClickEvent | DbxMapboxLongPressEvent;\n\n/**\n * Options for MapboxGl.Map.fitBounds()\n */\nexport type MapboxFitBoundsOptions = Parameters<MapboxGl.Map['fitBounds']>[1];\n\n/**\n * Options for MapboxGl.Map.easeTo()\n */\nexport type MapboxEaseToOptions = Parameters<MapboxGl.Map['easeTo']>[0];\n\n/**\n * Options for MapboxGl.Map.flyTo()\n */\nexport type MapboxFlyToOptions = Parameters<MapboxGl.Map['flyTo']>[0];\n\n/**\n * Options for MapboxGl.Map.setStyle()\n */\nexport type MapboxSetStyleOptions = Parameters<MapboxGl.Map['setStyle']>[1];\n\nexport interface MapboxStyleConfig {\n  readonly style: MapboxGl.StyleSpecification | string;\n  readonly options?: MapboxSetStyleOptions;\n}\n\nexport interface MapboxFitPositions {\n  positions: ExtendLatLngBoundInput;\n  options?: MapboxFitBoundsOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxFitBounds {\n  bounds: LatLngBoundInput;\n  options?: MapboxFitBoundsOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxJumpToPositionOptions extends Omit<MapboxGl.CameraOptions, 'center'> {\n  center: LatLngPointInput;\n}\n\nexport interface MapboxJumpTo {\n  center?: LatLngPointInput;\n  to?: MapboxJumpToPositionOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxEaseToPositionOptions extends Omit<MapboxEaseToOptions, 'center'>, MapboxJumpToPositionOptions {}\n\nexport interface MapboxEaseTo {\n  center?: LatLngPointInput;\n  to?: MapboxEaseToPositionOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxFlyToPositionOptions extends Omit<MapboxFlyToOptions, 'center'>, MapboxJumpToPositionOptions {}\n\nexport interface MapboxFlyTo {\n  center?: LatLngPointInput;\n  to?: MapboxFlyToPositionOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxRotateTo {\n  bearing: MapboxBearing;\n  options?: mapboxgl.AnimationOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxResetNorth {\n  options?: mapboxgl.AnimationOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxResetNorthPitch {\n  options?: mapboxgl.AnimationOptions;\n  eventData?: MapboxEventData;\n}\n\nexport interface MapboxSnapToNorth {\n  options?: mapboxgl.AnimationOptions;\n  eventData?: MapboxEventData;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;AACA;;AAEG;AACI,MAAM,kCAAkC,GAAiB;AAEhE;;;;AAIG;AACI,MAAM,mCAAmC,GAAW;AAE3D;;;;AAIG;AACI,MAAM,4CAA4C,GAAiB;AAE1E;;AAEG;AACI,MAAM,gCAAgC,GAAG;AAoDhD;;;;;AAKG;AACG,SAAU,+BAA+B,CAAC,KAA2C,EAAA;AACzF,IAAA,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK;AAChC,IAAA,IAAI,MAAuC;AAE3C,IAAA,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,MAAM,GAAG,QAAQ,KAAK,KAAK,GAAG,SAAS,GAAG,EAAE,IAAI,IAAI,IAAI,SAAS,CAAC,EAAE,GAAG,QAAQ,EAAE;IACnF;AAAO,SAAA,IAAI,IAAI,KAAK,KAAK,EAAE;AACzB,QAAA,MAAM,GAA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