@kaufmann-lab/ui 0.1.29 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, input, output, linkedSignal, Component, signal, computed, booleanAttribute, inject, EnvironmentInjector, DestroyRef, ElementRef, viewChild, afterNextRender, afterRenderEffect, createComponent, ViewEncapsulation } from '@angular/core';
2
+ import { InjectionToken, input, output, linkedSignal, Component, signal, computed, booleanAttribute, inject, EnvironmentInjector, DestroyRef, ElementRef, viewChild, afterNextRender, afterRenderEffect, createComponent, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
3
3
  import { Icon, Button, Dropdown, DropdownPanel, TooltipDirective, Spinner, Text } from '@kaufmann-lab/ui/core';
4
4
  import { handleArrowKeyNavigation } from '@kaufmann-lab/ui/shared';
5
- import { DOCUMENT } from '@angular/common';
5
+ import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
6
6
  import { Map, AttributionControl, LngLatBounds, Marker } from 'mapbox-gl/esm';
7
7
 
8
8
  const MAP_CONFIG = new InjectionToken('MAP_CONFIG');
@@ -221,13 +221,80 @@ class MapControls {
221
221
  fullscreenLabel = computed(() => this.isFullscreen() ? 'Salir de pantalla completa' : 'Pantalla completa', /* @ts-ignore */
222
222
  ...(ngDevMode ? [{ debugName: "fullscreenLabel" }] : /* istanbul ignore next */ []));
223
223
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: MapControls, deps: [], target: i0.ɵɵFactoryTarget.Component });
224
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: MapControls, isStandalone: true, selector: "kf-map-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, clusterActive: { classPropertyName: "clusterActive", publicName: "clusterActive", isSignal: true, isRequired: false, transformFunction: null }, followActive: { classPropertyName: "followActive", publicName: "followActive", isSignal: true, isRequired: false, transformFunction: null }, canFollow: { classPropertyName: "canFollow", publicName: "canFollow", isSignal: true, isRequired: false, transformFunction: null }, isFullscreen: { classPropertyName: "isFullscreen", publicName: "isFullscreen", isSignal: true, isRequired: false, transformFunction: null }, styleLabel: { classPropertyName: "styleLabel", publicName: "styleLabel", isSignal: true, isRequired: false, transformFunction: null }, activeTheme: { classPropertyName: "activeTheme", publicName: "activeTheme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zoomIn: "zoomIn", zoomOut: "zoomOut", recenter: "recenter", followToggle: "followToggle", clusterToggle: "clusterToggle", themeSelect: "themeSelect", fullscreenToggle: "fullscreenToggle" }, ngImport: i0, template: "@if (hasZoom()) {\n <div class=\"kf-map-controls__group kf-map-controls__group--zoom\">\n <div class=\"kf-map-controls__item\" kfTooltip=\"Acercar\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"plus\"\n ariaLabel=\"Acercar\"\n (click)=\"zoomIn.emit()\"\n />\n </div>\n <div class=\"kf-map-controls__item\" kfTooltip=\"Alejar\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"minus\"\n ariaLabel=\"Alejar\"\n (click)=\"zoomOut.emit()\"\n />\n </div>\n </div>\n}\n@if (hasCamera()) {\n <div class=\"kf-map-controls__group\">\n @if (hasRecenter()) {\n <div class=\"kf-map-controls__item\" kfTooltip=\"Centrar mapa\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"crosshair\"\n ariaLabel=\"Volver a encuadrar el mapa\"\n (click)=\"recenter.emit()\"\n />\n </div>\n }\n @if (hasFollow()) {\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"followLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"navigation\"\n [ariaLabel]=\"followActive() ? 'Dejar de seguir' : 'Seguir posici\u00F3n'\"\n [ariaPressed]=\"followActive()\"\n [disabled]=\"!canFollow()\"\n (click)=\"followToggle.emit()\"\n />\n </div>\n }\n </div>\n}\n@if (hasCluster()) {\n <div class=\"kf-map-controls__group\">\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"clusterLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"grid\"\n [ariaLabel]=\"clusterActive() ? 'Desagrupar marcadores' : 'Agrupar marcadores cercanos'\"\n [ariaPressed]=\"clusterActive()\"\n (click)=\"clusterToggle.emit()\"\n />\n </div>\n </div>\n}\n@if (hasChrome()) {\n <div class=\"kf-map-controls__group\">\n @if (hasMapStyle()) {\n <kf-dropdown\n class=\"kf-map-controls__item\"\n [kfTooltip]=\"mapStyleLabel()\"\n kfTooltipPosition=\"left\"\n [(open)]=\"mapStyleOpen\"\n >\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"layers\"\n [ariaLabel]=\"'Cambiar estilo de mapa (actual: ' + styleLabel() + ')'\"\n [ariaExpanded]=\"mapStyleOpen()\"\n (click)=\"mapStyleOpen.set(!mapStyleOpen())\"\n />\n <kf-dropdown-panel>\n <kf-map-theme-picker [active]=\"activeTheme()\" (themeSelect)=\"onThemeSelect($event)\" />\n </kf-dropdown-panel>\n </kf-dropdown>\n }\n @if (hasFullscreen()) {\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"fullscreenLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n [icon]=\"isFullscreen() ? 'minimize' : 'maximize'\"\n [ariaLabel]=\"isFullscreen() ? 'Salir de pantalla completa' : 'Pantalla completa'\"\n [ariaPressed]=\"isFullscreen()\"\n (click)=\"fullscreenToggle.emit()\"\n />\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;align-items:flex-end;gap:var(--kf-space-sm)}.kf-map-controls__item{position:relative;display:flex}.kf-map-controls__group{display:flex;flex-direction:column;gap:2px;background:var(--kf-color-surface);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:3px}.kf-map-controls__group kf-button{--kf-color-surface: transparent;--kf-color-border: transparent;--kf-shadow-md: none}.kf-map-controls__group--zoom{gap:0}.kf-map-controls__group--zoom .kf-map-controls__item+.kf-map-controls__item{border-top:1px solid var(--kf-color-border)}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaHaspopup"] }, { kind: "component", type: Dropdown, selector: "kf-dropdown", inputs: ["open", "anchor", "autoFocus"], outputs: ["openChange"] }, { kind: "component", type: DropdownPanel, selector: "kf-dropdown-panel", inputs: ["variant", "role", "ariaLabel"] }, { kind: "component", type: MapThemePicker, selector: "kf-map-theme-picker", inputs: ["active"], outputs: ["themeSelect"] }, { kind: "directive", type: TooltipDirective, selector: "[kfTooltip]", inputs: ["kfTooltip", "kfTooltipPosition"] }] });
224
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: MapControls, isStandalone: true, selector: "kf-map-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, clusterActive: { classPropertyName: "clusterActive", publicName: "clusterActive", isSignal: true, isRequired: false, transformFunction: null }, followActive: { classPropertyName: "followActive", publicName: "followActive", isSignal: true, isRequired: false, transformFunction: null }, canFollow: { classPropertyName: "canFollow", publicName: "canFollow", isSignal: true, isRequired: false, transformFunction: null }, isFullscreen: { classPropertyName: "isFullscreen", publicName: "isFullscreen", isSignal: true, isRequired: false, transformFunction: null }, styleLabel: { classPropertyName: "styleLabel", publicName: "styleLabel", isSignal: true, isRequired: false, transformFunction: null }, activeTheme: { classPropertyName: "activeTheme", publicName: "activeTheme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zoomIn: "zoomIn", zoomOut: "zoomOut", recenter: "recenter", followToggle: "followToggle", clusterToggle: "clusterToggle", themeSelect: "themeSelect", fullscreenToggle: "fullscreenToggle" }, ngImport: i0, template: "@if (hasZoom()) {\n <div class=\"kf-map-controls__group kf-map-controls__group--zoom\">\n <div class=\"kf-map-controls__item\" kfTooltip=\"Acercar\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"plus\"\n ariaLabel=\"Acercar\"\n (click)=\"zoomIn.emit()\"\n />\n </div>\n <div class=\"kf-map-controls__item\" kfTooltip=\"Alejar\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"minus\"\n ariaLabel=\"Alejar\"\n (click)=\"zoomOut.emit()\"\n />\n </div>\n </div>\n}\n@if (hasCamera()) {\n <div class=\"kf-map-controls__group\">\n @if (hasRecenter()) {\n <div class=\"kf-map-controls__item\" kfTooltip=\"Centrar mapa\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"crosshair\"\n ariaLabel=\"Volver a encuadrar el mapa\"\n (click)=\"recenter.emit()\"\n />\n </div>\n }\n @if (hasFollow()) {\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"followLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"navigation\"\n [ariaLabel]=\"followActive() ? 'Dejar de seguir' : 'Seguir posici\u00F3n'\"\n [ariaPressed]=\"followActive()\"\n [disabled]=\"!canFollow()\"\n (click)=\"followToggle.emit()\"\n />\n </div>\n }\n </div>\n}\n@if (hasCluster()) {\n <div class=\"kf-map-controls__group\">\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"clusterLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"grid\"\n [ariaLabel]=\"clusterActive() ? 'Desagrupar marcadores' : 'Agrupar marcadores cercanos'\"\n [ariaPressed]=\"clusterActive()\"\n (click)=\"clusterToggle.emit()\"\n />\n </div>\n </div>\n}\n@if (hasChrome()) {\n <div class=\"kf-map-controls__group\">\n @if (hasMapStyle()) {\n <kf-dropdown\n class=\"kf-map-controls__item\"\n [kfTooltip]=\"mapStyleLabel()\"\n kfTooltipPosition=\"left\"\n [(open)]=\"mapStyleOpen\"\n >\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"layers\"\n [ariaLabel]=\"'Cambiar estilo de mapa (actual: ' + styleLabel() + ')'\"\n [ariaExpanded]=\"mapStyleOpen()\"\n (click)=\"mapStyleOpen.set(!mapStyleOpen())\"\n />\n <kf-dropdown-panel>\n <kf-map-theme-picker [active]=\"activeTheme()\" (themeSelect)=\"onThemeSelect($event)\" />\n </kf-dropdown-panel>\n </kf-dropdown>\n }\n @if (hasFullscreen()) {\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"fullscreenLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n [icon]=\"isFullscreen() ? 'minimize' : 'maximize'\"\n [ariaLabel]=\"isFullscreen() ? 'Salir de pantalla completa' : 'Pantalla completa'\"\n [ariaPressed]=\"isFullscreen()\"\n (click)=\"fullscreenToggle.emit()\"\n />\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;align-items:flex-end;gap:var(--kf-space-sm)}.kf-map-controls__item{position:relative;display:flex}.kf-map-controls__group{display:flex;flex-direction:column;gap:2px;background:var(--kf-color-surface);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:3px}.kf-map-controls__group kf-button{--kf-color-surface: transparent;--kf-color-border: transparent;--kf-shadow-md: none}.kf-map-controls__group--zoom{gap:0}.kf-map-controls__group--zoom .kf-map-controls__item+.kf-map-controls__item{border-top:1px solid var(--kf-color-border)}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Dropdown, selector: "kf-dropdown", inputs: ["open", "anchor", "autoFocus"], outputs: ["openChange"] }, { kind: "component", type: DropdownPanel, selector: "kf-dropdown-panel", inputs: ["variant", "role", "maxHeight", "width", "ariaLabel"] }, { kind: "component", type: MapThemePicker, selector: "kf-map-theme-picker", inputs: ["active"], outputs: ["themeSelect"] }, { kind: "directive", type: TooltipDirective, selector: "[kfTooltip]", inputs: ["kfTooltip", "kfTooltipPosition"] }] });
225
225
  }
226
226
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: MapControls, decorators: [{
227
227
  type: Component,
228
228
  args: [{ selector: 'kf-map-controls', imports: [Button, Dropdown, DropdownPanel, MapThemePicker, TooltipDirective], template: "@if (hasZoom()) {\n <div class=\"kf-map-controls__group kf-map-controls__group--zoom\">\n <div class=\"kf-map-controls__item\" kfTooltip=\"Acercar\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"plus\"\n ariaLabel=\"Acercar\"\n (click)=\"zoomIn.emit()\"\n />\n </div>\n <div class=\"kf-map-controls__item\" kfTooltip=\"Alejar\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"minus\"\n ariaLabel=\"Alejar\"\n (click)=\"zoomOut.emit()\"\n />\n </div>\n </div>\n}\n@if (hasCamera()) {\n <div class=\"kf-map-controls__group\">\n @if (hasRecenter()) {\n <div class=\"kf-map-controls__item\" kfTooltip=\"Centrar mapa\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"crosshair\"\n ariaLabel=\"Volver a encuadrar el mapa\"\n (click)=\"recenter.emit()\"\n />\n </div>\n }\n @if (hasFollow()) {\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"followLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"navigation\"\n [ariaLabel]=\"followActive() ? 'Dejar de seguir' : 'Seguir posici\u00F3n'\"\n [ariaPressed]=\"followActive()\"\n [disabled]=\"!canFollow()\"\n (click)=\"followToggle.emit()\"\n />\n </div>\n }\n </div>\n}\n@if (hasCluster()) {\n <div class=\"kf-map-controls__group\">\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"clusterLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"grid\"\n [ariaLabel]=\"clusterActive() ? 'Desagrupar marcadores' : 'Agrupar marcadores cercanos'\"\n [ariaPressed]=\"clusterActive()\"\n (click)=\"clusterToggle.emit()\"\n />\n </div>\n </div>\n}\n@if (hasChrome()) {\n <div class=\"kf-map-controls__group\">\n @if (hasMapStyle()) {\n <kf-dropdown\n class=\"kf-map-controls__item\"\n [kfTooltip]=\"mapStyleLabel()\"\n kfTooltipPosition=\"left\"\n [(open)]=\"mapStyleOpen\"\n >\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"layers\"\n [ariaLabel]=\"'Cambiar estilo de mapa (actual: ' + styleLabel() + ')'\"\n [ariaExpanded]=\"mapStyleOpen()\"\n (click)=\"mapStyleOpen.set(!mapStyleOpen())\"\n />\n <kf-dropdown-panel>\n <kf-map-theme-picker [active]=\"activeTheme()\" (themeSelect)=\"onThemeSelect($event)\" />\n </kf-dropdown-panel>\n </kf-dropdown>\n }\n @if (hasFullscreen()) {\n <div class=\"kf-map-controls__item\" [kfTooltip]=\"fullscreenLabel()\" kfTooltipPosition=\"left\">\n <kf-button\n variant=\"surface\"\n shape=\"circle\"\n size=\"sm\"\n [icon]=\"isFullscreen() ? 'minimize' : 'maximize'\"\n [ariaLabel]=\"isFullscreen() ? 'Salir de pantalla completa' : 'Pantalla completa'\"\n [ariaPressed]=\"isFullscreen()\"\n (click)=\"fullscreenToggle.emit()\"\n />\n </div>\n }\n </div>\n}\n", styles: [":host{display:flex;flex-direction:column;align-items:flex-end;gap:var(--kf-space-sm)}.kf-map-controls__item{position:relative;display:flex}.kf-map-controls__group{display:flex;flex-direction:column;gap:2px;background:var(--kf-color-surface);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:3px}.kf-map-controls__group kf-button{--kf-color-surface: transparent;--kf-color-border: transparent;--kf-shadow-md: none}.kf-map-controls__group--zoom{gap:0}.kf-map-controls__group--zoom .kf-map-controls__item+.kf-map-controls__item{border-top:1px solid var(--kf-color-border)}\n"] }]
229
229
  }], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], clusterActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterActive", required: false }] }], followActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "followActive", required: false }] }], canFollow: [{ type: i0.Input, args: [{ isSignal: true, alias: "canFollow", required: false }] }], isFullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFullscreen", required: false }] }], styleLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleLabel", required: false }] }], activeTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTheme", required: false }] }], zoomIn: [{ type: i0.Output, args: ["zoomIn"] }], zoomOut: [{ type: i0.Output, args: ["zoomOut"] }], recenter: [{ type: i0.Output, args: ["recenter"] }], followToggle: [{ type: i0.Output, args: ["followToggle"] }], clusterToggle: [{ type: i0.Output, args: ["clusterToggle"] }], themeSelect: [{ type: i0.Output, args: ["themeSelect"] }], fullscreenToggle: [{ type: i0.Output, args: ["fullscreenToggle"] }] } });
230
230
 
231
+ /** Radio medio de la Tierra (m): esfera de referencia de las fórmulas de abajo. */
232
+ const EARTH_RADIUS_M = 6_371_008.8;
233
+ const toRad = (degrees) => (degrees * Math.PI) / 180;
234
+ const toDeg = (radians) => (radians * 180) / Math.PI;
235
+ /**
236
+ * Anillo cerrado `[lng, lat][]` de un círculo geodésico de `radiusMeters` alrededor
237
+ * de `center`, con `steps` vértices (más el que cierra el anillo): el contorno de
238
+ * una geocerca circular como polígono GeoJSON, sin dependencias. Cada vértice
239
+ * está a la misma distancia del centro (mide `radiusMeters` con la fórmula
240
+ * del gran círculo), así que el polígono es un círculo real también cerca de
241
+ * los polos, donde un círculo en grados se deformaría.
242
+ */
243
+ function circlePolygon(center, radiusMeters, steps = 64) {
244
+ const vertices = Math.max(8, Math.round(steps));
245
+ const angular = radiusMeters / EARTH_RADIUS_M;
246
+ const lat1 = toRad(center.lat);
247
+ const lng1 = toRad(center.lng);
248
+ const ring = [];
249
+ for (let step = 0; step < vertices; step++) {
250
+ const bearing = (2 * Math.PI * step) / vertices;
251
+ const lat2 = Math.asin(Math.sin(lat1) * Math.cos(angular) + Math.cos(lat1) * Math.sin(angular) * Math.cos(bearing));
252
+ const lng2 = lng1 +
253
+ Math.atan2(Math.sin(bearing) * Math.sin(angular) * Math.cos(lat1), Math.cos(angular) - Math.sin(lat1) * Math.sin(lat2));
254
+ ring.push([toDeg(lng2), toDeg(lat2)]);
255
+ }
256
+ ring.push(ring[0]);
257
+ return ring;
258
+ }
259
+ /** Distancia en metros entre dos puntos por el gran círculo (haversine). */
260
+ function distanceMeters(a, b) {
261
+ const dLat = toRad(b.lat - a.lat);
262
+ const dLng = toRad(b.lng - a.lng);
263
+ const h = Math.sin(dLat / 2) ** 2 +
264
+ Math.cos(toRad(a.lat)) * Math.cos(toRad(b.lat)) * Math.sin(dLng / 2) ** 2;
265
+ return 2 * EARTH_RADIUS_M * Math.asin(Math.min(1, Math.sqrt(h)));
266
+ }
267
+ /** Distancia legible: metros bajo 1 km y kilómetros con un decimal bajo 10 km. */
268
+ function formatDistance(meters) {
269
+ if (meters < 1000) {
270
+ return `${Math.round(meters)} m`;
271
+ }
272
+ const km = meters / 1000;
273
+ const formatted = km.toLocaleString('es', { maximumFractionDigits: km < 10 ? 1 : 0 });
274
+ return `${formatted} km`;
275
+ }
276
+ /** Punto medio geográfico aproximado entre dos puntos (suficiente para ubicar un rótulo). */
277
+ function midpoint(a, b) {
278
+ return { lat: (a.lat + b.lat) / 2, lng: (a.lng + b.lng) / 2 };
279
+ }
280
+
281
+ /** Ícono de un marcador sin `icon`: el pin genérico del catálogo. */
282
+ const DEFAULT_MARKER_ICON = 'map-pin';
283
+ /**
284
+ * Resuelve la forma, el tono y el ícono con que se dibuja un marcador, con los
285
+ * valores por defecto de siempre (círculo, neutral, `map-pin`). Es el único
286
+ * lugar donde se deciden: `kf-map` lo usa para sus marcadores y `kf-map-legend`
287
+ * para sus glifos, así que la leyenda no puede dibujar algo distinto de lo que
288
+ * explica. El color de cada tono vive en `map-marker-tones.css`.
289
+ */
290
+ function resolveMarkerVisual(spec) {
291
+ return {
292
+ shape: spec.shape ?? 'circle',
293
+ tone: spec.tone ?? 'neutral',
294
+ icon: spec.icon ?? DEFAULT_MARKER_ICON,
295
+ };
296
+ }
297
+
231
298
  /// <reference types="geojson" />
232
299
  // `tsconfig.lib.json` fija `types: []` a propósito (no filtrar globals
233
300
  // ambientales a la librería publicada) — esta referencia explícita es la
@@ -240,6 +307,20 @@ const FIT_BOUNDS_PADDING_PX = 48;
240
307
  const FIT_BOUNDS_MAX_ZOOM = 16;
241
308
  const ROUTE_SOURCE_ID = 'kf-map-route';
242
309
  const ROUTE_LAYER_ID = 'kf-map-route-line';
310
+ const AREAS_SOURCE_ID = 'kf-map-areas';
311
+ const AREAS_FILL_LAYER_ID = 'kf-map-areas-fill';
312
+ const AREAS_LINE_LAYER_ID = 'kf-map-areas-line';
313
+ const CONNECTIONS_SOURCE_ID = 'kf-map-connections';
314
+ const CONNECTIONS_LAYER_ID = 'kf-map-connections-line';
315
+ /** Token de color de cada tono para capas WebGL (que no resuelven `var()`). */
316
+ const TONE_COLOR_TOKEN = {
317
+ neutral: '--kf-color-primary',
318
+ ok: '--kf-color-success',
319
+ warn: '--kf-color-warning',
320
+ error: '--kf-color-error',
321
+ info: '--kf-color-info',
322
+ service: '--kf-color-secondary',
323
+ };
243
324
  /**
244
325
  * Duraciones de cámara — todas pasan por `cameraDuration()`, que las
245
326
  * colapsa a 0 si el usuario pidió `prefers-reduced-motion: reduce` (ver
@@ -361,6 +442,11 @@ class MapView {
361
442
  ...(ngDevMode ? [{ debugName: "markers" }] : /* istanbul ignore next */ []));
362
443
  route = input(/* @ts-ignore */
363
444
  ...(ngDevMode ? [undefined, { debugName: "route" }] : /* istanbul ignore next */ []));
445
+ /** Áreas circulares (geocercas) dibujadas bajo los marcadores. */
446
+ areas = input([], /* @ts-ignore */
447
+ ...(ngDevMode ? [{ debugName: "areas" }] : /* istanbul ignore next */ []));
448
+ /** Incluye las áreas al encuadrar la cámara (con `fitToMarkers`, que sigue mandando sobre el encuadre). */
449
+ fitToAreas = input(true, { ...(ngDevMode ? { debugName: "fitToAreas" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
364
450
  fitToMarkers = input(true, { ...(ngDevMode ? { debugName: "fitToMarkers" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
365
451
  center = input(/* @ts-ignore */
366
452
  ...(ngDevMode ? [undefined, { debugName: "center" }] : /* istanbul ignore next */ []));
@@ -466,6 +552,8 @@ class MapView {
466
552
  /** `extraIconRefs`: íconos de las acciones del popup (ver `buildMarkerPopup()`)
467
553
  * — se crean con `createComponent()` igual que `iconRef` (el pin), así que
468
554
  * necesitan el mismo `.destroy()` en `clearMarkers()`. */
555
+ /** Rótulos de distancia de `MapMarker.connect`, montados sobre el punto medio de cada línea. */
556
+ connectionChips = [];
469
557
  markerHandles = [];
470
558
  /** Markers DOM reales sobre cada cluster real (punto 1, a11y) — separados
471
559
  * de `markerHandles` porque se reconstruyen en su propio ciclo (ver
@@ -521,10 +609,17 @@ class MapView {
521
609
  // se reencuadraría pero los datos dibujados quedarían viejos.
522
610
  // `syncRoute()` ya revisa `isStyleLoaded()`, así que no hace nada si
523
611
  // el estilo está a mitad de cargar.
524
- this.syncRoute();
612
+ const styleReady = this.map.isStyleLoaded();
613
+ this.syncRoute(styleReady);
614
+ this.syncAreas(styleReady);
615
+ this.syncConnections(styleReady);
525
616
  this.syncCamera();
526
617
  });
527
618
  this.destroyRef.onDestroy(() => {
619
+ for (const chip of this.connectionChips) {
620
+ chip.remove();
621
+ }
622
+ this.connectionChips = [];
528
623
  this.document.removeEventListener('fullscreenchange', this.onFullscreenChange);
529
624
  this.resizeObserver?.disconnect();
530
625
  this.clearMarkers();
@@ -666,7 +761,9 @@ class MapView {
666
761
  // del estilo anterior. Los markers en DOM (`syncMarkers()` sin
667
762
  // clustering) no dependen del estilo y por eso no se repiten acá.
668
763
  this.map.on('style.load', () => {
669
- this.syncRoute();
764
+ this.syncRoute(true);
765
+ this.syncAreas(true);
766
+ this.syncConnections(true);
670
767
  if (this.clusterActive()) {
671
768
  this.syncClusterSource();
672
769
  }
@@ -823,13 +920,19 @@ class MapView {
823
920
  */
824
921
  computeBounds() {
825
922
  const points = [...this.markers().map((marker) => marker.position), ...(this.route() ?? [])];
826
- if (points.length === 0) {
923
+ const areas = this.fitToAreas() ? this.areas() : [];
924
+ if (points.length === 0 && areas.length === 0) {
827
925
  return null;
828
926
  }
829
927
  const bounds = new LngLatBounds();
830
928
  for (const point of points) {
831
929
  bounds.extend(this.toLngLat(point));
832
930
  }
931
+ for (const area of areas) {
932
+ for (const [lng, lat] of circlePolygon(area.center, area.radiusMeters, 16)) {
933
+ bounds.extend([lng, lat]);
934
+ }
935
+ }
833
936
  return bounds;
834
937
  }
835
938
  syncMarkers() {
@@ -872,15 +975,19 @@ class MapView {
872
975
  // `kf-icon` real (no un `<svg>` a mano): reusa el sprite compartido y
873
976
  // se destruye igual que cualquier otro componente Angular al sacar el
874
977
  // marker del mapa.
978
+ // Forma, tono e ícono salen del mismo resolvedor que usa `kf-map-legend`.
979
+ const visual = resolveMarkerVisual(markerData);
875
980
  const iconRef = createComponent(Icon, { environmentInjector: this.environmentInjector });
876
- iconRef.setInput('name', markerData.icon ?? 'map-pin');
981
+ iconRef.setInput('name', visual.icon);
877
982
  iconRef.setInput('size', 'sm');
878
983
  iconRef.changeDetectorRef.detectChanges();
879
984
  const element = this.document.createElement('div');
880
985
  element.className = [
881
986
  'kf-map__marker',
882
- `kf-map__marker--${markerData.tone ?? 'neutral'}`,
987
+ `kf-map__marker--${visual.tone}`,
883
988
  markerData.live ? 'kf-map__marker--live' : '',
989
+ visual.shape === 'pin' ? 'kf-map__marker--pin' : '',
990
+ markerData.selected ? 'kf-map__marker--selected' : '',
884
991
  ]
885
992
  .filter(Boolean)
886
993
  .join(' ');
@@ -889,6 +996,18 @@ class MapView {
889
996
  element.setAttribute('aria-label', markerData.label);
890
997
  element.setAttribute('title', markerData.label);
891
998
  }
999
+ else if (markerData.caption) {
1000
+ // Sin `label`, el rótulo visible también nombra al marcador.
1001
+ element.setAttribute('aria-label', markerData.caption);
1002
+ }
1003
+ if (visual.shape === 'pin') {
1004
+ // La gota rota -45° en un hijo: la raíz recibe el `transform` de Mapbox y
1005
+ // el ícono tiene que quedar derecho.
1006
+ const pinShape = this.document.createElement('span');
1007
+ pinShape.className = 'kf-map__marker-pin';
1008
+ pinShape.setAttribute('aria-hidden', 'true');
1009
+ element.appendChild(pinShape);
1010
+ }
892
1011
  const extraIconRefs = [];
893
1012
  if (markerData.id) {
894
1013
  // `id` (ver JSDoc de `MapMarker.id`) es lo único que hace a un
@@ -898,6 +1017,9 @@ class MapView {
898
1017
  element.classList.add('kf-map__marker--clickable');
899
1018
  element.setAttribute('role', 'button');
900
1019
  element.setAttribute('tabindex', '0');
1020
+ if (markerData.selected !== undefined) {
1021
+ element.setAttribute('aria-pressed', String(markerData.selected));
1022
+ }
901
1023
  element.addEventListener('click', () => this.markerSelect.emit(markerId));
902
1024
  element.addEventListener('keydown', (event) => {
903
1025
  if (event.key === 'Enter' || event.key === ' ') {
@@ -910,7 +1032,7 @@ class MapView {
910
1032
  // que `popup` sin `id` se ignora en silencio en vez de agregar un
911
1033
  // elemento que nunca se vería.
912
1034
  if (markerData.popup) {
913
- const { element: popupElement, iconRefs: popupIconRefs } = this.buildMarkerPopup(markerData.popup, markerId, markerData.tone ?? 'neutral');
1035
+ const { element: popupElement, iconRefs: popupIconRefs } = this.buildMarkerPopup(markerData.popup, markerId, visual.tone);
914
1036
  extraIconRefs.push(...popupIconRefs);
915
1037
  // Reposiciona (recorte de borde, ver `positionMarkerPopup()`) en
916
1038
  // el evento que dispara la aparición — el mecanismo de mostrar/
@@ -923,7 +1045,17 @@ class MapView {
923
1045
  }
924
1046
  }
925
1047
  element.appendChild(iconRef.location.nativeElement);
926
- const marker = new Marker({ element })
1048
+ if (markerData.caption) {
1049
+ const caption = this.document.createElement('span');
1050
+ caption.className = 'kf-map__marker-caption';
1051
+ caption.textContent = markerData.caption;
1052
+ caption.setAttribute('aria-hidden', 'true');
1053
+ element.appendChild(caption);
1054
+ }
1055
+ const marker = new Marker({
1056
+ element,
1057
+ anchor: visual.shape === 'pin' ? 'bottom' : 'center',
1058
+ })
927
1059
  .setLngLat(this.toLngLat(markerData.position))
928
1060
  .addTo(this.map);
929
1061
  this.markerHandles.push({ marker, iconRef, extraIconRefs });
@@ -1491,8 +1623,13 @@ class MapView {
1491
1623
  }
1492
1624
  this.clusterPopupIconRefs = [];
1493
1625
  }
1494
- syncRoute() {
1495
- if (!this.map || !this.map.isStyleLoaded()) {
1626
+ /**
1627
+ * `styleReady` se calcula una sola vez por pasada (ver el efecto y `style.load`): cada
1628
+ * `addSource` deja `isStyleLoaded()` en falso hasta que la fuente carga, y reevaluarlo
1629
+ * en `syncAreas`/`syncConnections` tras haber agregado la ruta las dejaba sin dibujar.
1630
+ */
1631
+ syncRoute(styleReady = this.map?.isStyleLoaded() ?? false) {
1632
+ if (!this.map || !styleReady) {
1496
1633
  return;
1497
1634
  }
1498
1635
  if (this.map.getLayer(ROUTE_LAYER_ID)) {
@@ -1531,6 +1668,116 @@ class MapView {
1531
1668
  },
1532
1669
  });
1533
1670
  }
1671
+ /** Áreas circulares como polígonos GeoJSON: relleno suave y contorno del color del tono. */
1672
+ syncAreas(styleReady = this.map?.isStyleLoaded() ?? false) {
1673
+ if (!this.map || !styleReady) {
1674
+ return;
1675
+ }
1676
+ for (const layerId of [AREAS_LINE_LAYER_ID, AREAS_FILL_LAYER_ID]) {
1677
+ if (this.map.getLayer(layerId)) {
1678
+ this.map.removeLayer(layerId);
1679
+ }
1680
+ }
1681
+ if (this.map.getSource(AREAS_SOURCE_ID)) {
1682
+ this.map.removeSource(AREAS_SOURCE_ID);
1683
+ }
1684
+ const areas = this.areas();
1685
+ if (areas.length === 0) {
1686
+ return;
1687
+ }
1688
+ this.map.addSource(AREAS_SOURCE_ID, {
1689
+ type: 'geojson',
1690
+ data: {
1691
+ type: 'FeatureCollection',
1692
+ features: areas.map((area) => ({
1693
+ type: 'Feature',
1694
+ properties: {
1695
+ id: area.id,
1696
+ color: this.resolveColorToken(TONE_COLOR_TOKEN[area.tone ?? 'neutral']),
1697
+ },
1698
+ geometry: {
1699
+ type: 'Polygon',
1700
+ coordinates: [circlePolygon(area.center, area.radiusMeters)],
1701
+ },
1702
+ })),
1703
+ },
1704
+ });
1705
+ this.map.addLayer({
1706
+ id: AREAS_FILL_LAYER_ID,
1707
+ type: 'fill',
1708
+ source: AREAS_SOURCE_ID,
1709
+ paint: { 'fill-color': ['get', 'color'], 'fill-opacity': 0.14 },
1710
+ });
1711
+ this.map.addLayer({
1712
+ id: AREAS_LINE_LAYER_ID,
1713
+ type: 'line',
1714
+ source: AREAS_SOURCE_ID,
1715
+ paint: { 'line-color': ['get', 'color'], 'line-width': 2 },
1716
+ });
1717
+ }
1718
+ /** Líneas punteadas entre marcadores (`MapMarker.connect`) y su rótulo de distancia. */
1719
+ syncConnections(styleReady = this.map?.isStyleLoaded() ?? false) {
1720
+ for (const chip of this.connectionChips) {
1721
+ chip.remove();
1722
+ }
1723
+ this.connectionChips = [];
1724
+ const markers = this.markers();
1725
+ const features = [];
1726
+ for (const origin of markers) {
1727
+ const target = origin.connect
1728
+ ? markers.find((candidate) => candidate.id === origin.connect?.to)
1729
+ : undefined;
1730
+ if (!origin.connect || !target) {
1731
+ continue;
1732
+ }
1733
+ features.push({
1734
+ type: 'Feature',
1735
+ properties: {},
1736
+ geometry: {
1737
+ type: 'LineString',
1738
+ coordinates: [this.toLngLat(origin.position), this.toLngLat(target.position)],
1739
+ },
1740
+ });
1741
+ if (this.map) {
1742
+ const distance = formatDistance(distanceMeters(origin.position, target.position));
1743
+ const chip = this.document.createElement('div');
1744
+ chip.className = 'kf-map__connection-chip';
1745
+ chip.textContent = origin.connect.label
1746
+ ? `${origin.connect.label} · ${distance}`
1747
+ : distance;
1748
+ this.connectionChips.push(new Marker({ element: chip })
1749
+ .setLngLat(this.toLngLat(midpoint(origin.position, target.position)))
1750
+ .addTo(this.map));
1751
+ }
1752
+ }
1753
+ if (!this.map || !styleReady) {
1754
+ return;
1755
+ }
1756
+ if (this.map.getLayer(CONNECTIONS_LAYER_ID)) {
1757
+ this.map.removeLayer(CONNECTIONS_LAYER_ID);
1758
+ }
1759
+ if (this.map.getSource(CONNECTIONS_SOURCE_ID)) {
1760
+ this.map.removeSource(CONNECTIONS_SOURCE_ID);
1761
+ }
1762
+ if (features.length === 0) {
1763
+ return;
1764
+ }
1765
+ this.map.addSource(CONNECTIONS_SOURCE_ID, {
1766
+ type: 'geojson',
1767
+ data: { type: 'FeatureCollection', features },
1768
+ });
1769
+ this.map.addLayer({
1770
+ id: CONNECTIONS_LAYER_ID,
1771
+ type: 'line',
1772
+ source: CONNECTIONS_SOURCE_ID,
1773
+ layout: { 'line-cap': 'round' },
1774
+ paint: {
1775
+ 'line-color': this.resolveColorToken('--kf-color-ink'),
1776
+ 'line-width': 2,
1777
+ 'line-dasharray': [1, 2],
1778
+ },
1779
+ });
1780
+ }
1534
1781
  resolveColorToken(name) {
1535
1782
  return getComputedStyle(this.document.documentElement).getPropertyValue(name).trim();
1536
1783
  }
@@ -1588,7 +1835,7 @@ class MapView {
1588
1835
  }
1589
1836
  }
1590
1837
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: MapView, deps: [], target: i0.ɵɵFactoryTarget.Component });
1591
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: MapView, isStandalone: true, selector: "kf-map", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, markers: { classPropertyName: "markers", publicName: "markers", isSignal: true, isRequired: false, transformFunction: null }, route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: false, transformFunction: null }, fitToMarkers: { classPropertyName: "fitToMarkers", publicName: "fitToMarkers", isSignal: true, isRequired: false, transformFunction: null }, center: { classPropertyName: "center", publicName: "center", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, clusterAbove: { classPropertyName: "clusterAbove", publicName: "clusterAbove", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { markerSelect: "markerSelect", markerAction: "markerAction" }, host: { properties: { "class.kf-map--sm": "size() === 'sm'", "class.kf-map--md": "size() === 'md'", "class.kf-map--lg": "size() === 'lg'", "class.kf-map--full": "size() === 'full'" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["mapContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #mapContainer\n class=\"kf-map__container\"\n [attr.role]=\"containerRole()\"\n [attr.aria-label]=\"label()\"\n [attr.tabindex]=\"isPreview() ? -1 : null\"\n></div>\n\n@if (status() === 'loading') {\n <div class=\"kf-map__overlay\" aria-live=\"polite\">\n <kf-spinner label=\"Cargando mapa\u2026\" />\n </div>\n} @else if (status() === 'error') {\n <div class=\"kf-map__overlay kf-map__overlay--error\" role=\"alert\">\n <kf-icon name=\"alert-triangle\" size=\"lg\" />\n <kf-text as=\"p\" variant=\"body\" tone=\"error\">No pudimos cargar el mapa</kf-text>\n </div>\n}\n\n@if (showControls()) {\n <kf-map-controls\n class=\"kf-map__controls\"\n [controls]=\"effectiveControls()\"\n [clusterActive]=\"clusterActive()\"\n [followActive]=\"followActive()\"\n [canFollow]=\"hasLiveMarker()\"\n [isFullscreen]=\"isFullscreen()\"\n [styleLabel]=\"styleLabel()\"\n [activeTheme]=\"activeTheme()\"\n (zoomIn)=\"handleZoomIn()\"\n (zoomOut)=\"handleZoomOut()\"\n (recenter)=\"handleRecenter()\"\n (followToggle)=\"handleFollowToggle()\"\n (clusterToggle)=\"handleClusterToggle()\"\n (themeSelect)=\"handleThemeSelect($event)\"\n (fullscreenToggle)=\"handleFullscreenToggle()\"\n />\n}\n", styles: ["kf-map{display:block;position:relative;width:100%;border-radius:var(--kf-radius-md);overflow:hidden;background:var(--kf-color-gray-100)}kf-map.kf-map--sm{height:200px}kf-map.kf-map--md{height:320px}kf-map.kf-map--lg{height:480px}kf-map.kf-map--full{height:100%}kf-map:fullscreen,kf-map:-webkit-full-screen{width:100vw;height:100vh;border-radius:0}.kf-map__container{width:100%;height:100%}.kf-map__overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--kf-space-sm);background:var(--kf-color-gray-100);text-align:center;padding:var(--kf-space-md);box-sizing:border-box}.kf-map__overlay--error{background:var(--kf-color-error-soft)}.kf-map__controls{position:absolute;top:var(--kf-space-sm);right:var(--kf-space-sm);z-index:3}.kf-map__marker{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:3px solid var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-white);z-index:1}.kf-map__marker:hover,.kf-map__marker:focus-within{z-index:3}.kf-map__marker--neutral{background:var(--kf-color-gray-700)}.kf-map__marker--ok{background:var(--kf-color-success)}.kf-map__marker--warn{background:var(--kf-color-warning)}.kf-map__marker--error{background:var(--kf-color-error)}.kf-map__marker--info{background:var(--kf-color-info)}.kf-map__marker--live:before{content:\"\";position:absolute;inset:-8px;border-radius:50%;background:var(--kf-color-white);opacity:.45;animation:kf-map-marker-pulse 1.8s ease-out infinite}@keyframes kf-map-marker-pulse{0%{transform:scale(.6);opacity:.45}to{transform:scale(1.6);opacity:0}}.kf-map__marker--clickable{cursor:pointer}.kf-map__marker--clickable:after{content:\"\";position:absolute;inset:-6px;border-radius:50%;transition:background-color .12s ease}.kf-map__marker--clickable:hover:after{background-color:color-mix(in srgb,var(--kf-color-ink) 12%,transparent)}.kf-map__marker--clickable:active{filter:brightness(.85)}.kf-map__marker--clickable:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}@media(prefers-reduced-motion:reduce){.kf-map__marker--clickable:after{transition:none}.kf-map__marker--live:before{animation:none}}.kf-map__cluster-marker{position:absolute;top:0;left:0;border-radius:50%;cursor:pointer}.kf-map__cluster-marker:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}.kf-map__marker-popup{--kf-map-popup-tx: -50%;--kf-map-popup-ty: 4px;position:absolute;bottom:calc(100% + 12px);left:50%;transform:translate(var(--kf-map-popup-tx),var(--kf-map-popup-ty));display:flex;flex-direction:column;gap:var(--kf-space-xs);min-width:240px;max-width:320px;background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:var(--kf-space-md);text-align:left;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;z-index:4}.kf-map__marker-popup:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border:7px solid transparent;border-top-color:var(--kf-color-white)}.kf-map__marker:hover .kf-map__marker-popup,.kf-map__marker:focus-within .kf-map__marker-popup{opacity:1;transform:translate(var(--kf-map-popup-tx));pointer-events:auto}.kf-map__marker-popup--align-start{left:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--align-end{left:auto;right:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--below{bottom:auto;top:calc(100% + 12px);--kf-map-popup-ty: -4px}.kf-map__marker-popup--below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--kf-color-white)}.kf-map__marker-popup-heading{display:flex;align-items:center;gap:var(--kf-space-xs)}.kf-map__marker-popup-tone{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);flex:none}.kf-map__marker-popup-tone--neutral{background:var(--kf-color-gray-700)}.kf-map__marker-popup-tone--ok{background:var(--kf-color-success)}.kf-map__marker-popup-tone--warn{background:var(--kf-color-warning)}.kf-map__marker-popup-tone--error{background:var(--kf-color-error)}.kf-map__marker-popup-tone--info{background:var(--kf-color-info)}.kf-map__marker-popup-title{font-family:var(--kf-font-mono);font-weight:700;font-size:.9375rem;line-height:1.25;color:var(--kf-color-primary)}.kf-map__marker-popup-description{font-size:.8125rem;line-height:1.4;color:var(--kf-color-text)}.kf-map__marker-popup-details{display:flex;flex-direction:column;gap:4px;margin:2px 0 0;padding:var(--kf-space-xs) 0 0;border-top:1px solid var(--kf-color-border)}.kf-map__marker-popup-detail{display:flex;align-items:baseline;justify-content:space-between;gap:var(--kf-space-sm);margin:0}.kf-map__marker-popup-detail-label{font-size:.625rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--kf-color-text-muted);white-space:nowrap}.kf-map__marker-popup-detail-value{margin:0;font-size:.75rem;font-weight:600;color:var(--kf-color-text);text-align:right}.kf-map__marker-popup-actions{display:flex;gap:var(--kf-space-xs);margin-top:2px}.kf-map__marker-popup-action{flex:1;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:4px;font:inherit;font-size:.75rem;font-weight:700;border:1px solid transparent;border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}.kf-map__marker-popup-action-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__marker-popup-action--primary{color:var(--kf-color-white);background:var(--kf-color-primary);border-color:var(--kf-color-primary)}.kf-map__marker-popup-action--primary:hover{background:var(--kf-color-primary-hover);border-color:var(--kf-color-primary-hover)}.kf-map__marker-popup-action--ghost{color:var(--kf-color-primary);background:transparent}.kf-map__marker-popup-action--ghost:hover{background:var(--kf-color-primary-soft)}.kf-map__marker-popup-action:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__marker-popup-action svg,.kf-map__cluster-popup-close svg,.kf-map__cluster-popup-expand svg{width:14px;height:14px;flex:none}@media(prefers-reduced-motion:reduce){.kf-map__marker-popup,.kf-map__marker-popup-action{transition:none}}.kf-map__cluster-popup{position:absolute;display:flex;flex-direction:column;width:280px;max-width:calc(100% - 2 * var(--kf-space-sm));background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);overflow:hidden;z-index:5}.kf-map__cluster-popup-header{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border-bottom:1px solid var(--kf-color-border)}.kf-map__cluster-popup-title{font-weight:700;font-size:.8125rem;color:var(--kf-color-text)}.kf-map__cluster-popup-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--kf-radius-sm);background:transparent;color:var(--kf-color-text-muted);cursor:pointer;flex:none}.kf-map__cluster-popup-close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-map__cluster-popup-close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__cluster-popup-list{display:flex;flex-direction:column;max-height:240px;overflow-y:auto;margin:0;padding:var(--kf-space-xs) 0;list-style:none}.kf-map__cluster-popup-item{display:flex;align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-xs) var(--kf-space-md)}.kf-map__cluster-popup-item--clickable{cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-item--clickable:hover,.kf-map__cluster-popup-item--clickable:focus-visible{background:var(--kf-color-surface);outline:none}.kf-map__cluster-popup-dot{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);flex:none}.kf-map__cluster-popup-dot--neutral{background:var(--kf-color-gray-700)}.kf-map__cluster-popup-dot--ok{background:var(--kf-color-success)}.kf-map__cluster-popup-dot--warn{background:var(--kf-color-warning)}.kf-map__cluster-popup-dot--error{background:var(--kf-color-error)}.kf-map__cluster-popup-dot--info{background:var(--kf-color-info)}.kf-map__cluster-popup-text{display:flex;flex-direction:column;min-width:0;gap:1px}.kf-map__cluster-popup-item-title{font-weight:600;font-size:.8125rem;color:var(--kf-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-item-description{font-size:.75rem;color:var(--kf-color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-footer{padding:var(--kf-space-sm) var(--kf-space-md);border-top:1px solid var(--kf-color-border)}.kf-map__cluster-popup-expand{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:100%;font:inherit;font-size:.75rem;font-weight:700;color:var(--kf-color-primary);background:transparent;border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-expand:hover{background:var(--kf-color-primary-soft)}.kf-map__cluster-popup-expand:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-map__cluster-popup-item--clickable,.kf-map__cluster-popup-expand{transition:none}}\n"], dependencies: [{ kind: "component", type: MapControls, selector: "kf-map-controls", inputs: ["controls", "clusterActive", "followActive", "canFollow", "isFullscreen", "styleLabel", "activeTheme"], outputs: ["zoomIn", "zoomOut", "recenter", "followToggle", "clusterToggle", "themeSelect", "fullscreenToggle"] }, { kind: "component", type: Spinner, selector: "kf-spinner", inputs: ["size", "label", "onDark"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "component", type: Text, selector: "kf-text", inputs: ["as", "variant", "tone"] }], encapsulation: i0.ViewEncapsulation.None });
1838
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: MapView, isStandalone: true, selector: "kf-map", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, markers: { classPropertyName: "markers", publicName: "markers", isSignal: true, isRequired: false, transformFunction: null }, route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: false, transformFunction: null }, areas: { classPropertyName: "areas", publicName: "areas", isSignal: true, isRequired: false, transformFunction: null }, fitToAreas: { classPropertyName: "fitToAreas", publicName: "fitToAreas", isSignal: true, isRequired: false, transformFunction: null }, fitToMarkers: { classPropertyName: "fitToMarkers", publicName: "fitToMarkers", isSignal: true, isRequired: false, transformFunction: null }, center: { classPropertyName: "center", publicName: "center", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, clusterAbove: { classPropertyName: "clusterAbove", publicName: "clusterAbove", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { markerSelect: "markerSelect", markerAction: "markerAction" }, host: { properties: { "class.kf-map--sm": "size() === 'sm'", "class.kf-map--md": "size() === 'md'", "class.kf-map--lg": "size() === 'lg'", "class.kf-map--full": "size() === 'full'" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["mapContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #mapContainer\n class=\"kf-map__container\"\n [attr.role]=\"containerRole()\"\n [attr.aria-label]=\"label()\"\n [attr.tabindex]=\"isPreview() ? -1 : null\"\n></div>\n\n@if (status() === 'loading') {\n <div class=\"kf-map__overlay\" aria-live=\"polite\">\n <kf-spinner label=\"Cargando mapa\u2026\" />\n </div>\n} @else if (status() === 'error') {\n <div class=\"kf-map__overlay kf-map__overlay--error\" role=\"alert\">\n <kf-icon name=\"alert-triangle\" size=\"lg\" />\n <kf-text as=\"p\" variant=\"body\" tone=\"error\">No pudimos cargar el mapa</kf-text>\n </div>\n}\n\n@if (showControls()) {\n <kf-map-controls\n class=\"kf-map__controls\"\n [controls]=\"effectiveControls()\"\n [clusterActive]=\"clusterActive()\"\n [followActive]=\"followActive()\"\n [canFollow]=\"hasLiveMarker()\"\n [isFullscreen]=\"isFullscreen()\"\n [styleLabel]=\"styleLabel()\"\n [activeTheme]=\"activeTheme()\"\n (zoomIn)=\"handleZoomIn()\"\n (zoomOut)=\"handleZoomOut()\"\n (recenter)=\"handleRecenter()\"\n (followToggle)=\"handleFollowToggle()\"\n (clusterToggle)=\"handleClusterToggle()\"\n (themeSelect)=\"handleThemeSelect($event)\"\n (fullscreenToggle)=\"handleFullscreenToggle()\"\n />\n}\n", styles: [".kf-map__marker--neutral,.kf-map__marker-popup-tone--neutral,.kf-map-legend__glyph--neutral{--kf-map-tone-bg: var(--kf-color-gray-700)}.kf-map__marker--ok,.kf-map__marker-popup-tone--ok,.kf-map-legend__glyph--ok{--kf-map-tone-bg: var(--kf-color-success)}.kf-map__marker--warn,.kf-map__marker-popup-tone--warn,.kf-map-legend__glyph--warn{--kf-map-tone-bg: var(--kf-color-warning)}.kf-map__marker--error,.kf-map__marker-popup-tone--error,.kf-map-legend__glyph--error{--kf-map-tone-bg: var(--kf-color-error)}.kf-map__marker--info,.kf-map__marker-popup-tone--info,.kf-map-legend__glyph--info{--kf-map-tone-bg: var(--kf-color-info)}.kf-map__marker--service,.kf-map__marker-popup-tone--service,.kf-map-legend__glyph--service{--kf-map-tone-bg: var(--kf-color-secondary)}.kf-map__marker-pin,.kf-map-legend__pin{position:absolute;inset:0;box-sizing:border-box;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--kf-map-tone-bg, var(--kf-color-gray-700))}kf-map{display:block;position:relative;container-type:inline-size;width:100%;border-radius:var(--kf-radius-md);overflow:hidden;background:var(--kf-color-gray-100)}kf-map.kf-map--sm{height:200px}kf-map.kf-map--md{height:320px}kf-map.kf-map--lg{height:480px}kf-map.kf-map--full{height:100%}kf-map:fullscreen,kf-map:-webkit-full-screen{width:100vw;height:100vh;border-radius:0}.kf-map__container{width:100%;height:100%}.kf-map__overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--kf-space-sm);background:var(--kf-color-gray-100);text-align:center;padding:var(--kf-space-md);box-sizing:border-box}.kf-map__overlay--error{background:var(--kf-color-error-soft)}.kf-map__controls{position:absolute;top:var(--kf-space-sm);right:var(--kf-space-sm);z-index:3}.kf-map__marker{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:3px solid var(--kf-color-white);box-shadow:var(--kf-shadow-md);background:var(--kf-map-tone-bg, var(--kf-color-gray-700));color:var(--kf-color-white);z-index:1}.kf-map__marker:hover,.kf-map__marker:focus-within{z-index:3}.kf-map__marker--pin{background:transparent;border:0;box-shadow:none}.kf-map__marker-pin{border:3px solid var(--kf-color-white);box-shadow:var(--kf-shadow-md)}.kf-map__marker--pin>kf-icon{position:relative;z-index:1}.kf-map__marker--selected{box-shadow:0 0 0 3px var(--kf-color-ink),var(--kf-shadow-md)}.kf-map__marker--pin.kf-map__marker--selected{box-shadow:none}.kf-map__marker--selected .kf-map__marker-pin{box-shadow:0 0 0 3px var(--kf-color-ink),var(--kf-shadow-md)}.kf-map__marker-caption{position:absolute;top:calc(100% + 4px);left:50%;transform:translate(-50%);padding:2px var(--kf-space-sm);border-radius:var(--kf-radius-pill);background:var(--kf-color-white);box-shadow:var(--kf-shadow-sm);color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1.4;white-space:nowrap;pointer-events:none}@container (max-width: 30rem){.kf-map__marker-caption{display:none}}.kf-map__connection-chip{padding:2px var(--kf-space-sm);border:1px solid var(--kf-color-ink);border-radius:var(--kf-radius-pill);background:var(--kf-color-white);color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1.4;white-space:nowrap;pointer-events:none}.kf-map__marker--live:before{content:\"\";position:absolute;inset:-8px;border-radius:50%;background:var(--kf-color-white);opacity:.45;animation:kf-map-marker-pulse 1.8s ease-out infinite}@keyframes kf-map-marker-pulse{0%{transform:scale(.6);opacity:.45}to{transform:scale(1.6);opacity:0}}.kf-map__marker--clickable{cursor:pointer}.kf-map__marker--clickable:after{content:\"\";position:absolute;inset:-6px;border-radius:50%;transition:background-color .12s ease}.kf-map__marker--clickable:hover:after{background-color:color-mix(in srgb,var(--kf-color-ink) 12%,transparent)}.kf-map__marker--clickable:active{filter:brightness(.85)}.kf-map__marker--clickable:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}@media(prefers-reduced-motion:reduce){.kf-map__marker--clickable:after{transition:none}.kf-map__marker--live:before{animation:none}}.kf-map__cluster-marker{position:absolute;top:0;left:0;border-radius:50%;cursor:pointer}.kf-map__cluster-marker:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}.kf-map__marker-popup{--kf-map-popup-tx: -50%;--kf-map-popup-ty: 4px;position:absolute;bottom:calc(100% + 12px);left:50%;transform:translate(var(--kf-map-popup-tx),var(--kf-map-popup-ty));display:flex;flex-direction:column;gap:var(--kf-space-xs);min-width:240px;max-width:320px;background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:var(--kf-space-md);text-align:left;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;z-index:4}.kf-map__marker-popup:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border:7px solid transparent;border-top-color:var(--kf-color-white)}.kf-map__marker:hover .kf-map__marker-popup,.kf-map__marker:focus-within .kf-map__marker-popup{opacity:1;transform:translate(var(--kf-map-popup-tx));pointer-events:auto}.kf-map__marker-popup--align-start{left:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--align-end{left:auto;right:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--below{bottom:auto;top:calc(100% + 12px);--kf-map-popup-ty: -4px}.kf-map__marker-popup--below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--kf-color-white)}.kf-map__marker-popup-heading{display:flex;align-items:center;gap:var(--kf-space-xs)}.kf-map__marker-popup-tone{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);background:var(--kf-map-tone-bg, var(--kf-color-gray-700));flex:none}.kf-map__marker-popup-title{font-family:var(--kf-font-mono);font-weight:700;font-size:.9375rem;line-height:1.25;color:var(--kf-color-primary)}.kf-map__marker-popup-description{font-size:var(--kf-font-size-label);line-height:1.4;color:var(--kf-color-text)}.kf-map__marker-popup-details{display:flex;flex-direction:column;gap:4px;margin:2px 0 0;padding:var(--kf-space-xs) 0 0;border-top:1px solid var(--kf-color-border)}.kf-map__marker-popup-detail{display:flex;align-items:baseline;justify-content:space-between;gap:var(--kf-space-sm);margin:0}.kf-map__marker-popup-detail-label{font-size:.625rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--kf-color-text-muted);white-space:nowrap}.kf-map__marker-popup-detail-value{margin:0;font-size:.75rem;font-weight:600;color:var(--kf-color-text);text-align:right}.kf-map__marker-popup-actions{display:flex;gap:var(--kf-space-xs);margin-top:2px}.kf-map__marker-popup-action{flex:1;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:4px;font:inherit;font-size:.75rem;font-weight:700;border:1px solid transparent;border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}.kf-map__marker-popup-action-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__marker-popup-action--primary{color:var(--kf-color-white);background:var(--kf-color-primary);border-color:var(--kf-color-primary)}.kf-map__marker-popup-action--primary:hover{background:var(--kf-color-primary-hover);border-color:var(--kf-color-primary-hover)}.kf-map__marker-popup-action--ghost{color:var(--kf-color-primary);background:transparent}.kf-map__marker-popup-action--ghost:hover{background:var(--kf-color-primary-soft)}.kf-map__marker-popup-action:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__marker-popup-action svg,.kf-map__cluster-popup-close svg,.kf-map__cluster-popup-expand svg{width:14px;height:14px;flex:none}@media(prefers-reduced-motion:reduce){.kf-map__marker-popup,.kf-map__marker-popup-action{transition:none}}.kf-map__cluster-popup{position:absolute;display:flex;flex-direction:column;width:280px;max-width:calc(100% - 2 * var(--kf-space-sm));background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);overflow:hidden;z-index:5}.kf-map__cluster-popup-header{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border-bottom:1px solid var(--kf-color-border)}.kf-map__cluster-popup-title{font-weight:700;font-size:var(--kf-font-size-label);color:var(--kf-color-text)}.kf-map__cluster-popup-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--kf-radius-sm);background:transparent;color:var(--kf-color-text-muted);cursor:pointer;flex:none}.kf-map__cluster-popup-close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-map__cluster-popup-close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__cluster-popup-list{display:flex;flex-direction:column;max-height:240px;overflow-y:auto;margin:0;padding:var(--kf-space-xs) 0;list-style:none}.kf-map__cluster-popup-item{display:flex;align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-xs) var(--kf-space-md)}.kf-map__cluster-popup-item--clickable{cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-item--clickable:hover,.kf-map__cluster-popup-item--clickable:focus-visible{background:var(--kf-color-surface);outline:none}.kf-map__cluster-popup-dot{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);flex:none}.kf-map__cluster-popup-dot--neutral{background:var(--kf-color-gray-700)}.kf-map__cluster-popup-dot--ok{background:var(--kf-color-success)}.kf-map__cluster-popup-dot--warn{background:var(--kf-color-warning)}.kf-map__cluster-popup-dot--error{background:var(--kf-color-error)}.kf-map__cluster-popup-dot--info{background:var(--kf-color-info)}.kf-map__cluster-popup-dot--service{background:var(--kf-color-secondary)}.kf-map__cluster-popup-text{display:flex;flex-direction:column;min-width:0;gap:1px}.kf-map__cluster-popup-item-title{font-weight:600;font-size:var(--kf-font-size-label);color:var(--kf-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-item-description{font-size:.75rem;color:var(--kf-color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-footer{padding:var(--kf-space-sm) var(--kf-space-md);border-top:1px solid var(--kf-color-border)}.kf-map__cluster-popup-expand{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:100%;font:inherit;font-size:.75rem;font-weight:700;color:var(--kf-color-primary);background:transparent;border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-expand:hover{background:var(--kf-color-primary-soft)}.kf-map__cluster-popup-expand:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-map__cluster-popup-item--clickable,.kf-map__cluster-popup-expand{transition:none}}\n"], dependencies: [{ kind: "component", type: MapControls, selector: "kf-map-controls", inputs: ["controls", "clusterActive", "followActive", "canFollow", "isFullscreen", "styleLabel", "activeTheme"], outputs: ["zoomIn", "zoomOut", "recenter", "followToggle", "clusterToggle", "themeSelect", "fullscreenToggle"] }, { kind: "component", type: Spinner, selector: "kf-spinner", inputs: ["size", "label", "onDark"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "component", type: Text, selector: "kf-text", inputs: ["as", "variant", "tone"] }], encapsulation: i0.ViewEncapsulation.None });
1592
1839
  }
1593
1840
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: MapView, decorators: [{
1594
1841
  type: Component,
@@ -1597,8 +1844,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
1597
1844
  '[class.kf-map--md]': "size() === 'md'",
1598
1845
  '[class.kf-map--lg]': "size() === 'lg'",
1599
1846
  '[class.kf-map--full]': "size() === 'full'",
1600
- }, template: "<div\n #mapContainer\n class=\"kf-map__container\"\n [attr.role]=\"containerRole()\"\n [attr.aria-label]=\"label()\"\n [attr.tabindex]=\"isPreview() ? -1 : null\"\n></div>\n\n@if (status() === 'loading') {\n <div class=\"kf-map__overlay\" aria-live=\"polite\">\n <kf-spinner label=\"Cargando mapa\u2026\" />\n </div>\n} @else if (status() === 'error') {\n <div class=\"kf-map__overlay kf-map__overlay--error\" role=\"alert\">\n <kf-icon name=\"alert-triangle\" size=\"lg\" />\n <kf-text as=\"p\" variant=\"body\" tone=\"error\">No pudimos cargar el mapa</kf-text>\n </div>\n}\n\n@if (showControls()) {\n <kf-map-controls\n class=\"kf-map__controls\"\n [controls]=\"effectiveControls()\"\n [clusterActive]=\"clusterActive()\"\n [followActive]=\"followActive()\"\n [canFollow]=\"hasLiveMarker()\"\n [isFullscreen]=\"isFullscreen()\"\n [styleLabel]=\"styleLabel()\"\n [activeTheme]=\"activeTheme()\"\n (zoomIn)=\"handleZoomIn()\"\n (zoomOut)=\"handleZoomOut()\"\n (recenter)=\"handleRecenter()\"\n (followToggle)=\"handleFollowToggle()\"\n (clusterToggle)=\"handleClusterToggle()\"\n (themeSelect)=\"handleThemeSelect($event)\"\n (fullscreenToggle)=\"handleFullscreenToggle()\"\n />\n}\n", styles: ["kf-map{display:block;position:relative;width:100%;border-radius:var(--kf-radius-md);overflow:hidden;background:var(--kf-color-gray-100)}kf-map.kf-map--sm{height:200px}kf-map.kf-map--md{height:320px}kf-map.kf-map--lg{height:480px}kf-map.kf-map--full{height:100%}kf-map:fullscreen,kf-map:-webkit-full-screen{width:100vw;height:100vh;border-radius:0}.kf-map__container{width:100%;height:100%}.kf-map__overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--kf-space-sm);background:var(--kf-color-gray-100);text-align:center;padding:var(--kf-space-md);box-sizing:border-box}.kf-map__overlay--error{background:var(--kf-color-error-soft)}.kf-map__controls{position:absolute;top:var(--kf-space-sm);right:var(--kf-space-sm);z-index:3}.kf-map__marker{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:3px solid var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-white);z-index:1}.kf-map__marker:hover,.kf-map__marker:focus-within{z-index:3}.kf-map__marker--neutral{background:var(--kf-color-gray-700)}.kf-map__marker--ok{background:var(--kf-color-success)}.kf-map__marker--warn{background:var(--kf-color-warning)}.kf-map__marker--error{background:var(--kf-color-error)}.kf-map__marker--info{background:var(--kf-color-info)}.kf-map__marker--live:before{content:\"\";position:absolute;inset:-8px;border-radius:50%;background:var(--kf-color-white);opacity:.45;animation:kf-map-marker-pulse 1.8s ease-out infinite}@keyframes kf-map-marker-pulse{0%{transform:scale(.6);opacity:.45}to{transform:scale(1.6);opacity:0}}.kf-map__marker--clickable{cursor:pointer}.kf-map__marker--clickable:after{content:\"\";position:absolute;inset:-6px;border-radius:50%;transition:background-color .12s ease}.kf-map__marker--clickable:hover:after{background-color:color-mix(in srgb,var(--kf-color-ink) 12%,transparent)}.kf-map__marker--clickable:active{filter:brightness(.85)}.kf-map__marker--clickable:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}@media(prefers-reduced-motion:reduce){.kf-map__marker--clickable:after{transition:none}.kf-map__marker--live:before{animation:none}}.kf-map__cluster-marker{position:absolute;top:0;left:0;border-radius:50%;cursor:pointer}.kf-map__cluster-marker:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}.kf-map__marker-popup{--kf-map-popup-tx: -50%;--kf-map-popup-ty: 4px;position:absolute;bottom:calc(100% + 12px);left:50%;transform:translate(var(--kf-map-popup-tx),var(--kf-map-popup-ty));display:flex;flex-direction:column;gap:var(--kf-space-xs);min-width:240px;max-width:320px;background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:var(--kf-space-md);text-align:left;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;z-index:4}.kf-map__marker-popup:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border:7px solid transparent;border-top-color:var(--kf-color-white)}.kf-map__marker:hover .kf-map__marker-popup,.kf-map__marker:focus-within .kf-map__marker-popup{opacity:1;transform:translate(var(--kf-map-popup-tx));pointer-events:auto}.kf-map__marker-popup--align-start{left:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--align-end{left:auto;right:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--below{bottom:auto;top:calc(100% + 12px);--kf-map-popup-ty: -4px}.kf-map__marker-popup--below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--kf-color-white)}.kf-map__marker-popup-heading{display:flex;align-items:center;gap:var(--kf-space-xs)}.kf-map__marker-popup-tone{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);flex:none}.kf-map__marker-popup-tone--neutral{background:var(--kf-color-gray-700)}.kf-map__marker-popup-tone--ok{background:var(--kf-color-success)}.kf-map__marker-popup-tone--warn{background:var(--kf-color-warning)}.kf-map__marker-popup-tone--error{background:var(--kf-color-error)}.kf-map__marker-popup-tone--info{background:var(--kf-color-info)}.kf-map__marker-popup-title{font-family:var(--kf-font-mono);font-weight:700;font-size:.9375rem;line-height:1.25;color:var(--kf-color-primary)}.kf-map__marker-popup-description{font-size:.8125rem;line-height:1.4;color:var(--kf-color-text)}.kf-map__marker-popup-details{display:flex;flex-direction:column;gap:4px;margin:2px 0 0;padding:var(--kf-space-xs) 0 0;border-top:1px solid var(--kf-color-border)}.kf-map__marker-popup-detail{display:flex;align-items:baseline;justify-content:space-between;gap:var(--kf-space-sm);margin:0}.kf-map__marker-popup-detail-label{font-size:.625rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--kf-color-text-muted);white-space:nowrap}.kf-map__marker-popup-detail-value{margin:0;font-size:.75rem;font-weight:600;color:var(--kf-color-text);text-align:right}.kf-map__marker-popup-actions{display:flex;gap:var(--kf-space-xs);margin-top:2px}.kf-map__marker-popup-action{flex:1;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:4px;font:inherit;font-size:.75rem;font-weight:700;border:1px solid transparent;border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}.kf-map__marker-popup-action-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__marker-popup-action--primary{color:var(--kf-color-white);background:var(--kf-color-primary);border-color:var(--kf-color-primary)}.kf-map__marker-popup-action--primary:hover{background:var(--kf-color-primary-hover);border-color:var(--kf-color-primary-hover)}.kf-map__marker-popup-action--ghost{color:var(--kf-color-primary);background:transparent}.kf-map__marker-popup-action--ghost:hover{background:var(--kf-color-primary-soft)}.kf-map__marker-popup-action:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__marker-popup-action svg,.kf-map__cluster-popup-close svg,.kf-map__cluster-popup-expand svg{width:14px;height:14px;flex:none}@media(prefers-reduced-motion:reduce){.kf-map__marker-popup,.kf-map__marker-popup-action{transition:none}}.kf-map__cluster-popup{position:absolute;display:flex;flex-direction:column;width:280px;max-width:calc(100% - 2 * var(--kf-space-sm));background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);overflow:hidden;z-index:5}.kf-map__cluster-popup-header{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border-bottom:1px solid var(--kf-color-border)}.kf-map__cluster-popup-title{font-weight:700;font-size:.8125rem;color:var(--kf-color-text)}.kf-map__cluster-popup-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--kf-radius-sm);background:transparent;color:var(--kf-color-text-muted);cursor:pointer;flex:none}.kf-map__cluster-popup-close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-map__cluster-popup-close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__cluster-popup-list{display:flex;flex-direction:column;max-height:240px;overflow-y:auto;margin:0;padding:var(--kf-space-xs) 0;list-style:none}.kf-map__cluster-popup-item{display:flex;align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-xs) var(--kf-space-md)}.kf-map__cluster-popup-item--clickable{cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-item--clickable:hover,.kf-map__cluster-popup-item--clickable:focus-visible{background:var(--kf-color-surface);outline:none}.kf-map__cluster-popup-dot{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);flex:none}.kf-map__cluster-popup-dot--neutral{background:var(--kf-color-gray-700)}.kf-map__cluster-popup-dot--ok{background:var(--kf-color-success)}.kf-map__cluster-popup-dot--warn{background:var(--kf-color-warning)}.kf-map__cluster-popup-dot--error{background:var(--kf-color-error)}.kf-map__cluster-popup-dot--info{background:var(--kf-color-info)}.kf-map__cluster-popup-text{display:flex;flex-direction:column;min-width:0;gap:1px}.kf-map__cluster-popup-item-title{font-weight:600;font-size:.8125rem;color:var(--kf-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-item-description{font-size:.75rem;color:var(--kf-color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-footer{padding:var(--kf-space-sm) var(--kf-space-md);border-top:1px solid var(--kf-color-border)}.kf-map__cluster-popup-expand{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:100%;font:inherit;font-size:.75rem;font-weight:700;color:var(--kf-color-primary);background:transparent;border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-expand:hover{background:var(--kf-color-primary-soft)}.kf-map__cluster-popup-expand:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-map__cluster-popup-item--clickable,.kf-map__cluster-popup-expand{transition:none}}\n"] }]
1601
- }], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], markers: [{ type: i0.Input, args: [{ isSignal: true, alias: "markers", required: false }] }], route: [{ type: i0.Input, args: [{ isSignal: true, alias: "route", required: false }] }], fitToMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitToMarkers", required: false }] }], center: [{ type: i0.Input, args: [{ isSignal: true, alias: "center", required: false }] }], zoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "zoom", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], clusterAbove: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterAbove", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], markerSelect: [{ type: i0.Output, args: ["markerSelect"] }], markerAction: [{ type: i0.Output, args: ["markerAction"] }], containerRef: [{ type: i0.ViewChild, args: ['mapContainer', { isSignal: true }] }] } });
1847
+ }, template: "<div\n #mapContainer\n class=\"kf-map__container\"\n [attr.role]=\"containerRole()\"\n [attr.aria-label]=\"label()\"\n [attr.tabindex]=\"isPreview() ? -1 : null\"\n></div>\n\n@if (status() === 'loading') {\n <div class=\"kf-map__overlay\" aria-live=\"polite\">\n <kf-spinner label=\"Cargando mapa\u2026\" />\n </div>\n} @else if (status() === 'error') {\n <div class=\"kf-map__overlay kf-map__overlay--error\" role=\"alert\">\n <kf-icon name=\"alert-triangle\" size=\"lg\" />\n <kf-text as=\"p\" variant=\"body\" tone=\"error\">No pudimos cargar el mapa</kf-text>\n </div>\n}\n\n@if (showControls()) {\n <kf-map-controls\n class=\"kf-map__controls\"\n [controls]=\"effectiveControls()\"\n [clusterActive]=\"clusterActive()\"\n [followActive]=\"followActive()\"\n [canFollow]=\"hasLiveMarker()\"\n [isFullscreen]=\"isFullscreen()\"\n [styleLabel]=\"styleLabel()\"\n [activeTheme]=\"activeTheme()\"\n (zoomIn)=\"handleZoomIn()\"\n (zoomOut)=\"handleZoomOut()\"\n (recenter)=\"handleRecenter()\"\n (followToggle)=\"handleFollowToggle()\"\n (clusterToggle)=\"handleClusterToggle()\"\n (themeSelect)=\"handleThemeSelect($event)\"\n (fullscreenToggle)=\"handleFullscreenToggle()\"\n />\n}\n", styles: [".kf-map__marker--neutral,.kf-map__marker-popup-tone--neutral,.kf-map-legend__glyph--neutral{--kf-map-tone-bg: var(--kf-color-gray-700)}.kf-map__marker--ok,.kf-map__marker-popup-tone--ok,.kf-map-legend__glyph--ok{--kf-map-tone-bg: var(--kf-color-success)}.kf-map__marker--warn,.kf-map__marker-popup-tone--warn,.kf-map-legend__glyph--warn{--kf-map-tone-bg: var(--kf-color-warning)}.kf-map__marker--error,.kf-map__marker-popup-tone--error,.kf-map-legend__glyph--error{--kf-map-tone-bg: var(--kf-color-error)}.kf-map__marker--info,.kf-map__marker-popup-tone--info,.kf-map-legend__glyph--info{--kf-map-tone-bg: var(--kf-color-info)}.kf-map__marker--service,.kf-map__marker-popup-tone--service,.kf-map-legend__glyph--service{--kf-map-tone-bg: var(--kf-color-secondary)}.kf-map__marker-pin,.kf-map-legend__pin{position:absolute;inset:0;box-sizing:border-box;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--kf-map-tone-bg, var(--kf-color-gray-700))}kf-map{display:block;position:relative;container-type:inline-size;width:100%;border-radius:var(--kf-radius-md);overflow:hidden;background:var(--kf-color-gray-100)}kf-map.kf-map--sm{height:200px}kf-map.kf-map--md{height:320px}kf-map.kf-map--lg{height:480px}kf-map.kf-map--full{height:100%}kf-map:fullscreen,kf-map:-webkit-full-screen{width:100vw;height:100vh;border-radius:0}.kf-map__container{width:100%;height:100%}.kf-map__overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--kf-space-sm);background:var(--kf-color-gray-100);text-align:center;padding:var(--kf-space-md);box-sizing:border-box}.kf-map__overlay--error{background:var(--kf-color-error-soft)}.kf-map__controls{position:absolute;top:var(--kf-space-sm);right:var(--kf-space-sm);z-index:3}.kf-map__marker{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:3px solid var(--kf-color-white);box-shadow:var(--kf-shadow-md);background:var(--kf-map-tone-bg, var(--kf-color-gray-700));color:var(--kf-color-white);z-index:1}.kf-map__marker:hover,.kf-map__marker:focus-within{z-index:3}.kf-map__marker--pin{background:transparent;border:0;box-shadow:none}.kf-map__marker-pin{border:3px solid var(--kf-color-white);box-shadow:var(--kf-shadow-md)}.kf-map__marker--pin>kf-icon{position:relative;z-index:1}.kf-map__marker--selected{box-shadow:0 0 0 3px var(--kf-color-ink),var(--kf-shadow-md)}.kf-map__marker--pin.kf-map__marker--selected{box-shadow:none}.kf-map__marker--selected .kf-map__marker-pin{box-shadow:0 0 0 3px var(--kf-color-ink),var(--kf-shadow-md)}.kf-map__marker-caption{position:absolute;top:calc(100% + 4px);left:50%;transform:translate(-50%);padding:2px var(--kf-space-sm);border-radius:var(--kf-radius-pill);background:var(--kf-color-white);box-shadow:var(--kf-shadow-sm);color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1.4;white-space:nowrap;pointer-events:none}@container (max-width: 30rem){.kf-map__marker-caption{display:none}}.kf-map__connection-chip{padding:2px var(--kf-space-sm);border:1px solid var(--kf-color-ink);border-radius:var(--kf-radius-pill);background:var(--kf-color-white);color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1.4;white-space:nowrap;pointer-events:none}.kf-map__marker--live:before{content:\"\";position:absolute;inset:-8px;border-radius:50%;background:var(--kf-color-white);opacity:.45;animation:kf-map-marker-pulse 1.8s ease-out infinite}@keyframes kf-map-marker-pulse{0%{transform:scale(.6);opacity:.45}to{transform:scale(1.6);opacity:0}}.kf-map__marker--clickable{cursor:pointer}.kf-map__marker--clickable:after{content:\"\";position:absolute;inset:-6px;border-radius:50%;transition:background-color .12s ease}.kf-map__marker--clickable:hover:after{background-color:color-mix(in srgb,var(--kf-color-ink) 12%,transparent)}.kf-map__marker--clickable:active{filter:brightness(.85)}.kf-map__marker--clickable:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}@media(prefers-reduced-motion:reduce){.kf-map__marker--clickable:after{transition:none}.kf-map__marker--live:before{animation:none}}.kf-map__cluster-marker{position:absolute;top:0;left:0;border-radius:50%;cursor:pointer}.kf-map__cluster-marker:focus-visible{outline:none;box-shadow:0 0 0 2px var(--kf-color-white),0 0 0 4px var(--kf-color-ink)}.kf-map__marker-popup{--kf-map-popup-tx: -50%;--kf-map-popup-ty: 4px;position:absolute;bottom:calc(100% + 12px);left:50%;transform:translate(var(--kf-map-popup-tx),var(--kf-map-popup-ty));display:flex;flex-direction:column;gap:var(--kf-space-xs);min-width:240px;max-width:320px;background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);padding:var(--kf-space-md);text-align:left;opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease;z-index:4}.kf-map__marker-popup:after{content:\"\";position:absolute;top:100%;left:50%;transform:translate(-50%);border:7px solid transparent;border-top-color:var(--kf-color-white)}.kf-map__marker:hover .kf-map__marker-popup,.kf-map__marker:focus-within .kf-map__marker-popup{opacity:1;transform:translate(var(--kf-map-popup-tx));pointer-events:auto}.kf-map__marker-popup--align-start{left:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--align-end{left:auto;right:0;--kf-map-popup-tx: 0%}.kf-map__marker-popup--below{bottom:auto;top:calc(100% + 12px);--kf-map-popup-ty: -4px}.kf-map__marker-popup--below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--kf-color-white)}.kf-map__marker-popup-heading{display:flex;align-items:center;gap:var(--kf-space-xs)}.kf-map__marker-popup-tone{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);background:var(--kf-map-tone-bg, var(--kf-color-gray-700));flex:none}.kf-map__marker-popup-title{font-family:var(--kf-font-mono);font-weight:700;font-size:.9375rem;line-height:1.25;color:var(--kf-color-primary)}.kf-map__marker-popup-description{font-size:var(--kf-font-size-label);line-height:1.4;color:var(--kf-color-text)}.kf-map__marker-popup-details{display:flex;flex-direction:column;gap:4px;margin:2px 0 0;padding:var(--kf-space-xs) 0 0;border-top:1px solid var(--kf-color-border)}.kf-map__marker-popup-detail{display:flex;align-items:baseline;justify-content:space-between;gap:var(--kf-space-sm);margin:0}.kf-map__marker-popup-detail-label{font-size:.625rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--kf-color-text-muted);white-space:nowrap}.kf-map__marker-popup-detail-value{margin:0;font-size:.75rem;font-weight:600;color:var(--kf-color-text);text-align:right}.kf-map__marker-popup-actions{display:flex;gap:var(--kf-space-xs);margin-top:2px}.kf-map__marker-popup-action{flex:1;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:4px;font:inherit;font-size:.75rem;font-weight:700;border:1px solid transparent;border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease,border-color .12s ease,color .12s ease}.kf-map__marker-popup-action-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__marker-popup-action--primary{color:var(--kf-color-white);background:var(--kf-color-primary);border-color:var(--kf-color-primary)}.kf-map__marker-popup-action--primary:hover{background:var(--kf-color-primary-hover);border-color:var(--kf-color-primary-hover)}.kf-map__marker-popup-action--ghost{color:var(--kf-color-primary);background:transparent}.kf-map__marker-popup-action--ghost:hover{background:var(--kf-color-primary-soft)}.kf-map__marker-popup-action:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__marker-popup-action svg,.kf-map__cluster-popup-close svg,.kf-map__cluster-popup-expand svg{width:14px;height:14px;flex:none}@media(prefers-reduced-motion:reduce){.kf-map__marker-popup,.kf-map__marker-popup-action{transition:none}}.kf-map__cluster-popup{position:absolute;display:flex;flex-direction:column;width:280px;max-width:calc(100% - 2 * var(--kf-space-sm));background:var(--kf-color-white);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-md);box-shadow:var(--kf-shadow-md);overflow:hidden;z-index:5}.kf-map__cluster-popup-header{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border-bottom:1px solid var(--kf-color-border)}.kf-map__cluster-popup-title{font-weight:700;font-size:var(--kf-font-size-label);color:var(--kf-color-text)}.kf-map__cluster-popup-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--kf-radius-sm);background:transparent;color:var(--kf-color-text-muted);cursor:pointer;flex:none}.kf-map__cluster-popup-close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-map__cluster-popup-close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map__cluster-popup-list{display:flex;flex-direction:column;max-height:240px;overflow-y:auto;margin:0;padding:var(--kf-space-xs) 0;list-style:none}.kf-map__cluster-popup-item{display:flex;align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-xs) var(--kf-space-md)}.kf-map__cluster-popup-item--clickable{cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-item--clickable:hover,.kf-map__cluster-popup-item--clickable:focus-visible{background:var(--kf-color-surface);outline:none}.kf-map__cluster-popup-dot{inline-size:8px;block-size:8px;border-radius:var(--kf-radius-pill);flex:none}.kf-map__cluster-popup-dot--neutral{background:var(--kf-color-gray-700)}.kf-map__cluster-popup-dot--ok{background:var(--kf-color-success)}.kf-map__cluster-popup-dot--warn{background:var(--kf-color-warning)}.kf-map__cluster-popup-dot--error{background:var(--kf-color-error)}.kf-map__cluster-popup-dot--info{background:var(--kf-color-info)}.kf-map__cluster-popup-dot--service{background:var(--kf-color-secondary)}.kf-map__cluster-popup-text{display:flex;flex-direction:column;min-width:0;gap:1px}.kf-map__cluster-popup-item-title{font-weight:600;font-size:var(--kf-font-size-label);color:var(--kf-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-item-description{font-size:.75rem;color:var(--kf-color-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-map__cluster-popup-footer{padding:var(--kf-space-sm) var(--kf-space-md);border-top:1px solid var(--kf-color-border)}.kf-map__cluster-popup-expand{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:100%;font:inherit;font-size:.75rem;font-weight:700;color:var(--kf-color-primary);background:transparent;border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-sm);padding:6px 10px;cursor:pointer;transition:background .12s ease}.kf-map__cluster-popup-expand:hover{background:var(--kf-color-primary-soft)}.kf-map__cluster-popup-expand:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-map__cluster-popup-item--clickable,.kf-map__cluster-popup-expand{transition:none}}\n"] }]
1848
+ }], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], markers: [{ type: i0.Input, args: [{ isSignal: true, alias: "markers", required: false }] }], route: [{ type: i0.Input, args: [{ isSignal: true, alias: "route", required: false }] }], areas: [{ type: i0.Input, args: [{ isSignal: true, alias: "areas", required: false }] }], fitToAreas: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitToAreas", required: false }] }], fitToMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "fitToMarkers", required: false }] }], center: [{ type: i0.Input, args: [{ isSignal: true, alias: "center", required: false }] }], zoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "zoom", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], clusterAbove: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterAbove", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], markerSelect: [{ type: i0.Output, args: ["markerSelect"] }], markerAction: [{ type: i0.Output, args: ["markerAction"] }], containerRef: [{ type: i0.ViewChild, args: ['mapContainer', { isSignal: true }] }] } });
1849
+
1850
+ /**
1851
+ * Leyenda de los marcadores de un `kf-map`: un glifo con la misma forma, tono e
1852
+ * ícono que el marcador (los resuelve `resolveMarkerVisual`, el mismo que usa
1853
+ * `kf-map`, y comparten la hoja de tonos) y el texto que lo explica. El glifo es
1854
+ * decorativo: lo que identifica a cada marcador es la forma, el ícono y el
1855
+ * texto, nunca solo el color.
1856
+ *
1857
+ * Con `interactive` cada ítem es un botón conmutable (`aria-pressed`) que emite
1858
+ * `itemToggle` con su `id`; sin él es una lista de solo lectura. Con `floating`
1859
+ * toma la superficie de una leyenda superpuesta al mapa (fondo y sombra); la
1860
+ * posición la decide quien la usa. Sin ítems no dibuja nada.
1861
+ *
1862
+ * Los botones son `<button>` nativos: cada uno es una píldora con un glifo con la
1863
+ * forma del marcador, que `kf-button` y `kf-chip` no pueden representar.
1864
+ *
1865
+ * <kf-map-legend ariaLabel="Leyenda del mapa" interactive
1866
+ * [items]="[{ id: 'client', label: 'Unidad del cliente', shape: 'pin', tone: 'warn' }]"
1867
+ * (itemToggle)="alternar($event)" />
1868
+ */
1869
+ class MapLegend {
1870
+ items = input.required(/* @ts-ignore */
1871
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
1872
+ interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1873
+ floating = input(false, { ...(ngDevMode ? { debugName: "floating" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1874
+ ariaLabel = input.required(/* @ts-ignore */
1875
+ ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1876
+ /** `id` del ítem pulsado. */
1877
+ itemToggle = output();
1878
+ entries = computed(() => this.items().map((item) => ({ ...item, visual: resolveMarkerVisual(item) })), /* @ts-ignore */
1879
+ ...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
1880
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: MapLegend, deps: [], target: i0.ɵɵFactoryTarget.Component });
1881
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: MapLegend, isStandalone: true, selector: "kf-map-legend", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, floating: { classPropertyName: "floating", publicName: "floating", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { itemToggle: "itemToggle" }, ngImport: i0, template: "<ng-template #glyph let-visual>\n <span\n class=\"kf-map-legend__glyph\"\n [class]=\"'kf-map-legend__glyph kf-map-legend__glyph--' + visual.tone\"\n [class.kf-map-legend__glyph--pin]=\"visual.shape === 'pin'\"\n aria-hidden=\"true\"\n >\n @if (visual.shape === 'pin') {\n <span class=\"kf-map-legend__pin\"></span>\n }\n <kf-icon [name]=\"visual.icon\" size=\"sm\" />\n </span>\n</ng-template>\n\n@if (entries().length > 0) {\n <ul\n class=\"kf-map-legend\"\n [class.kf-map-legend--floating]=\"floating()\"\n [attr.aria-label]=\"ariaLabel()\"\n >\n @for (item of entries(); track item.id) {\n <li class=\"kf-map-legend__item\">\n @if (interactive()) {\n <button\n type=\"button\"\n class=\"kf-map-legend__key kf-map-legend__key--interactive\"\n [attr.aria-pressed]=\"item.pressed === true\"\n (click)=\"itemToggle.emit(item.id)\"\n >\n <ng-container *ngTemplateOutlet=\"glyph; context: { $implicit: item.visual }\" />\n <span class=\"kf-map-legend__label\">{{ item.label }}</span>\n </button>\n } @else {\n <span class=\"kf-map-legend__key\">\n <ng-container *ngTemplateOutlet=\"glyph; context: { $implicit: item.visual }\" />\n <span class=\"kf-map-legend__label\">{{ item.label }}</span>\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [".kf-map__marker--neutral,.kf-map__marker-popup-tone--neutral,.kf-map-legend__glyph--neutral{--kf-map-tone-bg: var(--kf-color-gray-700)}.kf-map__marker--ok,.kf-map__marker-popup-tone--ok,.kf-map-legend__glyph--ok{--kf-map-tone-bg: var(--kf-color-success)}.kf-map__marker--warn,.kf-map__marker-popup-tone--warn,.kf-map-legend__glyph--warn{--kf-map-tone-bg: var(--kf-color-warning)}.kf-map__marker--error,.kf-map__marker-popup-tone--error,.kf-map-legend__glyph--error{--kf-map-tone-bg: var(--kf-color-error)}.kf-map__marker--info,.kf-map__marker-popup-tone--info,.kf-map-legend__glyph--info{--kf-map-tone-bg: var(--kf-color-info)}.kf-map__marker--service,.kf-map__marker-popup-tone--service,.kf-map-legend__glyph--service{--kf-map-tone-bg: var(--kf-color-secondary)}.kf-map__marker-pin,.kf-map-legend__pin{position:absolute;inset:0;box-sizing:border-box;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--kf-map-tone-bg, var(--kf-color-gray-700))}:host{display:block;min-width:0}.kf-map-legend{display:flex;flex-wrap:wrap;gap:var(--kf-space-xs) var(--kf-space-md);margin:0;padding:0;list-style:none;font-size:var(--kf-font-size-caption);color:var(--kf-color-text)}.kf-map-legend--floating{padding:var(--kf-space-xs) var(--kf-space-sm);border-radius:var(--kf-radius-sm);background:color-mix(in srgb,var(--kf-color-white) 94%,transparent);box-shadow:var(--kf-shadow-sm)}.kf-map-legend__item{display:flex;min-width:0}.kf-map-legend__key{display:inline-flex;align-items:center;gap:var(--kf-space-xs);min-width:0;font:inherit;color:inherit}.kf-map-legend__key--interactive{min-height:max(28px,var(--kf-control-min-height, 0px));padding:2px var(--kf-space-sm) 2px 2px;border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-pill);background:var(--kf-color-white);font-weight:var(--kf-font-weight-medium);cursor:pointer}.kf-map-legend__key--interactive:hover{background:var(--kf-color-surface)}.kf-map-legend__key--interactive[aria-pressed=true]{border-color:var(--kf-color-ink);background:var(--kf-color-surface);color:var(--kf-color-ink);box-shadow:inset 0 0 0 1px var(--kf-color-ink)}.kf-map-legend__key--interactive:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map-legend__key--interactive[aria-pressed=true]:focus-visible{box-shadow:inset 0 0 0 1px var(--kf-color-ink),var(--kf-shadow-focus)}.kf-map-legend__glyph{position:relative;display:grid;flex:none;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--kf-map-tone-bg, var(--kf-color-gray-700));color:var(--kf-color-white)}.kf-map-legend__glyph--pin{background:transparent}.kf-map-legend__glyph>kf-icon{position:relative;z-index:1}.kf-map-legend__label{min-width:0;overflow-wrap:anywhere;text-align:start}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1882
+ }
1883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: MapLegend, decorators: [{
1884
+ type: Component,
1885
+ args: [{ selector: 'kf-map-legend', imports: [Icon, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #glyph let-visual>\n <span\n class=\"kf-map-legend__glyph\"\n [class]=\"'kf-map-legend__glyph kf-map-legend__glyph--' + visual.tone\"\n [class.kf-map-legend__glyph--pin]=\"visual.shape === 'pin'\"\n aria-hidden=\"true\"\n >\n @if (visual.shape === 'pin') {\n <span class=\"kf-map-legend__pin\"></span>\n }\n <kf-icon [name]=\"visual.icon\" size=\"sm\" />\n </span>\n</ng-template>\n\n@if (entries().length > 0) {\n <ul\n class=\"kf-map-legend\"\n [class.kf-map-legend--floating]=\"floating()\"\n [attr.aria-label]=\"ariaLabel()\"\n >\n @for (item of entries(); track item.id) {\n <li class=\"kf-map-legend__item\">\n @if (interactive()) {\n <button\n type=\"button\"\n class=\"kf-map-legend__key kf-map-legend__key--interactive\"\n [attr.aria-pressed]=\"item.pressed === true\"\n (click)=\"itemToggle.emit(item.id)\"\n >\n <ng-container *ngTemplateOutlet=\"glyph; context: { $implicit: item.visual }\" />\n <span class=\"kf-map-legend__label\">{{ item.label }}</span>\n </button>\n } @else {\n <span class=\"kf-map-legend__key\">\n <ng-container *ngTemplateOutlet=\"glyph; context: { $implicit: item.visual }\" />\n <span class=\"kf-map-legend__label\">{{ item.label }}</span>\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [".kf-map__marker--neutral,.kf-map__marker-popup-tone--neutral,.kf-map-legend__glyph--neutral{--kf-map-tone-bg: var(--kf-color-gray-700)}.kf-map__marker--ok,.kf-map__marker-popup-tone--ok,.kf-map-legend__glyph--ok{--kf-map-tone-bg: var(--kf-color-success)}.kf-map__marker--warn,.kf-map__marker-popup-tone--warn,.kf-map-legend__glyph--warn{--kf-map-tone-bg: var(--kf-color-warning)}.kf-map__marker--error,.kf-map__marker-popup-tone--error,.kf-map-legend__glyph--error{--kf-map-tone-bg: var(--kf-color-error)}.kf-map__marker--info,.kf-map__marker-popup-tone--info,.kf-map-legend__glyph--info{--kf-map-tone-bg: var(--kf-color-info)}.kf-map__marker--service,.kf-map__marker-popup-tone--service,.kf-map-legend__glyph--service{--kf-map-tone-bg: var(--kf-color-secondary)}.kf-map__marker-pin,.kf-map-legend__pin{position:absolute;inset:0;box-sizing:border-box;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--kf-map-tone-bg, var(--kf-color-gray-700))}:host{display:block;min-width:0}.kf-map-legend{display:flex;flex-wrap:wrap;gap:var(--kf-space-xs) var(--kf-space-md);margin:0;padding:0;list-style:none;font-size:var(--kf-font-size-caption);color:var(--kf-color-text)}.kf-map-legend--floating{padding:var(--kf-space-xs) var(--kf-space-sm);border-radius:var(--kf-radius-sm);background:color-mix(in srgb,var(--kf-color-white) 94%,transparent);box-shadow:var(--kf-shadow-sm)}.kf-map-legend__item{display:flex;min-width:0}.kf-map-legend__key{display:inline-flex;align-items:center;gap:var(--kf-space-xs);min-width:0;font:inherit;color:inherit}.kf-map-legend__key--interactive{min-height:max(28px,var(--kf-control-min-height, 0px));padding:2px var(--kf-space-sm) 2px 2px;border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-pill);background:var(--kf-color-white);font-weight:var(--kf-font-weight-medium);cursor:pointer}.kf-map-legend__key--interactive:hover{background:var(--kf-color-surface)}.kf-map-legend__key--interactive[aria-pressed=true]{border-color:var(--kf-color-ink);background:var(--kf-color-surface);color:var(--kf-color-ink);box-shadow:inset 0 0 0 1px var(--kf-color-ink)}.kf-map-legend__key--interactive:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-map-legend__key--interactive[aria-pressed=true]:focus-visible{box-shadow:inset 0 0 0 1px var(--kf-color-ink),var(--kf-shadow-focus)}.kf-map-legend__glyph{position:relative;display:grid;flex:none;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--kf-map-tone-bg, var(--kf-color-gray-700));color:var(--kf-color-white)}.kf-map-legend__glyph--pin{background:transparent}.kf-map-legend__glyph>kf-icon{position:relative;z-index:1}.kf-map-legend__label{min-width:0;overflow-wrap:anywhere;text-align:start}\n"] }]
1886
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], floating: [{ type: i0.Input, args: [{ isSignal: true, alias: "floating", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }], itemToggle: [{ type: i0.Output, args: ["itemToggle"] }] } });
1602
1887
 
1603
1888
  /*
1604
1889
  * Public API Surface of ui/map — entry point secundario, `@kaufmann-lab/ui/map`.
@@ -1652,5 +1937,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
1652
1937
  * Generated bundle index. Do not edit.
1653
1938
  */
1654
1939
 
1655
- export { MAP_CONFIG, MapControls, MapView, STYLE_BY_THEME, THEME_LABEL, THEME_ORDER, provideMapConfig };
1940
+ export { MAP_CONFIG, MapControls, MapLegend, MapView, STYLE_BY_THEME, THEME_LABEL, THEME_ORDER, provideMapConfig };
1656
1941
  //# sourceMappingURL=kaufmann-lab-ui-map.mjs.map