@aceshooting/lyra-ui 18.1.0 → 18.2.0

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,6 +1,11 @@
1
1
  import{type TemplateResult,type PropertyValues}from'lit';import type{Feature,FeatureCollection}from'geojson';import{LyraElement}from'../../../internal/lyra-element.js';import{type MapLibreGeoJsonDiff}from'./map-loader.js';import'../../overlays/skeleton/skeleton.class.js';
2
2
  /** Non-color encoding retained when a legend entry's authored color is unavailable. */
3
3
  export type LyraMapLegendPattern='solid'|'diagonal'|'dots'|'crosshatch';
4
+ /**
5
+ * Presentation role for each keyed `legendInteractive` row's toggle control. See the
6
+ * `legendControlRole` property JSDoc for the full contract.
7
+ */
8
+ export type LyraMapLegendControlRole='button'|'checkbox';
4
9
  /** One immutable, bounded map-legend row. Pattern is required so color is never the sole cue. */
5
10
  export interface LyraMapLegendEntry{readonly color:string;readonly label:string;readonly pattern:LyraMapLegendPattern;
6
11
  /**
@@ -632,7 +637,29 @@ get legendProjection():LyraMapLegendProjection;
632
637
  * 100-series `lr-chart` legend does. Each row also grows to the `--lr-icon-button-size` hit-area
633
638
  * floor; the legend panel's own `max-block-size`/`overflow: auto` contains the taller list.
634
639
  */
635
- legendInteractive:boolean;
640
+ legendInteractive:boolean;private _legendControlRole;
641
+ /**
642
+ * How each keyed `legendInteractive` row's toggle control presents itself to assistive tech.
643
+ * Inert while `legendInteractive` is unset, exactly like the toggle itself.
644
+ *
645
+ * - `'button'` (default) -- `<button aria-pressed>`, byte-identical to every 18.1.0 interactive
646
+ * legend. Leaving this property unset changes nothing.
647
+ * - `'checkbox'` -- the SAME `<button>` element `renderLegendRow()` already renders, with its
648
+ * implicit role overridden to `role="checkbox"` and `aria-checked` in place of `aria-pressed`.
649
+ * A native `<input type="checkbox">` was considered and rejected: it would need its own
650
+ * swatch/label markup and its own click/keyboard wiring duplicated from the button branch,
651
+ * splitting `renderLegendRowContent()` in two. `<button role="checkbox">` keeps the swatch,
652
+ * the label, the click handler and the platform's own Enter/Space activation exactly as they
653
+ * are for the button branch -- only the two ARIA attributes differ, so the CSS in
654
+ * `map.styles.ts` (which targets `button[part~='legend-toggle']`, never a role or an ARIA
655
+ * state) needs no `'checkbox'`-specific rule.
656
+ *
657
+ * `aria-checked` tracks the same `visible` flag `aria-pressed` does, inverted from
658
+ * `hiddenCategories`: a hidden category renders `aria-checked="false"`. Both states always
659
+ * render explicitly (`"true"`/`"false"`), never a Lit `?aria-*` presence directive, which cannot
660
+ * express the false state at all.
661
+ */
662
+ get legendControlRole():LyraMapLegendControlRole;set legendControlRole(next:LyraMapLegendControlRole);
636
663
  /**
637
664
  * Renders a disclosure button inside the legend panel that collapses the key down to its header.
638
665
  * Default `false`, and an unset map renders exactly the panel it rendered before this property
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LyraElement}from"../../../internal/lyra-element.js";import{getOwnDataDescriptor,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";import{trueDefaultBooleanConverter}from"../../../internal/converters.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{chevronIcon}from"../../../internal/icons.js";import{sanitizeCssColor}from"../../../internal/safe-css.js";import{finiteRange}from"../../../internal/numbers.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{notifyMapCanvasReady}from"../../../internal/map-canvas-ready.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{srOnly}from"../../../internal/a11y.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{loadMaplibre}from"./map-loader.js";import{styles}from"./map.styles.js";import"../../overlays/skeleton/skeleton.class.js";import{LYRA_DEFAULT_close,LYRA_DEFAULT_items,LYRA_DEFAULT_legendTypeHidden,LYRA_DEFAULT_legendTypeShown,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_mapInitializationFailed,LYRA_DEFAULT_mapLegend,LYRA_DEFAULT_mapMissingLibrary,LYRA_DEFAULT_mapResetNorth,LYRA_DEFAULT_mapStyleRequired,LYRA_DEFAULT_mapWebglUnavailable,LYRA_DEFAULT_paginationSummary,LYRA_DEFAULT_zoomIn,LYRA_DEFAULT_zoomOut}from"../../../internal/default-strings.generated.js";function supportsWebGL2(host){try{const context=host.ownerDocument.createElement("canvas").getContext("webgl2");if(!context)return!1;try{context.getExtension("WEBGL_lose_context")?.loseContext()}catch{}return!0}catch{return!1}}function hasMapStyle(style){return typeof style=="string"?style.trim().length>0:style!==void 0}const MAX_MAP_LEGEND_GRADIENT_STOPS=64;function isRuntimeArray(value){try{return Array.isArray(value)}catch{return!1}}function isRuntimeRecord(value){try{return value!==null&&typeof value=="object"&&!Array.isArray(value)}catch{return!1}}function boundedOwnArrayLength(value,limit){if(!isRuntimeArray(value))return;const descriptor=getOwnDataDescriptor(value,"length");if(!(descriptor===MISSING_OWN_DATA_DESCRIPTOR||descriptor===UNSAFE_OWN_DATA_DESCRIPTOR||typeof descriptor.value!="number"||!Number.isSafeInteger(descriptor.value)||descriptor.value<0))return Math.min(descriptor.value,limit)}function ownDataValue(value,property2){return getOwnDataDescriptor(value,property2)}function isUnsafeDescriptor(descriptor){return descriptor===UNSAFE_OWN_DATA_DESCRIPTOR}function optionalDescriptorValue(descriptor){return descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor)?void 0:descriptor.value}function normalizeMapLegendGradient(value){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_LEGEND_GRADIENT_STOPS);if(scanCount===void 0)return[];const usable=[];for(let index=0;index<scanCount;index+=1){const stopDescriptor=ownDataValue(value,String(index));if(stopDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(stopDescriptor))continue;const stop=stopDescriptor.value,stopLength=boundedOwnArrayLength(stop,2);if(stopLength===void 0||stopLength<2)continue;const valueDescriptor=ownDataValue(stop,"0"),colorDescriptor=ownDataValue(stop,"1");if(valueDescriptor===MISSING_OWN_DATA_DESCRIPTOR||colorDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(valueDescriptor)||isUnsafeDescriptor(colorDescriptor)||typeof valueDescriptor.value!="number"||!Number.isFinite(valueDescriptor.value)||typeof colorDescriptor.value!="string")continue;const color=sanitizeCssColor(colorDescriptor.value);color&&usable.push([valueDescriptor.value,color])}return usable.length<2?[]:Object.freeze([...usable].sort((a,b)=>a[0]-b[0]))}catch{return[]}}const MAP_LEGEND_ITEM_LIMIT=100,MAP_LEGEND_SCAN_LIMIT=1e3,MAP_LEGEND_LABEL_LIMIT=256,MAP_LEGEND_TOTAL_LABEL_LIMIT=8192,MAP_LEGEND_COLOR_LIMIT=256,MAP_LEGEND_VALUE_LIMIT=256,MAP_LEGEND_PATTERNS=new Set(["solid","diagonal","dots","crosshatch"]),EMPTY_MAP_LEGEND=Object.freeze([]),EMPTY_MAP_LEGEND_PROJECTION=Object.freeze({inputCount:0,renderedCount:0,omittedCount:0,truncatedLabelCount:0,truncated:!1});function boundedLegendText(value,limit){return value.length<=limit?value:`${value.slice(0,Math.max(0,limit-1))}…`}function normalizeMapLegend(value){let input;try{input=Array.isArray(value)?value:[]}catch{input=[]}let inputCount=0;try{inputCount=Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,input.length))}catch{inputCount=0}const entries=[];let labelCharacters=0,truncatedLabelCount=0;const scanCount=Math.min(inputCount,MAP_LEGEND_SCAN_LIMIT);for(let index=0;index<scanCount&&entries.length<MAP_LEGEND_ITEM_LIMIT;index++)try{const candidate=input[index];if(!candidate||typeof candidate!="object")continue;const rawColor=candidate.color,rawLabel=candidate.label,rawPattern=candidate.pattern;if(typeof rawColor!="string"||typeof rawLabel!="string"||typeof rawPattern!="string"||!MAP_LEGEND_PATTERNS.has(rawPattern))continue;const remaining=MAP_LEGEND_TOTAL_LABEL_LIMIT-labelCharacters;if(remaining<=0)break;const labelLimit=Math.min(MAP_LEGEND_LABEL_LIMIT,remaining),label=boundedLegendText(rawLabel,labelLimit);if(!label.trim())continue;rawLabel.length>labelLimit&&truncatedLabelCount++,labelCharacters+=label.length;const rawValue=candidate.value,trimmedValue=typeof rawValue=="string"?rawValue.trim():"",value2=trimmedValue?trimmedValue.slice(0,MAP_LEGEND_VALUE_LIMIT):void 0,rawGroup=candidate.group,trimmedGroup=typeof rawGroup=="string"?rawGroup.trim():"",group=trimmedGroup?boundedLegendText(trimmedGroup,MAP_LEGEND_LABEL_LIMIT):void 0,rawIcon=candidate.icon,icon=isRuntimeRecord(rawIcon)?projectIconPaint(rawIcon):void 0;entries.push(Object.freeze({color:rawColor.slice(0,MAP_LEGEND_COLOR_LIMIT),label,pattern:rawPattern,...value2?{value:value2}:{},...group?{group}:{},...icon?{icon}:{}}))}catch{}const frozenEntries=entries.length?Object.freeze(entries):EMPTY_MAP_LEGEND,omittedCount=Math.max(0,inputCount-frozenEntries.length),projection=Object.freeze({inputCount,renderedCount:frozenEntries.length,omittedCount,truncatedLabelCount,truncated:omittedCount>0||truncatedLabelCount>0});return{entries:frozenEntries,projection,grouped:frozenEntries.some(entry=>entry.group!==void 0)}}const EMPTY_HIDDEN_CATEGORIES=Object.freeze([]);function normalizeMapHiddenCategories(value){let input,length=0;try{input=Array.isArray(value)?value:[],length=Math.max(0,Math.min(MAP_LEGEND_SCAN_LIMIT,input.length))}catch{return EMPTY_HIDDEN_CATEGORIES}const keys=[];for(let index=0;index<length&&keys.length<MAP_LEGEND_ITEM_LIMIT;index++)try{const candidate=input[index];if(typeof candidate!="string")continue;const key=candidate.trim().slice(0,MAP_LEGEND_VALUE_LIMIT);if(!key||keys.includes(key))continue;keys.push(key)}catch{}return keys.length?Object.freeze(keys):EMPTY_HIDDEN_CATEGORIES}function renderLegendIcon(icon){const[x,y,width,height]=icon.viewBox??DEFAULT_ICON_VIEW_BOX,mode=icon.mode??"fill";return html`<svg
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LyraElement}from"../../../internal/lyra-element.js";import{getOwnDataDescriptor,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";import{literalSetConverter,trueDefaultBooleanConverter}from"../../../internal/converters.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{chevronIcon}from"../../../internal/icons.js";import{sanitizeCssColor}from"../../../internal/safe-css.js";import{finiteRange}from"../../../internal/numbers.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{notifyMapCanvasReady}from"../../../internal/map-canvas-ready.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{srOnly}from"../../../internal/a11y.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{loadMaplibre}from"./map-loader.js";import{styles}from"./map.styles.js";import"../../overlays/skeleton/skeleton.class.js";import{LYRA_DEFAULT_close,LYRA_DEFAULT_items,LYRA_DEFAULT_legendTypeHidden,LYRA_DEFAULT_legendTypeShown,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_mapInitializationFailed,LYRA_DEFAULT_mapLegend,LYRA_DEFAULT_mapMissingLibrary,LYRA_DEFAULT_mapResetNorth,LYRA_DEFAULT_mapStyleRequired,LYRA_DEFAULT_mapWebglUnavailable,LYRA_DEFAULT_paginationSummary,LYRA_DEFAULT_zoomIn,LYRA_DEFAULT_zoomOut}from"../../../internal/default-strings.generated.js";function supportsWebGL2(host){try{const context=host.ownerDocument.createElement("canvas").getContext("webgl2");if(!context)return!1;try{context.getExtension("WEBGL_lose_context")?.loseContext()}catch{}return!0}catch{return!1}}function hasMapStyle(style){return typeof style=="string"?style.trim().length>0:style!==void 0}const LEGEND_CONTROL_ROLE=literalSetConverter(["button","checkbox"],"button"),MAX_MAP_LEGEND_GRADIENT_STOPS=64;function isRuntimeArray(value){try{return Array.isArray(value)}catch{return!1}}function isRuntimeRecord(value){try{return value!==null&&typeof value=="object"&&!Array.isArray(value)}catch{return!1}}function boundedOwnArrayLength(value,limit){if(!isRuntimeArray(value))return;const descriptor=getOwnDataDescriptor(value,"length");if(!(descriptor===MISSING_OWN_DATA_DESCRIPTOR||descriptor===UNSAFE_OWN_DATA_DESCRIPTOR||typeof descriptor.value!="number"||!Number.isSafeInteger(descriptor.value)||descriptor.value<0))return Math.min(descriptor.value,limit)}function ownDataValue(value,property2){return getOwnDataDescriptor(value,property2)}function isUnsafeDescriptor(descriptor){return descriptor===UNSAFE_OWN_DATA_DESCRIPTOR}function optionalDescriptorValue(descriptor){return descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor)?void 0:descriptor.value}function normalizeMapLegendGradient(value){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_LEGEND_GRADIENT_STOPS);if(scanCount===void 0)return[];const usable=[];for(let index=0;index<scanCount;index+=1){const stopDescriptor=ownDataValue(value,String(index));if(stopDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(stopDescriptor))continue;const stop=stopDescriptor.value,stopLength=boundedOwnArrayLength(stop,2);if(stopLength===void 0||stopLength<2)continue;const valueDescriptor=ownDataValue(stop,"0"),colorDescriptor=ownDataValue(stop,"1");if(valueDescriptor===MISSING_OWN_DATA_DESCRIPTOR||colorDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(valueDescriptor)||isUnsafeDescriptor(colorDescriptor)||typeof valueDescriptor.value!="number"||!Number.isFinite(valueDescriptor.value)||typeof colorDescriptor.value!="string")continue;const color=sanitizeCssColor(colorDescriptor.value);color&&usable.push([valueDescriptor.value,color])}return usable.length<2?[]:Object.freeze([...usable].sort((a,b)=>a[0]-b[0]))}catch{return[]}}const MAP_LEGEND_ITEM_LIMIT=100,MAP_LEGEND_SCAN_LIMIT=1e3,MAP_LEGEND_LABEL_LIMIT=256,MAP_LEGEND_TOTAL_LABEL_LIMIT=8192,MAP_LEGEND_COLOR_LIMIT=256,MAP_LEGEND_VALUE_LIMIT=256,MAP_LEGEND_PATTERNS=new Set(["solid","diagonal","dots","crosshatch"]),EMPTY_MAP_LEGEND=Object.freeze([]),EMPTY_MAP_LEGEND_PROJECTION=Object.freeze({inputCount:0,renderedCount:0,omittedCount:0,truncatedLabelCount:0,truncated:!1});function boundedLegendText(value,limit){return value.length<=limit?value:`${value.slice(0,Math.max(0,limit-1))}…`}function normalizeMapLegend(value){let input;try{input=Array.isArray(value)?value:[]}catch{input=[]}let inputCount=0;try{inputCount=Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,input.length))}catch{inputCount=0}const entries=[];let labelCharacters=0,truncatedLabelCount=0;const scanCount=Math.min(inputCount,MAP_LEGEND_SCAN_LIMIT);for(let index=0;index<scanCount&&entries.length<MAP_LEGEND_ITEM_LIMIT;index++)try{const candidate=input[index];if(!candidate||typeof candidate!="object")continue;const rawColor=candidate.color,rawLabel=candidate.label,rawPattern=candidate.pattern;if(typeof rawColor!="string"||typeof rawLabel!="string"||typeof rawPattern!="string"||!MAP_LEGEND_PATTERNS.has(rawPattern))continue;const remaining=MAP_LEGEND_TOTAL_LABEL_LIMIT-labelCharacters;if(remaining<=0)break;const labelLimit=Math.min(MAP_LEGEND_LABEL_LIMIT,remaining),label=boundedLegendText(rawLabel,labelLimit);if(!label.trim())continue;rawLabel.length>labelLimit&&truncatedLabelCount++,labelCharacters+=label.length;const rawValue=candidate.value,trimmedValue=typeof rawValue=="string"?rawValue.trim():"",value2=trimmedValue?trimmedValue.slice(0,MAP_LEGEND_VALUE_LIMIT):void 0,rawGroup=candidate.group,trimmedGroup=typeof rawGroup=="string"?rawGroup.trim():"",group=trimmedGroup?boundedLegendText(trimmedGroup,MAP_LEGEND_LABEL_LIMIT):void 0,rawIcon=candidate.icon,icon=isRuntimeRecord(rawIcon)?projectIconPaint(rawIcon):void 0;entries.push(Object.freeze({color:rawColor.slice(0,MAP_LEGEND_COLOR_LIMIT),label,pattern:rawPattern,...value2?{value:value2}:{},...group?{group}:{},...icon?{icon}:{}}))}catch{}const frozenEntries=entries.length?Object.freeze(entries):EMPTY_MAP_LEGEND,omittedCount=Math.max(0,inputCount-frozenEntries.length),projection=Object.freeze({inputCount,renderedCount:frozenEntries.length,omittedCount,truncatedLabelCount,truncated:omittedCount>0||truncatedLabelCount>0});return{entries:frozenEntries,projection,grouped:frozenEntries.some(entry=>entry.group!==void 0)}}const EMPTY_HIDDEN_CATEGORIES=Object.freeze([]);function normalizeMapHiddenCategories(value){let input,length=0;try{input=Array.isArray(value)?value:[],length=Math.max(0,Math.min(MAP_LEGEND_SCAN_LIMIT,input.length))}catch{return EMPTY_HIDDEN_CATEGORIES}const keys=[];for(let index=0;index<length&&keys.length<MAP_LEGEND_ITEM_LIMIT;index++)try{const candidate=input[index];if(typeof candidate!="string")continue;const key=candidate.trim().slice(0,MAP_LEGEND_VALUE_LIMIT);if(!key||keys.includes(key))continue;keys.push(key)}catch{}return keys.length?Object.freeze(keys):EMPTY_HIDDEN_CATEGORIES}function renderLegendIcon(icon){const[x,y,width,height]=icon.viewBox??DEFAULT_ICON_VIEW_BOX,mode=icon.mode??"fill";return html`<svg
2
2
  class="legend-icon"
3
3
  viewBox=${`${x} ${y} ${width} ${height}`}
4
4
  focusable="false"
@@ -9,7 +9,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
9
9
  stroke-width=${icon.strokeWidth??DEFAULT_ICON_STROKE_WIDTH}
10
10
  stroke-linecap=${icon.lineCap??"round"}
11
11
  stroke-linejoin=${icon.lineJoin??"round"}
12
- ></path></svg>`}function addPartToken(element,token){const tokens=new Set((element.getAttribute("part")??"").split(/\s+/).filter(Boolean));tokens.add(token),element.setAttribute("part",[...tokens].join(" "))}const CHOROPLETH_LOG_INTERPOLATION_BASE=.25,CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL=8;function choroplethLogInterpolationFactor(input,lower,upper){const difference=upper-lower;if(difference===0)return 0;const progress=input-lower;return(Math.pow(CHOROPLETH_LOG_INTERPOLATION_BASE,progress)-1)/(Math.pow(CHOROPLETH_LOG_INTERPOLATION_BASE,difference)-1)}function compactGradientPercent(value){return String(Math.round(Math.min(100,Math.max(0,value))*1e4)/1e4)}function choroplethLegendGradientImage(stops,interpolation){const lo=stops[0],span=stops[stops.length-1][0]-lo[0],stopPercent=(value,index)=>span>0?(value-lo[0])/span*100:index/(stops.length-1)*100;if(interpolation!=="logarithmic"||span<=0)return`linear-gradient(to right, ${stops.map(([value,color],index)=>`${color} ${compactGradientPercent(stopPercent(value,index))}%`).join(", ")})`;const image=[`${lo[1]} 0%`];for(let index=1;index<stops.length;index+=1){const lower=stops[index-1],upper=stops[index],interval=upper[0]-lower[0];if(interval<=0){image.push(`${upper[1]} ${compactGradientPercent(stopPercent(upper[0],index))}%`);continue}for(let sample=1;sample<=CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL;sample+=1){const intervalProgress=sample/CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL,input=lower[0]+interval*intervalProgress,position=(input-lo[0])/span*100;if(sample===CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL){image.push(`${upper[1]} ${compactGradientPercent(position)}%`);continue}const factor=Math.min(1,Math.max(0,choroplethLogInterpolationFactor(input,lower[0],upper[0]))),lowerWeight=compactGradientPercent((1-factor)*100),upperWeight=compactGradientPercent(factor*100);image.push(`color-mix(in srgb, ${lower[1]} ${lowerWeight}%, ${upper[1]} ${upperWeight}%) ${compactGradientPercent(position)}%`)}}return`linear-gradient(to right, ${image.join(", ")})`}const MAX_MAP_MARKERS=2e3;function popupText(host,markup){const template=host.ownerDocument.createElement("template");template.innerHTML=markup;for(const hidden of template.content.querySelectorAll('script, style, template, [hidden], [aria-hidden="true"]'))hidden.remove();return(template.content.textContent??"").replace(/\s+/gu," ").trim()}function markerPopupText(host,markup){return typeof markup=="string"&&markup?popupText(host,markup):""}const MAX_MAP_DATA_LAYERS=100,EMPTY_CANONICAL_MAP_DATA_LAYERS=Object.freeze([]);function mapTone(value){switch(value){case"accent":case"success":case"warning":case"danger":case"neutral":return value;default:return}}function projectMapDataLayer(value){try{if(!isRuntimeRecord(value))return;const sourceIdDescriptor=ownDataValue(value,"sourceId"),geojsonDescriptor=ownDataValue(value,"geojson"),toneDescriptor=ownDataValue(value,"tone"),colorDescriptor=ownDataValue(value,"color"),strokeColorDescriptor=ownDataValue(value,"strokeColor"),lineDescriptor=ownDataValue(value,"line"),kindDescriptor=ownDataValue(value,"kind"),heatmapDescriptor=ownDataValue(value,"heatmap"),clusterDescriptor=ownDataValue(value,"cluster");if(sourceIdDescriptor===MISSING_OWN_DATA_DESCRIPTOR||geojsonDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(sourceIdDescriptor)||isUnsafeDescriptor(geojsonDescriptor))return;const sourceId=sourceIdDescriptor.value,geojson=geojsonDescriptor.value;if(typeof sourceId!="string"||sourceId.trim().length===0||!isRuntimeRecord(geojson))return;const optionalValue=descriptor=>descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor)?void 0:descriptor.value,tone=mapTone(optionalValue(toneDescriptor)),colorValue=optionalValue(colorDescriptor),strokeColorValue=optionalValue(strokeColorDescriptor),kindValue=optionalValue(kindDescriptor),heatmapValue=optionalValue(heatmapDescriptor),clusterValue=optionalValue(clusterDescriptor),kind=kindValue==="heatmap"?"heatmap":"auto";return Object.freeze({sourceId:sourceId.trim(),geojson,geojsonProjection:projectGeoJson(geojson),tone,color:typeof colorValue=="string"?colorValue:void 0,strokeColor:typeof strokeColorValue=="string"?strokeColorValue:void 0,line:kind==="auto"?projectLineOptions(optionalValue(lineDescriptor)):void 0,point:kind==="auto"?projectPointOptions(optionalDescriptorValue(ownDataValue(value,"point"))):void 0,kind,heatmap:kind==="heatmap"?projectHeatmapOptions(heatmapValue):void 0,cluster:kind==="auto"?normalizedClusterOptions(clusterValue):void 0})}catch{return}}function projectMapDataLayers(value){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_DATA_LAYERS);if(scanCount===void 0)return EMPTY_CANONICAL_MAP_DATA_LAYERS;const output=[],seenSourceIds=new Set;for(let index=0;index<scanCount;index+=1){const descriptor=ownDataValue(value,String(index));if(descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor))continue;const layer=projectMapDataLayer(descriptor.value);!layer||seenSourceIds.has(layer.sourceId)||(seenSourceIds.add(layer.sourceId),output.push(layer))}return output.length?Object.freeze(output):EMPTY_CANONICAL_MAP_DATA_LAYERS}catch{return EMPTY_CANONICAL_MAP_DATA_LAYERS}}const DATA_LAYER_SUFFIXES=["-fill","-line","-circle","-point-icon","-cluster","-cluster-count","-heatmap"],QUERYABLE_DATA_LAYER_SUFFIXES=["-fill","-line","-circle","-cluster","-point-icon"],MAX_MAP_STEP_STOPS=32;function normalizedSteps(value,isOutput,clampThreshold=threshold=>threshold){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_STEP_STOPS);if(scanCount===void 0)return Object.freeze([]);const usable=[];for(let index=0;index<scanCount;index+=1){const stopDescriptor=ownDataValue(value,String(index));if(stopDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(stopDescriptor))continue;const stop=stopDescriptor.value,stopLength=boundedOwnArrayLength(stop,2);if(stopLength===void 0||stopLength<2)continue;const thresholdDescriptor=ownDataValue(stop,"0"),outputDescriptor=ownDataValue(stop,"1");thresholdDescriptor===MISSING_OWN_DATA_DESCRIPTOR||outputDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(thresholdDescriptor)||isUnsafeDescriptor(outputDescriptor)||typeof thresholdDescriptor.value!="number"||!Number.isFinite(thresholdDescriptor.value)||!isOutput(outputDescriptor.value)||usable.push([clampThreshold(thresholdDescriptor.value),outputDescriptor.value])}usable.sort((a,b)=>a[0]-b[0]);const deduplicated=usable.filter((stop,index)=>index===0||stop[0]>usable[index-1][0]);return Object.freeze(deduplicated.map(stop=>Object.freeze(stop)))}catch{return Object.freeze([])}}const isFiniteOutput=candidate=>typeof candidate=="number"&&Number.isFinite(candidate),isColorOutput=candidate=>typeof candidate=="string"&&candidate.trim().length>0;function stepExpression(input,stops){const expression=["step",input,stops[0][1]];for(const[threshold,output]of stops)expression.push(threshold,output);return expression}const DEFAULT_CLUSTER_RADIUS=50,DEFAULT_CLUSTER_MAX_ZOOM=14,DEFAULT_CLUSTER_RADIUS_STEPS=Object.freeze([[0,14],[10,18],[50,24]]),DEFAULT_HEATMAP_RADIUS=30,DEFAULT_HEATMAP_INTENSITY=1,HEATMAP_TRANSPARENT="rgba(0, 0, 0, 0)";function withTransparentFloor(stops){return stops.length&&stops[0][0]>0?[[0,HEATMAP_TRANSPARENT],...stops]:stops}const MAX_CLUSTER_COUNT_FONTS=8;function normalizedClusterOptions(value){try{if(!isRuntimeRecord(value))return;const radiusDescriptor=ownDataValue(value,"radius"),maxZoomDescriptor=ownDataValue(value,"maxZoom"),radiusStepsDescriptor=ownDataValue(value,"radiusSteps"),colorStepsDescriptor=ownDataValue(value,"colorSteps"),countFontDescriptor=ownDataValue(value,"countFont"),radiusValue=optionalDescriptorValue(radiusDescriptor),maxZoomValue=optionalDescriptorValue(maxZoomDescriptor),radiusSteps=normalizedSteps(optionalDescriptorValue(radiusStepsDescriptor),isFiniteOutput),colorSteps=normalizedSteps(optionalDescriptorValue(colorStepsDescriptor),isColorOutput),fonts=normalizedClusterFonts(optionalDescriptorValue(countFontDescriptor));return Object.freeze({radius:finiteRange(typeof radiusValue=="number"?radiusValue:Number.NaN,DEFAULT_CLUSTER_RADIUS,1,1e3),maxZoom:finiteRange(typeof maxZoomValue=="number"?maxZoomValue:Number.NaN,DEFAULT_CLUSTER_MAX_ZOOM,0,24),radiusSteps:radiusSteps.length?radiusSteps:DEFAULT_CLUSTER_RADIUS_STEPS,colorSteps,countFont:fonts.length?fonts:void 0})}catch{return}}function normalizedClusterFonts(value){try{const length=boundedOwnArrayLength(value,MAX_CLUSTER_COUNT_FONTS);if(length===void 0)return Object.freeze([]);const fonts=[];for(let index=0;index<length;index+=1){const descriptor=ownDataValue(value,String(index));descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor)||typeof descriptor.value!="string"||descriptor.value.trim().length===0||fonts.push(descriptor.value)}return Object.freeze(fonts)}catch{return Object.freeze([])}}const DEFAULT_ICON_VIEW_BOX=Object.freeze([0,0,24,24]),DEFAULT_ICON_STROKE_WIDTH=2,ICON_PATH_GRAMMAR=/^[MmLlHhVvCcSsQqTtAaZz\d.eE+,\s-]+$/u,MAX_ICON_PATH_LENGTH=8192;function projectIconPaint(row){const path=optionalDescriptorValue(ownDataValue(row,"path"));if(typeof path!="string"||path.length===0||path.length>MAX_ICON_PATH_LENGTH||!ICON_PATH_GRAMMAR.test(path))return;const rawBox=optionalDescriptorValue(ownDataValue(row,"viewBox")),box=[];if(rawBox===void 0)box.push(...DEFAULT_ICON_VIEW_BOX);else{if(boundedOwnArrayLength(rawBox,4)!==4)return;for(let index=0;index<4;index++){const coordinate=optionalDescriptorValue(ownDataValue(rawBox,String(index)));if(typeof coordinate!="number"||!Number.isFinite(coordinate)||Math.abs(coordinate)>1e4)return;box.push(coordinate)}if(box[2]<.001||box[3]<.001)return}const mode=optionalDescriptorValue(ownDataValue(row,"mode")),strokeWidth=optionalDescriptorValue(ownDataValue(row,"strokeWidth")),lineCap=optionalDescriptorValue(ownDataValue(row,"lineCap")),lineJoin=optionalDescriptorValue(ownDataValue(row,"lineJoin"));return Object.freeze({path,viewBox:Object.freeze(box),mode:mode==="stroke"||mode==="fill-stroke"?mode:"fill",strokeWidth:finiteRange(typeof strokeWidth=="number"?strokeWidth:NaN,DEFAULT_ICON_STROKE_WIDTH,0,200),lineCap:lineCap==="butt"||lineCap==="square"?lineCap:"round",lineJoin:lineJoin==="miter"||lineJoin==="bevel"?lineJoin:"round"})}function projectPointRadius(value){if(!isRuntimeRecord(value))return finiteRange(typeof value=="number"?value:NaN,5,0,200);const read=key=>optionalDescriptorValue(ownDataValue(value,key)),field=read("field"),rawFallback=read("fallback"),fallback=finiteRange(typeof rawFallback=="number"?rawFallback:NaN,5,0,200),stops=normalizedSteps(read("stops"),isFiniteOutput).map(([threshold,radius])=>Object.freeze([threshold,finiteRange(radius,5,0,200)]));return typeof field!="string"||!field.trim()||!stops.length?fallback:Object.freeze({field:field.trim(),stops:Object.freeze(stops),fallback,interpolation:read("interpolation")==="linear"?"linear":"step"})}function pointRadiusExpression(radius){if(typeof radius=="number")return radius;const input=["number",["get",radius.field],0];let domainInput=input,stops=radius.stops;if(radius.interpolation==="linear"&&!Number.isFinite(stops.at(-1)[0]-stops[0][0])){if(stops=stops.map(([value,output2])=>[value/2,output2]),stops.some(([value],index)=>index>0&&value<=stops[index-1][0]))return radius.fallback;domainInput=["/",input,2]}const output=stops.length===1?stops[0][1]:radius.interpolation==="linear"?["interpolate",["linear"],domainInput,...stops.flat()]:stepExpression(input,stops);return["case",["all",["==",["typeof",["get",radius.field]],"number"],[">=",input,-Number.MAX_VALUE],["<=",input,Number.MAX_VALUE]],output,radius.fallback]}function projectPointOptions(value){if(!isRuntimeRecord(value))return;const read=key=>optionalDescriptorValue(ownDataValue(value,key)),string=key=>{const candidate=read(key);return typeof candidate=="string"&&candidate.trim()?candidate:void 0},number=(key,fallback,min,max)=>{const candidate=read(key);return finiteRange(typeof candidate=="number"?candidate:NaN,fallback,min,max)},colors=[],icons=[],project=(input,accept)=>{const length=boundedOwnArrayLength(input,MAX_MAP_STEP_STOPS)??0;for(let index=0;index<length;index++){const row=optionalDescriptorValue(ownDataValue(input,String(index)));row!==null&&typeof row=="object"&&accept(row)}};return project(read("colors"),row=>{const key=optionalDescriptorValue(ownDataValue(row,"0")),color=optionalDescriptorValue(ownDataValue(row,"1"));typeof key!="string"||typeof color!="string"||!sanitizeCssColor(color)||colors.some(([existing])=>existing===key)||colors.push(Object.freeze([key,color]))}),project(read("icons"),row=>{const key=optionalDescriptorValue(ownDataValue(row,"value"));if(typeof key!="string"||icons.some(icon=>icon.value===key))return;const paint=projectIconPaint(row);paint&&icons.push(Object.freeze({value:key,...paint}))}),Object.freeze({field:string("field"),colors:Object.freeze(colors),radius:projectPointRadius(read("radius")),strokeWidth:number("strokeWidth",0,0,200),strokeColor:string("strokeColor"),iconField:string("iconField")??string("field"),icons:Object.freeze(icons),iconColor:string("iconColor"),iconSize:number("iconSize",16,1,200)})}const POINT_ICON_RASTER_SIZE=64;function rasterPointIcon(host,icon,color){try{const canvas=host.ownerDocument.createElement("canvas");canvas.width=canvas.height=POINT_ICON_RASTER_SIZE;const context=canvas.getContext("2d"),Path=host.ownerDocument.defaultView?.Path2D;if(!context||!Path)return;const[x,y,width,height]=icon.viewBox,scale=POINT_ICON_RASTER_SIZE/Math.max(width,height);context.translate((POINT_ICON_RASTER_SIZE-width*scale)/2,(POINT_ICON_RASTER_SIZE-height*scale)/2),context.scale(scale,scale),context.translate(-x,-y);const path=new Path(icon.path);return icon.mode!=="stroke"&&(context.fillStyle=color,context.fill(path)),icon.mode!=="fill"&&icon.strokeWidth>0&&(context.strokeStyle=color,context.lineWidth=icon.strokeWidth,context.lineCap=icon.lineCap,context.lineJoin=icon.lineJoin,context.stroke(path)),context.getImageData(0,0,POINT_ICON_RASTER_SIZE,POINT_ICON_RASTER_SIZE)}catch{return}}function projectLineOptions(value){try{if(!isRuntimeRecord(value))return;const field=optionalDescriptorValue(ownDataValue(value,"field")),width=optionalDescriptorValue(ownDataValue(value,"width")),opacity=optionalDescriptorValue(ownDataValue(value,"opacity"));return Object.freeze({field:typeof field=="string"&&field.trim()?field.trim():void 0,stops:Object.freeze(normalizeMapLegendGradient(optionalDescriptorValue(ownDataValue(value,"stops"))).filter((stop,index,stops)=>index===0||stop[0]>stops[index-1][0]).map(stop=>Object.freeze(stop))),width:typeof width=="number"?finiteRange(width,2,0,200):2,opacity:typeof opacity=="number"?finiteRange(opacity,1,0,1):1})}catch{return}}function projectedHeatmapRange(value){try{const length=boundedOwnArrayLength(value,2);if(length===void 0||length<2)return;const minDescriptor=ownDataValue(value,"0"),maxDescriptor=ownDataValue(value,"1");return minDescriptor===MISSING_OWN_DATA_DESCRIPTOR||maxDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(minDescriptor)||isUnsafeDescriptor(maxDescriptor)||typeof minDescriptor.value!="number"||typeof maxDescriptor.value!="number"||!Number.isFinite(minDescriptor.value)||!Number.isFinite(maxDescriptor.value)?void 0:Object.freeze([minDescriptor.value,maxDescriptor.value])}catch{return}}function projectedHeatmapZoomValue(value){if(typeof value=="number"&&Number.isFinite(value))return value;if(isRuntimeArray(value))return normalizedSteps(value,isFiniteOutput,zoom=>finiteRange(zoom,0,0,24))}function projectHeatmapOptions(value){try{if(!isRuntimeRecord(value))return;const weightFieldDescriptor=ownDataValue(value,"weightField"),weightRangeDescriptor=ownDataValue(value,"weightRange"),stopsDescriptor=ownDataValue(value,"stops"),radiusDescriptor=ownDataValue(value,"radius"),intensityDescriptor=ownDataValue(value,"intensity"),opacityDescriptor=ownDataValue(value,"opacity"),weightFieldValue=optionalDescriptorValue(weightFieldDescriptor),opacityValue=optionalDescriptorValue(opacityDescriptor);return Object.freeze({weightField:typeof weightFieldValue=="string"&&weightFieldValue.trim().length>0?weightFieldValue.trim():void 0,weightRange:projectedHeatmapRange(optionalDescriptorValue(weightRangeDescriptor)),stops:normalizedSteps(optionalDescriptorValue(stopsDescriptor),isColorOutput,density=>finiteRange(density,0,0,1)),radius:projectedHeatmapZoomValue(optionalDescriptorValue(radiusDescriptor)),intensity:projectedHeatmapZoomValue(optionalDescriptorValue(intensityDescriptor)),opacity:typeof opacityValue=="number"&&Number.isFinite(opacityValue)?opacityValue:void 0})}catch{return}}function dataLayerShape(layer){if(layer.kind==="heatmap")return"heatmap";const cluster=layer.cluster;return cluster?`cluster:${cluster.radius}:${cluster.maxZoom}:${cluster.countFont?.join(",")??""}`:"auto"}function heatmapWeightExpression(options){const field=options?.weightField??"";if(!field)return;const min=options?.weightRange?.[0]??Number.NaN,max=options?.weightRange?.[1]??Number.NaN;return!Number.isFinite(min)||!Number.isFinite(max)||min>=max?["get",field]:["interpolate",["linear"],["get",field],min,0,max,1]}function heatmapZoomValue(value,fallback,min,max){if(!isRuntimeArray(value))return finiteRange(typeof value=="number"?value:Number.NaN,fallback,min,max);const stops=value.map(([zoom,output])=>[zoom,finiteRange(output,fallback,min,max)]);if(stops.length===0)return fallback;if(stops.length===1)return stops[0][1];const expression=["interpolate",["linear"],["zoom"]];for(const[zoom,output]of stops)expression.push(zoom,output);return expression}function projectMapChoropleth(value){try{if(!isRuntimeRecord(value))return;const sourceIdDescriptor=ownDataValue(value,"sourceId"),geojsonDescriptor=ownDataValue(value,"geojson"),fieldDescriptor=ownDataValue(value,"field"),stopsDescriptor=ownDataValue(value,"stops"),interpolationDescriptor=ownDataValue(value,"interpolation"),stepBaseColorDescriptor=ownDataValue(value,"stepBaseColor");if(sourceIdDescriptor===MISSING_OWN_DATA_DESCRIPTOR||geojsonDescriptor===MISSING_OWN_DATA_DESCRIPTOR||fieldDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(sourceIdDescriptor)||isUnsafeDescriptor(geojsonDescriptor)||isUnsafeDescriptor(fieldDescriptor))return;const sourceId=sourceIdDescriptor.value,geojson=geojsonDescriptor.value,field=fieldDescriptor.value;if(typeof sourceId!="string"||sourceId.trim().length===0||!isRuntimeRecord(geojson)||typeof field!="string"||field.trim().length===0)return;const interpolationValue=optionalDescriptorValue(interpolationDescriptor),stepBaseColorValue=optionalDescriptorValue(stepBaseColorDescriptor),interpolation=interpolationValue==="logarithmic"||interpolationValue==="step"?interpolationValue:"linear";return Object.freeze({sourceId:sourceId.trim(),geojson,geojsonProjection:projectGeoJson(geojson),field:field.trim(),stops:normalizedSteps(optionalDescriptorValue(stopsDescriptor),isColorOutput),interpolation,stepBaseColor:typeof stepBaseColorValue=="string"&&stepBaseColorValue.trim().length>0?stepBaseColorValue:void 0})}catch{return}}const EMPTY_CANONICAL_MAP_MARKERS=Object.freeze([]),UNPROJECTED_MAP_VALUE=Symbol("unprojected-map-value");function projectMarkerLngLat(value){try{const length=boundedOwnArrayLength(value,2);if(length===void 0||length<2)return;const lngDescriptor=ownDataValue(value,"0"),latDescriptor=ownDataValue(value,"1");return lngDescriptor===MISSING_OWN_DATA_DESCRIPTOR||latDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(lngDescriptor)||isUnsafeDescriptor(latDescriptor)||typeof lngDescriptor.value!="number"||typeof latDescriptor.value!="number"||!Number.isFinite(lngDescriptor.value)||!Number.isFinite(latDescriptor.value)||latDescriptor.value<-90||latDescriptor.value>90?void 0:Object.freeze([lngDescriptor.value,latDescriptor.value])}catch{return}}function projectMapMarker(value){try{if(!isRuntimeRecord(value))return;const idDescriptor=ownDataValue(value,"id"),lngLatDescriptor=ownDataValue(value,"lngLat"),colorDescriptor=ownDataValue(value,"color"),labelDescriptor=ownDataValue(value,"label"),unsafeHtmlDescriptor=ownDataValue(value,"unsafeHtml");if(lngLatDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(idDescriptor)||isUnsafeDescriptor(lngLatDescriptor)||isUnsafeDescriptor(colorDescriptor)||isUnsafeDescriptor(labelDescriptor)||isUnsafeDescriptor(unsafeHtmlDescriptor))return;const lngLat=projectMarkerLngLat(lngLatDescriptor.value),idValue=optionalDescriptorValue(idDescriptor),labelValue=optionalDescriptorValue(labelDescriptor);if(!lngLat||idValue!==void 0&&typeof idValue!="string"||typeof idValue=="string"&&idValue.trim().length===0||labelValue!==void 0&&typeof labelValue!="string")return;const colorValue=optionalDescriptorValue(colorDescriptor);return Object.freeze({id:typeof idValue=="string"?idValue.trim():void 0,lngLat,color:typeof colorValue=="string"?colorValue:void 0,label:typeof labelValue=="string"?labelValue:void 0,unsafeHtml:optionalDescriptorValue(unsafeHtmlDescriptor)})}catch{return}}function projectMapMarkers(value){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_MARKERS);if(scanCount===void 0)return EMPTY_CANONICAL_MAP_MARKERS;const output=[],explicitIds=new Set;for(let index=0;index<scanCount;index+=1){const descriptor=ownDataValue(value,String(index));if(descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor))continue;const marker=projectMapMarker(descriptor.value);!marker||marker.id!==void 0&&explicitIds.has(marker.id)||(marker.id!==void 0&&explicitIds.add(marker.id),output.push(marker))}return output.length?Object.freeze(output):EMPTY_CANONICAL_MAP_MARKERS}catch{return EMPTY_CANONICAL_MAP_MARKERS}}const FALLBACK_FILL_OPACITY=.75;function ownerWindow(host){return host.ownerDocument?.defaultView??null}function choroplethFillOpacity(host){const raw=ownerWindow(host)?.getComputedStyle(host).getPropertyValue("--lr-map-choropleth-fill-opacity").trim()??"",parsed=Number.parseFloat(raw);return Number.isFinite(parsed)?parsed:FALLBACK_FILL_OPACITY}const FALLBACK_HIDDEN_CATEGORY_OPACITY=.15;function hiddenCategoryOpacity(host){const raw=ownerWindow(host)?.getComputedStyle(host).getPropertyValue("--lr-map-hidden-category-opacity").trim()??"";return finiteRange(Number.parseFloat(raw),FALLBACK_HIDDEN_CATEGORY_OPACITY,0,1)}const TONE_TOKEN={accent:"--lr-color-brand",success:"--lr-color-success",warning:"--lr-color-warning",danger:"--lr-color-danger",neutral:"--lr-color-text-quiet"},ON_TONE_TOKEN={accent:"--lr-color-on-brand",success:"--lr-color-on-success",warning:"--lr-color-on-warning",danger:"--lr-color-on-danger",neutral:"--lr-color-on-neutral"},HEATMAP_RAMP_TOKENS=Object.freeze([[.25,"--lr-color-brand"],[.5,"--lr-color-success"],[.75,"--lr-color-warning"],[1,"--lr-color-danger"]]);function dataLayerColor(host,tone){const token=TONE_TOKEN[tone??"accent"];return(ownerWindow(host)?.getComputedStyle(host).getPropertyValue(token).trim()??"")||"#0969da"}function resolvedLayerColor(host,explicit,tone){const candidate=typeof explicit=="string"?explicit.trim():"";if(!candidate)return dataLayerColor(host,tone);const reference=/^var\(\s*(--[\w-]+)/.exec(candidate);return reference?ownerWindow(host)?.getComputedStyle(host).getPropertyValue(reference[1]).trim()||dataLayerColor(host,tone):candidate}const GEOJSON_DIFF_FEATURE_LIMIT=1e4,GEOJSON_DIFF_VALUE_LIMIT=5e4,GEOJSON_PROJECTION_DEPTH_LIMIT=100,INVALID_GEOJSON_PROJECTION_VALUE=Symbol("invalid-geojson-projection-value"),GEOJSON_FUNCTION_TO_STRING=Function.prototype.toString,GEOJSON_OBJECT_CONSTRUCTOR_SOURCE=GEOJSON_FUNCTION_TO_STRING.call(Object),EMPTY_CANONICAL_GEOJSON_PROJECTION=Object.freeze({diagnostics:Object.freeze([]),collection:void 0}),EMPTY_CANONICAL_GEOJSON_PROPERTIES=new Map;function spendGeoJsonProjectionWork(budget){return budget.remaining<=0?!1:(budget.remaining-=1,!0)}function projectedGeoJsonOwnValue(value,key,budget){if(!spendGeoJsonProjectionWork(budget))return INVALID_GEOJSON_PROJECTION_VALUE;const descriptor=ownDataValue(value,key);return isUnsafeDescriptor(descriptor)?INVALID_GEOJSON_PROJECTION_VALUE:descriptor===MISSING_OWN_DATA_DESCRIPTOR?descriptor:descriptor.value}function isPlainGeoJsonRecord(value){try{const prototype=Object.getPrototypeOf(value);if(prototype===null)return!0;if(Object.getPrototypeOf(prototype)!==null)return!1;const constructorDescriptor=Object.getOwnPropertyDescriptor(prototype,"constructor");if(!constructorDescriptor||!("value"in constructorDescriptor)||typeof constructorDescriptor.value!="function")return!1;const constructor=constructorDescriptor.value,constructorPrototype=Object.getOwnPropertyDescriptor(constructor,"prototype");return!!(constructorPrototype&&"value"in constructorPrototype&&constructorPrototype.value===prototype&&GEOJSON_FUNCTION_TO_STRING.call(constructor)===GEOJSON_OBJECT_CONSTRUCTOR_SOURCE)}catch{return!1}}function projectGeoJsonComparableValue(value,budget,depth=0){if(!spendGeoJsonProjectionWork(budget)||depth>GEOJSON_PROJECTION_DEPTH_LIMIT)return INVALID_GEOJSON_PROJECTION_VALUE;if(value==null||typeof value=="boolean"||typeof value=="string")return value;if(typeof value=="number")return Number.isFinite(value)?value:INVALID_GEOJSON_PROJECTION_VALUE;if(typeof value!="object"||budget.active.has(value))return INVALID_GEOJSON_PROJECTION_VALUE;const remembered=budget.seen.get(value);if(remembered!==void 0)return remembered;if(isRuntimeArray(value)){const length=projectedGeoJsonOwnValue(value,"length",budget);if(length===INVALID_GEOJSON_PROJECTION_VALUE||length===MISSING_OWN_DATA_DESCRIPTOR||typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>budget.remaining)return INVALID_GEOJSON_PROJECTION_VALUE;const output2=new Array(length);budget.seen.set(value,output2),budget.active.add(value);let completed2=!1;try{for(let index=0;index<length;index+=1){const entry=projectedGeoJsonOwnValue(value,String(index),budget);if(entry===INVALID_GEOJSON_PROJECTION_VALUE)return entry;if(entry===MISSING_OWN_DATA_DESCRIPTOR)continue;const projected=projectGeoJsonComparableValue(entry,budget,depth+1);if(projected===INVALID_GEOJSON_PROJECTION_VALUE)return projected;Object.defineProperty(output2,index,{value:projected,enumerable:!0,configurable:!1,writable:!1})}const frozen=Object.freeze(output2);return completed2=!0,frozen}finally{budget.active.delete(value),completed2||budget.seen.delete(value)}}if(!isPlainGeoJsonRecord(value))return INVALID_GEOJSON_PROJECTION_VALUE;const output=Object.create(null);budget.seen.set(value,output),budget.active.add(value);let completed=!1;try{for(const key in value){const entry=projectedGeoJsonOwnValue(value,key,budget);if(entry===INVALID_GEOJSON_PROJECTION_VALUE)return entry;if(entry===MISSING_OWN_DATA_DESCRIPTOR)continue;const projected=projectGeoJsonComparableValue(entry,budget,depth+1);if(projected===INVALID_GEOJSON_PROJECTION_VALUE)return projected;Object.defineProperty(output,key,{value:projected,enumerable:!0,configurable:!1,writable:!1})}const frozen=Object.freeze(output);return completed=!0,frozen}catch{return INVALID_GEOJSON_PROJECTION_VALUE}finally{budget.active.delete(value),completed||budget.seen.delete(value)}}function projectGeoJsonProperties(value,budget){if(value==null)return EMPTY_CANONICAL_GEOJSON_PROPERTIES;if(!isRuntimeRecord(value))return;const output=new Map;try{for(const key in value){const entry=projectedGeoJsonOwnValue(value,key,budget);if(entry===INVALID_GEOJSON_PROJECTION_VALUE)return;entry!==MISSING_OWN_DATA_DESCRIPTOR&&output.set(key,entry)}}catch{return}return output}function projectGeoJsonFeature(value,index,budget){if(!isRuntimeRecord(value))return;const type=projectedGeoJsonOwnValue(value,"type",budget),id=projectedGeoJsonOwnValue(value,"id",budget),geometry=projectedGeoJsonOwnValue(value,"geometry",budget),bbox=projectedGeoJsonOwnValue(value,"bbox",budget),properties=projectedGeoJsonOwnValue(value,"properties",budget);if(properties===INVALID_GEOJSON_PROJECTION_VALUE)return;const projectedProperties=projectGeoJsonProperties(properties===MISSING_OWN_DATA_DESCRIPTOR?void 0:properties,budget);if(!projectedProperties)return;const diagnostic=Object.freeze({id:typeof id=="string"||typeof id=="number"?id:void 0,index,properties:projectedProperties});if(type===INVALID_GEOJSON_PROJECTION_VALUE||id===INVALID_GEOJSON_PROJECTION_VALUE||geometry===INVALID_GEOJSON_PROJECTION_VALUE||bbox===INVALID_GEOJSON_PROJECTION_VALUE||type!=="Feature"||id===MISSING_OWN_DATA_DESCRIPTOR||typeof id!="string"&&typeof id!="number")return Object.freeze({diagnostic,feature:void 0});const comparableGeometry=projectGeoJsonComparableValue(geometry===MISSING_OWN_DATA_DESCRIPTOR?void 0:geometry,budget),comparableBbox=projectGeoJsonComparableValue(bbox===MISSING_OWN_DATA_DESCRIPTOR?void 0:bbox,budget);return Object.freeze(comparableGeometry===INVALID_GEOJSON_PROJECTION_VALUE||comparableBbox===INVALID_GEOJSON_PROJECTION_VALUE?{diagnostic,feature:void 0}:{diagnostic,feature:Object.freeze({id,index,feature:value,geometry:comparableGeometry,bbox:comparableBbox,properties:projectedProperties})})}function projectGeoJson(value){try{if(!isRuntimeRecord(value))return EMPTY_CANONICAL_GEOJSON_PROJECTION;const budget={remaining:GEOJSON_DIFF_VALUE_LIMIT,seen:new WeakMap,active:new WeakSet},type=projectedGeoJsonOwnValue(value,"type",budget),features=projectedGeoJsonOwnValue(value,"features",budget);if(type!=="FeatureCollection"||features===INVALID_GEOJSON_PROJECTION_VALUE||features===MISSING_OWN_DATA_DESCRIPTOR||!isRuntimeArray(features))return EMPTY_CANONICAL_GEOJSON_PROJECTION;const length=projectedGeoJsonOwnValue(features,"length",budget);if(length===INVALID_GEOJSON_PROJECTION_VALUE||length===MISSING_OWN_DATA_DESCRIPTOR||typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>GEOJSON_DIFF_FEATURE_LIMIT)return EMPTY_CANONICAL_GEOJSON_PROJECTION;const diagnostics=[],ordered=[],byId=new Map;let collectionIsAddressable=!0;for(let index=0;index<length;index+=1){const candidate=projectedGeoJsonOwnValue(features,String(index),budget);if(candidate===INVALID_GEOJSON_PROJECTION_VALUE||candidate===MISSING_OWN_DATA_DESCRIPTOR){collectionIsAddressable=!1;continue}const projected=projectGeoJsonFeature(candidate,index,budget);if(!projected){collectionIsAddressable=!1;continue}diagnostics.push(projected.diagnostic);const feature=projected.feature;if(!feature||byId.has(feature.id)){collectionIsAddressable=!1;continue}ordered.push(feature),byId.set(feature.id,feature)}return Object.freeze({diagnostics:Object.freeze(diagnostics),collection:collectionIsAddressable&&ordered.length===length?Object.freeze({ordered:Object.freeze(ordered),byId}):void 0})}catch{return EMPTY_CANONICAL_GEOJSON_PROJECTION}}function warnOnUntileableProperties(projection,sourceLabel){for(const feature of projection.diagnostics)for(const[key,value]of feature.properties){if(typeof value!="number"||!Number.isFinite(value)||Math.abs(value)<=Number.MAX_SAFE_INTEGER)continue;const identity=feature.id??`index ${feature.index}`;devWarnOnce(`lyra-map-untileable-property:${sourceLabel}:${key}`,`<lr-map>: feature ${String(identity)} in "${sourceLabel}" carries ${key}=${value}, which is too large to survive maplibre-gl's vector-tile encoding. Tiling happens in a worker, so the failure would reach you only as an opaque "Given varint doesn't fit into 10 bytes" error while the rest of the layer still paints. Carry a reduced figure in the feature and keep the exact value in your own data.`)}}function sameGeoJsonValue(previous,next,comparison){if(comparison.remaining<=0)return!1;if(comparison.remaining-=1,Object.is(previous,next))return!0;if(previous===null||next===null||typeof previous!="object"||typeof next!="object")return!1;const pairedNext=comparison.forward.get(previous);if(pairedNext)return pairedNext===next;const pairedPrevious=comparison.reverse.get(next);if(pairedPrevious)return pairedPrevious===previous;comparison.forward.set(previous,next),comparison.reverse.set(next,previous);const previousIsArray=Array.isArray(previous),nextIsArray=Array.isArray(next);if(previousIsArray||nextIsArray){if(!previousIsArray||!nextIsArray||previous.length!==next.length)return!1;for(let index=0;index<previous.length;index+=1){const before=Object.getOwnPropertyDescriptor(previous,String(index)),after=Object.getOwnPropertyDescriptor(next,String(index));if(!!before!=!!after)return!1;if(!(!before||!after)&&(!("value"in before)||!("value"in after)||!sameGeoJsonValue(before.value,after.value,comparison)))return!1}return!0}if(!isPlainGeoJsonRecord(previous)||!isPlainGeoJsonRecord(next))return!1;const previousKeys=Object.keys(previous),nextKeys=Object.keys(next);if(previousKeys.length!==nextKeys.length)return!1;for(let index=0;index<previousKeys.length;index+=1){const key=previousKeys[index];if(key!==nextKeys[index])return!1;const before=Object.getOwnPropertyDescriptor(previous,key),after=Object.getOwnPropertyDescriptor(next,key);if(!before||!after||!("value"in before)||!("value"in after)||!sameGeoJsonValue(before.value,after.value,comparison))return!1}return!0}function sameGeoJsonSnapshots(previous,next){try{return sameGeoJsonValue(previous,next,{remaining:GEOJSON_DIFF_VALUE_LIMIT,forward:new WeakMap,reverse:new WeakMap})}catch{return!1}}function buildProjectedGeoJsonPropertyDiff(previous,next){const previousCollection=previous.collection,nextCollection=next.collection;if(!previousCollection||!nextCollection)return null;const previousGeometry=[],nextGeometry=[];for(const after of nextCollection.ordered){const before=previousCollection.byId.get(after.id);before&&(previousGeometry.push(before.geometry,before.bbox),nextGeometry.push(after.geometry,after.bbox))}if(!sameGeoJsonSnapshots(previousGeometry,nextGeometry))return null;const retained=new Set;let previousIndex=-1;for(const feature of nextCollection.ordered){const before=previousCollection.byId.get(feature.id);if(!before||before.index<=previousIndex)break;retained.add(feature.id),previousIndex=before.index}const remove=previousCollection.ordered.filter(feature=>!retained.has(feature.id)).map(feature=>feature.id),add=nextCollection.ordered.filter(feature=>!retained.has(feature.id)).map(feature=>feature.feature),update=[];for(const after of nextCollection.ordered){if(!retained.has(after.id))continue;const before=previousCollection.byId.get(after.id),addOrUpdateProperties=[];for(const[key,value]of after.properties)Object.is(before.properties.get(key),value)||addOrUpdateProperties.push({key,value});const removeProperties=[...before.properties.keys()].filter(key=>!after.properties.has(key));addOrUpdateProperties.length===0&&removeProperties.length===0||update.push({id:after.id,addOrUpdateProperties,removeProperties})}return{...remove.length?{remove}:{},...add.length?{add}:{},update}}function buildGeoJsonPropertyDiff(previous,next){return buildProjectedGeoJsonPropertyDiff(projectGeoJson(previous),projectGeoJson(next))}class LyraMap extends LyraElement{static{this.defaultStrings={...super.defaultStrings,close:LYRA_DEFAULT_close,items:LYRA_DEFAULT_items,legendTypeHidden:LYRA_DEFAULT_legendTypeHidden,legendTypeShown:LYRA_DEFAULT_legendTypeShown,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,mapInitializationFailed:LYRA_DEFAULT_mapInitializationFailed,mapLegend:LYRA_DEFAULT_mapLegend,mapMissingLibrary:LYRA_DEFAULT_mapMissingLibrary,mapResetNorth:LYRA_DEFAULT_mapResetNorth,mapStyleRequired:LYRA_DEFAULT_mapStyleRequired,mapWebglUnavailable:LYRA_DEFAULT_mapWebglUnavailable,paginationSummary:LYRA_DEFAULT_paginationSummary,zoomIn:LYRA_DEFAULT_zoomIn,zoomOut:LYRA_DEFAULT_zoomOut}}static{this.immutableEventDetails=Object.freeze(["lr-map-click","lr-map-legend-panel-toggle","lr-map-legend-toggle","lr-map-marker-activate"])}static{this.identityEventDetailProperties=Object.freeze({"lr-map-click":Object.freeze(["feature"]),"lr-map-marker-activate":Object.freeze(["marker"])})}static{this.ownedCollectionProperties=Object.freeze(["center","mapStyle","choropleth","markers","dataLayers"])}static{this.identityCollectionProperties=Object.freeze(["markers","dataLayers"])}static{this.identityCollectionObjectProperties=Object.freeze(["choropleth"])}static{this.styles=[LyraElement.styles,styles,srOnly]}static preload(){return loadMaplibre().then(module=>module!==null)}constructor(){super(),this.center=[0,0],this.zoom=2,this.maxBounds=null,this._legend=EMPTY_MAP_LEGEND,this._legendProjection=EMPTY_MAP_LEGEND_PROJECTION,this._legendGrouped=!1,this.hasLegendSlot=!1,this.hasLegendStartSlot=!1,this._legendGradient=Object.freeze([]),this.legendGradientLoLabel=null,this.legendGradientHiLabel=null,this.legendInteractive=!1,this.legendCollapsible=!1,this.legendOpen=!0,this._hiddenCategories=EMPTY_HIDDEN_CATEGORIES,this.markers=[],this.dataLayers=[],this._canonicalChoroplethSource=UNPROJECTED_MAP_VALUE,this._canonicalDataLayersSource=UNPROJECTED_MAP_VALUE,this._canonicalDataLayers=EMPTY_CANONICAL_MAP_DATA_LAYERS,this._canonicalMarkersSource=UNPROJECTED_MAP_VALUE,this._canonicalMarkers=EMPTY_CANONICAL_MAP_MARKERS,this.label="",this.loading=!0,this.loadLibrary=loadMaplibre,this.visible=ownerWindow(this)?.IntersectionObserver===void 0,this._styleLoaded=!1,this._appliedDataLayerIds=new Map,this._appliedDataLayerShapes=new Map,this._appliedGeoJson=new Map,this._nextDataLayerId=0,this.nextPointIconId=0,this.appliedPointPaint=new Set,this.appliedPointMuting=new Set,this.appliedPointIcons=new Map,this._webglReady=!1,this._markerInstances=new Map,this._markerLabels=new Map,this._markerPopupIds=new Map,this.markerActivationDetails=new WeakMap,this._configuredPopups=new WeakSet,this._nextPopupId=0,this._markerColors=new Map,this._connectGeneration=0,this.configuredMarkerElements=new WeakSet,this.onLegendSlotChange=event=>{const slot=event.target,filled=slot.assignedNodes({flatten:!0}).some(node=>node.nodeType===Node.ELEMENT_NODE||(node.textContent??"").trim().length>0);slot.name==="legend-start"?this.hasLegendStartSlot=filled:this.hasLegendSlot=filled},new ThemeWatcher(this,()=>this.refreshThemePaint())}get legend(){return this._legend}set legend(value){const previous=this._legend,normalized=normalizeMapLegend(value);this._legend=normalized.entries,this._legendProjection=normalized.projection,this._legendGrouped=normalized.grouped,this.requestUpdate("legend",previous)}probeLegendSlot(name){for(const child of Array.from(this.children))if(child.getAttribute("slot")===name)return!0;return!1}get legendGradient(){return this._legendGradient}set legendGradient(value){const previous=this._legendGradient;this._legendGradient=normalizeMapLegendGradient(value),this.requestUpdate("legendGradient",previous)}warnOnLegendChoroplethMismatch(){if(this.legendDescribesLine())return;const layer=this.canonicalChoropleth,legend=this.legendGradient;!layer||legend.length===0||layer.stops.length===0||legend.length===layer.stops.length&&legend.every(([legendValue,legendColor],index)=>{const layerStop=layer.stops[index];return layerStop!==void 0&&layerStop[0]===legendValue&&resolvedLayerColor(this,layerStop[1],void 0)===resolvedLayerColor(this,legendColor,void 0)})||devWarnOnce("lyra-map-legend-choropleth-mismatch",`<${this.localName}>: legendGradient does not match choropleth.stops, so the visible key may misdescribe the map. Assign the same stops array to both, or derive both from one source.`)}legendDescribesLine(){const stops=this.legendGradient;return stops.length<2?!1:this.canonicalDataLayers.some(layer=>layer.kind==="auto"&&!layer.cluster&&layer.line?.field&&layer.line.stops.length===stops.length&&layer.line.stops.every(([value,color],index)=>value===stops[index][0]&&resolvedLayerColor(this,color,layer.tone)===resolvedLayerColor(this,stops[index][1],layer.tone)))}get legendProjection(){return this._legendProjection}get legendCollapsed(){return this.legendCollapsible&&!this.legendOpen}toggleLegendPanel(){if(!this.legendCollapsible)return;const open=!this.legendOpen;this.emit("lr-map-legend-panel-toggle",{open},{cancelable:!0}).defaultPrevented||(this.legendOpen=open)}renderLegendDisclosure(){return this.legendCollapsible?html`<button
12
+ ></path></svg>`}function addPartToken(element,token){const tokens=new Set((element.getAttribute("part")??"").split(/\s+/).filter(Boolean));tokens.add(token),element.setAttribute("part",[...tokens].join(" "))}const CHOROPLETH_LOG_INTERPOLATION_BASE=.25,CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL=8;function choroplethLogInterpolationFactor(input,lower,upper){const difference=upper-lower;if(difference===0)return 0;const progress=input-lower;return(Math.pow(CHOROPLETH_LOG_INTERPOLATION_BASE,progress)-1)/(Math.pow(CHOROPLETH_LOG_INTERPOLATION_BASE,difference)-1)}function compactGradientPercent(value){return String(Math.round(Math.min(100,Math.max(0,value))*1e4)/1e4)}function choroplethLegendGradientImage(stops,interpolation){const lo=stops[0],span=stops[stops.length-1][0]-lo[0],stopPercent=(value,index)=>span>0?(value-lo[0])/span*100:index/(stops.length-1)*100;if(interpolation!=="logarithmic"||span<=0)return`linear-gradient(to right, ${stops.map(([value,color],index)=>`${color} ${compactGradientPercent(stopPercent(value,index))}%`).join(", ")})`;const image=[`${lo[1]} 0%`];for(let index=1;index<stops.length;index+=1){const lower=stops[index-1],upper=stops[index],interval=upper[0]-lower[0];if(interval<=0){image.push(`${upper[1]} ${compactGradientPercent(stopPercent(upper[0],index))}%`);continue}for(let sample=1;sample<=CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL;sample+=1){const intervalProgress=sample/CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL,input=lower[0]+interval*intervalProgress,position=(input-lo[0])/span*100;if(sample===CHOROPLETH_LEGEND_SAMPLES_PER_INTERVAL){image.push(`${upper[1]} ${compactGradientPercent(position)}%`);continue}const factor=Math.min(1,Math.max(0,choroplethLogInterpolationFactor(input,lower[0],upper[0]))),lowerWeight=compactGradientPercent((1-factor)*100),upperWeight=compactGradientPercent(factor*100);image.push(`color-mix(in srgb, ${lower[1]} ${lowerWeight}%, ${upper[1]} ${upperWeight}%) ${compactGradientPercent(position)}%`)}}return`linear-gradient(to right, ${image.join(", ")})`}const MAX_MAP_MARKERS=2e3;function popupText(host,markup){const template=host.ownerDocument.createElement("template");template.innerHTML=markup;for(const hidden of template.content.querySelectorAll('script, style, template, [hidden], [aria-hidden="true"]'))hidden.remove();return(template.content.textContent??"").replace(/\s+/gu," ").trim()}function markerPopupText(host,markup){return typeof markup=="string"&&markup?popupText(host,markup):""}const MAX_MAP_DATA_LAYERS=100,EMPTY_CANONICAL_MAP_DATA_LAYERS=Object.freeze([]);function mapTone(value){switch(value){case"accent":case"success":case"warning":case"danger":case"neutral":return value;default:return}}function projectMapDataLayer(value){try{if(!isRuntimeRecord(value))return;const sourceIdDescriptor=ownDataValue(value,"sourceId"),geojsonDescriptor=ownDataValue(value,"geojson"),toneDescriptor=ownDataValue(value,"tone"),colorDescriptor=ownDataValue(value,"color"),strokeColorDescriptor=ownDataValue(value,"strokeColor"),lineDescriptor=ownDataValue(value,"line"),kindDescriptor=ownDataValue(value,"kind"),heatmapDescriptor=ownDataValue(value,"heatmap"),clusterDescriptor=ownDataValue(value,"cluster");if(sourceIdDescriptor===MISSING_OWN_DATA_DESCRIPTOR||geojsonDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(sourceIdDescriptor)||isUnsafeDescriptor(geojsonDescriptor))return;const sourceId=sourceIdDescriptor.value,geojson=geojsonDescriptor.value;if(typeof sourceId!="string"||sourceId.trim().length===0||!isRuntimeRecord(geojson))return;const optionalValue=descriptor=>descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor)?void 0:descriptor.value,tone=mapTone(optionalValue(toneDescriptor)),colorValue=optionalValue(colorDescriptor),strokeColorValue=optionalValue(strokeColorDescriptor),kindValue=optionalValue(kindDescriptor),heatmapValue=optionalValue(heatmapDescriptor),clusterValue=optionalValue(clusterDescriptor),kind=kindValue==="heatmap"?"heatmap":"auto";return Object.freeze({sourceId:sourceId.trim(),geojson,geojsonProjection:projectGeoJson(geojson),tone,color:typeof colorValue=="string"?colorValue:void 0,strokeColor:typeof strokeColorValue=="string"?strokeColorValue:void 0,line:kind==="auto"?projectLineOptions(optionalValue(lineDescriptor)):void 0,point:kind==="auto"?projectPointOptions(optionalDescriptorValue(ownDataValue(value,"point"))):void 0,kind,heatmap:kind==="heatmap"?projectHeatmapOptions(heatmapValue):void 0,cluster:kind==="auto"?normalizedClusterOptions(clusterValue):void 0})}catch{return}}function projectMapDataLayers(value){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_DATA_LAYERS);if(scanCount===void 0)return EMPTY_CANONICAL_MAP_DATA_LAYERS;const output=[],seenSourceIds=new Set;for(let index=0;index<scanCount;index+=1){const descriptor=ownDataValue(value,String(index));if(descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor))continue;const layer=projectMapDataLayer(descriptor.value);!layer||seenSourceIds.has(layer.sourceId)||(seenSourceIds.add(layer.sourceId),output.push(layer))}return output.length?Object.freeze(output):EMPTY_CANONICAL_MAP_DATA_LAYERS}catch{return EMPTY_CANONICAL_MAP_DATA_LAYERS}}const DATA_LAYER_SUFFIXES=["-fill","-line","-circle","-point-icon","-cluster","-cluster-count","-heatmap"],QUERYABLE_DATA_LAYER_SUFFIXES=["-fill","-line","-circle","-cluster","-point-icon"],MAX_MAP_STEP_STOPS=32;function normalizedSteps(value,isOutput,clampThreshold=threshold=>threshold){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_STEP_STOPS);if(scanCount===void 0)return Object.freeze([]);const usable=[];for(let index=0;index<scanCount;index+=1){const stopDescriptor=ownDataValue(value,String(index));if(stopDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(stopDescriptor))continue;const stop=stopDescriptor.value,stopLength=boundedOwnArrayLength(stop,2);if(stopLength===void 0||stopLength<2)continue;const thresholdDescriptor=ownDataValue(stop,"0"),outputDescriptor=ownDataValue(stop,"1");thresholdDescriptor===MISSING_OWN_DATA_DESCRIPTOR||outputDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(thresholdDescriptor)||isUnsafeDescriptor(outputDescriptor)||typeof thresholdDescriptor.value!="number"||!Number.isFinite(thresholdDescriptor.value)||!isOutput(outputDescriptor.value)||usable.push([clampThreshold(thresholdDescriptor.value),outputDescriptor.value])}usable.sort((a,b)=>a[0]-b[0]);const deduplicated=usable.filter((stop,index)=>index===0||stop[0]>usable[index-1][0]);return Object.freeze(deduplicated.map(stop=>Object.freeze(stop)))}catch{return Object.freeze([])}}const isFiniteOutput=candidate=>typeof candidate=="number"&&Number.isFinite(candidate),isColorOutput=candidate=>typeof candidate=="string"&&candidate.trim().length>0;function stepExpression(input,stops){const expression=["step",input,stops[0][1]];for(const[threshold,output]of stops)expression.push(threshold,output);return expression}const DEFAULT_CLUSTER_RADIUS=50,DEFAULT_CLUSTER_MAX_ZOOM=14,DEFAULT_CLUSTER_RADIUS_STEPS=Object.freeze([[0,14],[10,18],[50,24]]),DEFAULT_HEATMAP_RADIUS=30,DEFAULT_HEATMAP_INTENSITY=1,HEATMAP_TRANSPARENT="rgba(0, 0, 0, 0)";function withTransparentFloor(stops){return stops.length&&stops[0][0]>0?[[0,HEATMAP_TRANSPARENT],...stops]:stops}const MAX_CLUSTER_COUNT_FONTS=8;function normalizedClusterOptions(value){try{if(!isRuntimeRecord(value))return;const radiusDescriptor=ownDataValue(value,"radius"),maxZoomDescriptor=ownDataValue(value,"maxZoom"),radiusStepsDescriptor=ownDataValue(value,"radiusSteps"),colorStepsDescriptor=ownDataValue(value,"colorSteps"),countFontDescriptor=ownDataValue(value,"countFont"),radiusValue=optionalDescriptorValue(radiusDescriptor),maxZoomValue=optionalDescriptorValue(maxZoomDescriptor),radiusSteps=normalizedSteps(optionalDescriptorValue(radiusStepsDescriptor),isFiniteOutput),colorSteps=normalizedSteps(optionalDescriptorValue(colorStepsDescriptor),isColorOutput),fonts=normalizedClusterFonts(optionalDescriptorValue(countFontDescriptor));return Object.freeze({radius:finiteRange(typeof radiusValue=="number"?radiusValue:Number.NaN,DEFAULT_CLUSTER_RADIUS,1,1e3),maxZoom:finiteRange(typeof maxZoomValue=="number"?maxZoomValue:Number.NaN,DEFAULT_CLUSTER_MAX_ZOOM,0,24),radiusSteps:radiusSteps.length?radiusSteps:DEFAULT_CLUSTER_RADIUS_STEPS,colorSteps,countFont:fonts.length?fonts:void 0})}catch{return}}function normalizedClusterFonts(value){try{const length=boundedOwnArrayLength(value,MAX_CLUSTER_COUNT_FONTS);if(length===void 0)return Object.freeze([]);const fonts=[];for(let index=0;index<length;index+=1){const descriptor=ownDataValue(value,String(index));descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor)||typeof descriptor.value!="string"||descriptor.value.trim().length===0||fonts.push(descriptor.value)}return Object.freeze(fonts)}catch{return Object.freeze([])}}const DEFAULT_ICON_VIEW_BOX=Object.freeze([0,0,24,24]),DEFAULT_ICON_STROKE_WIDTH=2,ICON_PATH_GRAMMAR=/^[MmLlHhVvCcSsQqTtAaZz\d.eE+,\s-]+$/u,MAX_ICON_PATH_LENGTH=8192;function projectIconPaint(row){const path=optionalDescriptorValue(ownDataValue(row,"path"));if(typeof path!="string"||path.length===0||path.length>MAX_ICON_PATH_LENGTH||!ICON_PATH_GRAMMAR.test(path))return;const rawBox=optionalDescriptorValue(ownDataValue(row,"viewBox")),box=[];if(rawBox===void 0)box.push(...DEFAULT_ICON_VIEW_BOX);else{if(boundedOwnArrayLength(rawBox,4)!==4)return;for(let index=0;index<4;index++){const coordinate=optionalDescriptorValue(ownDataValue(rawBox,String(index)));if(typeof coordinate!="number"||!Number.isFinite(coordinate)||Math.abs(coordinate)>1e4)return;box.push(coordinate)}if(box[2]<.001||box[3]<.001)return}const mode=optionalDescriptorValue(ownDataValue(row,"mode")),strokeWidth=optionalDescriptorValue(ownDataValue(row,"strokeWidth")),lineCap=optionalDescriptorValue(ownDataValue(row,"lineCap")),lineJoin=optionalDescriptorValue(ownDataValue(row,"lineJoin"));return Object.freeze({path,viewBox:Object.freeze(box),mode:mode==="stroke"||mode==="fill-stroke"?mode:"fill",strokeWidth:finiteRange(typeof strokeWidth=="number"?strokeWidth:NaN,DEFAULT_ICON_STROKE_WIDTH,0,200),lineCap:lineCap==="butt"||lineCap==="square"?lineCap:"round",lineJoin:lineJoin==="miter"||lineJoin==="bevel"?lineJoin:"round"})}function projectPointRadius(value){if(!isRuntimeRecord(value))return finiteRange(typeof value=="number"?value:NaN,5,0,200);const read=key=>optionalDescriptorValue(ownDataValue(value,key)),field=read("field"),rawFallback=read("fallback"),fallback=finiteRange(typeof rawFallback=="number"?rawFallback:NaN,5,0,200),stops=normalizedSteps(read("stops"),isFiniteOutput).map(([threshold,radius])=>Object.freeze([threshold,finiteRange(radius,5,0,200)]));return typeof field!="string"||!field.trim()||!stops.length?fallback:Object.freeze({field:field.trim(),stops:Object.freeze(stops),fallback,interpolation:read("interpolation")==="linear"?"linear":"step"})}function pointRadiusExpression(radius){if(typeof radius=="number")return radius;const input=["number",["get",radius.field],0];let domainInput=input,stops=radius.stops;if(radius.interpolation==="linear"&&!Number.isFinite(stops.at(-1)[0]-stops[0][0])){if(stops=stops.map(([value,output2])=>[value/2,output2]),stops.some(([value],index)=>index>0&&value<=stops[index-1][0]))return radius.fallback;domainInput=["/",input,2]}const output=stops.length===1?stops[0][1]:radius.interpolation==="linear"?["interpolate",["linear"],domainInput,...stops.flat()]:stepExpression(input,stops);return["case",["all",["==",["typeof",["get",radius.field]],"number"],[">=",input,-Number.MAX_VALUE],["<=",input,Number.MAX_VALUE]],output,radius.fallback]}function projectPointOptions(value){if(!isRuntimeRecord(value))return;const read=key=>optionalDescriptorValue(ownDataValue(value,key)),string=key=>{const candidate=read(key);return typeof candidate=="string"&&candidate.trim()?candidate:void 0},number=(key,fallback,min,max)=>{const candidate=read(key);return finiteRange(typeof candidate=="number"?candidate:NaN,fallback,min,max)},colors=[],icons=[],project=(input,accept)=>{const length=boundedOwnArrayLength(input,MAX_MAP_STEP_STOPS)??0;for(let index=0;index<length;index++){const row=optionalDescriptorValue(ownDataValue(input,String(index)));row!==null&&typeof row=="object"&&accept(row)}};return project(read("colors"),row=>{const key=optionalDescriptorValue(ownDataValue(row,"0")),color=optionalDescriptorValue(ownDataValue(row,"1"));typeof key!="string"||typeof color!="string"||!sanitizeCssColor(color)||colors.some(([existing])=>existing===key)||colors.push(Object.freeze([key,color]))}),project(read("icons"),row=>{const key=optionalDescriptorValue(ownDataValue(row,"value"));if(typeof key!="string"||icons.some(icon=>icon.value===key))return;const paint=projectIconPaint(row);paint&&icons.push(Object.freeze({value:key,...paint}))}),Object.freeze({field:string("field"),colors:Object.freeze(colors),radius:projectPointRadius(read("radius")),strokeWidth:number("strokeWidth",0,0,200),strokeColor:string("strokeColor"),iconField:string("iconField")??string("field"),icons:Object.freeze(icons),iconColor:string("iconColor"),iconSize:number("iconSize",16,1,200)})}const POINT_ICON_RASTER_SIZE=64;function rasterPointIcon(host,icon,color){try{const canvas=host.ownerDocument.createElement("canvas");canvas.width=canvas.height=POINT_ICON_RASTER_SIZE;const context=canvas.getContext("2d"),Path=host.ownerDocument.defaultView?.Path2D;if(!context||!Path)return;const[x,y,width,height]=icon.viewBox,scale=POINT_ICON_RASTER_SIZE/Math.max(width,height);context.translate((POINT_ICON_RASTER_SIZE-width*scale)/2,(POINT_ICON_RASTER_SIZE-height*scale)/2),context.scale(scale,scale),context.translate(-x,-y);const path=new Path(icon.path);return icon.mode!=="stroke"&&(context.fillStyle=color,context.fill(path)),icon.mode!=="fill"&&icon.strokeWidth>0&&(context.strokeStyle=color,context.lineWidth=icon.strokeWidth,context.lineCap=icon.lineCap,context.lineJoin=icon.lineJoin,context.stroke(path)),context.getImageData(0,0,POINT_ICON_RASTER_SIZE,POINT_ICON_RASTER_SIZE)}catch{return}}function projectLineOptions(value){try{if(!isRuntimeRecord(value))return;const field=optionalDescriptorValue(ownDataValue(value,"field")),width=optionalDescriptorValue(ownDataValue(value,"width")),opacity=optionalDescriptorValue(ownDataValue(value,"opacity"));return Object.freeze({field:typeof field=="string"&&field.trim()?field.trim():void 0,stops:Object.freeze(normalizeMapLegendGradient(optionalDescriptorValue(ownDataValue(value,"stops"))).filter((stop,index,stops)=>index===0||stop[0]>stops[index-1][0]).map(stop=>Object.freeze(stop))),width:typeof width=="number"?finiteRange(width,2,0,200):2,opacity:typeof opacity=="number"?finiteRange(opacity,1,0,1):1})}catch{return}}function projectedHeatmapRange(value){try{const length=boundedOwnArrayLength(value,2);if(length===void 0||length<2)return;const minDescriptor=ownDataValue(value,"0"),maxDescriptor=ownDataValue(value,"1");return minDescriptor===MISSING_OWN_DATA_DESCRIPTOR||maxDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(minDescriptor)||isUnsafeDescriptor(maxDescriptor)||typeof minDescriptor.value!="number"||typeof maxDescriptor.value!="number"||!Number.isFinite(minDescriptor.value)||!Number.isFinite(maxDescriptor.value)?void 0:Object.freeze([minDescriptor.value,maxDescriptor.value])}catch{return}}function projectedHeatmapZoomValue(value){if(typeof value=="number"&&Number.isFinite(value))return value;if(isRuntimeArray(value))return normalizedSteps(value,isFiniteOutput,zoom=>finiteRange(zoom,0,0,24))}function projectHeatmapOptions(value){try{if(!isRuntimeRecord(value))return;const weightFieldDescriptor=ownDataValue(value,"weightField"),weightRangeDescriptor=ownDataValue(value,"weightRange"),stopsDescriptor=ownDataValue(value,"stops"),radiusDescriptor=ownDataValue(value,"radius"),intensityDescriptor=ownDataValue(value,"intensity"),opacityDescriptor=ownDataValue(value,"opacity"),weightFieldValue=optionalDescriptorValue(weightFieldDescriptor),opacityValue=optionalDescriptorValue(opacityDescriptor);return Object.freeze({weightField:typeof weightFieldValue=="string"&&weightFieldValue.trim().length>0?weightFieldValue.trim():void 0,weightRange:projectedHeatmapRange(optionalDescriptorValue(weightRangeDescriptor)),stops:normalizedSteps(optionalDescriptorValue(stopsDescriptor),isColorOutput,density=>finiteRange(density,0,0,1)),radius:projectedHeatmapZoomValue(optionalDescriptorValue(radiusDescriptor)),intensity:projectedHeatmapZoomValue(optionalDescriptorValue(intensityDescriptor)),opacity:typeof opacityValue=="number"&&Number.isFinite(opacityValue)?opacityValue:void 0})}catch{return}}function dataLayerShape(layer){if(layer.kind==="heatmap")return"heatmap";const cluster=layer.cluster;return cluster?`cluster:${cluster.radius}:${cluster.maxZoom}:${cluster.countFont?.join(",")??""}`:"auto"}function heatmapWeightExpression(options){const field=options?.weightField??"";if(!field)return;const min=options?.weightRange?.[0]??Number.NaN,max=options?.weightRange?.[1]??Number.NaN;return!Number.isFinite(min)||!Number.isFinite(max)||min>=max?["get",field]:["interpolate",["linear"],["get",field],min,0,max,1]}function heatmapZoomValue(value,fallback,min,max){if(!isRuntimeArray(value))return finiteRange(typeof value=="number"?value:Number.NaN,fallback,min,max);const stops=value.map(([zoom,output])=>[zoom,finiteRange(output,fallback,min,max)]);if(stops.length===0)return fallback;if(stops.length===1)return stops[0][1];const expression=["interpolate",["linear"],["zoom"]];for(const[zoom,output]of stops)expression.push(zoom,output);return expression}function projectMapChoropleth(value){try{if(!isRuntimeRecord(value))return;const sourceIdDescriptor=ownDataValue(value,"sourceId"),geojsonDescriptor=ownDataValue(value,"geojson"),fieldDescriptor=ownDataValue(value,"field"),stopsDescriptor=ownDataValue(value,"stops"),interpolationDescriptor=ownDataValue(value,"interpolation"),stepBaseColorDescriptor=ownDataValue(value,"stepBaseColor");if(sourceIdDescriptor===MISSING_OWN_DATA_DESCRIPTOR||geojsonDescriptor===MISSING_OWN_DATA_DESCRIPTOR||fieldDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(sourceIdDescriptor)||isUnsafeDescriptor(geojsonDescriptor)||isUnsafeDescriptor(fieldDescriptor))return;const sourceId=sourceIdDescriptor.value,geojson=geojsonDescriptor.value,field=fieldDescriptor.value;if(typeof sourceId!="string"||sourceId.trim().length===0||!isRuntimeRecord(geojson)||typeof field!="string"||field.trim().length===0)return;const interpolationValue=optionalDescriptorValue(interpolationDescriptor),stepBaseColorValue=optionalDescriptorValue(stepBaseColorDescriptor),interpolation=interpolationValue==="logarithmic"||interpolationValue==="step"?interpolationValue:"linear";return Object.freeze({sourceId:sourceId.trim(),geojson,geojsonProjection:projectGeoJson(geojson),field:field.trim(),stops:normalizedSteps(optionalDescriptorValue(stopsDescriptor),isColorOutput),interpolation,stepBaseColor:typeof stepBaseColorValue=="string"&&stepBaseColorValue.trim().length>0?stepBaseColorValue:void 0})}catch{return}}const EMPTY_CANONICAL_MAP_MARKERS=Object.freeze([]),UNPROJECTED_MAP_VALUE=Symbol("unprojected-map-value");function projectMarkerLngLat(value){try{const length=boundedOwnArrayLength(value,2);if(length===void 0||length<2)return;const lngDescriptor=ownDataValue(value,"0"),latDescriptor=ownDataValue(value,"1");return lngDescriptor===MISSING_OWN_DATA_DESCRIPTOR||latDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(lngDescriptor)||isUnsafeDescriptor(latDescriptor)||typeof lngDescriptor.value!="number"||typeof latDescriptor.value!="number"||!Number.isFinite(lngDescriptor.value)||!Number.isFinite(latDescriptor.value)||latDescriptor.value<-90||latDescriptor.value>90?void 0:Object.freeze([lngDescriptor.value,latDescriptor.value])}catch{return}}function projectMapMarker(value){try{if(!isRuntimeRecord(value))return;const idDescriptor=ownDataValue(value,"id"),lngLatDescriptor=ownDataValue(value,"lngLat"),colorDescriptor=ownDataValue(value,"color"),labelDescriptor=ownDataValue(value,"label"),unsafeHtmlDescriptor=ownDataValue(value,"unsafeHtml");if(lngLatDescriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(idDescriptor)||isUnsafeDescriptor(lngLatDescriptor)||isUnsafeDescriptor(colorDescriptor)||isUnsafeDescriptor(labelDescriptor)||isUnsafeDescriptor(unsafeHtmlDescriptor))return;const lngLat=projectMarkerLngLat(lngLatDescriptor.value),idValue=optionalDescriptorValue(idDescriptor),labelValue=optionalDescriptorValue(labelDescriptor);if(!lngLat||idValue!==void 0&&typeof idValue!="string"||typeof idValue=="string"&&idValue.trim().length===0||labelValue!==void 0&&typeof labelValue!="string")return;const colorValue=optionalDescriptorValue(colorDescriptor);return Object.freeze({id:typeof idValue=="string"?idValue.trim():void 0,lngLat,color:typeof colorValue=="string"?colorValue:void 0,label:typeof labelValue=="string"?labelValue:void 0,unsafeHtml:optionalDescriptorValue(unsafeHtmlDescriptor)})}catch{return}}function projectMapMarkers(value){try{const scanCount=boundedOwnArrayLength(value,MAX_MAP_MARKERS);if(scanCount===void 0)return EMPTY_CANONICAL_MAP_MARKERS;const output=[],explicitIds=new Set;for(let index=0;index<scanCount;index+=1){const descriptor=ownDataValue(value,String(index));if(descriptor===MISSING_OWN_DATA_DESCRIPTOR||isUnsafeDescriptor(descriptor))continue;const marker=projectMapMarker(descriptor.value);!marker||marker.id!==void 0&&explicitIds.has(marker.id)||(marker.id!==void 0&&explicitIds.add(marker.id),output.push(marker))}return output.length?Object.freeze(output):EMPTY_CANONICAL_MAP_MARKERS}catch{return EMPTY_CANONICAL_MAP_MARKERS}}const FALLBACK_FILL_OPACITY=.75;function ownerWindow(host){return host.ownerDocument?.defaultView??null}function choroplethFillOpacity(host){const raw=ownerWindow(host)?.getComputedStyle(host).getPropertyValue("--lr-map-choropleth-fill-opacity").trim()??"",parsed=Number.parseFloat(raw);return Number.isFinite(parsed)?parsed:FALLBACK_FILL_OPACITY}const FALLBACK_HIDDEN_CATEGORY_OPACITY=.15;function hiddenCategoryOpacity(host){const raw=ownerWindow(host)?.getComputedStyle(host).getPropertyValue("--lr-map-hidden-category-opacity").trim()??"";return finiteRange(Number.parseFloat(raw),FALLBACK_HIDDEN_CATEGORY_OPACITY,0,1)}const TONE_TOKEN={accent:"--lr-color-brand",success:"--lr-color-success",warning:"--lr-color-warning",danger:"--lr-color-danger",neutral:"--lr-color-text-quiet"},ON_TONE_TOKEN={accent:"--lr-color-on-brand",success:"--lr-color-on-success",warning:"--lr-color-on-warning",danger:"--lr-color-on-danger",neutral:"--lr-color-on-neutral"},HEATMAP_RAMP_TOKENS=Object.freeze([[.25,"--lr-color-brand"],[.5,"--lr-color-success"],[.75,"--lr-color-warning"],[1,"--lr-color-danger"]]);function dataLayerColor(host,tone){const token=TONE_TOKEN[tone??"accent"];return(ownerWindow(host)?.getComputedStyle(host).getPropertyValue(token).trim()??"")||"#0969da"}function resolvedLayerColor(host,explicit,tone){const candidate=typeof explicit=="string"?explicit.trim():"";if(!candidate)return dataLayerColor(host,tone);const reference=/^var\(\s*(--[\w-]+)/.exec(candidate);return reference?ownerWindow(host)?.getComputedStyle(host).getPropertyValue(reference[1]).trim()||dataLayerColor(host,tone):candidate}const GEOJSON_DIFF_FEATURE_LIMIT=1e4,GEOJSON_DIFF_VALUE_LIMIT=5e4,GEOJSON_PROJECTION_DEPTH_LIMIT=100,INVALID_GEOJSON_PROJECTION_VALUE=Symbol("invalid-geojson-projection-value"),GEOJSON_FUNCTION_TO_STRING=Function.prototype.toString,GEOJSON_OBJECT_CONSTRUCTOR_SOURCE=GEOJSON_FUNCTION_TO_STRING.call(Object),EMPTY_CANONICAL_GEOJSON_PROJECTION=Object.freeze({diagnostics:Object.freeze([]),collection:void 0}),EMPTY_CANONICAL_GEOJSON_PROPERTIES=new Map;function spendGeoJsonProjectionWork(budget){return budget.remaining<=0?!1:(budget.remaining-=1,!0)}function projectedGeoJsonOwnValue(value,key,budget){if(!spendGeoJsonProjectionWork(budget))return INVALID_GEOJSON_PROJECTION_VALUE;const descriptor=ownDataValue(value,key);return isUnsafeDescriptor(descriptor)?INVALID_GEOJSON_PROJECTION_VALUE:descriptor===MISSING_OWN_DATA_DESCRIPTOR?descriptor:descriptor.value}function isPlainGeoJsonRecord(value){try{const prototype=Object.getPrototypeOf(value);if(prototype===null)return!0;if(Object.getPrototypeOf(prototype)!==null)return!1;const constructorDescriptor=Object.getOwnPropertyDescriptor(prototype,"constructor");if(!constructorDescriptor||!("value"in constructorDescriptor)||typeof constructorDescriptor.value!="function")return!1;const constructor=constructorDescriptor.value,constructorPrototype=Object.getOwnPropertyDescriptor(constructor,"prototype");return!!(constructorPrototype&&"value"in constructorPrototype&&constructorPrototype.value===prototype&&GEOJSON_FUNCTION_TO_STRING.call(constructor)===GEOJSON_OBJECT_CONSTRUCTOR_SOURCE)}catch{return!1}}function projectGeoJsonComparableValue(value,budget,depth=0){if(!spendGeoJsonProjectionWork(budget)||depth>GEOJSON_PROJECTION_DEPTH_LIMIT)return INVALID_GEOJSON_PROJECTION_VALUE;if(value==null||typeof value=="boolean"||typeof value=="string")return value;if(typeof value=="number")return Number.isFinite(value)?value:INVALID_GEOJSON_PROJECTION_VALUE;if(typeof value!="object"||budget.active.has(value))return INVALID_GEOJSON_PROJECTION_VALUE;const remembered=budget.seen.get(value);if(remembered!==void 0)return remembered;if(isRuntimeArray(value)){const length=projectedGeoJsonOwnValue(value,"length",budget);if(length===INVALID_GEOJSON_PROJECTION_VALUE||length===MISSING_OWN_DATA_DESCRIPTOR||typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>budget.remaining)return INVALID_GEOJSON_PROJECTION_VALUE;const output2=new Array(length);budget.seen.set(value,output2),budget.active.add(value);let completed2=!1;try{for(let index=0;index<length;index+=1){const entry=projectedGeoJsonOwnValue(value,String(index),budget);if(entry===INVALID_GEOJSON_PROJECTION_VALUE)return entry;if(entry===MISSING_OWN_DATA_DESCRIPTOR)continue;const projected=projectGeoJsonComparableValue(entry,budget,depth+1);if(projected===INVALID_GEOJSON_PROJECTION_VALUE)return projected;Object.defineProperty(output2,index,{value:projected,enumerable:!0,configurable:!1,writable:!1})}const frozen=Object.freeze(output2);return completed2=!0,frozen}finally{budget.active.delete(value),completed2||budget.seen.delete(value)}}if(!isPlainGeoJsonRecord(value))return INVALID_GEOJSON_PROJECTION_VALUE;const output=Object.create(null);budget.seen.set(value,output),budget.active.add(value);let completed=!1;try{for(const key in value){const entry=projectedGeoJsonOwnValue(value,key,budget);if(entry===INVALID_GEOJSON_PROJECTION_VALUE)return entry;if(entry===MISSING_OWN_DATA_DESCRIPTOR)continue;const projected=projectGeoJsonComparableValue(entry,budget,depth+1);if(projected===INVALID_GEOJSON_PROJECTION_VALUE)return projected;Object.defineProperty(output,key,{value:projected,enumerable:!0,configurable:!1,writable:!1})}const frozen=Object.freeze(output);return completed=!0,frozen}catch{return INVALID_GEOJSON_PROJECTION_VALUE}finally{budget.active.delete(value),completed||budget.seen.delete(value)}}function projectGeoJsonProperties(value,budget){if(value==null)return EMPTY_CANONICAL_GEOJSON_PROPERTIES;if(!isRuntimeRecord(value))return;const output=new Map;try{for(const key in value){const entry=projectedGeoJsonOwnValue(value,key,budget);if(entry===INVALID_GEOJSON_PROJECTION_VALUE)return;entry!==MISSING_OWN_DATA_DESCRIPTOR&&output.set(key,entry)}}catch{return}return output}function projectGeoJsonFeature(value,index,budget){if(!isRuntimeRecord(value))return;const type=projectedGeoJsonOwnValue(value,"type",budget),id=projectedGeoJsonOwnValue(value,"id",budget),geometry=projectedGeoJsonOwnValue(value,"geometry",budget),bbox=projectedGeoJsonOwnValue(value,"bbox",budget),properties=projectedGeoJsonOwnValue(value,"properties",budget);if(properties===INVALID_GEOJSON_PROJECTION_VALUE)return;const projectedProperties=projectGeoJsonProperties(properties===MISSING_OWN_DATA_DESCRIPTOR?void 0:properties,budget);if(!projectedProperties)return;const diagnostic=Object.freeze({id:typeof id=="string"||typeof id=="number"?id:void 0,index,properties:projectedProperties});if(type===INVALID_GEOJSON_PROJECTION_VALUE||id===INVALID_GEOJSON_PROJECTION_VALUE||geometry===INVALID_GEOJSON_PROJECTION_VALUE||bbox===INVALID_GEOJSON_PROJECTION_VALUE||type!=="Feature"||id===MISSING_OWN_DATA_DESCRIPTOR||typeof id!="string"&&typeof id!="number")return Object.freeze({diagnostic,feature:void 0});const comparableGeometry=projectGeoJsonComparableValue(geometry===MISSING_OWN_DATA_DESCRIPTOR?void 0:geometry,budget),comparableBbox=projectGeoJsonComparableValue(bbox===MISSING_OWN_DATA_DESCRIPTOR?void 0:bbox,budget);return Object.freeze(comparableGeometry===INVALID_GEOJSON_PROJECTION_VALUE||comparableBbox===INVALID_GEOJSON_PROJECTION_VALUE?{diagnostic,feature:void 0}:{diagnostic,feature:Object.freeze({id,index,feature:value,geometry:comparableGeometry,bbox:comparableBbox,properties:projectedProperties})})}function projectGeoJson(value){try{if(!isRuntimeRecord(value))return EMPTY_CANONICAL_GEOJSON_PROJECTION;const budget={remaining:GEOJSON_DIFF_VALUE_LIMIT,seen:new WeakMap,active:new WeakSet},type=projectedGeoJsonOwnValue(value,"type",budget),features=projectedGeoJsonOwnValue(value,"features",budget);if(type!=="FeatureCollection"||features===INVALID_GEOJSON_PROJECTION_VALUE||features===MISSING_OWN_DATA_DESCRIPTOR||!isRuntimeArray(features))return EMPTY_CANONICAL_GEOJSON_PROJECTION;const length=projectedGeoJsonOwnValue(features,"length",budget);if(length===INVALID_GEOJSON_PROJECTION_VALUE||length===MISSING_OWN_DATA_DESCRIPTOR||typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>GEOJSON_DIFF_FEATURE_LIMIT)return EMPTY_CANONICAL_GEOJSON_PROJECTION;const diagnostics=[],ordered=[],byId=new Map;let collectionIsAddressable=!0;for(let index=0;index<length;index+=1){const candidate=projectedGeoJsonOwnValue(features,String(index),budget);if(candidate===INVALID_GEOJSON_PROJECTION_VALUE||candidate===MISSING_OWN_DATA_DESCRIPTOR){collectionIsAddressable=!1;continue}const projected=projectGeoJsonFeature(candidate,index,budget);if(!projected){collectionIsAddressable=!1;continue}diagnostics.push(projected.diagnostic);const feature=projected.feature;if(!feature||byId.has(feature.id)){collectionIsAddressable=!1;continue}ordered.push(feature),byId.set(feature.id,feature)}return Object.freeze({diagnostics:Object.freeze(diagnostics),collection:collectionIsAddressable&&ordered.length===length?Object.freeze({ordered:Object.freeze(ordered),byId}):void 0})}catch{return EMPTY_CANONICAL_GEOJSON_PROJECTION}}function warnOnUntileableProperties(projection,sourceLabel){for(const feature of projection.diagnostics)for(const[key,value]of feature.properties){if(typeof value!="number"||!Number.isFinite(value)||Math.abs(value)<=Number.MAX_SAFE_INTEGER)continue;const identity=feature.id??`index ${feature.index}`;devWarnOnce(`lyra-map-untileable-property:${sourceLabel}:${key}`,`<lr-map>: feature ${String(identity)} in "${sourceLabel}" carries ${key}=${value}, which is too large to survive maplibre-gl's vector-tile encoding. Tiling happens in a worker, so the failure would reach you only as an opaque "Given varint doesn't fit into 10 bytes" error while the rest of the layer still paints. Carry a reduced figure in the feature and keep the exact value in your own data.`)}}function sameGeoJsonValue(previous,next,comparison){if(comparison.remaining<=0)return!1;if(comparison.remaining-=1,Object.is(previous,next))return!0;if(previous===null||next===null||typeof previous!="object"||typeof next!="object")return!1;const pairedNext=comparison.forward.get(previous);if(pairedNext)return pairedNext===next;const pairedPrevious=comparison.reverse.get(next);if(pairedPrevious)return pairedPrevious===previous;comparison.forward.set(previous,next),comparison.reverse.set(next,previous);const previousIsArray=Array.isArray(previous),nextIsArray=Array.isArray(next);if(previousIsArray||nextIsArray){if(!previousIsArray||!nextIsArray||previous.length!==next.length)return!1;for(let index=0;index<previous.length;index+=1){const before=Object.getOwnPropertyDescriptor(previous,String(index)),after=Object.getOwnPropertyDescriptor(next,String(index));if(!!before!=!!after)return!1;if(!(!before||!after)&&(!("value"in before)||!("value"in after)||!sameGeoJsonValue(before.value,after.value,comparison)))return!1}return!0}if(!isPlainGeoJsonRecord(previous)||!isPlainGeoJsonRecord(next))return!1;const previousKeys=Object.keys(previous),nextKeys=Object.keys(next);if(previousKeys.length!==nextKeys.length)return!1;for(let index=0;index<previousKeys.length;index+=1){const key=previousKeys[index];if(key!==nextKeys[index])return!1;const before=Object.getOwnPropertyDescriptor(previous,key),after=Object.getOwnPropertyDescriptor(next,key);if(!before||!after||!("value"in before)||!("value"in after)||!sameGeoJsonValue(before.value,after.value,comparison))return!1}return!0}function sameGeoJsonSnapshots(previous,next){try{return sameGeoJsonValue(previous,next,{remaining:GEOJSON_DIFF_VALUE_LIMIT,forward:new WeakMap,reverse:new WeakMap})}catch{return!1}}function buildProjectedGeoJsonPropertyDiff(previous,next){const previousCollection=previous.collection,nextCollection=next.collection;if(!previousCollection||!nextCollection)return null;const previousGeometry=[],nextGeometry=[];for(const after of nextCollection.ordered){const before=previousCollection.byId.get(after.id);before&&(previousGeometry.push(before.geometry,before.bbox),nextGeometry.push(after.geometry,after.bbox))}if(!sameGeoJsonSnapshots(previousGeometry,nextGeometry))return null;const retained=new Set;let previousIndex=-1;for(const feature of nextCollection.ordered){const before=previousCollection.byId.get(feature.id);if(!before||before.index<=previousIndex)break;retained.add(feature.id),previousIndex=before.index}const remove=previousCollection.ordered.filter(feature=>!retained.has(feature.id)).map(feature=>feature.id),add=nextCollection.ordered.filter(feature=>!retained.has(feature.id)).map(feature=>feature.feature),update=[];for(const after of nextCollection.ordered){if(!retained.has(after.id))continue;const before=previousCollection.byId.get(after.id),addOrUpdateProperties=[];for(const[key,value]of after.properties)Object.is(before.properties.get(key),value)||addOrUpdateProperties.push({key,value});const removeProperties=[...before.properties.keys()].filter(key=>!after.properties.has(key));addOrUpdateProperties.length===0&&removeProperties.length===0||update.push({id:after.id,addOrUpdateProperties,removeProperties})}return{...remove.length?{remove}:{},...add.length?{add}:{},update}}function buildGeoJsonPropertyDiff(previous,next){return buildProjectedGeoJsonPropertyDiff(projectGeoJson(previous),projectGeoJson(next))}class LyraMap extends LyraElement{static{this.defaultStrings={...super.defaultStrings,close:LYRA_DEFAULT_close,items:LYRA_DEFAULT_items,legendTypeHidden:LYRA_DEFAULT_legendTypeHidden,legendTypeShown:LYRA_DEFAULT_legendTypeShown,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,mapInitializationFailed:LYRA_DEFAULT_mapInitializationFailed,mapLegend:LYRA_DEFAULT_mapLegend,mapMissingLibrary:LYRA_DEFAULT_mapMissingLibrary,mapResetNorth:LYRA_DEFAULT_mapResetNorth,mapStyleRequired:LYRA_DEFAULT_mapStyleRequired,mapWebglUnavailable:LYRA_DEFAULT_mapWebglUnavailable,paginationSummary:LYRA_DEFAULT_paginationSummary,zoomIn:LYRA_DEFAULT_zoomIn,zoomOut:LYRA_DEFAULT_zoomOut}}static{this.immutableEventDetails=Object.freeze(["lr-map-click","lr-map-legend-panel-toggle","lr-map-legend-toggle","lr-map-marker-activate"])}static{this.identityEventDetailProperties=Object.freeze({"lr-map-click":Object.freeze(["feature"]),"lr-map-marker-activate":Object.freeze(["marker"])})}static{this.ownedCollectionProperties=Object.freeze(["center","mapStyle","choropleth","markers","dataLayers"])}static{this.identityCollectionProperties=Object.freeze(["markers","dataLayers"])}static{this.identityCollectionObjectProperties=Object.freeze(["choropleth"])}static{this.styles=[LyraElement.styles,styles,srOnly]}static preload(){return loadMaplibre().then(module=>module!==null)}constructor(){super(),this.center=[0,0],this.zoom=2,this.maxBounds=null,this._legend=EMPTY_MAP_LEGEND,this._legendProjection=EMPTY_MAP_LEGEND_PROJECTION,this._legendGrouped=!1,this.hasLegendSlot=!1,this.hasLegendStartSlot=!1,this._legendGradient=Object.freeze([]),this.legendGradientLoLabel=null,this.legendGradientHiLabel=null,this.legendInteractive=!1,this._legendControlRole="button",this.legendCollapsible=!1,this.legendOpen=!0,this._hiddenCategories=EMPTY_HIDDEN_CATEGORIES,this.markers=[],this.dataLayers=[],this._canonicalChoroplethSource=UNPROJECTED_MAP_VALUE,this._canonicalDataLayersSource=UNPROJECTED_MAP_VALUE,this._canonicalDataLayers=EMPTY_CANONICAL_MAP_DATA_LAYERS,this._canonicalMarkersSource=UNPROJECTED_MAP_VALUE,this._canonicalMarkers=EMPTY_CANONICAL_MAP_MARKERS,this.label="",this.loading=!0,this.loadLibrary=loadMaplibre,this.visible=ownerWindow(this)?.IntersectionObserver===void 0,this._styleLoaded=!1,this._appliedDataLayerIds=new Map,this._appliedDataLayerShapes=new Map,this._appliedGeoJson=new Map,this._nextDataLayerId=0,this.nextPointIconId=0,this.appliedPointPaint=new Set,this.appliedPointMuting=new Set,this.appliedPointIcons=new Map,this._webglReady=!1,this._markerInstances=new Map,this._markerLabels=new Map,this._markerPopupIds=new Map,this.markerActivationDetails=new WeakMap,this._configuredPopups=new WeakSet,this._nextPopupId=0,this._markerColors=new Map,this._connectGeneration=0,this.configuredMarkerElements=new WeakSet,this.onLegendSlotChange=event=>{const slot=event.target,filled=slot.assignedNodes({flatten:!0}).some(node=>node.nodeType===Node.ELEMENT_NODE||(node.textContent??"").trim().length>0);slot.name==="legend-start"?this.hasLegendStartSlot=filled:this.hasLegendSlot=filled},new ThemeWatcher(this,()=>this.refreshThemePaint())}get legend(){return this._legend}set legend(value){const previous=this._legend,normalized=normalizeMapLegend(value);this._legend=normalized.entries,this._legendProjection=normalized.projection,this._legendGrouped=normalized.grouped,this.requestUpdate("legend",previous)}probeLegendSlot(name){for(const child of Array.from(this.children))if(child.getAttribute("slot")===name)return!0;return!1}get legendGradient(){return this._legendGradient}set legendGradient(value){const previous=this._legendGradient;this._legendGradient=normalizeMapLegendGradient(value),this.requestUpdate("legendGradient",previous)}warnOnLegendChoroplethMismatch(){if(this.legendDescribesLine())return;const layer=this.canonicalChoropleth,legend=this.legendGradient;!layer||legend.length===0||layer.stops.length===0||legend.length===layer.stops.length&&legend.every(([legendValue,legendColor],index)=>{const layerStop=layer.stops[index];return layerStop!==void 0&&layerStop[0]===legendValue&&resolvedLayerColor(this,layerStop[1],void 0)===resolvedLayerColor(this,legendColor,void 0)})||devWarnOnce("lyra-map-legend-choropleth-mismatch",`<${this.localName}>: legendGradient does not match choropleth.stops, so the visible key may misdescribe the map. Assign the same stops array to both, or derive both from one source.`)}legendDescribesLine(){const stops=this.legendGradient;return stops.length<2?!1:this.canonicalDataLayers.some(layer=>layer.kind==="auto"&&!layer.cluster&&layer.line?.field&&layer.line.stops.length===stops.length&&layer.line.stops.every(([value,color],index)=>value===stops[index][0]&&resolvedLayerColor(this,color,layer.tone)===resolvedLayerColor(this,stops[index][1],layer.tone)))}get legendProjection(){return this._legendProjection}get legendControlRole(){return this._legendControlRole}set legendControlRole(next){const normalized=LEGEND_CONTROL_ROLE.normalizeReflected(this,"legend-control-role",next),old=this._legendControlRole;old!==normalized&&(this._legendControlRole=normalized,this.requestUpdate("legendControlRole",old))}get legendCollapsed(){return this.legendCollapsible&&!this.legendOpen}toggleLegendPanel(){if(!this.legendCollapsible)return;const open=!this.legendOpen;this.emit("lr-map-legend-panel-toggle",{open},{cancelable:!0}).defaultPrevented||(this.legendOpen=open)}renderLegendDisclosure(){return this.legendCollapsible?html`<button
13
13
  part="legend-disclosure"
14
14
  type="button"
15
15
  aria-expanded=${this.legendOpen?"true":"false"}
@@ -32,7 +32,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
32
32
  inert
33
33
  style=${styleMap(paint?{backgroundColor:paint}:{})}
34
34
  ></span>`}
35
- <span>${entry.label}</span>`}toggleLegendCategory(entry){const value=entry.value;if(!this.legendInteractive||value===void 0)return;const hidden=this.hiddenCategories,wasHidden=hidden.includes(value),next=wasHidden?hidden.filter(key=>key!==value):[...hidden,value];this.emit("lr-map-legend-toggle",{value,visible:wasHidden,hiddenCategories:next},{cancelable:!0}).defaultPrevented||(this.hiddenCategories=next,this.announceLegendVisibility(entry,wasHidden))}announceLegendVisibility(entry,nowVisible){this.syncLegendAnnouncementSink(),this.legendAnnouncementSink?.announce(this.localize(nowVisible?"legendTypeShown":"legendTypeHidden",void 0,{label:entry.label}))}syncLegendAnnouncementSink(){this.isConnected&&this.legendAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseLegendAnnouncementSink(),this.legendAnnouncementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}releaseLegendAnnouncementSink(){this.legendAnnouncementSink?.release(),this.legendAnnouncementSink=void 0}renderLegendRow(entry,index){const key=entry.value,interactive=this.legendInteractive&&key!==void 0,visible=key===void 0||!this.hiddenCategories.includes(key);return html`<div
35
+ <span>${entry.label}</span>`}toggleLegendCategory(entry){const value=entry.value;if(!this.legendInteractive||value===void 0)return;const hidden=this.hiddenCategories,wasHidden=hidden.includes(value),next=wasHidden?hidden.filter(key=>key!==value):[...hidden,value];this.emit("lr-map-legend-toggle",{value,visible:wasHidden,hiddenCategories:next},{cancelable:!0}).defaultPrevented||(this.hiddenCategories=next,this.announceLegendVisibility(entry,wasHidden))}announceLegendVisibility(entry,nowVisible){this.syncLegendAnnouncementSink(),this.legendAnnouncementSink?.announce(this.localize(nowVisible?"legendTypeShown":"legendTypeHidden",void 0,{label:entry.label}))}syncLegendAnnouncementSink(){this.isConnected&&this.legendAnnouncementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseLegendAnnouncementSink(),this.legendAnnouncementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}releaseLegendAnnouncementSink(){this.legendAnnouncementSink?.release(),this.legendAnnouncementSink=void 0}renderLegendRow(entry,index){const key=entry.value,interactive=this.legendInteractive&&key!==void 0,visible=key===void 0||!this.hiddenCategories.includes(key),checkbox=this.legendControlRole==="checkbox";return html`<div
36
36
  class="legend-row"
37
37
  role="listitem"
38
38
  aria-posinset=${String(index+1)}
@@ -41,7 +41,9 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
41
41
  ${interactive?html`<button
42
42
  part=${visible?"legend-toggle":"legend-toggle legend-toggle-hidden"}
43
43
  type="button"
44
- aria-pressed=${visible?"true":"false"}
44
+ role=${checkbox?"checkbox":nothing}
45
+ aria-pressed=${checkbox?nothing:visible?"true":"false"}
46
+ aria-checked=${checkbox?visible?"true":"false":nothing}
45
47
  @click=${()=>this.toggleLegendCategory(entry)}
46
48
  >${this.renderLegendRowContent(entry)}</button>`:this.renderLegendRowContent(entry)}
47
49
  </div>`}renderLegendRows(){if(!this._legendGrouped)return this.legend.map((entry,index)=>this.renderLegendRow(entry,index));const sections=[];return this.legend.forEach((entry,index)=>{const row=this.renderLegendRow(entry,index),open=sections[sections.length-1];open&&open.group===entry.group?open.rows.push(row):sections.push({group:entry.group,rows:[row]})}),sections.map((section,sectionIndex)=>{const rows=html`<div class="legend-section-list" role="list">${section.rows}</div>`;if(section.group===void 0)return rows;const headingId=`map-legend-group-${sectionIndex}`;return html`<div
@@ -100,4 +102,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
100
102
  <slot name="legend" ?hidden=${this.legendCollapsed} @slotchange=${this.onLegendSlotChange}></slot>
101
103
  </div>`:nothing}
102
104
  </div>
103
- `}}__decorate([property({type:Array})],LyraMap.prototype,"center",void 0),__decorate([property({type:Number})],LyraMap.prototype,"zoom",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"renderWorldCopies",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"maxBounds",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"mapStyle",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"legend",null),__decorate([state()],LyraMap.prototype,"hasLegendSlot",void 0),__decorate([state()],LyraMap.prototype,"hasLegendStartSlot",void 0),__decorate([property({attribute:"legend-gradient-lo-label"})],LyraMap.prototype,"legendGradientLoLabel",void 0),__decorate([property({attribute:"legend-gradient-hi-label"})],LyraMap.prototype,"legendGradientHiLabel",void 0),__decorate([property({type:Boolean,attribute:"legend-interactive",reflect:!0})],LyraMap.prototype,"legendInteractive",void 0),__decorate([property({type:Boolean,attribute:"legend-collapsible",reflect:!0})],LyraMap.prototype,"legendCollapsible",void 0),__decorate([property({attribute:"legend-open",reflect:!0,converter:trueDefaultBooleanConverter})],LyraMap.prototype,"legendOpen",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"hiddenCategories",null),__decorate([property({attribute:!1})],LyraMap.prototype,"choropleth",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"markers",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"dataLayers",void 0),__decorate([property()],LyraMap.prototype,"label",void 0),__decorate([state()],LyraMap.prototype,"loading",void 0),__decorate([state()],LyraMap.prototype,"failure",void 0),__decorate([state()],LyraMap.prototype,"visible",void 0),__decorate([query('[part="container"]')],LyraMap.prototype,"containerEl",void 0);export{LyraMap,buildGeoJsonPropertyDiff};
105
+ `}}__decorate([property({type:Array})],LyraMap.prototype,"center",void 0),__decorate([property({type:Number})],LyraMap.prototype,"zoom",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"renderWorldCopies",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"maxBounds",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"mapStyle",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"legend",null),__decorate([state()],LyraMap.prototype,"hasLegendSlot",void 0),__decorate([state()],LyraMap.prototype,"hasLegendStartSlot",void 0),__decorate([property({attribute:"legend-gradient-lo-label"})],LyraMap.prototype,"legendGradientLoLabel",void 0),__decorate([property({attribute:"legend-gradient-hi-label"})],LyraMap.prototype,"legendGradientHiLabel",void 0),__decorate([property({type:Boolean,attribute:"legend-interactive",reflect:!0})],LyraMap.prototype,"legendInteractive",void 0),__decorate([property({converter:LEGEND_CONTROL_ROLE,attribute:"legend-control-role",reflect:!0})],LyraMap.prototype,"legendControlRole",null),__decorate([property({type:Boolean,attribute:"legend-collapsible",reflect:!0})],LyraMap.prototype,"legendCollapsible",void 0),__decorate([property({attribute:"legend-open",reflect:!0,converter:trueDefaultBooleanConverter})],LyraMap.prototype,"legendOpen",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"hiddenCategories",null),__decorate([property({attribute:!1})],LyraMap.prototype,"choropleth",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"markers",void 0),__decorate([property({attribute:!1})],LyraMap.prototype,"dataLayers",void 0),__decorate([property()],LyraMap.prototype,"label",void 0),__decorate([state()],LyraMap.prototype,"loading",void 0),__decorate([state()],LyraMap.prototype,"failure",void 0),__decorate([state()],LyraMap.prototype,"visible",void 0),__decorate([query('[part="container"]')],LyraMap.prototype,"containerEl",void 0);export{LyraMap,buildGeoJsonPropertyDiff};