diff --git a/searx/static/themes/simple/.gitattributes b/searx/static/themes/simple/.gitattributes deleted file mode 100644 index dc8d7a30e..000000000 --- a/searx/static/themes/simple/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -leaflet.css -diff -leaflet.js -diff diff --git a/searx/static/themes/simple/css/images/layers-2x.png b/searx/static/themes/simple/css/images/layers-2x.png deleted file mode 100644 index 200c333dc..000000000 Binary files a/searx/static/themes/simple/css/images/layers-2x.png and /dev/null differ diff --git a/searx/static/themes/simple/css/images/layers.png b/searx/static/themes/simple/css/images/layers.png deleted file mode 100644 index 1a72e5784..000000000 Binary files a/searx/static/themes/simple/css/images/layers.png and /dev/null differ diff --git a/searx/static/themes/simple/css/images/marker-icon-2x.png b/searx/static/themes/simple/css/images/marker-icon-2x.png deleted file mode 100644 index 88f9e5018..000000000 Binary files a/searx/static/themes/simple/css/images/marker-icon-2x.png and /dev/null differ diff --git a/searx/static/themes/simple/css/images/marker-icon.png b/searx/static/themes/simple/css/images/marker-icon.png deleted file mode 100644 index 950edf246..000000000 Binary files a/searx/static/themes/simple/css/images/marker-icon.png and /dev/null differ diff --git a/searx/static/themes/simple/css/images/marker-shadow.png b/searx/static/themes/simple/css/images/marker-shadow.png deleted file mode 100644 index 9fd297953..000000000 Binary files a/searx/static/themes/simple/css/images/marker-shadow.png and /dev/null differ diff --git a/searx/static/themes/simple/css/leaflet.css b/searx/static/themes/simple/css/leaflet.css deleted file mode 100644 index 2961b7618..000000000 --- a/searx/static/themes/simple/css/leaflet.css +++ /dev/null @@ -1,661 +0,0 @@ -/* required styles */ - -.leaflet-pane, -.leaflet-tile, -.leaflet-marker-icon, -.leaflet-marker-shadow, -.leaflet-tile-container, -.leaflet-pane > svg, -.leaflet-pane > canvas, -.leaflet-zoom-box, -.leaflet-image-layer, -.leaflet-layer { - position: absolute; - left: 0; - top: 0; - } -.leaflet-container { - overflow: hidden; - } -.leaflet-tile, -.leaflet-marker-icon, -.leaflet-marker-shadow { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - -webkit-user-drag: none; - } -/* Prevents IE11 from highlighting tiles in blue */ -.leaflet-tile::selection { - background: transparent; -} -/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ -.leaflet-safari .leaflet-tile { - image-rendering: -webkit-optimize-contrast; - } -/* hack that prevents hw layers "stretching" when loading new tiles */ -.leaflet-safari .leaflet-tile-container { - width: 1600px; - height: 1600px; - -webkit-transform-origin: 0 0; - } -.leaflet-marker-icon, -.leaflet-marker-shadow { - display: block; - } -/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ -/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ -.leaflet-container .leaflet-overlay-pane svg { - max-width: none !important; - max-height: none !important; - } -.leaflet-container .leaflet-marker-pane img, -.leaflet-container .leaflet-shadow-pane img, -.leaflet-container .leaflet-tile-pane img, -.leaflet-container img.leaflet-image-layer, -.leaflet-container .leaflet-tile { - max-width: none !important; - max-height: none !important; - width: auto; - padding: 0; - } - -.leaflet-container img.leaflet-tile { - /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */ - mix-blend-mode: plus-lighter; -} - -.leaflet-container.leaflet-touch-zoom { - -ms-touch-action: pan-x pan-y; - touch-action: pan-x pan-y; - } -.leaflet-container.leaflet-touch-drag { - -ms-touch-action: pinch-zoom; - /* Fallback for FF which doesn't support pinch-zoom */ - touch-action: none; - touch-action: pinch-zoom; -} -.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { - -ms-touch-action: none; - touch-action: none; -} -.leaflet-container { - -webkit-tap-highlight-color: transparent; -} -.leaflet-container a { - -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); -} -.leaflet-tile { - filter: inherit; - visibility: hidden; - } -.leaflet-tile-loaded { - visibility: inherit; - } -.leaflet-zoom-box { - width: 0; - height: 0; - -moz-box-sizing: border-box; - box-sizing: border-box; - z-index: 800; - } -/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ -.leaflet-overlay-pane svg { - -moz-user-select: none; - } - -.leaflet-pane { z-index: 400; } - -.leaflet-tile-pane { z-index: 200; } -.leaflet-overlay-pane { z-index: 400; } -.leaflet-shadow-pane { z-index: 500; } -.leaflet-marker-pane { z-index: 600; } -.leaflet-tooltip-pane { z-index: 650; } -.leaflet-popup-pane { z-index: 700; } - -.leaflet-map-pane canvas { z-index: 100; } -.leaflet-map-pane svg { z-index: 200; } - -.leaflet-vml-shape { - width: 1px; - height: 1px; - } -.lvml { - behavior: url(#default#VML); - display: inline-block; - position: absolute; - } - - -/* control positioning */ - -.leaflet-control { - position: relative; - z-index: 800; - pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ - pointer-events: auto; - } -.leaflet-top, -.leaflet-bottom { - position: absolute; - z-index: 1000; - pointer-events: none; - } -.leaflet-top { - top: 0; - } -.leaflet-right { - right: 0; - } -.leaflet-bottom { - bottom: 0; - } -.leaflet-left { - left: 0; - } -.leaflet-control { - float: left; - clear: both; - } -.leaflet-right .leaflet-control { - float: right; - } -.leaflet-top .leaflet-control { - margin-top: 10px; - } -.leaflet-bottom .leaflet-control { - margin-bottom: 10px; - } -.leaflet-left .leaflet-control { - margin-left: 10px; - } -.leaflet-right .leaflet-control { - margin-right: 10px; - } - - -/* zoom and fade animations */ - -.leaflet-fade-anim .leaflet-popup { - opacity: 0; - -webkit-transition: opacity 0.2s linear; - -moz-transition: opacity 0.2s linear; - transition: opacity 0.2s linear; - } -.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { - opacity: 1; - } -.leaflet-zoom-animated { - -webkit-transform-origin: 0 0; - -ms-transform-origin: 0 0; - transform-origin: 0 0; - } -svg.leaflet-zoom-animated { - will-change: transform; -} - -.leaflet-zoom-anim .leaflet-zoom-animated { - -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); - -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); - transition: transform 0.25s cubic-bezier(0,0,0.25,1); - } -.leaflet-zoom-anim .leaflet-tile, -.leaflet-pan-anim .leaflet-tile { - -webkit-transition: none; - -moz-transition: none; - transition: none; - } - -.leaflet-zoom-anim .leaflet-zoom-hide { - visibility: hidden; - } - - -/* cursors */ - -.leaflet-interactive { - cursor: pointer; - } -.leaflet-grab { - cursor: -webkit-grab; - cursor: -moz-grab; - cursor: grab; - } -.leaflet-crosshair, -.leaflet-crosshair .leaflet-interactive { - cursor: crosshair; - } -.leaflet-popup-pane, -.leaflet-control { - cursor: auto; - } -.leaflet-dragging .leaflet-grab, -.leaflet-dragging .leaflet-grab .leaflet-interactive, -.leaflet-dragging .leaflet-marker-draggable { - cursor: move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; - cursor: grabbing; - } - -/* marker & overlays interactivity */ -.leaflet-marker-icon, -.leaflet-marker-shadow, -.leaflet-image-layer, -.leaflet-pane > svg path, -.leaflet-tile-container { - pointer-events: none; - } - -.leaflet-marker-icon.leaflet-interactive, -.leaflet-image-layer.leaflet-interactive, -.leaflet-pane > svg path.leaflet-interactive, -svg.leaflet-image-layer.leaflet-interactive path { - pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ - pointer-events: auto; - } - -/* visual tweaks */ - -.leaflet-container { - background: #ddd; - outline-offset: 1px; - } -.leaflet-container a { - color: #0078A8; - } -.leaflet-zoom-box { - border: 2px dotted #38f; - background: rgba(255,255,255,0.5); - } - - -/* general typography */ -.leaflet-container { - font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; - font-size: 12px; - font-size: 0.75rem; - line-height: 1.5; - } - - -/* general toolbar styles */ - -.leaflet-bar { - box-shadow: 0 1px 5px rgba(0,0,0,0.65); - border-radius: 4px; - } -.leaflet-bar a { - background-color: #fff; - border-bottom: 1px solid #ccc; - width: 26px; - height: 26px; - line-height: 26px; - display: block; - text-align: center; - text-decoration: none; - color: black; - } -.leaflet-bar a, -.leaflet-control-layers-toggle { - background-position: 50% 50%; - background-repeat: no-repeat; - display: block; - } -.leaflet-bar a:hover, -.leaflet-bar a:focus { - background-color: #f4f4f4; - } -.leaflet-bar a:first-child { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - } -.leaflet-bar a:last-child { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom: none; - } -.leaflet-bar a.leaflet-disabled { - cursor: default; - background-color: #f4f4f4; - color: #bbb; - } - -.leaflet-touch .leaflet-bar a { - width: 30px; - height: 30px; - line-height: 30px; - } -.leaflet-touch .leaflet-bar a:first-child { - border-top-left-radius: 2px; - border-top-right-radius: 2px; - } -.leaflet-touch .leaflet-bar a:last-child { - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - } - -/* zoom control */ - -.leaflet-control-zoom-in, -.leaflet-control-zoom-out { - font: bold 18px 'Lucida Console', Monaco, monospace; - text-indent: 1px; - } - -.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { - font-size: 22px; - } - - -/* layers control */ - -.leaflet-control-layers { - box-shadow: 0 1px 5px rgba(0,0,0,0.4); - background: #fff; - border-radius: 5px; - } -.leaflet-control-layers-toggle { - background-image: url(images/layers.png); - width: 36px; - height: 36px; - } -.leaflet-retina .leaflet-control-layers-toggle { - background-image: url(images/layers-2x.png); - background-size: 26px 26px; - } -.leaflet-touch .leaflet-control-layers-toggle { - width: 44px; - height: 44px; - } -.leaflet-control-layers .leaflet-control-layers-list, -.leaflet-control-layers-expanded .leaflet-control-layers-toggle { - display: none; - } -.leaflet-control-layers-expanded .leaflet-control-layers-list { - display: block; - position: relative; - } -.leaflet-control-layers-expanded { - padding: 6px 10px 6px 6px; - color: #333; - background: #fff; - } -.leaflet-control-layers-scrollbar { - overflow-y: scroll; - overflow-x: hidden; - padding-right: 5px; - } -.leaflet-control-layers-selector { - margin-top: 2px; - position: relative; - top: 1px; - } -.leaflet-control-layers label { - display: block; - font-size: 13px; - font-size: 1.08333em; - } -.leaflet-control-layers-separator { - height: 0; - border-top: 1px solid #ddd; - margin: 5px -10px 5px -6px; - } - -/* Default icon URLs */ -.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */ - background-image: url(images/marker-icon.png); - } - - -/* attribution and scale controls */ - -.leaflet-container .leaflet-control-attribution { - background: #fff; - background: rgba(255, 255, 255, 0.8); - margin: 0; - } -.leaflet-control-attribution, -.leaflet-control-scale-line { - padding: 0 5px; - color: #333; - line-height: 1.4; - } -.leaflet-control-attribution a { - text-decoration: none; - } -.leaflet-control-attribution a:hover, -.leaflet-control-attribution a:focus { - text-decoration: underline; - } -.leaflet-attribution-flag { - display: inline !important; - vertical-align: baseline !important; - width: 1em; - height: 0.6669em; - } -.leaflet-left .leaflet-control-scale { - margin-left: 5px; - } -.leaflet-bottom .leaflet-control-scale { - margin-bottom: 5px; - } -.leaflet-control-scale-line { - border: 2px solid #777; - border-top: none; - line-height: 1.1; - padding: 2px 5px 1px; - white-space: nowrap; - -moz-box-sizing: border-box; - box-sizing: border-box; - background: rgba(255, 255, 255, 0.8); - text-shadow: 1px 1px #fff; - } -.leaflet-control-scale-line:not(:first-child) { - border-top: 2px solid #777; - border-bottom: none; - margin-top: -2px; - } -.leaflet-control-scale-line:not(:first-child):not(:last-child) { - border-bottom: 2px solid #777; - } - -.leaflet-touch .leaflet-control-attribution, -.leaflet-touch .leaflet-control-layers, -.leaflet-touch .leaflet-bar { - box-shadow: none; - } -.leaflet-touch .leaflet-control-layers, -.leaflet-touch .leaflet-bar { - border: 2px solid rgba(0,0,0,0.2); - background-clip: padding-box; - } - - -/* popup */ - -.leaflet-popup { - position: absolute; - text-align: center; - margin-bottom: 20px; - } -.leaflet-popup-content-wrapper { - padding: 1px; - text-align: left; - border-radius: 12px; - } -.leaflet-popup-content { - margin: 13px 24px 13px 20px; - line-height: 1.3; - font-size: 13px; - font-size: 1.08333em; - min-height: 1px; - } -.leaflet-popup-content p { - margin: 17px 0; - margin: 1.3em 0; - } -.leaflet-popup-tip-container { - width: 40px; - height: 20px; - position: absolute; - left: 50%; - margin-top: -1px; - margin-left: -20px; - overflow: hidden; - pointer-events: none; - } -.leaflet-popup-tip { - width: 17px; - height: 17px; - padding: 1px; - - margin: -10px auto 0; - pointer-events: auto; - - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - transform: rotate(45deg); - } -.leaflet-popup-content-wrapper, -.leaflet-popup-tip { - background: white; - color: #333; - box-shadow: 0 3px 14px rgba(0,0,0,0.4); - } -.leaflet-container a.leaflet-popup-close-button { - position: absolute; - top: 0; - right: 0; - border: none; - text-align: center; - width: 24px; - height: 24px; - font: 16px/24px Tahoma, Verdana, sans-serif; - color: #757575; - text-decoration: none; - background: transparent; - } -.leaflet-container a.leaflet-popup-close-button:hover, -.leaflet-container a.leaflet-popup-close-button:focus { - color: #585858; - } -.leaflet-popup-scrolled { - overflow: auto; - } - -.leaflet-oldie .leaflet-popup-content-wrapper { - -ms-zoom: 1; - } -.leaflet-oldie .leaflet-popup-tip { - width: 24px; - margin: 0 auto; - - -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; - filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); - } - -.leaflet-oldie .leaflet-control-zoom, -.leaflet-oldie .leaflet-control-layers, -.leaflet-oldie .leaflet-popup-content-wrapper, -.leaflet-oldie .leaflet-popup-tip { - border: 1px solid #999; - } - - -/* div icon */ - -.leaflet-div-icon { - background: #fff; - border: 1px solid #666; - } - - -/* Tooltip */ -/* Base styles for the element that has a tooltip */ -.leaflet-tooltip { - position: absolute; - padding: 6px; - background-color: #fff; - border: 1px solid #fff; - border-radius: 3px; - color: #222; - white-space: nowrap; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - pointer-events: none; - box-shadow: 0 1px 3px rgba(0,0,0,0.4); - } -.leaflet-tooltip.leaflet-interactive { - cursor: pointer; - pointer-events: auto; - } -.leaflet-tooltip-top:before, -.leaflet-tooltip-bottom:before, -.leaflet-tooltip-left:before, -.leaflet-tooltip-right:before { - position: absolute; - pointer-events: none; - border: 6px solid transparent; - background: transparent; - content: ""; - } - -/* Directions */ - -.leaflet-tooltip-bottom { - margin-top: 6px; -} -.leaflet-tooltip-top { - margin-top: -6px; -} -.leaflet-tooltip-bottom:before, -.leaflet-tooltip-top:before { - left: 50%; - margin-left: -6px; - } -.leaflet-tooltip-top:before { - bottom: 0; - margin-bottom: -12px; - border-top-color: #fff; - } -.leaflet-tooltip-bottom:before { - top: 0; - margin-top: -12px; - margin-left: -6px; - border-bottom-color: #fff; - } -.leaflet-tooltip-left { - margin-left: -6px; -} -.leaflet-tooltip-right { - margin-left: 6px; -} -.leaflet-tooltip-left:before, -.leaflet-tooltip-right:before { - top: 50%; - margin-top: -6px; - } -.leaflet-tooltip-left:before { - right: 0; - margin-right: -12px; - border-left-color: #fff; - } -.leaflet-tooltip-right:before { - left: 0; - margin-left: -12px; - border-right-color: #fff; - } - -/* Printing */ - -@media print { - /* Prevent printers from removing background-images of controls. */ - .leaflet-control { - -webkit-print-color-adjust: exact; - print-color-adjust: exact; - } - } diff --git a/searx/static/themes/simple/css/ol.min.css b/searx/static/themes/simple/css/ol.min.css new file mode 100644 index 000000000..26b695b71 --- /dev/null +++ b/searx/static/themes/simple/css/ol.min.css @@ -0,0 +1 @@ +:root,:host{--ol-background-color:white;--ol-accent-background-color:#f5f5f5;--ol-subtle-background-color:#80808040;--ol-partial-background-color:#ffffffbf;--ol-foreground-color:#333;--ol-subtle-foreground-color:#666;--ol-brand-color:#0af}.ol-box{box-sizing:border-box;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color);border-radius:2px}.ol-mouse-position{position:absolute;top:8px;right:8px}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;padding:2px;position:absolute;bottom:8px;left:8px}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-align:center;will-change:contents,width;border-top:none;margin:1px;font-size:10px;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{background-color:var(--ol-foreground-color);float:right;z-index:10;width:1px;height:15px}.ol-scale-step-text{z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color);font-size:10px;position:absolute;bottom:-5px}.ol-scale-text{text-align:center;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color);font-size:12px;position:absolute;bottom:25px}.ol-scale-singlebar{z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color);height:10px;position:relative}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{background-color:var(--ol-subtle-background-color);border-radius:4px;position:absolute}.ol-zoom{top:.5em;left:.5em}.ol-rotate{transition:opacity .25s linear,visibility linear;top:.5em;right:.5em}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{top:.5em;right:.5em}.ol-control button{color:var(--ol-subtle-foreground-color);font-weight:700;font-size:inherit;text-align:center;background-color:var(--ol-background-color);border:none;border-radius:2px;width:1.375em;height:1.375em;margin:1px;padding:0;line-height:.4em;text-decoration:none;display:block}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{will-change:transform;font-weight:400;display:block}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-decoration:none}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;flex-flow:row-reverse;align-items:center;max-width:calc(100% - 1.3em);display:flex;bottom:.5em;right:.5em}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);margin:0;padding:1px .5em;font-size:12px}.ol-attribution li{list-style:none;display:inline}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{border-radius:4px 0 0;bottom:0;right:0}.ol-attribution.ol-uncollapsible img{max-height:1.6em;margin-top:-.2em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{height:200px;top:4.5em;left:.5em}.ol-zoomslider button{height:10px;position:relative}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{bottom:.5em;left:.5em}.ol-overviewmap.ol-uncollapsible{border-radius:0 4px 0 0;bottom:0;left:0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);width:150px;height:150px}.ol-overviewmap:not(.ol-collapsed) button{position:absolute;bottom:0;left:0}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer} diff --git a/searx/static/themes/simple/css/rss.min.css b/searx/static/themes/simple/css/rss.min.css index bc3a43091..35c887990 100644 --- a/searx/static/themes/simple/css/rss.min.css +++ b/searx/static/themes/simple/css/rss.min.css @@ -1 +1,2 @@ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--color-base-font: #444;--color-base-font-rgb: 68, 68, 68;--color-base-background: #fff;--color-base-background-mobile: #f2f5f8;--color-url-font: #334999;--color-url-visited-font: #9822c3;--color-header-background: #fdfbff;--color-header-border: #ddd;--color-footer-background: #fdfbff;--color-footer-border: #ddd;--color-sidebar-border: #ddd;--color-sidebar-font: #000;--color-sidebar-background: #fff;--color-backtotop-font: #444;--color-backtotop-border: #ddd;--color-backtotop-background: #fff;--color-btn-background: #3050ff;--color-btn-font: #fff;--color-show-btn-background: #bbb;--color-show-btn-font: #000;--color-search-border: #bbb;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #fff;--color-search-font: #222;--color-search-background-hover: #3050ff;--color-error: #db3434;--color-error-background: #fae1e1;--color-warning: #dbba34;--color-warning-background: #faf5e1;--color-success: #42db34;--color-success-background: #e3fae1;--color-categories-item-selected-font: #3050ff;--color-categories-item-border-selected: #3050ff;--color-autocomplete-font: #000;--color-autocomplete-border: #bbb;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #fff;--color-autocomplete-background-hover: #e3e3e3;--color-answer-font: #444;--color-answer-background: #fff;--color-result-keyvalue-col-table: #fdfbff;--color-result-keyvalue-odd: #fdfbff;--color-result-keyvalue-even: #fff;--color-result-background: #fff;--color-result-border: #ddd;--color-result-url-font: #000;--color-result-vim-selected: #f7f7f7;--color-result-vim-arrow: #000bbb;--color-result-description-highlight-font: #000;--color-result-link-font: #000bbb;--color-result-link-font-highlight: #000bbb;--color-result-link-visited-font: #9822c3;--color-result-publishdate-font: #777;--color-result-engines-font: #545454;--color-result-search-url-border: #ddd;--color-result-search-url-font: #000;--color-result-image-span-font: #444;--color-result-image-span-font-selected: #fff;--color-result-image-background: #fff;--color-settings-tr-hover: #ebebeb;--color-settings-engine-description-font: #545454;--color-settings-table-group-background: #0001;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #242424;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #545454;--color-toolkit-kbd-font: #fff;--color-toolkit-kbd-background: #000;--color-toolkit-dialog-border: #ddd;--color-toolkit-dialog-background: #fff;--color-toolkit-tabs-label-border: #fff;--color-toolkit-tabs-section-border: #ddd;--color-toolkit-select-background: #e1e1e1;--color-toolkit-select-border: #ddd;--color-toolkit-select-background-hover: #bbb;--color-toolkit-input-text-font: #222;--color-toolkit-checkbox-onoff-off-background: #ddd;--color-toolkit-checkbox-onoff-on-background: #ddd;--color-toolkit-checkbox-onoff-on-mark-background: #3050ff;--color-toolkit-checkbox-onoff-on-mark-color: #fff;--color-toolkit-checkbox-onoff-off-mark-background: #aaa;--color-toolkit-checkbox-onoff-off-mark-color: #fff;--color-toolkit-checkbox-label-background: #ddd;--color-toolkit-checkbox-label-border: #ddd;--color-toolkit-checkbox-input-border: #3050ff;--color-toolkit-engine-tooltip-border: #ddd;--color-toolkit-engine-tooltip-background: #fff;--color-toolkit-loader-border: rgba(0, 0, 0, .2);--color-toolkit-loader-borderleft: rgba(255, 255, 255, 0);--color-doc-code: #003;--color-doc-code-background: #ddeaff;--color-bar-chart-primary: #5bc0de;--color-bar-chart-secondary: #deb15b;--color-image-resolution-background: rgba(0, 0, 0, .5);--color-image-resolution-font: #fff;--color-loading-indicator: rgba(255, 255, 255, .2);--color-loading-indicator-gap: #fff;--color-line-number: #64708d;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}@media (prefers-color-scheme: dark){:root.theme-auto{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}}:root.theme-dark{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}:root.theme-black{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc;--color-base-background: #000;--color-base-background-mobile: #000;--color-header-background: #000;--color-footer-background: #000;--color-sidebar-background: #000}html,body,main{padding:0;margin:0}html{font-family:sans-serif;font-size:.9em;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:var(--color-base-font);background-color:var(--color-base-background);scroll-behavior:smooth}body{margin-inline:1rem}a{text-decoration:none;color:var(--color-url-font)}a:visited,a:visited .highlight{color:var(--color-url-visited-font)} +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{margin:.67em 0;font-size:2em}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:#0000}abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:100%;line-height:1.15}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner{border-style:none;padding:0}[type=button]::-moz-focus-inner{border-style:none;padding:0}[type=reset]::-moz-focus-inner{border-style:none;padding:0}[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring{outline:1px dotted buttontext}[type=button]:-moz-focusring{outline:1px dotted buttontext}[type=reset]:-moz-focusring{outline:1px dotted buttontext}[type=submit]:-moz-focusring{outline:1px dotted buttontext}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;white-space:normal;max-width:100%;padding:0;display:table}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button{height:auto}[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template,[hidden]{display:none}:root{--color-base-font:#444;--color-base-font-rgb:68,68,68;--color-base-background:#fff;--color-base-background-mobile:#f2f5f8;--color-url-font:#334999;--color-url-visited-font:#9822c3;--color-header-background:#fdfbff;--color-header-border:#ddd;--color-footer-background:#fdfbff;--color-footer-border:#ddd;--color-sidebar-border:#ddd;--color-sidebar-font:#000;--color-sidebar-background:#fff;--color-backtotop-font:#444;--color-backtotop-border:#ddd;--color-backtotop-background:#fff;--color-btn-background:#3050ff;--color-btn-font:#fff;--color-show-btn-background:#bbb;--color-show-btn-font:#000;--color-search-border:#bbb;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#fff;--color-search-font:#222;--color-search-background-hover:#3050ff;--color-error:#db3434;--color-error-background:#fae1e1;--color-warning:#dbba34;--color-warning-background:#faf5e1;--color-success:#42db34;--color-success-background:#e3fae1;--color-categories-item-selected-font:#3050ff;--color-categories-item-border-selected:#3050ff;--color-autocomplete-font:#000;--color-autocomplete-border:#bbb;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#fff;--color-autocomplete-background-hover:#e3e3e3;--color-answer-font:#444;--color-answer-background:#fff;--color-result-keyvalue-col-table:#fdfbff;--color-result-keyvalue-odd:#fdfbff;--color-result-keyvalue-even:#fff;--color-result-background:#fff;--color-result-border:#ddd;--color-result-url-font:#000;--color-result-vim-selected:#f7f7f7;--color-result-vim-arrow:#000bbb;--color-result-description-highlight-font:#000;--color-result-link-font:#000bbb;--color-result-link-font-highlight:#000bbb;--color-result-link-visited-font:#9822c3;--color-result-publishdate-font:#777;--color-result-engines-font:#545454;--color-result-search-url-border:#ddd;--color-result-search-url-font:#000;--color-result-image-span-font:#444;--color-result-image-span-font-selected:#fff;--color-result-image-background:#fff;--color-settings-tr-hover:#ebebeb;--color-settings-engine-description-font:#545454;--color-settings-table-group-background:#0001;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#242424;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#545454;--color-toolkit-kbd-font:#fff;--color-toolkit-kbd-background:#000;--color-toolkit-dialog-border:#ddd;--color-toolkit-dialog-background:#fff;--color-toolkit-tabs-label-border:#fff;--color-toolkit-tabs-section-border:#ddd;--color-toolkit-select-background:#e1e1e1;--color-toolkit-select-border:#ddd;--color-toolkit-select-background-hover:#bbb;--color-toolkit-input-text-font:#222;--color-toolkit-checkbox-onoff-off-background:#ddd;--color-toolkit-checkbox-onoff-on-background:#ddd;--color-toolkit-checkbox-onoff-on-mark-background:#3050ff;--color-toolkit-checkbox-onoff-on-mark-color:#fff;--color-toolkit-checkbox-onoff-off-mark-background:#aaa;--color-toolkit-checkbox-onoff-off-mark-color:#fff;--color-toolkit-checkbox-label-background:#ddd;--color-toolkit-checkbox-label-border:#ddd;--color-toolkit-checkbox-input-border:#3050ff;--color-toolkit-engine-tooltip-border:#ddd;--color-toolkit-engine-tooltip-background:#fff;--color-toolkit-loader-border:#0003;--color-toolkit-loader-borderleft:#fff0;--color-doc-code:#003;--color-doc-code-background:#ddeaff;--color-bar-chart-primary:#5bc0de;--color-bar-chart-secondary:#deb15b;--color-image-resolution-background:#00000080;--color-image-resolution-font:#fff;--color-loading-indicator:#fff3;--color-loading-indicator-gap:#fff;--color-line-number:#64708d;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}@media (prefers-color-scheme:dark){:root.theme-auto{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#222428;--color-base-background-mobile:#222428;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#1e1e22;--color-header-border:#333;--color-footer-background:#1e1e22;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#292c34;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}}:root.theme-dark{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#222428;--color-base-background-mobile:#222428;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#1e1e22;--color-header-border:#333;--color-footer-background:#1e1e22;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#292c34;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}:root.theme-black{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#000;--color-base-background-mobile:#000;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#000;--color-header-border:#333;--color-footer-background:#000;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#000;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}html,body,main{margin:0;padding:0}html{-moz-text-size-adjust:100%;text-size-adjust:100%;color:var(--color-base-font);background-color:var(--color-base-background);scroll-behavior:smooth;font-family:sans-serif;font-size:.9em}body{margin-inline:1rem}a{color:var(--color-url-font);text-decoration:none}a:visited,a:visited .highlight{color:var(--color-url-visited-font)} diff --git a/searx/static/themes/simple/css/searxng-ltr.min.css b/searx/static/themes/simple/css/searxng-ltr.min.css new file mode 100644 index 000000000..e9ea4c918 --- /dev/null +++ b/searx/static/themes/simple/css/searxng-ltr.min.css @@ -0,0 +1,2 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{margin:.67em 0;font-size:2em}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:#0000}abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:100%;line-height:1.15}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner{border-style:none;padding:0}[type=button]::-moz-focus-inner{border-style:none;padding:0}[type=reset]::-moz-focus-inner{border-style:none;padding:0}[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring{outline:1px dotted buttontext}[type=button]:-moz-focusring{outline:1px dotted buttontext}[type=reset]:-moz-focusring{outline:1px dotted buttontext}[type=submit]:-moz-focusring{outline:1px dotted buttontext}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;white-space:normal;max-width:100%;padding:0;display:table}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button{height:auto}[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template,[hidden]{display:none}:root{--color-base-font:#444;--color-base-font-rgb:68,68,68;--color-base-background:#fff;--color-base-background-mobile:#f2f5f8;--color-url-font:#334999;--color-url-visited-font:#9822c3;--color-header-background:#fdfbff;--color-header-border:#ddd;--color-footer-background:#fdfbff;--color-footer-border:#ddd;--color-sidebar-border:#ddd;--color-sidebar-font:#000;--color-sidebar-background:#fff;--color-backtotop-font:#444;--color-backtotop-border:#ddd;--color-backtotop-background:#fff;--color-btn-background:#3050ff;--color-btn-font:#fff;--color-show-btn-background:#bbb;--color-show-btn-font:#000;--color-search-border:#bbb;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#fff;--color-search-font:#222;--color-search-background-hover:#3050ff;--color-error:#db3434;--color-error-background:#fae1e1;--color-warning:#dbba34;--color-warning-background:#faf5e1;--color-success:#42db34;--color-success-background:#e3fae1;--color-categories-item-selected-font:#3050ff;--color-categories-item-border-selected:#3050ff;--color-autocomplete-font:#000;--color-autocomplete-border:#bbb;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#fff;--color-autocomplete-background-hover:#e3e3e3;--color-answer-font:#444;--color-answer-background:#fff;--color-result-keyvalue-col-table:#fdfbff;--color-result-keyvalue-odd:#fdfbff;--color-result-keyvalue-even:#fff;--color-result-background:#fff;--color-result-border:#ddd;--color-result-url-font:#000;--color-result-vim-selected:#f7f7f7;--color-result-vim-arrow:#000bbb;--color-result-description-highlight-font:#000;--color-result-link-font:#000bbb;--color-result-link-font-highlight:#000bbb;--color-result-link-visited-font:#9822c3;--color-result-publishdate-font:#777;--color-result-engines-font:#545454;--color-result-search-url-border:#ddd;--color-result-search-url-font:#000;--color-result-image-span-font:#444;--color-result-image-span-font-selected:#fff;--color-result-image-background:#fff;--color-settings-tr-hover:#ebebeb;--color-settings-engine-description-font:#545454;--color-settings-table-group-background:#0001;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#242424;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#545454;--color-toolkit-kbd-font:#fff;--color-toolkit-kbd-background:#000;--color-toolkit-dialog-border:#ddd;--color-toolkit-dialog-background:#fff;--color-toolkit-tabs-label-border:#fff;--color-toolkit-tabs-section-border:#ddd;--color-toolkit-select-background:#e1e1e1;--color-toolkit-select-border:#ddd;--color-toolkit-select-background-hover:#bbb;--color-toolkit-input-text-font:#222;--color-toolkit-checkbox-onoff-off-background:#ddd;--color-toolkit-checkbox-onoff-on-background:#ddd;--color-toolkit-checkbox-onoff-on-mark-background:#3050ff;--color-toolkit-checkbox-onoff-on-mark-color:#fff;--color-toolkit-checkbox-onoff-off-mark-background:#aaa;--color-toolkit-checkbox-onoff-off-mark-color:#fff;--color-toolkit-checkbox-label-background:#ddd;--color-toolkit-checkbox-label-border:#ddd;--color-toolkit-checkbox-input-border:#3050ff;--color-toolkit-engine-tooltip-border:#ddd;--color-toolkit-engine-tooltip-background:#fff;--color-toolkit-loader-border:#0003;--color-toolkit-loader-borderleft:#fff0;--color-doc-code:#003;--color-doc-code-background:#ddeaff;--color-bar-chart-primary:#5bc0de;--color-bar-chart-secondary:#deb15b;--color-image-resolution-background:#00000080;--color-image-resolution-font:#fff;--color-loading-indicator:#fff3;--color-loading-indicator-gap:#fff;--color-line-number:#64708d;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}@media (prefers-color-scheme:dark){:root.theme-auto{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#222428;--color-base-background-mobile:#222428;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#1e1e22;--color-header-border:#333;--color-footer-background:#1e1e22;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#292c34;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}}:root.theme-dark{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#222428;--color-base-background-mobile:#222428;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#1e1e22;--color-header-border:#333;--color-footer-background:#1e1e22;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#292c34;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}:root.theme-black{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#000;--color-base-background-mobile:#000;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#000;--color-header-border:#333;--color-footer-background:#000;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#000;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}.code-highlight pre{line-height:100%}.code-highlight td.linenos .normal,.code-highlight span.linenos{color:inherit;background-color:#0000;padding-left:5px;padding-right:5px}.code-highlight td.linenos .special,.code-highlight span.linenos.special{color:#000;background-color:#ffffc0;padding-left:5px;padding-right:5px}.code-highlight .hll{background-color:#ffc}.code-highlight .c{color:#3d7b7b;font-style:italic}.code-highlight .err{border:1px solid red}.code-highlight .k{color:green;font-weight:700}.code-highlight .o{color:#666}.code-highlight .ch,.code-highlight .cm{color:#3d7b7b;font-style:italic}.code-highlight .cp{color:#9c6500}.code-highlight .cpf,.code-highlight .c1,.code-highlight .cs{color:#3d7b7b;font-style:italic}.code-highlight .gd{color:#a00000}.code-highlight .ge{font-style:italic}.code-highlight .ges{font-style:italic;font-weight:700}.code-highlight .gr{color:#e40000}.code-highlight .gh{color:navy;font-weight:700}.code-highlight .gi{color:#008400}.code-highlight .go{color:#717171}.code-highlight .gp{color:navy;font-weight:700}.code-highlight .gs{font-weight:700}.code-highlight .gu{color:purple;font-weight:700}.code-highlight .gt{color:#04d}.code-highlight .kc,.code-highlight .kd,.code-highlight .kn{color:green;font-weight:700}.code-highlight .kp{color:green}.code-highlight .kr{color:green;font-weight:700}.code-highlight .kt{color:#b00040}.code-highlight .m{color:#666}.code-highlight .s{color:#ba2121}.code-highlight .na{color:#687822}.code-highlight .nb{color:green}.code-highlight .nc{color:#00f;font-weight:700}.code-highlight .no{color:#800}.code-highlight .nd{color:#a2f}.code-highlight .ni{color:#717171;font-weight:700}.code-highlight .ne{color:#cb3f38;font-weight:700}.code-highlight .nf{color:#00f}.code-highlight .nl{color:#767600}.code-highlight .nn{color:#00f;font-weight:700}.code-highlight .nt{color:green;font-weight:700}.code-highlight .nv{color:#19177c}.code-highlight .ow{color:#a2f;font-weight:700}.code-highlight .w{color:#bbb}.code-highlight .mb,.code-highlight .mf,.code-highlight .mh,.code-highlight .mi,.code-highlight .mo{color:#666}.code-highlight .sa,.code-highlight .sb,.code-highlight .sc,.code-highlight .dl{color:#ba2121}.code-highlight .sd{color:#ba2121;font-style:italic}.code-highlight .s2{color:#ba2121}.code-highlight .se{color:#aa5d1f;font-weight:700}.code-highlight .sh{color:#ba2121}.code-highlight .si{color:#a45a77;font-weight:700}.code-highlight .sx{color:green}.code-highlight .sr{color:#a45a77}.code-highlight .s1{color:#ba2121}.code-highlight .ss{color:#19177c}.code-highlight .bp{color:green}.code-highlight .fm{color:#00f}.code-highlight .vc,.code-highlight .vg,.code-highlight .vi,.code-highlight .vm{color:#19177c}.code-highlight .il{color:#666}.codelines{margin:.125rem 0 0;padding:1rem 0 0}.code-highlight pre{margin:0;padding:0 0 .75rem;overflow:auto}.code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;text-align:right;margin-right:8px}.code-highlight .linenos::selection{background:0 0}.code-highlight span.linenos{color:var(--color-line-number)}@media (prefers-color-scheme:dark){:root.theme-auto .code-highlight pre{line-height:100%}:root.theme-auto .code-highlight td.linenos .normal,:root.theme-auto .code-highlight span.linenos{color:#3c4354;background-color:#0000;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight td.linenos .special,:root.theme-auto .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight .hll{background-color:#6e7681}:root.theme-auto .code-highlight .c{color:#7e8aa1}:root.theme-auto .code-highlight .err{color:#f88f7f}:root.theme-auto .code-highlight .esc,:root.theme-auto .code-highlight .g{color:#d4d2c8}:root.theme-auto .code-highlight .k{color:#ffad66}:root.theme-auto .code-highlight .l{color:#d5ff80}:root.theme-auto .code-highlight .n{color:#d4d2c8}:root.theme-auto .code-highlight .o{color:#ffad66}:root.theme-auto .code-highlight .x,:root.theme-auto .code-highlight .p{color:#d4d2c8}:root.theme-auto .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-auto .code-highlight .cm{color:#7e8aa1}:root.theme-auto .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-auto .code-highlight .cpf,:root.theme-auto .code-highlight .c1{color:#7e8aa1}:root.theme-auto .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-auto .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-auto .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-auto .code-highlight .ges{color:#d4d2c8}:root.theme-auto .code-highlight .gr{color:#f88f7f}:root.theme-auto .code-highlight .gh{color:#d4d2c8}:root.theme-auto .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-auto .code-highlight .go{color:#7e8aa1}:root.theme-auto .code-highlight .gp{color:#d4d2c8}:root.theme-auto .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-auto .code-highlight .gu{color:#d4d2c8}:root.theme-auto .code-highlight .gt{color:#f88f7f}:root.theme-auto .code-highlight .kc,:root.theme-auto .code-highlight .kd,:root.theme-auto .code-highlight .kn,:root.theme-auto .code-highlight .kp,:root.theme-auto .code-highlight .kr{color:#ffad66}:root.theme-auto .code-highlight .kt{color:#73d0ff}:root.theme-auto .code-highlight .ld{color:#d5ff80}:root.theme-auto .code-highlight .m{color:#dfbfff}:root.theme-auto .code-highlight .s{color:#d5ff80}:root.theme-auto .code-highlight .na,:root.theme-auto .code-highlight .nb{color:#ffd173}:root.theme-auto .code-highlight .nc{color:#73d0ff}:root.theme-auto .code-highlight .no{color:#ffd173}:root.theme-auto .code-highlight .nd{color:#7e8aa1;font-style:italic;font-weight:700}:root.theme-auto .code-highlight .ni{color:#95e6cb}:root.theme-auto .code-highlight .ne{color:#73d0ff}:root.theme-auto .code-highlight .nf{color:#ffd173}:root.theme-auto .code-highlight .nl,:root.theme-auto .code-highlight .nn,:root.theme-auto .code-highlight .nx{color:#d4d2c8}:root.theme-auto .code-highlight .py{color:#ffd173}:root.theme-auto .code-highlight .nt{color:#5ccfe6}:root.theme-auto .code-highlight .nv{color:#d4d2c8}:root.theme-auto .code-highlight .ow{color:#ffad66}:root.theme-auto .code-highlight .pm,:root.theme-auto .code-highlight .w{color:#d4d2c8}:root.theme-auto .code-highlight .mb,:root.theme-auto .code-highlight .mf,:root.theme-auto .code-highlight .mh,:root.theme-auto .code-highlight .mi,:root.theme-auto .code-highlight .mo{color:#dfbfff}:root.theme-auto .code-highlight .sa{color:#f29e74}:root.theme-auto .code-highlight .sb,:root.theme-auto .code-highlight .sc,:root.theme-auto .code-highlight .dl{color:#d5ff80}:root.theme-auto .code-highlight .sd{color:#7e8aa1}:root.theme-auto .code-highlight .s2{color:#d5ff80}:root.theme-auto .code-highlight .se{color:#95e6cb}:root.theme-auto .code-highlight .sh{color:#d5ff80}:root.theme-auto .code-highlight .si,:root.theme-auto .code-highlight .sx,:root.theme-auto .code-highlight .sr{color:#95e6cb}:root.theme-auto .code-highlight .s1{color:#d5ff80}:root.theme-auto .code-highlight .ss{color:#dfbfff}:root.theme-auto .code-highlight .bp{color:#5ccfe6}:root.theme-auto .code-highlight .fm{color:#ffd173}:root.theme-auto .code-highlight .vc,:root.theme-auto .code-highlight .vg,:root.theme-auto .code-highlight .vi,:root.theme-auto .code-highlight .vm{color:#d4d2c8}:root.theme-auto .code-highlight .il{color:#dfbfff}:root.theme-auto .code-highlight pre{margin:0;padding:0 0 .75rem;overflow:auto}:root.theme-auto .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;text-align:right;margin-right:8px}:root.theme-auto .code-highlight .linenos::selection{background:0 0}:root.theme-auto .code-highlight span.linenos{color:var(--color-line-number)}}:root.theme-dark .code-highlight pre{line-height:100%}:root.theme-dark .code-highlight td.linenos .normal,:root.theme-dark .code-highlight span.linenos{color:#3c4354;background-color:#0000;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight td.linenos .special,:root.theme-dark .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight .hll{background-color:#6e7681}:root.theme-dark .code-highlight .c{color:#7e8aa1}:root.theme-dark .code-highlight .err{color:#f88f7f}:root.theme-dark .code-highlight .esc,:root.theme-dark .code-highlight .g{color:#d4d2c8}:root.theme-dark .code-highlight .k{color:#ffad66}:root.theme-dark .code-highlight .l{color:#d5ff80}:root.theme-dark .code-highlight .n{color:#d4d2c8}:root.theme-dark .code-highlight .o{color:#ffad66}:root.theme-dark .code-highlight .x,:root.theme-dark .code-highlight .p{color:#d4d2c8}:root.theme-dark .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-dark .code-highlight .cm{color:#7e8aa1}:root.theme-dark .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-dark .code-highlight .cpf,:root.theme-dark .code-highlight .c1{color:#7e8aa1}:root.theme-dark .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-dark .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-dark .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-dark .code-highlight .ges{color:#d4d2c8}:root.theme-dark .code-highlight .gr{color:#f88f7f}:root.theme-dark .code-highlight .gh{color:#d4d2c8}:root.theme-dark .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-dark .code-highlight .go{color:#7e8aa1}:root.theme-dark .code-highlight .gp{color:#d4d2c8}:root.theme-dark .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-dark .code-highlight .gu{color:#d4d2c8}:root.theme-dark .code-highlight .gt{color:#f88f7f}:root.theme-dark .code-highlight .kc,:root.theme-dark .code-highlight .kd,:root.theme-dark .code-highlight .kn,:root.theme-dark .code-highlight .kp,:root.theme-dark .code-highlight .kr{color:#ffad66}:root.theme-dark .code-highlight .kt{color:#73d0ff}:root.theme-dark .code-highlight .ld{color:#d5ff80}:root.theme-dark .code-highlight .m{color:#dfbfff}:root.theme-dark .code-highlight .s{color:#d5ff80}:root.theme-dark .code-highlight .na,:root.theme-dark .code-highlight .nb{color:#ffd173}:root.theme-dark .code-highlight .nc{color:#73d0ff}:root.theme-dark .code-highlight .no{color:#ffd173}:root.theme-dark .code-highlight .nd{color:#7e8aa1;font-style:italic;font-weight:700}:root.theme-dark .code-highlight .ni{color:#95e6cb}:root.theme-dark .code-highlight .ne{color:#73d0ff}:root.theme-dark .code-highlight .nf{color:#ffd173}:root.theme-dark .code-highlight .nl,:root.theme-dark .code-highlight .nn,:root.theme-dark .code-highlight .nx{color:#d4d2c8}:root.theme-dark .code-highlight .py{color:#ffd173}:root.theme-dark .code-highlight .nt{color:#5ccfe6}:root.theme-dark .code-highlight .nv{color:#d4d2c8}:root.theme-dark .code-highlight .ow{color:#ffad66}:root.theme-dark .code-highlight .pm,:root.theme-dark .code-highlight .w{color:#d4d2c8}:root.theme-dark .code-highlight .mb,:root.theme-dark .code-highlight .mf,:root.theme-dark .code-highlight .mh,:root.theme-dark .code-highlight .mi,:root.theme-dark .code-highlight .mo{color:#dfbfff}:root.theme-dark .code-highlight .sa{color:#f29e74}:root.theme-dark .code-highlight .sb,:root.theme-dark .code-highlight .sc,:root.theme-dark .code-highlight .dl{color:#d5ff80}:root.theme-dark .code-highlight .sd{color:#7e8aa1}:root.theme-dark .code-highlight .s2{color:#d5ff80}:root.theme-dark .code-highlight .se{color:#95e6cb}:root.theme-dark .code-highlight .sh{color:#d5ff80}:root.theme-dark .code-highlight .si,:root.theme-dark .code-highlight .sx,:root.theme-dark .code-highlight .sr{color:#95e6cb}:root.theme-dark .code-highlight .s1{color:#d5ff80}:root.theme-dark .code-highlight .ss{color:#dfbfff}:root.theme-dark .code-highlight .bp{color:#5ccfe6}:root.theme-dark .code-highlight .fm{color:#ffd173}:root.theme-dark .code-highlight .vc,:root.theme-dark .code-highlight .vg,:root.theme-dark .code-highlight .vi,:root.theme-dark .code-highlight .vm{color:#d4d2c8}:root.theme-dark .code-highlight .il{color:#dfbfff}:root.theme-dark .code-highlight pre{margin:0;padding:0 0 .75rem;overflow:auto}:root.theme-dark .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;text-align:right;margin-right:8px}:root.theme-dark .code-highlight .linenos::selection{background:0 0}:root.theme-dark .code-highlight span.linenos{color:var(--color-line-number)}html.no-js .hide_if_nojs,html.js .show_if_nojs{display:none}.center{text-align:center}.right{float:right}.left{float:left}.invisible{display:none!important}.list-unstyled{list-style-type:none}.list-unstyled li{margin-top:4px;margin-bottom:4px}.danger{background-color:var(--color-error-background)}.warning{background:var(--color-warning-background)}.success{background:var(--color-success-background)}.badge{color:var(--color-toolkit-badge-font);background-color:var(--color-toolkit-badge-background);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:5px;min-width:10px;padding:1px 5px;display:inline-block}kbd{color:var(--color-toolkit-kbd-font);background:var(--color-toolkit-kbd-background);margin:1px;padding:2px 4px;font-size:90%}table{width:100%}table.striped tr{border-bottom:1px solid var(--color-settings-tr-hover)}th{padding:.4em}td{padding:0 4px}tr:hover{background:var(--color-settings-tr-hover)!important}div.selectable_url{border:1px solid var(--color-result-search-url-border);color:var(--color-result-search-url-font);border-radius:5px;height:1.2em;margin:.1em;padding:4px;line-height:1.2em;display:block;overflow:hidden}div.selectable_url pre{word-break:break-all;-webkit-user-select:all;user-select:all;margin:.1em;font-size:.8em;display:block}.dialog-error{border:1px solid var(--color-toolkit-dialog-border);text-align:left;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error);border-radius:10px;margin:0 0 1em;padding:1rem;display:flex;position:relative}.dialog-error .close{float:right;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-error ul,.dialog-error ol,.dialog-error p{margin:1px 0 0}.dialog-error table{width:auto}.dialog-error tr{vertical-align:text-top}.dialog-error tr:hover{background:0 0!important}.dialog-error td{padding:0 1rem 0 0}.dialog-error h4{margin-top:.3em;margin-bottom:.3em}.dialog-error-block{border:1px solid var(--color-toolkit-dialog-border);text-align:left;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error);border-radius:10px;margin:0 0 1em;padding:1rem;display:block;position:relative}.dialog-error-block .close{float:right;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-error-block ul,.dialog-error-block ol,.dialog-error-block p{margin:1px 0 0}.dialog-error-block table{width:auto}.dialog-error-block tr{vertical-align:text-top}.dialog-error-block tr:hover{background:0 0!important}.dialog-error-block td{padding:0 1rem 0 0}.dialog-error-block h4{margin-top:.3em;margin-bottom:.3em}.dialog-warning{border:1px solid var(--color-toolkit-dialog-border);text-align:left;color:var(--color-warning);background:var(--color-warning-background);border-color:var(--color-warning);border-radius:10px;margin:0 0 1em;padding:1rem;display:flex;position:relative}.dialog-warning .close{float:right;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-warning ul,.dialog-warning ol,.dialog-warning p{margin:1px 0 0}.dialog-warning table{width:auto}.dialog-warning tr{vertical-align:text-top}.dialog-warning tr:hover{background:0 0!important}.dialog-warning td{padding:0 1rem 0 0}.dialog-warning h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal{border:1px solid var(--color-toolkit-dialog-border);text-align:left;background:var(--color-toolkit-dialog-background);z-index:5000;border-radius:10px;margin:0 auto;padding:1rem;display:block;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.dialog-modal .close{float:right;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-modal ul,.dialog-modal ol,.dialog-modal p{margin:1px 0 0}.dialog-modal table{width:auto}.dialog-modal tr{vertical-align:text-top}.dialog-modal tr:hover{background:0 0!important}.dialog-modal td{padding:0 1rem 0 0}.dialog-modal h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal h3{margin-top:0}.btn-collapse{cursor:pointer}.scrollx{border:none;margin:0;padding:0;display:block;overflow:auto hidden}.tabs .tabs>label{font-size:90%}ul.tabs{border-bottom:1px solid var(--color-toolkit-tabs-section-border);padding-left:0;list-style:none}ul.tabs li{display:flex}.tabs{flex-wrap:wrap;width:100%;min-width:100%;display:flex}.tabs>*{order:2}.tabs>input[type=radio]{display:none}.tabs>label,.tabs>li>a{letter-spacing:.5px;text-transform:uppercase;border:solid var(--color-toolkit-tabs-label-border);color:unset;-webkit-user-select:none;user-select:none;cursor:pointer;border-width:0 0 2px;order:1;margin:0 .7em;padding:.7em}.tabs>label.active,.tabs>li>a.active{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}.tabs>label:hover,.tabs>li>a:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}.tabs>section{box-sizing:border-box;border-top:1px solid var(--color-toolkit-tabs-section-border);min-width:100%;padding:.7rem 0;display:none}.tabs>label:last-of-type{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font);letter-spacing:-.1px}.tabs>section:last-of-type{display:block}html body .tabs>input:checked~section{display:none}html body .tabs>input:checked~label{position:inherit;background:inherit;color:inherit;border-bottom:2px solid #0000;font-weight:400}html body .tabs>input:checked~label:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}html body .tabs>input:checked+label{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}html body .tabs>input:checked+label+section{display:block}select{height:2.4rem;color:var(--color-search-font);z-index:100;margin:0 1rem 0 0;font-size:.9rem;padding:.2rem!important}select:hover,select:focus{cursor:pointer}@supports (background-position-x:100%) and (appearance:none){select{appearance:none;background:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E) calc(100% + 2rem) 0/2rem no-repeat content-box border-box;background-color:var(--color-toolkit-select-background);text-overflow:ellipsis;border-width:0 2rem 0 0;border-color:#0000;border-radius:5px;outline:none}select:hover,select:focus{background-color:var(--color-toolkit-select-background-hover)}select option{background-color:var(--color-base-background)}@media (prefers-color-scheme:dark){html.theme-auto select,html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}input.checkbox-onoff[type=checkbox]{appearance:none;cursor:pointer;border-radius:10px;width:2.5em;height:.7em;margin:0 16px;display:inline-block;position:relative;box-shadow:none!important}input.checkbox-onoff[type=checkbox]:focus,input.checkbox-onoff[type=checkbox]:hover{outline:none}input.checkbox-onoff[type=checkbox]:focus:after{content:"";border:1px solid var(--color-btn-background);width:3.5em;height:1.65em;box-shadow:var(--color-btn-background)0 0 3px;z-index:1200;border-radius:12px;position:absolute;top:-.55em;left:-.6em}input.checkbox-onoff[type=checkbox]:before{border-radius:50%;justify-content:center;align-items:center;width:1.875em;height:1.875em;font-size:.75em;display:flex;position:absolute;top:-.5em}input.checkbox-onoff[type=checkbox],input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked{background:var(--color-toolkit-checkbox-onoff-off-background)}input.checkbox-onoff[type=checkbox]:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked:before{content:"✕";color:var(--color-toolkit-checkbox-onoff-off-mark-color);background:var(--color-toolkit-checkbox-onoff-off-mark-background);left:-.5em}input.checkbox-onoff[type=checkbox]:checked,input.checkbox-onoff.reversed-checkbox[type=checkbox]{background:var(--color-toolkit-checkbox-onoff-on-background)}input.checkbox-onoff[type=checkbox]:checked:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:before{content:"✓";color:var(--color-toolkit-checkbox-onoff-on-mark-color);background:var(--color-toolkit-checkbox-onoff-on-mark-background);left:calc(100% - 1.5em)}@supports (transform:rotate(-45deg)){input[type=checkbox]:not(.checkbox-onoff){appearance:none;cursor:pointer;border:2px solid var(--color-toolkit-checkbox-input-border);border-radius:.3em;width:20px;height:20px;position:relative;top:0;left:0}input[type=checkbox]:not(.checkbox-onoff):after{content:"";border:3px solid var(--color-toolkit-checkbox-label-border);opacity:0;background:0 0;border-top:none;border-right:none;width:9px;height:5px;position:absolute;top:3px;left:2px;transform:rotate(-45deg)}input[type=checkbox]:not(.checkbox-onoff):checked:after{border-color:var(--color-toolkit-checkbox-input-border);opacity:1}input[type=checkbox][disabled]:not(.checkbox-onoff){border:inherit;cursor:inherit;background-color:#0000!important}input.checkbox[type=checkbox]:not(:checked,[disabled],.checkbox-onoff):hover:after{opacity:.5}}@media screen and (max-width:50em){.tabs>label{width:100%}}.loader,.loader:after{border-radius:50%;width:2em;height:2em}.loader{text-indent:-9999em;border-top:.5em solid var(--color-toolkit-loader-border);border-right:.5em solid var(--color-toolkit-loader-border);border-bottom:.5em solid var(--color-toolkit-loader-border);border-left:.5em solid var(--color-toolkit-loader-borderleft);margin:1em auto;font-size:10px;animation:1.2s linear infinite load8;position:relative;transform:translateZ(0)}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.engine-tooltip{border:1px solid var(--color-toolkit-engine-tooltip-border);background:var(--color-toolkit-engine-tooltip-background);z-index:5000;text-align:left;border-radius:10px;margin:0 0 0 2rem;padding:.5rem 1rem;font-size:14px;font-weight:400;display:none;position:absolute}th:hover .engine-tooltip,td:hover .engine-tooltip,.engine-tooltip:hover{display:inline-block}.stacked-bar-chart{flex-flow:row;align-items:center;width:100%;margin:0;padding:0 .125rem 0 4rem;display:inline-flex}.stacked-bar-chart-value{text-align:right;width:3rem;padding:0 .5rem;display:inline-block;position:absolute}.stacked-bar-chart-base{flex-grow:0;flex-shrink:0;flex-basis:unset;display:flex}.stacked-bar-chart-median{flex-grow:0;flex-shrink:0;flex-basis:unset;background:var(--color-base-font);border:1px solid rgba(var(--color-base-font-rgb),.9);padding:.3rem 0;display:flex}.stacked-bar-chart-rate80{flex-grow:0;flex-shrink:0;flex-basis:unset;border:1px solid rgba(var(--color-base-font-rgb),.3);background:0 0;padding:.3rem 0;display:flex}.stacked-bar-chart-rate95{flex-grow:0;flex-shrink:0;flex-basis:unset;border-bottom:1px dotted rgba(var(--color-base-font-rgb),.5);background:0 0;padding:0;display:flex}.stacked-bar-chart-rate100{flex-grow:0;flex-shrink:0;flex-basis:unset;border-left:1px solid rgba(var(--color-base-font-rgb),.9);background:0 0;width:1px;padding:.4rem 0;display:flex}.autocomplete{text-align:left;border-radius:10px;width:44rem;max-width:calc(100% - 1rem);max-height:0;position:absolute;overflow-y:hidden}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:var(--color-autocomplete-background)}.autocomplete:empty{display:none}.autocomplete>ul{margin:0;padding:0;list-style-type:none}.autocomplete>ul>li{cursor:pointer;padding:.5rem 1rem}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus,.autocomplete>ul>li:hover{background-color:var(--color-autocomplete-background-hover)}.autocomplete>ul>li.active a:active,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:hover a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:hover a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:hover,.autocomplete>ul>li:hover a:hover{text-decoration:none}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete.open{background-color:var(--color-autocomplete-background);color:var(--color-autocomplete-font);z-index:5000;border-radius:.8rem;max-height:32rem;margin-top:3.5rem;display:block;overflow-y:auto}.autocomplete.open:empty{display:none}@media screen and (max-width:50em){.autocomplete>ul>li{padding:1rem}}#main_results #results.image-detail-open.only_template_images{width:min(98%,59.25rem)!important}#main_results #results.only_template_images.image-detail-open #backToTop{right:inherit;left:56.75rem!important}article.result-images .detail{display:none}#results.image-detail-open article.result-images[data-vim-selected] .detail{background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-background);z-index:1000;flex-direction:column;padding:4rem 3rem 3rem;transition:top 64ms ease-in;display:flex;position:fixed;inset:13rem 0 0 60rem;overflow-y:scroll}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{text-align:left;border:none;flex:1;width:100%;text-decoration:none;display:block}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{object-fit:contain;width:inherit;height:inherit;max-width:100%;min-height:inherit;background:inherit;border:none;max-height:calc(100vh - 42rem);margin:0;padding:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels{color:var(--color-result-detail-font);height:19rem}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels hr{border-top:1px solid var(--color-result-detail-hr);border-bottom:none}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4{text-overflow:ellipsis;height:2rem;margin-bottom:0;font-size:.9rem;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p{color:var(--color-result-detail-label-font);white-space:nowrap;text-overflow:ellipsis;margin:.8rem 0;font-size:.9rem;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{width:12rem;display:inline-block}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a{text-align:left}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content{height:2rem;line-height:unset;text-overflow:ellipsis;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url:hover{background:var(--color-result-detail-background);position:relative;overflow:inherit!important;text-overflow:inherit!important}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:active{color:var(--color-result-detail-link)}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover{text-decoration:underline}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close{padding:.4rem;top:1rem;left:1rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{padding:.4rem .5rem .4rem .3rem;top:1rem;right:6rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{padding:.4rem;top:1rem;right:2rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{filter:opacity(40%);z-index:1200;border-radius:50%;width:1.5rem;height:1.5rem;display:block;position:absolute}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span{text-align:center;width:1.5rem;height:1.5rem;display:block}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span:before,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span:before{vertical-align:sub}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:active{color:var(--color-result-detail-font);background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-font)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover{filter:opacity(80%)}#results.image-detail-open article.result-images[data-vim-selected] .detail .loader{border-top:.5em solid var(--color-result-detail-loader-border);border-right:.5em solid var(--color-result-detail-loader-border);border-bottom:.5em solid var(--color-result-detail-loader-border);border-left:.5em solid var(--color-result-detail-loader-borderleft);position:absolute;top:1rem;right:50%}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail{top:0}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail a.result-images-source img{max-height:calc(100vh - 25rem)}@media screen and (max-width:79.75em){#results.image-detail-open article.result-images[data-vim-selected] .detail{top:0;left:0}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{flex-direction:column;justify-content:center;display:flex}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 24rem)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{right:1rem}}@media screen and (max-width:50em){#results.image-detail-open article.result-images[data-vim-selected] .detail{padding:1rem;top:0;left:0}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 2rem);margin:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{width:inherit;margin-right:1rem}}.dialog-modal{animation-name:dialogmodal;animation-duration:.13s}@keyframes dialogmodal{0%{opacity:0}50%{opacity:.5;transform:translate(-50%,-50%)scale(1.05)}}input.checkbox-onoff[type=checkbox]:before{transition:left .25s}iframe[src^="https://w.soundcloud.com"]{height:120px}iframe[src^="https://www.deezer.com"]{height:94px}iframe[src^="https://www.mixcloud.com"]{height:250px}iframe[src^="https://bandcamp.com/EmbeddedPlayer"]{height:350px}iframe[src^="https://bandcamp.com/EmbeddedPlayer/track"]{height:120px}iframe[src^="https://genius.com/songs"]{height:65px}.info-page code{background-color:var(--color-doc-code-background);color:var(--color-doc-code);border:0;border-radius:5px;padding:.2rem;font-family:monospace}.stats_endpoint .github-issue-button{font-size:16px;display:block}.stats_endpoint .issue-hide{display:none}.stats_endpoint input[type=checked]{position:absolute}.stats_endpoint label{margin:1rem 1rem 1rem 0}.stats_endpoint .step_content{margin:1rem 1rem 1rem 2rem}.stats_endpoint .step1,.stats_endpoint .step2{visibility:hidden}.stats_endpoint .step1_delay{transition:visibility 0s linear 4s}.stats_endpoint #step1:checked~.step1,.stats_endpoint #step2:checked~.step2{visibility:visible}.engine-stats{border-spacing:0;border-collapse:collapse}.engine-stats tr td,.engine-stats tr th{border-bottom:1px solid var(--color-result-border);padding:.25rem}.engine-stats table.engine-tooltip{border-spacing:0;border-collapse:collapse}.engine-stats table.engine-tooltip td,.engine-stats table.engine-tooltip th{border:none}.engine-stats .engine-name{width:20rem}.engine-stats .engine-score{text-align:right;width:7rem}.engine-stats .engine-reliability{text-align:right}table.engine-error th.engine-error-type,table.engine-error td.engine-error-type,failed-test{width:10rem}.engine-errors{margin-top:3rem}.engine-errors table.engine-error{border:1px solid var(--color-result-border);text-align:left;max-width:1280px;margin:1rem 0 3rem}.engine-errors table.engine-error tr th,.engine-errors table.engine-error tr td{padding:.5rem}.engine-errors table.engine-error span.log_parameters{border-right:1px solid solid var(--color-result-border);margin:0 0 0 .5rem;padding:0 1rem 0 0}.bar-chart-value{text-align:right;width:3em;padding-right:.5rem;display:inline-block}.bar-chart-graph{width:calc(100% - 5rem);display:inline-block}.bar-chart-bar{border:3px solid var(--color-bar-chart-primary);margin:1px 0}.bar-chart-serie1{border:3px solid var(--color-bar-chart-primary);float:left;margin:1px 0}.bar-chart-serie2{border:3px solid var(--color-bar-chart-secondary);float:left;margin:1px 0}.bar0{border:0;width:0}.bar1{width:1%}.bar2{width:2%}.bar3{width:3%}.bar4{width:4%}.bar5{width:5%}.bar6{width:6%}.bar7{width:7%}.bar8{width:8%}.bar9{width:9%}.bar10{width:10%}.bar11{width:11%}.bar12{width:12%}.bar13{width:13%}.bar14{width:14%}.bar15{width:15%}.bar16{width:16%}.bar17{width:17%}.bar18{width:18%}.bar19{width:19%}.bar20{width:20%}.bar21{width:21%}.bar22{width:22%}.bar23{width:23%}.bar24{width:24%}.bar25{width:25%}.bar26{width:26%}.bar27{width:27%}.bar28{width:28%}.bar29{width:29%}.bar30{width:30%}.bar31{width:31%}.bar32{width:32%}.bar33{width:33%}.bar34{width:34%}.bar35{width:35%}.bar36{width:36%}.bar37{width:37%}.bar38{width:38%}.bar39{width:39%}.bar40{width:40%}.bar41{width:41%}.bar42{width:42%}.bar43{width:43%}.bar44{width:44%}.bar45{width:45%}.bar46{width:46%}.bar47{width:47%}.bar48{width:48%}.bar49{width:49%}.bar50{width:50%}.bar51{width:51%}.bar52{width:52%}.bar53{width:53%}.bar54{width:54%}.bar55{width:55%}.bar56{width:56%}.bar57{width:57%}.bar58{width:58%}.bar59{width:59%}.bar60{width:60%}.bar61{width:61%}.bar62{width:62%}.bar63{width:63%}.bar64{width:64%}.bar65{width:65%}.bar66{width:66%}.bar67{width:67%}.bar68{width:68%}.bar69{width:69%}.bar70{width:70%}.bar71{width:71%}.bar72{width:72%}.bar73{width:73%}.bar74{width:74%}.bar75{width:75%}.bar76{width:76%}.bar77{width:77%}.bar78{width:78%}.bar79{width:79%}.bar80{width:80%}.bar81{width:81%}.bar82{width:82%}.bar83{width:83%}.bar84{width:84%}.bar85{width:85%}.bar86{width:86%}.bar87{width:87%}.bar88{width:88%}.bar89{width:89%}.bar90{width:90%}.bar91{width:91%}.bar92{width:92%}.bar93{width:93%}.bar94{width:94%}.bar95{width:95%}.bar96{width:96%}.bar97{width:97%}.bar98{width:98%}.bar99{width:99%}.bar100{width:100%}.osm-map-box{width:100%;height:300px;margin:10px 0}#answers .weather summary{list-style:none;display:block}#answers .weather div.summary{background-color:var(--color-header-background);border-radius:5px;margin:0;padding:.5rem 1rem}#answers .weather table{table-layout:fixed;border-collapse:separate;border-spacing:.1em 0;margin-top:.5rem;margin-bottom:.5rem;font-size:.9rem}#answers .weather td{text-overflow:ellipsis;padding:0;overflow:hidden}#answers .weather img.symbol{width:5rem;margin:auto;display:block}#main_index{margin-top:26vh}.index{text-align:center}.index .title{background:url(../img/searxng.png) 50%/contain no-repeat;min-height:4rem;margin:4rem auto}.index h1{visibility:hidden;font-size:4em}.index #search,.index #search_header{background:inherit;border:inherit;margin:0 auto;padding:0;display:block}.index .search_filters{margin:1em 0;display:block}.index .category label{padding:6px 10px;border-bottom:initial!important}@media screen and (max-width:79.75em){div.title h1{font-size:1em}#main_index{margin-top:6em}}table{border-collapse:collapse}table th,table td{text-align:center;text-align:left;padding:1rem .5rem}table tr.pref-group th{text-align:left;background:var(--color-settings-table-group-background);font-weight:400}#main_preferences form{width:100%}#main_preferences fieldset{border:none;margin:8px}#main_preferences legend{float:left;width:300px;margin:0;padding:5px 0 0;display:block}#main_preferences input[type=text]{width:13.25rem;color:var(--color-toolkit-input-text-font);background:none repeat scroll 0 0 var(--color-toolkit-select-background);border:none;border-radius:5px;height:2rem;padding:.2rem .4rem}#main_preferences input[type=text]:hover,#main_preferences input[type=text]:focus{background-color:var(--color-toolkit-select-background-hover)}#main_preferences div.pref-group{text-align:left;background:var(--color-settings-table-group-background);width:100%;padding:1rem .5rem;font-weight:400}#main_preferences .value{float:left;width:15em;margin:0;padding:0}#main_preferences .value select,#main_preferences .value input[type=text]{margin:0 1rem 0 0;font-size:inherit!important}#main_preferences .value select{width:14rem}#main_preferences .value select:focus,#main_preferences .value input:focus{box-shadow:0 0 1px 1px var(--color-btn-background);outline:none}#main_preferences .description{float:right;width:50%;color:var(--color-settings-engine-description-font);margin:0;padding:5px 0 0;font-size:90%}#main_preferences .bang{text-align:left;background-color:var(--color-doc-code-background);color:var(--color-doc-code);border:0;border-radius:5px;padding:.2rem}#main_preferences .category{margin-right:.5rem}#main_preferences .category label{border:2px solid #0000;border-radius:5px;padding:.2rem .4rem}#main_preferences .category input[type=checkbox]:checked+label{border:2px solid var(--color-categories-item-border-selected)}#main_preferences table.table_engines th.name label{cursor:pointer}#main_preferences table.table_engines th.name .engine-tooltip{max-width:40rem;margin-top:1.8rem;left:calc(50% - 32.5em)}#main_preferences table.table_engines th.name .engine-tooltip .engine-description{margin-top:.5rem}#main_preferences table.table_engines th.name .engine-tooltip .bang{margin:.3rem}#main_preferences table.table_engines .checkbox-col,#main_preferences table.table_engines .name,#main_preferences table.table_engines .shortcut{text-align:left}#main_preferences table.cookies{direction:ltr;width:100%}#main_preferences table.cookies th,#main_preferences table.cookies td{text-align:left;vertical-align:top;padding:.5em;font-family:monospace;font-size:1rem}#main_preferences table.cookies td:first-child{word-break:keep-all;width:14rem;padding-right:1rem}#main_preferences table.cookies td:last-child{word-break:break-all}#main_preferences table.cookies>tbody>tr:nth-child(2n)>th,#main_preferences table.cookies>tbody>tr:nth-child(2n)>td{background-color:var(--color-settings-tr-hover)}#main_preferences .preferences_back{background:none repeat scroll 0 0 var(--color-btn-background);color:var(--color-btn-font);cursor:pointer;border:0;border-radius:10px;margin:2px 4px;padding:.7em;display:inline-block}#main_preferences .preferences_back a{color:var(--color-settings-return-font)}#main_preferences .preferences_back a:first-letter{text-transform:uppercase}#main_preferences #toggle-all-engines-container{width:max-content;margin-left:auto}#main_preferences div.selectable_url pre{width:100%}#main_preferences #copy-hash-container{align-items:center;gap:.5rem;display:flex}#main_preferences #copy-hash-container div.selectable_url pre{flex-grow:1;width:auto}#main_preferences #pref-hash-input{width:100%}@media screen and (max-width:79.75em){.preferences_back{clear:both}.engine-tooltip{left:10em!important}}#search{margin:0;padding:0}#search_header{background:var(--color-header-background);border-bottom:1px solid var(--color-header-border);grid-template-columns:3rem 1fr;grid-template-areas:"logo search""spacer categories";gap:1rem 1.2rem;margin:0;padding-top:1.5em;padding-left:7rem;padding-right:2em;display:grid}.category_checkbox,.category_button{margin-right:1rem;padding:0;display:inline-block;position:relative}.category_checkbox input{display:none}.category_checkbox label{cursor:pointer;text-transform:capitalize;-webkit-user-select:none;user-select:none;border-bottom:2px solid #0000;padding:.2rem 0;font-size:.9em;display:inline-flex}.category_checkbox label svg{padding-right:.2rem}.category_checkbox label div.category_name{margin:auto 0}.category_checkbox input[type=checkbox]:checked+label{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}button.category_button{background-color:inherit;color:var(--color-base-font);cursor:pointer;text-transform:capitalize;border:none;border-bottom:2px solid #0000;align-items:center;padding:.2rem 0;font-size:.9em;display:inline-flex}button.category_button svg{padding-right:.2rem}button.category_button.selected,button.category_button:active{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}.no-js #categories_container:has(button.category_button:focus-within) button.category_button.selected{color:var(--color-base-font);border-bottom:none}.no-js #categories_container:has(button.category_button:focus-within) button.category_button:focus-within{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}#search_logo{grid-area:logo;justify-content:center;align-items:center;padding:.5rem 10px 0;display:flex}#search_logo svg{flex:1;width:30px;height:30px;margin:.5rem 0 auto}.search_categories{grid-area:categories}.search_categories .help{display:none}.search_categories:hover .help{background:var(--color-base-background);z-index:1000;width:100%;padding:1rem .6rem .6rem 0;display:block;position:absolute;left:-.1rem}#search_view{grid-area:search;padding:.5rem .5rem 0}body.results_endpoint #search_view{padding:.5rem 2.8rem 0 0}.search_box{white-space:nowrap;width:100%;max-width:44rem;box-shadow:var(--color-search-shadow);border-radius:.8rem;flex-direction:row;display:inline-flex}#clear_search{border-collapse:separate;box-sizing:border-box;background:none repeat scroll 0 0 var(--color-search-background);width:1.8rem;color:var(--color-search-font);z-index:1000;border:none;outline:none;margin:0;padding:.8rem .2rem;font-size:1.1rem;display:block}#clear_search:hover{color:var(--color-search-background-hover)}#clear_search.empty *,html.no-js #clear_search.hide_if_nojs{display:none}#q,#send_search{background:none repeat scroll 0 0 var(--color-search-background);color:var(--color-search-font);z-index:100;border:none;outline:none;margin:0;padding:.8rem;font-size:1.1rem;display:block}#q{border-radius:.8rem 0 0 .8rem;width:100%;padding-left:1rem;padding-right:0!important}#send_search{border-radius:0 .8rem .8rem 0}#send_search:hover{cursor:pointer;background-color:var(--color-search-background-hover);color:var(--color-search-background)}.no-js #clear_search,.no-js #send_search{border-left:1px solid var(--color-search-border);width:auto!important}.search_filters{overscroll-behavior-inline:contain;margin:.6rem 0 0 10.6rem;display:flex;overflow-x:auto}.search_filters select{background-color:inherit}.search_filters select:hover,.search_filters select:focus{color:var(--color-base-font)}@media screen and (max-width:79.75em){#search_header{column-gap:.5rem;padding:1.5em .5rem 0}.search_filters{margin:.6rem 0 0 3.5rem}#categories{clear:both;font-size:90%}}@media screen and (max-width:79.75em) and (hover:none){#main_index #categories_container,#main_results #categories_container{width:max-content}#main_index #categories_container .category_checkbox,#main_results #categories_container .category_checkbox{width:auto;display:inline-block}#main_index #categories,#main_results #categories{text-align:left;width:100%;overflow:scroll hidden}}@media screen and (max-width:50em){#search_header{grid-template-areas:"logo search""categories categories";gap:0;width:100%;margin:0;padding:.1rem 0 0}.search_logo{padding:0}.search_box{width:100%}#q{flex:1;width:100%}.search_filters{margin:0 10px;padding:.5rem 0}.category{width:auto;margin:0;display:inline-block}.category svg{display:none}.category_checkbox label,.category_button{margin:0!important;padding:1rem!important}#search_view:focus-within{background-color:var(--color-search-background);z-index:2000;width:100%;height:100%;display:block;position:absolute;top:0}#search_view:focus-within .search_box{border-bottom:1px solid var(--color-search-border);width:100%;box-shadow:none;border-radius:0}#search_view:focus-within .search_box #send_search{margin-right:0!important}#search_view:focus-within .search_box *{box-shadow:none;border:none;border-radius:0}#main_results #q:placeholder-shown~#send_search{margin-right:2.6rem;transition:margin .1s}}@media screen and (max-width:20rem){#search_header{grid-template-areas:"search search""categories categories"}#search_logo{display:none}}#categories{-webkit-user-select:none;user-select:none}#categories_container{position:relative}.favicon img{background-color:var(--color-favicon-background-color);border:1px solid var(--color-favicon-border-color);border-radius:10%;width:1.5rem;height:1.5rem;display:flex}@media screen and (min-width:50em){.center-alignment-yes #main_results{--center-page-width:48rem}}@media screen and (min-width:62rem){.center-alignment-yes #main_results{--center-page-width:60rem}}@media screen and (min-width:79.75em){.center-alignment-yes #main_results{--center-page-width:73rem}}@media screen and (min-width:50em) and (max-width:79.75em){.center-alignment-yes #main_results #results{grid-template-columns:60% calc(40% - 5rem);margin-left:0;margin-right:0}.center-alignment-yes #main_results #urls{margin-left:3rem}.center-alignment-yes #main_results #sidebar{margin-right:1rem}.center-alignment-yes #main_results #backToTop{left:calc(60% + 1rem)}}@media screen and (min-width:79.75em){.center-alignment-yes #main_results{flex-direction:column;align-items:center;display:flex}.center-alignment-yes #main_results #search{flex-direction:column;align-items:center;width:100%;display:flex}.center-alignment-yes #main_results #search_header{grid-template-columns:calc(50% - 4.5rem - var(--center-page-width)/2)3rem var(--center-page-width);grid-template-areas:"na logo search""na spacer categories";column-gap:1.2rem;width:100%;padding-left:0;padding-right:0}.center-alignment-yes #main_results .search_filters{width:var(--center-page-width);margin-left:.5rem}.center-alignment-yes #main_results #results{margin-left:10rem;margin-right:2rem}.center-alignment-yes #main_results #results.only_template_images,.center-alignment-yes #main_results #results.image-detail-open{align-self:flex-start}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open){grid-template-columns:calc(var(--center-page-width) - 5rem - 25rem)25rem;margin-left:1.5rem}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open) #backToTop{left:calc(50% - 25rem - 5rem + 1rem + var(--center-page-width)/2)}.center-alignment-yes #main_results #results .result .content{max-width:inherit}.center-alignment-yes #main_results #urls{margin-left:0}.center-alignment-yes #main_results #sidebar{margin-right:0}}.sxng-icon-set{vertical-align:bottom;-webkit-text-decoration:inherit;text-decoration:inherit;line-height:1;display:inline-block;transform:scale(1)}.sxng-icon-set-small{vertical-align:bottom;width:1rem;height:1rem;-webkit-text-decoration:inherit;text-decoration:inherit;line-height:1;display:inline-block;transform:scale(1)}.sxng-icon-set-big{vertical-align:bottom;width:1.5rem;height:1.5rem;-webkit-text-decoration:inherit;text-decoration:inherit;line-height:1;display:inline-block;transform:scale(1)}html{-moz-text-size-adjust:100%;text-size-adjust:100%;color:var(--color-base-font);background-color:var(--color-base-background);scroll-behavior:smooth;margin:0;padding:0;font-family:sans-serif;font-size:.9em}body,main{margin:0;padding:0}body{flex-direction:column;height:100vh;margin:0;display:flex}@supports (height:100dvh){body{height:100dvh}}main{flex:1;width:100%;margin-bottom:2rem}.page_with_header{width:85em;margin:2em auto}footer{clear:both;text-align:center;background-color:var(--color-footer-background);border-top:1px solid var(--color-footer-border);width:100%;min-height:4rem;padding:1rem 0;overflow:hidden}footer p{font-size:.9em}.page_with_header .logo{height:40px}input[type=submit],#results button[type=submit],.button{background:var(--color-btn-background);color:var(--color-btn-font);cursor:pointer;border:0;border-radius:10px;padding:.7rem;display:inline-block}a{color:var(--color-url-font);text-decoration:none}a:visited,a:visited .highlight{color:var(--color-url-visited-font)}article[data-vim-selected]{background:var(--color-result-vim-selected);border-left:.2rem solid var(--color-result-vim-arrow);border-radius:0 10px 10px 0}article.result-images[data-vim-selected]{background:var(--color-result-vim-arrow);border:none;border-radius:10px}article.result-images[data-vim-selected] .image_thumbnail{filter:opacity(60%)}article.result-images[data-vim-selected] span.title,article.result-images[data-vim-selected] span.source{color:var(--color-result-image-span-font-selected)}article[data-vim-selected].category-videos,article[data-vim-selected].category-news,article[data-vim-selected].category-map,article[data-vim-selected].category-music,article[data-vim-selected].category-files,article[data-vim-selected].category-social{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{box-sizing:border-box;border-left:.2rem solid #0000;width:100%;margin:.125rem 0;padding:1rem}.result h3{word-wrap:break-word;margin:.4rem 0;padding:0;font-size:1.2rem}.result h3 a{color:var(--color-result-link-font);font-size:1.1em;font-weight:400}.result h3 a:visited{color:var(--color-result-link-visited-font)}.result h3 a:focus,.result h3 a:hover{border:none;outline:none;text-decoration:underline}.result .cache_link,.result .proxyfied_link{margin-left:.5rem;font-size:smaller!important}.result .content,.result .stat{word-wrap:break-word;max-width:54em;margin:0;padding:0;font-size:.9em;line-height:1.24}.result .content .highlight,.result .stat .highlight{color:var(--color-result-description-highlight-font);background:inherit;font-weight:700}.result .altlink a{background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer;border-radius:5px;margin:0 10px 0 0;padding:5px 10px;font-size:.9em}.result .altlink a:hover{background:var(--color-btn-background);color:var(--color-btn-font)}.result .codelines .highlight{color:inherit;background:inherit;font-weight:400}.result .url_header{gap:.5rem;display:flex}.result .url_wrapper{color:var(--color-result-url-font);flex-flow:row;align-items:center;margin:0;padding:0;font-size:1rem;display:flex;overflow:hidden}.result .url_wrapper .url_o1{white-space:nowrap;flex-shrink:1;padding-bottom:1px}.result .url_wrapper .url_o1 .url_i1{unicode-bidi:plaintext}.result .url_wrapper .url_o1:after{content:" ";width:1ch;display:inline-block}.result .url_wrapper .url_o2{white-space:nowrap;flex:0 1 content;text-align:right;padding-bottom:1px;overflow:hidden}.result .url_wrapper .url_o2 .url_i2{float:right}.result .published_date,.result .result_length,.result .result_views,.result .result_author,.result .result_shipping,.result .result_source_country{color:var(--color-result-publishdate-font);font-size:.8em}.result .result_price{color:var(--color-result-description-highlight-font);font-size:1.2em}.result img.thumbnail{float:left;width:7rem;height:unset;padding-top:.6rem;padding-right:1rem}.result .break{clear:both}.result-paper .attributes,.result-packages .attributes{border-spacing:.125rem;display:table}.result-paper .attributes div,.result-packages .attributes div{display:table-row}.result-paper .attributes div span,.result-packages .attributes div span{margin-top:.25rem;font-size:.9rem;display:table-cell}.result-paper .attributes div span time,.result-packages .attributes div span time{font-size:.9rem}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{color:var(--color-base-font);min-width:10rem}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){color:var(--color-result-publishdate-font)}.result-paper .content,.result-packages .content{margin-top:.25rem}.result-paper .comments,.result-packages .comments{word-wrap:break-word;margin:.25rem 0 0;padding:0;font-size:.9rem;font-style:italic;line-height:1.24}.result-packages .attributes{margin-top:.3rem}.template_group_images{flex-wrap:wrap;display:flex}.template_group_images:after{content:"";flex-grow:10}.category-videos,.category-news,.category-map,.category-music,.category-files,.category-social{border:1px solid var(--color-result-border);border-radius:10px;margin:0 .5rem 1rem!important}.category-social .image{min-width:48px;min-height:48px;width:auto!important;padding:0 5px 25px 0!important}.audio-control audio,.embedded-content iframe{width:100%;padding:10px 0 0}.result-videos img.thumbnail{float:left;width:20rem;height:unset;padding-top:.6rem;padding-right:1rem}.result-videos .content{overflow:hidden}.result-videos .embedded-video iframe{aspect-ratio:16/9;width:100%;padding:10px 0 0}@supports not (aspect-ratio:1 / 1){.result-videos .embedded-video iframe{height:25.3125rem}}.engines{float:right;color:var(--color-result-engines-font);flex-wrap:wrap;justify-content:flex-end;display:flex}.engines span{margin:0 .5rem 0 0;font-size:smaller}.small_font{font-size:.8em}.highlight{color:var(--color-result-link-font-highlight);background:inherit}.empty_element{font-style:italic}.result-images{height:12rem;width:unset;flex-grow:1;margin:.25rem;padding:.5rem .5rem 3rem;border:none!important}.result-images>a{outline:none;position:relative}.result-images img{object-fit:cover;vertical-align:bottom;background:var(--color-result-image-background);border:none;width:auto;height:100%;margin:0;padding:0}.result-images .image_resolution{background:var(--color-image-resolution-background);color:var(--color-image-resolution-font);border-top-left-radius:.3rem;padding:.3rem .5rem;font-size:.9rem;position:absolute;bottom:0;right:0}.result-images span.title,.result-images span.source{width:100%;color:var(--color-result-image-span-font);text-overflow:ellipsis;white-space:nowrap;padding:.5rem 0 0;font-size:.9rem;display:block;position:absolute;overflow:hidden}.result-images span.source{padding:1.8rem 0 0;font-size:.7rem}.result-map img.image{float:right!important;width:auto!important;height:100px!important}.result-map table{border-collapse:separate;border-spacing:0 .35rem;width:auto;font-size:.9em}.result-map table th{font-weight:inherit;vertical-align:top;text-align:left;width:17rem}.result-map table td{vertical-align:top;text-align:left}.hidden{display:none!important}#results{grid-template:"corrections sidebar"min-content"answers sidebar"min-content"urls sidebar"1fr"pagination sidebar"min-content/45rem 25rem;gap:0 5rem;margin:1rem 2rem 0 10rem;display:grid}#results #sidebar :first-child{margin-top:0}#urls{grid-area:urls;padding:0}#apis .wrapper{display:flex}#suggestions .wrapper{flex-flow:column;justify-content:flex-end;display:flex}#suggestions .wrapper form{flex:50%;display:inline-block}#suggestions input,#infoboxes input{color:var(--color-result-search-url-font);cursor:pointer;text-overflow:ellipsis;text-align:left;background:0 0;width:100%;margin:3px;padding:0;font-size:.9em;display:inline-block;overflow:hidden}#suggestions input[type=submit],#infoboxes input[type=submit],#suggestions .infobox .url a,#infoboxes .infobox .url a{color:var(--color-result-link-font);font-size:.9rem;text-decoration:none}#suggestions input[type=submit]:hover,#infoboxes input[type=submit]:hover,#suggestions .infobox .url a:hover,#infoboxes .infobox .url a:hover{text-decoration:underline}#corrections{flex-flow:wrap;grid-area:corrections;margin:0 0 1em;display:flex}#corrections h4,#corrections input[type=submit]{margin:.5rem;padding:.5rem;display:inline-block}#corrections input[type=submit]{border-radius:5px;font-size:.8rem}#infoboxes .title,#suggestions .title,#search_url .title,#engines_msg .title,#apis .title{color:var(--color-base-font);margin:2em 0 .5em}summary.title{cursor:pointer;padding-top:1em}.sidebar-collapsible{border-top:1px solid var(--color-sidebar-border);padding-bottom:.5em}#sidebar-end-collapsible{border-bottom:1px solid var(--color-sidebar-border);width:100%}#answers{background:var(--color-answer-background);color:var(--color-answer-font);border-radius:10px;grid-area:answers;margin:0 0 1rem;padding:1rem}#answers h4{display:none}#answers span{overflow-wrap:anywhere}#answers .answer{flex-direction:column;display:flex}#answers .answer-url{margin:5px 10px 10px auto}#infoboxes form{min-width:210px}#sidebar{word-wrap:break-word;color:var(--color-sidebar-font);grid-area:sidebar}#sidebar .infobox{border:1px solid var(--color-sidebar-border);border-radius:10px;margin:10px 0;padding:1rem;font-size:.9em}#sidebar .infobox h2{margin:0 0 .5em}#sidebar .infobox img{max-width:100%;max-height:12em;margin:0 auto;padding:0;display:block}#sidebar .infobox dt{font-weight:700}#sidebar .infobox .attributes dl{margin:.5em 0}#sidebar .infobox .attributes dt{margin:.5em .25em .5em 0;padding:0;display:inline}#sidebar .infobox .attributes dd{margin:.5em 0;padding:0;display:inline}#sidebar .infobox input{font-size:1em}#sidebar .infobox br,#sidebar .infobox .attributes,#sidebar .infobox .urls{clear:both}#apis input{background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer;border-radius:5px;margin:0 10px 0 0;padding:5px 10px;font-size:.9em}#apis input:hover{background:var(--color-btn-background);color:var(--color-btn-font)}#engines_msg .engine-name{width:10rem}#engines_msg .response-error{color:var(--color-error)}#engines_msg .bar-chart-value{width:auto}#search_url div.selectable_url pre{float:left;width:200em}#search_url button#copy_url{float:right;border-radius:.3rem;margin-left:.5rem;padding:.4rem;display:none}#links_on_top{text-align:right;color:var(--color-search-font);border:0;align-items:center;padding:0;font-size:1em;display:flex;position:absolute;top:2.7rem;right:1rem}#links_on_top a{align-items:center;margin-left:1em;display:flex}#links_on_top a svg{margin-right:.125em;font-size:1.2em}#links_on_top a,#links_on_top a:link *,#links_on_top a:hover *,#links_on_top a:visited *,#links_on_top a:active *{color:var(--color-search-font)}#pagination{grid-area:pagination}#pagination br{clear:both}.numbered_pagination{flex-direction:row;justify-content:center;align-items:center;display:flex;overflow:hidden}.page_number{text-decoration:underline;color:var(--color-result-link-font)!important;background:0 0!important}.page_number_current{color:var(--color-result-link-visited-font);background:0 0;border:none}#backToTop{border:1px solid var(--color-backtotop-border);background:var(--color-backtotop-background);opacity:0;pointer-events:none;border-radius:10px;margin:0;padding:0;font-size:1em;transition:opacity .5s;position:fixed;bottom:8rem;left:56.3rem}#backToTop a{margin:0;padding:.7em;display:block}#backToTop a,#backToTop a:visited,#backToTop a:hover,#backToTop a:active{color:var(--color-backtotop-font)}#results.scrolling #backToTop{opacity:1;pointer-events:all}@media screen and (max-width:calc(79.75em - .5px)){#links_on_top span{display:none}}@media screen and (max-width:52rem){body.results_endpoint #links_on_top .link_on_top_about,body.results_endpoint #links_on_top .link_on_top_donate{display:none}}@media screen and (min-width:50em) and (max-width:79.75em){.center-alignment-no #links_on_top span{display:none}.center-alignment-no .page_with_header{width:auto;margin:2rem .5rem}.center-alignment-no #infoboxes{position:inherit;max-width:inherit}.center-alignment-no #infoboxes .infobox{clear:both}.center-alignment-no #infoboxes .infobox img{float:left;max-width:10em;margin:.5em .5em .5em 0}.center-alignment-no #sidebar{float:none;border:none;width:auto;margin:0 .5rem .125rem;padding:0}.center-alignment-no #sidebar input{border:0}.center-alignment-no .result .thumbnail{max-width:98%}.center-alignment-no .result .url span.url{white-space:nowrap;text-overflow:ellipsis;width:100%;display:block;overflow:hidden}.center-alignment-no .result .engines{float:right;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0;display:flex}.center-alignment-no .result-images{border-bottom:none!important}.center-alignment-no .image_result,.center-alignment-no .image_result img{max-width:98%}.center-alignment-no #backToTop{display:none}.center-alignment-no #pagination{margin:2rem 0 0!important}.center-alignment-no #main_results div#results{grid-template:"corrections"min-content"answers"min-content"sidebar"min-content"urls"1fr"pagination"min-content/45rem;justify-content:center;gap:0;margin:0 auto;display:grid}}#main_results div#results.only_template_images{grid-template:"corrections"min-content"answers"min-content"sidebar"min-content"urls"1fr"pagination"min-content/100%;gap:0;margin:1rem .5rem 0;display:grid}#main_results div#results.only_template_images #sidebar{display:none}#main_results div#results.only_template_images #urls{flex-wrap:wrap;margin:0;display:flex}#main_results div#results.only_template_images #urls:after{content:"";flex-grow:10}#main_results div#results.only_template_images #backToTop{left:auto;right:1rem}#main_results div#results.only_template_images #pagination{margin-right:4rem}@media screen and (max-width:50em){#links_on_top span{display:none}.page_with_header{width:auto;margin:2rem .5rem}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em;margin:.5em .5em .5em 0}#sidebar{float:none;border:none;width:auto;margin:0 .5rem .125rem;padding:0}#sidebar input{border:0}.result .thumbnail{max-width:98%}.result .url span.url{white-space:nowrap;text-overflow:ellipsis;width:100%;display:block;overflow:hidden}.result .engines{float:right;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0;display:flex}.result-images{border-bottom:none!important}.image_result,.image_result img{max-width:98%}#backToTop{display:none}#main_results div#results{grid-template:"corrections"min-content"answers"min-content"sidebar"min-content"urls"1fr"pagination"min-content/45rem;justify-content:center;gap:0;margin:0 auto;display:grid}html{background-color:var(--color-base-background-mobile)}#main_results div#results{grid-template-columns:100%;margin:0 auto}#links_on_top{top:1.4rem;right:10px}#main_index #links_on_top{top:.5rem;right:.5rem}#results{margin:0;padding:0}#pagination{margin:2rem 1rem 0!important}article[data-vim-selected]{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{background:var(--color-result-background);border:1px solid var(--color-result-background);border-radius:10px;width:96%;margin:1rem 2%}.result-images{background:var(--color-base-background-mobile);height:10rem;width:unset;margin:0}.infobox{background-color:var(--color-sidebar-background);border:none!important}.numbered_pagination{display:none}.result-paper .attributes,.result-packages .attributes,.result-paper .attributes div,.result-packages .attributes div{display:block}.result-paper .attributes div span,.result-packages .attributes div span{display:inline}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{font-weight:700}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){margin-left:.5rem}}@media screen and (max-width:35em){.result-videos img.thumbnail{float:none!important}.result-videos .content{overflow:inherit}}pre code{white-space:pre-wrap}#main_results .result-keyvalue caption{caption-side:bottom;background-color:var(--color-result-keyvalue-table);padding:.8rem .5rem;font-style:italic}#main_results .result-keyvalue .col-key{width:25%}#main_results .result-keyvalue table{word-break:break-word;table-layout:fixed;background-color:var(--color-result-keyvalue-table);width:100%}#main_results .result-keyvalue tr.odd{background-color:var(--color-result-keyvalue-odd)}#main_results .result-keyvalue tr.even{background-color:var(--color-result-keyvalue-even)}#main_results .result-keyvalue th,#main_results .result-keyvalue td{padding:.3rem .5rem} diff --git a/searx/static/themes/simple/css/searxng-rtl.min.css b/searx/static/themes/simple/css/searxng-rtl.min.css index ddcacbe09..cf63e13b0 100644 --- a/searx/static/themes/simple/css/searxng-rtl.min.css +++ b/searx/static/themes/simple/css/searxng-rtl.min.css @@ -1 +1,2 @@ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--color-base-font: #444;--color-base-font-rgb: 68, 68, 68;--color-base-background: #fff;--color-base-background-mobile: #f2f5f8;--color-url-font: #334999;--color-url-visited-font: #9822c3;--color-header-background: #fdfbff;--color-header-border: #ddd;--color-footer-background: #fdfbff;--color-footer-border: #ddd;--color-sidebar-border: #ddd;--color-sidebar-font: #000;--color-sidebar-background: #fff;--color-backtotop-font: #444;--color-backtotop-border: #ddd;--color-backtotop-background: #fff;--color-btn-background: #3050ff;--color-btn-font: #fff;--color-show-btn-background: #bbb;--color-show-btn-font: #000;--color-search-border: #bbb;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #fff;--color-search-font: #222;--color-search-background-hover: #3050ff;--color-error: #db3434;--color-error-background: #fae1e1;--color-warning: #dbba34;--color-warning-background: #faf5e1;--color-success: #42db34;--color-success-background: #e3fae1;--color-categories-item-selected-font: #3050ff;--color-categories-item-border-selected: #3050ff;--color-autocomplete-font: #000;--color-autocomplete-border: #bbb;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #fff;--color-autocomplete-background-hover: #e3e3e3;--color-answer-font: #444;--color-answer-background: #fff;--color-result-keyvalue-col-table: #fdfbff;--color-result-keyvalue-odd: #fdfbff;--color-result-keyvalue-even: #fff;--color-result-background: #fff;--color-result-border: #ddd;--color-result-url-font: #000;--color-result-vim-selected: #f7f7f7;--color-result-vim-arrow: #000bbb;--color-result-description-highlight-font: #000;--color-result-link-font: #000bbb;--color-result-link-font-highlight: #000bbb;--color-result-link-visited-font: #9822c3;--color-result-publishdate-font: #777;--color-result-engines-font: #545454;--color-result-search-url-border: #ddd;--color-result-search-url-font: #000;--color-result-image-span-font: #444;--color-result-image-span-font-selected: #fff;--color-result-image-background: #fff;--color-settings-tr-hover: #ebebeb;--color-settings-engine-description-font: #545454;--color-settings-table-group-background: #0001;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #242424;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #545454;--color-toolkit-kbd-font: #fff;--color-toolkit-kbd-background: #000;--color-toolkit-dialog-border: #ddd;--color-toolkit-dialog-background: #fff;--color-toolkit-tabs-label-border: #fff;--color-toolkit-tabs-section-border: #ddd;--color-toolkit-select-background: #e1e1e1;--color-toolkit-select-border: #ddd;--color-toolkit-select-background-hover: #bbb;--color-toolkit-input-text-font: #222;--color-toolkit-checkbox-onoff-off-background: #ddd;--color-toolkit-checkbox-onoff-on-background: #ddd;--color-toolkit-checkbox-onoff-on-mark-background: #3050ff;--color-toolkit-checkbox-onoff-on-mark-color: #fff;--color-toolkit-checkbox-onoff-off-mark-background: #aaa;--color-toolkit-checkbox-onoff-off-mark-color: #fff;--color-toolkit-checkbox-label-background: #ddd;--color-toolkit-checkbox-label-border: #ddd;--color-toolkit-checkbox-input-border: #3050ff;--color-toolkit-engine-tooltip-border: #ddd;--color-toolkit-engine-tooltip-background: #fff;--color-toolkit-loader-border: rgba(0, 0, 0, .2);--color-toolkit-loader-borderleft: rgba(255, 255, 255, 0);--color-doc-code: #003;--color-doc-code-background: #ddeaff;--color-bar-chart-primary: #5bc0de;--color-bar-chart-secondary: #deb15b;--color-image-resolution-background: rgba(0, 0, 0, .5);--color-image-resolution-font: #fff;--color-loading-indicator: rgba(255, 255, 255, .2);--color-loading-indicator-gap: #fff;--color-line-number: #64708d;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}@media (prefers-color-scheme: dark){:root.theme-auto{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}}:root.theme-dark{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}:root.theme-black{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc;--color-base-background: #000;--color-base-background-mobile: #000;--color-header-background: #000;--color-footer-background: #000;--color-sidebar-background: #000}.code-highlight pre{line-height:100%}.code-highlight td.linenos .normal,.code-highlight span.linenos{color:inherit;background-color:transparent;padding-left:5px;padding-right:5px}.code-highlight td.linenos .special,.code-highlight span.linenos.special{color:#000;background-color:#ffffc0;padding-left:5px;padding-right:5px}.code-highlight .hll{background-color:#ffc}.code-highlight .c{color:#3d7b7b;font-style:italic}.code-highlight .err{border:1px solid #F00}.code-highlight .k{color:green;font-weight:700}.code-highlight .o{color:#666}.code-highlight .ch,.code-highlight .cm{color:#3d7b7b;font-style:italic}.code-highlight .cp{color:#9c6500}.code-highlight .cpf,.code-highlight .c1,.code-highlight .cs{color:#3d7b7b;font-style:italic}.code-highlight .gd{color:#a00000}.code-highlight .ge{font-style:italic}.code-highlight .ges{font-weight:700;font-style:italic}.code-highlight .gr{color:#e40000}.code-highlight .gh{color:navy;font-weight:700}.code-highlight .gi{color:#008400}.code-highlight .go{color:#717171}.code-highlight .gp{color:navy;font-weight:700}.code-highlight .gs{font-weight:700}.code-highlight .gu{color:purple;font-weight:700}.code-highlight .gt{color:#04d}.code-highlight .kc,.code-highlight .kd,.code-highlight .kn{color:green;font-weight:700}.code-highlight .kp{color:green}.code-highlight .kr{color:green;font-weight:700}.code-highlight .kt{color:#b00040}.code-highlight .m{color:#666}.code-highlight .s{color:#ba2121}.code-highlight .na{color:#687822}.code-highlight .nb{color:green}.code-highlight .nc{color:#00f;font-weight:700}.code-highlight .no{color:#800}.code-highlight .nd{color:#a2f}.code-highlight .ni{color:#717171;font-weight:700}.code-highlight .ne{color:#cb3f38;font-weight:700}.code-highlight .nf{color:#00f}.code-highlight .nl{color:#767600}.code-highlight .nn{color:#00f;font-weight:700}.code-highlight .nt{color:green;font-weight:700}.code-highlight .nv{color:#19177c}.code-highlight .ow{color:#a2f;font-weight:700}.code-highlight .w{color:#bbb}.code-highlight .mb,.code-highlight .mf,.code-highlight .mh,.code-highlight .mi,.code-highlight .mo{color:#666}.code-highlight .sa,.code-highlight .sb,.code-highlight .sc,.code-highlight .dl{color:#ba2121}.code-highlight .sd{color:#ba2121;font-style:italic}.code-highlight .s2{color:#ba2121}.code-highlight .se{color:#aa5d1f;font-weight:700}.code-highlight .sh{color:#ba2121}.code-highlight .si{color:#a45a77;font-weight:700}.code-highlight .sx{color:green}.code-highlight .sr{color:#a45a77}.code-highlight .s1{color:#ba2121}.code-highlight .ss{color:#19177c}.code-highlight .bp{color:green}.code-highlight .fm{color:#00f}.code-highlight .vc,.code-highlight .vg,.code-highlight .vi,.code-highlight .vm{color:#19177c}.code-highlight .il{color:#666}.codelines{margin:.125rem 0 0;padding:1rem 0 0}.code-highlight pre{overflow:auto;margin:0;padding:0 0 .75rem}.code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;margin-right:8px;text-align:right}.code-highlight .linenos::selection{background:transparent}.code-highlight .linenos::-moz-selection{background:transparent}.code-highlight span.linenos{color:var(--color-line-number)}@media (prefers-color-scheme: dark){:root.theme-auto .code-highlight pre{line-height:100%}:root.theme-auto .code-highlight td.linenos .normal{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight span.linenos{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight td.linenos .special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight .hll{background-color:#6e7681}:root.theme-auto .code-highlight .c{color:#7e8aa1}:root.theme-auto .code-highlight .err{color:#f88f7f}:root.theme-auto .code-highlight .esc{color:#d4d2c8}:root.theme-auto .code-highlight .g{color:#d4d2c8}:root.theme-auto .code-highlight .k{color:#ffad66}:root.theme-auto .code-highlight .l{color:#d5ff80}:root.theme-auto .code-highlight .n{color:#d4d2c8}:root.theme-auto .code-highlight .o{color:#ffad66}:root.theme-auto .code-highlight .x{color:#d4d2c8}:root.theme-auto .code-highlight .p{color:#d4d2c8}:root.theme-auto .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-auto .code-highlight .cm{color:#7e8aa1}:root.theme-auto .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-auto .code-highlight .cpf{color:#7e8aa1}:root.theme-auto .code-highlight .c1{color:#7e8aa1}:root.theme-auto .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-auto .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-auto .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-auto .code-highlight .ges{color:#d4d2c8}:root.theme-auto .code-highlight .gr{color:#f88f7f}:root.theme-auto .code-highlight .gh{color:#d4d2c8}:root.theme-auto .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-auto .code-highlight .go{color:#7e8aa1}:root.theme-auto .code-highlight .gp{color:#d4d2c8}:root.theme-auto .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-auto .code-highlight .gu{color:#d4d2c8}:root.theme-auto .code-highlight .gt{color:#f88f7f}:root.theme-auto .code-highlight .kc{color:#ffad66}:root.theme-auto .code-highlight .kd{color:#ffad66}:root.theme-auto .code-highlight .kn{color:#ffad66}:root.theme-auto .code-highlight .kp{color:#ffad66}:root.theme-auto .code-highlight .kr{color:#ffad66}:root.theme-auto .code-highlight .kt{color:#73d0ff}:root.theme-auto .code-highlight .ld{color:#d5ff80}:root.theme-auto .code-highlight .m{color:#dfbfff}:root.theme-auto .code-highlight .s{color:#d5ff80}:root.theme-auto .code-highlight .na{color:#ffd173}:root.theme-auto .code-highlight .nb{color:#ffd173}:root.theme-auto .code-highlight .nc{color:#73d0ff}:root.theme-auto .code-highlight .no{color:#ffd173}:root.theme-auto .code-highlight .nd{color:#7e8aa1;font-weight:700;font-style:italic}:root.theme-auto .code-highlight .ni{color:#95e6cb}:root.theme-auto .code-highlight .ne{color:#73d0ff}:root.theme-auto .code-highlight .nf{color:#ffd173}:root.theme-auto .code-highlight .nl{color:#d4d2c8}:root.theme-auto .code-highlight .nn{color:#d4d2c8}:root.theme-auto .code-highlight .nx{color:#d4d2c8}:root.theme-auto .code-highlight .py{color:#ffd173}:root.theme-auto .code-highlight .nt{color:#5ccfe6}:root.theme-auto .code-highlight .nv{color:#d4d2c8}:root.theme-auto .code-highlight .ow{color:#ffad66}:root.theme-auto .code-highlight .pm{color:#d4d2c8}:root.theme-auto .code-highlight .w{color:#d4d2c8}:root.theme-auto .code-highlight .mb{color:#dfbfff}:root.theme-auto .code-highlight .mf{color:#dfbfff}:root.theme-auto .code-highlight .mh{color:#dfbfff}:root.theme-auto .code-highlight .mi{color:#dfbfff}:root.theme-auto .code-highlight .mo{color:#dfbfff}:root.theme-auto .code-highlight .sa{color:#f29e74}:root.theme-auto .code-highlight .sb{color:#d5ff80}:root.theme-auto .code-highlight .sc{color:#d5ff80}:root.theme-auto .code-highlight .dl{color:#d5ff80}:root.theme-auto .code-highlight .sd{color:#7e8aa1}:root.theme-auto .code-highlight .s2{color:#d5ff80}:root.theme-auto .code-highlight .se{color:#95e6cb}:root.theme-auto .code-highlight .sh{color:#d5ff80}:root.theme-auto .code-highlight .si{color:#95e6cb}:root.theme-auto .code-highlight .sx{color:#95e6cb}:root.theme-auto .code-highlight .sr{color:#95e6cb}:root.theme-auto .code-highlight .s1{color:#d5ff80}:root.theme-auto .code-highlight .ss{color:#dfbfff}:root.theme-auto .code-highlight .bp{color:#5ccfe6}:root.theme-auto .code-highlight .fm{color:#ffd173}:root.theme-auto .code-highlight .vc{color:#d4d2c8}:root.theme-auto .code-highlight .vg{color:#d4d2c8}:root.theme-auto .code-highlight .vi{color:#d4d2c8}:root.theme-auto .code-highlight .vm{color:#d4d2c8}:root.theme-auto .code-highlight .il{color:#dfbfff}:root.theme-auto .code-highlight pre{overflow:auto;margin:0;padding:0 0 .75rem}:root.theme-auto .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;margin-right:8px;text-align:right}:root.theme-auto .code-highlight .linenos::selection{background:transparent}:root.theme-auto .code-highlight .linenos::-moz-selection{background:transparent}:root.theme-auto .code-highlight span.linenos{color:var(--color-line-number)}}:root.theme-dark .code-highlight pre{line-height:100%}:root.theme-dark .code-highlight td.linenos .normal{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight span.linenos{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight td.linenos .special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight .hll{background-color:#6e7681}:root.theme-dark .code-highlight .c{color:#7e8aa1}:root.theme-dark .code-highlight .err{color:#f88f7f}:root.theme-dark .code-highlight .esc{color:#d4d2c8}:root.theme-dark .code-highlight .g{color:#d4d2c8}:root.theme-dark .code-highlight .k{color:#ffad66}:root.theme-dark .code-highlight .l{color:#d5ff80}:root.theme-dark .code-highlight .n{color:#d4d2c8}:root.theme-dark .code-highlight .o{color:#ffad66}:root.theme-dark .code-highlight .x{color:#d4d2c8}:root.theme-dark .code-highlight .p{color:#d4d2c8}:root.theme-dark .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-dark .code-highlight .cm{color:#7e8aa1}:root.theme-dark .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-dark .code-highlight .cpf{color:#7e8aa1}:root.theme-dark .code-highlight .c1{color:#7e8aa1}:root.theme-dark .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-dark .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-dark .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-dark .code-highlight .ges{color:#d4d2c8}:root.theme-dark .code-highlight .gr{color:#f88f7f}:root.theme-dark .code-highlight .gh{color:#d4d2c8}:root.theme-dark .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-dark .code-highlight .go{color:#7e8aa1}:root.theme-dark .code-highlight .gp{color:#d4d2c8}:root.theme-dark .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-dark .code-highlight .gu{color:#d4d2c8}:root.theme-dark .code-highlight .gt{color:#f88f7f}:root.theme-dark .code-highlight .kc{color:#ffad66}:root.theme-dark .code-highlight .kd{color:#ffad66}:root.theme-dark .code-highlight .kn{color:#ffad66}:root.theme-dark .code-highlight .kp{color:#ffad66}:root.theme-dark .code-highlight .kr{color:#ffad66}:root.theme-dark .code-highlight .kt{color:#73d0ff}:root.theme-dark .code-highlight .ld{color:#d5ff80}:root.theme-dark .code-highlight .m{color:#dfbfff}:root.theme-dark .code-highlight .s{color:#d5ff80}:root.theme-dark .code-highlight .na{color:#ffd173}:root.theme-dark .code-highlight .nb{color:#ffd173}:root.theme-dark .code-highlight .nc{color:#73d0ff}:root.theme-dark .code-highlight .no{color:#ffd173}:root.theme-dark .code-highlight .nd{color:#7e8aa1;font-weight:700;font-style:italic}:root.theme-dark .code-highlight .ni{color:#95e6cb}:root.theme-dark .code-highlight .ne{color:#73d0ff}:root.theme-dark .code-highlight .nf{color:#ffd173}:root.theme-dark .code-highlight .nl{color:#d4d2c8}:root.theme-dark .code-highlight .nn{color:#d4d2c8}:root.theme-dark .code-highlight .nx{color:#d4d2c8}:root.theme-dark .code-highlight .py{color:#ffd173}:root.theme-dark .code-highlight .nt{color:#5ccfe6}:root.theme-dark .code-highlight .nv{color:#d4d2c8}:root.theme-dark .code-highlight .ow{color:#ffad66}:root.theme-dark .code-highlight .pm{color:#d4d2c8}:root.theme-dark .code-highlight .w{color:#d4d2c8}:root.theme-dark .code-highlight .mb{color:#dfbfff}:root.theme-dark .code-highlight .mf{color:#dfbfff}:root.theme-dark .code-highlight .mh{color:#dfbfff}:root.theme-dark .code-highlight .mi{color:#dfbfff}:root.theme-dark .code-highlight .mo{color:#dfbfff}:root.theme-dark .code-highlight .sa{color:#f29e74}:root.theme-dark .code-highlight .sb{color:#d5ff80}:root.theme-dark .code-highlight .sc{color:#d5ff80}:root.theme-dark .code-highlight .dl{color:#d5ff80}:root.theme-dark .code-highlight .sd{color:#7e8aa1}:root.theme-dark .code-highlight .s2{color:#d5ff80}:root.theme-dark .code-highlight .se{color:#95e6cb}:root.theme-dark .code-highlight .sh{color:#d5ff80}:root.theme-dark .code-highlight .si{color:#95e6cb}:root.theme-dark .code-highlight .sx{color:#95e6cb}:root.theme-dark .code-highlight .sr{color:#95e6cb}:root.theme-dark .code-highlight .s1{color:#d5ff80}:root.theme-dark .code-highlight .ss{color:#dfbfff}:root.theme-dark .code-highlight .bp{color:#5ccfe6}:root.theme-dark .code-highlight .fm{color:#ffd173}:root.theme-dark .code-highlight .vc{color:#d4d2c8}:root.theme-dark .code-highlight .vg{color:#d4d2c8}:root.theme-dark .code-highlight .vi{color:#d4d2c8}:root.theme-dark .code-highlight .vm{color:#d4d2c8}:root.theme-dark .code-highlight .il{color:#dfbfff}:root.theme-dark .code-highlight pre{overflow:auto;margin:0;padding:0 0 .75rem}:root.theme-dark .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;margin-right:8px;text-align:right}:root.theme-dark .code-highlight .linenos::selection{background:transparent}:root.theme-dark .code-highlight .linenos::-moz-selection{background:transparent}:root.theme-dark .code-highlight span.linenos{color:var(--color-line-number)}html.no-js .hide_if_nojs,html.js .show_if_nojs{display:none}.center{text-align:center}.right{float:right}.left{float:left}.invisible{display:none!important}.list-unstyled{list-style-type:none}.list-unstyled li{margin-top:4px;margin-bottom:4px}.danger{background-color:var(--color-error-background)}.warning{background:var(--color-warning-background)}.success{background:var(--color-success-background)}.badge{display:inline-block;color:var(--color-toolkit-badge-font);background-color:var(--color-toolkit-badge-background);text-align:center;white-space:nowrap;vertical-align:baseline;min-width:10px;padding:1px 5px;border-radius:5px}kbd{padding:2px 4px;margin:1px;font-size:90%;color:var(--color-toolkit-kbd-font);background:var(--color-toolkit-kbd-background)}table{width:100%}table.striped tr{border-bottom:1px solid var(--color-settings-tr-hover)}th{padding:.4em}td{padding:0 4px}tr:hover{background:var(--color-settings-tr-hover)!important}div.selectable_url{display:block;border:1px solid var(--color-result-search-url-border);padding:4px;color:var(--color-result-search-url-font);margin:.1em;overflow:hidden;height:1.2em;line-height:1.2em;border-radius:5px}div.selectable_url pre{display:block;font-size:.8em;word-break:break-all;margin:.1em;-webkit-user-select:all;user-select:all}.dialog-error{position:relative;display:flex;padding:1rem;margin:0 0 1em;border:1px solid var(--color-toolkit-dialog-border);text-align:right;border-radius:10px;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error)}.dialog-error .close{float:left;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-error ul,.dialog-error ol,.dialog-error p{margin:1px 0 0}.dialog-error table{width:auto}.dialog-error tr{vertical-align:text-top}.dialog-error tr:hover{background:transparent!important}.dialog-error td{padding:0 1em 0 0;padding-left:1rem;padding-bottom:0;padding-right:0}.dialog-error h4{margin-top:.3em;margin-bottom:.3em}.dialog-error-block{position:relative;display:flex;padding:1rem;margin:0 0 1em;border:1px solid var(--color-toolkit-dialog-border);text-align:right;border-radius:10px;display:block;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error)}.dialog-error-block .close{float:left;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-error-block ul,.dialog-error-block ol,.dialog-error-block p{margin:1px 0 0}.dialog-error-block table{width:auto}.dialog-error-block tr{vertical-align:text-top}.dialog-error-block tr:hover{background:transparent!important}.dialog-error-block td{padding:0 1em 0 0;padding-left:1rem;padding-bottom:0;padding-right:0}.dialog-error-block h4{margin-top:.3em;margin-bottom:.3em}.dialog-warning{position:relative;display:flex;padding:1rem;margin:0 0 1em;border:1px solid var(--color-toolkit-dialog-border);text-align:right;border-radius:10px;color:var(--color-warning);background:var(--color-warning-background);border-color:var(--color-warning)}.dialog-warning .close{float:left;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-warning ul,.dialog-warning ol,.dialog-warning p{margin:1px 0 0}.dialog-warning table{width:auto}.dialog-warning tr{vertical-align:text-top}.dialog-warning tr:hover{background:transparent!important}.dialog-warning td{padding:0 1em 0 0;padding-left:1rem;padding-bottom:0;padding-right:0}.dialog-warning h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal{position:relative;display:flex;padding:1rem;border:1px solid var(--color-toolkit-dialog-border);text-align:right;border-radius:10px;display:block;background:var(--color-toolkit-dialog-background);position:fixed;top:50%;left:50%;margin:0 auto;transform:translate(-50%,-50%);z-index:5000}.dialog-modal .close{float:left;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-modal ul,.dialog-modal ol,.dialog-modal p{margin:1px 0 0}.dialog-modal table{width:auto}.dialog-modal tr{vertical-align:text-top}.dialog-modal tr:hover{background:transparent!important}.dialog-modal td{padding:0 1em 0 0;padding-left:1rem;padding-bottom:0;padding-right:0}.dialog-modal h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal h3{margin-top:0}.btn-collapse{cursor:pointer}.scrollx{overflow:auto hidden;display:block;padding:0;margin:0;border:none}.tabs .tabs>label{font-size:90%}ul.tabs{border-bottom:1px solid var(--color-toolkit-tabs-section-border);list-style:none;padding-left:0}ul.tabs li{display:flex}.tabs{display:flex;flex-wrap:wrap;width:100%;min-width:100%}.tabs>*{order:2}.tabs>input[type=radio]{display:none}.tabs>label,.tabs>li>a{order:1;padding:.7em;margin:0 .7em;letter-spacing:.5px;text-transform:uppercase;border:solid var(--color-toolkit-tabs-label-border);border-width:0 0 2px 0;color:unset;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;cursor:pointer}.tabs>label.active,.tabs>li>a.active{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}.tabs>label:hover,.tabs>li>a:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}.tabs>section{min-width:100%;padding:.7rem 0;box-sizing:border-box;border-top:1px solid var(--color-toolkit-tabs-section-border);display:none}.tabs>label:last-of-type{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font);letter-spacing:-.1px}.tabs>section:last-of-type{display:block}html body .tabs>input:checked~section{display:none}html body .tabs>input:checked~label{position:inherited;background:inherit;border-bottom:2px solid transparent;font-weight:400;color:inherit}html body .tabs>input:checked~label:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}html body .tabs>input:checked+label{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}html body .tabs>input:checked+label+section{display:block}select{height:2.4rem;margin-top:0;margin-left:1rem;margin-bottom:0;margin-right:0;padding:.2rem!important;color:var(--color-search-font);font-size:.9rem;z-index:100}select:hover,select:focus{cursor:pointer}@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))){select{appearance:none;-webkit-appearance:none;-moz-appearance:none;border-width:0 2rem 0 0;border-color:transparent;background:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E) no-repeat;background-position-x:calc(100% + 2rem);background-size:2rem;background-origin:content-box;background-color:var(--color-toolkit-select-background);outline:medium none;text-overflow:ellipsis;border-radius:5px}select:hover,select:focus{background-color:var(--color-toolkit-select-background-hover)}select option{background-color:var(--color-base-background)}@media (prefers-color-scheme: dark){html.theme-auto select,html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}input.checkbox-onoff[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:inline-block;width:2.5em;height:.7em;box-shadow:none!important;margin:0 16px;border-radius:10px;position:relative}input.checkbox-onoff[type=checkbox]:focus,input.checkbox-onoff[type=checkbox]:hover{outline:none}input.checkbox-onoff[type=checkbox]:focus:after{content:"";position:absolute;width:3.5em;height:1.65em;border:1px solid var(--color-btn-background);border-radius:12px;box-shadow:var(--color-btn-background) 0 0 3px;z-index:1200;top:-.55em;left:-.6em}input.checkbox-onoff[type=checkbox]:before{position:absolute;top:-.5em;display:flex;justify-content:center;align-items:center;font-size:.75em;width:1.875em;height:1.875em;border-radius:50%}input.checkbox-onoff[type=checkbox],input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked{background:var(--color-toolkit-checkbox-onoff-off-background)}input.checkbox-onoff[type=checkbox]:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked:before{left:-.5em;content:"✕";color:var(--color-toolkit-checkbox-onoff-off-mark-color);background:var(--color-toolkit-checkbox-onoff-off-mark-background)}input.checkbox-onoff[type=checkbox]:checked,input.checkbox-onoff.reversed-checkbox[type=checkbox]{background:var(--color-toolkit-checkbox-onoff-on-background)}input.checkbox-onoff[type=checkbox]:checked:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:before{left:calc(100% - 1.5em);content:"✓";color:var(--color-toolkit-checkbox-onoff-on-mark-color);background:var(--color-toolkit-checkbox-onoff-on-mark-background)}@supports (transform: rotate(-45deg)){input[type=checkbox]:not(.checkbox-onoff){-webkit-appearance:none;-moz-appearance:none;appearance:none;width:20px;height:20px;cursor:pointer;position:relative;top:0;left:0;border:2px solid var(--color-toolkit-checkbox-input-border);border-radius:.3em}input[type=checkbox]:not(.checkbox-onoff):after{content:"";width:9px;height:5px;position:absolute;top:3px;left:2px;border:3px solid var(--color-toolkit-checkbox-label-border);border-top:none;border-right:none;background:transparent;opacity:0;transform:rotate(-45deg)}input[type=checkbox]:not(.checkbox-onoff):checked:after{border-color:var(--color-toolkit-checkbox-input-border);opacity:1}input[type=checkbox][disabled]:not(.checkbox-onoff){border:inherit;background-color:transparent!important;cursor:inherit}input.checkbox[type=checkbox]:not(:checked,[disabled],.checkbox-onoff):hover:after{opacity:.5}}@media screen and (max-width: 50em){.tabs>label{width:100%}}.loader,.loader:after{border-radius:50%;width:2em;height:2em}.loader{margin:1em auto;font-size:10px;position:relative;text-indent:-9999em;border-top:.5em solid var(--color-toolkit-loader-border);border-right:.5em solid var(--color-toolkit-loader-border);border-bottom:.5em solid var(--color-toolkit-loader-border);border-left:.5em solid var(--color-toolkit-loader-borderleft);-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.2s infinite linear;animation:load8 1.2s infinite linear}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.engine-tooltip{display:none;position:absolute;padding:.5rem 1rem;margin:0 0 0 2rem;border:1px solid var(--color-toolkit-engine-tooltip-border);background:var(--color-toolkit-engine-tooltip-background);font-size:14px;font-weight:400;z-index:5000;text-align:left;border-radius:10px}th:hover .engine-tooltip,td:hover .engine-tooltip,.engine-tooltip:hover{display:inline-block}.stacked-bar-chart{margin:0;padding:0 .125rem 0 4rem;width:100%;width:-moz-available;width:-webkit-fill-available;width:fill;flex-flow:row nowrap;align-items:center;display:inline-flex}.stacked-bar-chart-value{width:3rem;display:inline-block;position:absolute;padding:0 .5rem;text-align:right}.stacked-bar-chart-base{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset}.stacked-bar-chart-median{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:var(--color-base-font);border:1px solid rgba(var(--color-base-font-rgb),.9);padding:.3rem 0}.stacked-bar-chart-rate80{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:transparent;border:1px solid rgba(var(--color-base-font-rgb),.3);padding:.3rem 0}.stacked-bar-chart-rate95{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:transparent;border-bottom:1px dotted rgba(var(--color-base-font-rgb),.5);padding:0}.stacked-bar-chart-rate100{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:transparent;border-left:1px solid rgba(var(--color-base-font-rgb),.9);padding:.4rem 0;width:1px}/*! Autocomplete.js v2.6.3 | license MIT | (c) 2017, Baptiste Donaux | http://autocomplete-js.com */.autocomplete{position:absolute;width:44rem;max-width:calc(100% - 1rem);max-height:0;overflow-y:hidden;text-align:right;border-radius:10px}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:var(--color-autocomplete-background)}.autocomplete:empty{display:none}.autocomplete>ul{list-style-type:none;margin:0;padding:0}.autocomplete>ul>li{cursor:pointer;padding:.5rem 1rem}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus,.autocomplete>ul>li:hover{background-color:var(--color-autocomplete-background-hover)}.autocomplete>ul>li.active a:active,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:hover a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:hover a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:hover,.autocomplete>ul>li:hover a:hover{text-decoration:none}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete.open{display:block;background-color:var(--color-autocomplete-background);color:var(--color-autocomplete-font);max-height:32rem;overflow-y:auto;z-index:5000;margin-top:3.5rem;border-radius:.8rem}.autocomplete.open:empty{display:none}@media screen and (max-width: 50em){.autocomplete>ul>li{padding:1rem}}#main_results #results.image-detail-open.only_template_images{width:min(98%,59.25rem)!important}#main_results #results.only_template_images.image-detail-open #backToTop{right:56.75rem!important;left:inherit}article.result-images .detail{display:none}#results.image-detail-open article.result-images[data-vim-selected] .detail{display:flex;flex-direction:column;position:fixed;right:60rem;left:0;top:13rem;transition:top 64ms ease-in 0s;bottom:0;background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-background);z-index:1000;padding:4rem 3rem 3rem;overflow-y:scroll}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{display:block;flex:1;text-align:left;width:100%;border:none;text-decoration:none}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{padding:0;margin:0;border:none;object-fit:contain;width:inherit;height:inherit;max-width:100%;min-height:inherit;max-height:calc(100vh - 42rem);background:inherit}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels{color:var(--color-result-detail-font);height:19rem}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels hr{border-top:1px solid var(--color-result-detail-hr);border-bottom:none}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4{height:2rem;overflow:hidden;text-overflow:ellipsis;font-size:.9rem;margin-bottom:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p{color:var(--color-result-detail-label-font);font-size:.9rem;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:.8rem 0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{display:inline-block;width:12rem}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a{text-align:right}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content{height:2rem;line-height:unset;overflow:hidden;text-overflow:ellipsis}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url{white-space:nowrap;overflow:hidden hidden;text-overflow:ellipsis}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url:hover{position:relative;overflow:inherit!important;background:var(--color-result-detail-background);text-overflow:inherit!important}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:active{color:var(--color-result-detail-link)}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover{text-decoration:underline}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close{top:1rem;right:1rem;padding:.4rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{top:1rem;left:6rem;padding:.4rem .3rem .4rem .5rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{top:1rem;left:2rem;padding:.4rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{border-radius:50%;display:block;width:1.5rem;height:1.5rem;position:absolute;filter:opacity(40%);z-index:1200}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span{display:block;width:1.5rem;height:1.5rem;text-align:center}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span:before,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span:before{vertical-align:sub}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:active{color:var(--color-result-detail-font);background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-font)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover{filter:opacity(80%)}#results.image-detail-open article.result-images[data-vim-selected] .detail .loader{position:absolute;top:1rem;left:50%;border-top:.5em solid var(--color-result-detail-loader-border);border-right:.5em solid var(--color-result-detail-loader-border);border-bottom:.5em solid var(--color-result-detail-loader-border);border-left:.5em solid var(--color-result-detail-loader-borderleft)}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail{top:0}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail a.result-images-source img{max-height:calc(100vh - 25rem)}@media screen and (max-width: 79.75em){#results.image-detail-open article.result-images[data-vim-selected] .detail{top:0;right:0}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{display:flex;flex-direction:column;justify-content:center}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 24rem)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{left:1rem}}@media screen and (max-width: 50em){#results.image-detail-open article.result-images[data-vim-selected] .detail{top:0;right:0;padding:1rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 2rem);margin:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{width:inherit;margin-left:1rem}}.dialog-modal{animation-name:dialogmodal;animation-duration:.13s}@keyframes dialogmodal{0%{opacity:0}50%{opacity:.5;transform:translate(-50%,-50%) scale(1.05)}}input.checkbox-onoff[type=checkbox]:before{transition:left .25s}iframe[src^="https://w.soundcloud.com"]{height:120px}iframe[src^="https://www.deezer.com"]{height:94px}iframe[src^="https://www.mixcloud.com"]{height:250px}iframe[src^="https://bandcamp.com/EmbeddedPlayer"]{height:350px}iframe[src^="https://bandcamp.com/EmbeddedPlayer/track"]{height:120px}iframe[src^="https://genius.com/songs"]{height:65px}.info-page code{font-family:monospace;border-radius:5px;background-color:var(--color-doc-code-background);color:var(--color-doc-code);padding:.2rem;border:0 none}.stats_endpoint .github-issue-button{display:block;font-size:16px}.stats_endpoint .issue-hide{display:none}.stats_endpoint input[type=checked]{position:absolute}.stats_endpoint label{margin:1rem 1rem 1rem 0}.stats_endpoint .step_content{margin:1rem 1rem 1rem 2rem}.stats_endpoint .step1,.stats_endpoint .step2{visibility:hidden}.stats_endpoint .step1_delay{transition:visibility 0s linear 4s}.stats_endpoint #step1:checked~.step1,.stats_endpoint #step2:checked~.step2{visibility:visible}.engine-stats{border-spacing:0;border-collapse:collapse}.engine-stats tr td,.engine-stats tr th{border-bottom:1px solid var(--color-result-border);padding:.25rem}.engine-stats table.engine-tooltip{border-spacing:0;border-collapse:collapse}.engine-stats table.engine-tooltip td,.engine-stats table.engine-tooltip th{border:none}.engine-stats .engine-name{width:20rem}.engine-stats .engine-score{width:7rem;text-align:right}.engine-stats .engine-reliability{text-align:right}table.engine-error th.engine-error-type,table.engine-error td.engine-error-type,failed-test{width:10rem}.engine-errors{margin-top:3rem}.engine-errors table.engine-error{max-width:1280px;margin:1rem 0 3rem;border:1px solid var(--color-result-border);text-align:right}.engine-errors table.engine-error tr th,.engine-errors table.engine-error tr td{padding:.5rem}.engine-errors table.engine-error span.log_parameters{border-right:1px solid solid var(--color-result-border);padding:0 1rem 0 0;margin:0 0 0 .5rem}.bar-chart-value{width:3em;display:inline-block;text-align:right;padding-right:.5rem}.bar-chart-graph{width:calc(100% - 5rem);display:inline-block}.bar-chart-bar{border:3px solid var(--color-bar-chart-primary);margin:1px 0}.bar-chart-serie1{border:3px solid var(--color-bar-chart-primary);margin:1px 0;float:left}.bar-chart-serie2{border:3px solid var(--color-bar-chart-secondary);margin:1px 0;float:left}.bar0{width:0;border:0}.bar1{width:1%}.bar2{width:2%}.bar3{width:3%}.bar4{width:4%}.bar5{width:5%}.bar6{width:6%}.bar7{width:7%}.bar8{width:8%}.bar9{width:9%}.bar10{width:10%}.bar11{width:11%}.bar12{width:12%}.bar13{width:13%}.bar14{width:14%}.bar15{width:15%}.bar16{width:16%}.bar17{width:17%}.bar18{width:18%}.bar19{width:19%}.bar20{width:20%}.bar21{width:21%}.bar22{width:22%}.bar23{width:23%}.bar24{width:24%}.bar25{width:25%}.bar26{width:26%}.bar27{width:27%}.bar28{width:28%}.bar29{width:29%}.bar30{width:30%}.bar31{width:31%}.bar32{width:32%}.bar33{width:33%}.bar34{width:34%}.bar35{width:35%}.bar36{width:36%}.bar37{width:37%}.bar38{width:38%}.bar39{width:39%}.bar40{width:40%}.bar41{width:41%}.bar42{width:42%}.bar43{width:43%}.bar44{width:44%}.bar45{width:45%}.bar46{width:46%}.bar47{width:47%}.bar48{width:48%}.bar49{width:49%}.bar50{width:50%}.bar51{width:51%}.bar52{width:52%}.bar53{width:53%}.bar54{width:54%}.bar55{width:55%}.bar56{width:56%}.bar57{width:57%}.bar58{width:58%}.bar59{width:59%}.bar60{width:60%}.bar61{width:61%}.bar62{width:62%}.bar63{width:63%}.bar64{width:64%}.bar65{width:65%}.bar66{width:66%}.bar67{width:67%}.bar68{width:68%}.bar69{width:69%}.bar70{width:70%}.bar71{width:71%}.bar72{width:72%}.bar73{width:73%}.bar74{width:74%}.bar75{width:75%}.bar76{width:76%}.bar77{width:77%}.bar78{width:78%}.bar79{width:79%}.bar80{width:80%}.bar81{width:81%}.bar82{width:82%}.bar83{width:83%}.bar84{width:84%}.bar85{width:85%}.bar86{width:86%}.bar87{width:87%}.bar88{width:88%}.bar89{width:89%}.bar90{width:90%}.bar91{width:91%}.bar92{width:92%}.bar93{width:93%}.bar94{width:94%}.bar95{width:95%}.bar96{width:96%}.bar97{width:97%}.bar98{width:98%}.bar99{width:99%}.bar100{width:100%}.osm-map-box{height:300px;width:100%;margin:10px 0}#answers .weather summary{display:block;list-style:none}#answers .weather div.summary{margin:0;padding:.5rem 1rem;background-color:var(--color-header-background);border-radius:5px}#answers .weather table{font-size:.9rem;table-layout:fixed;margin-top:.5rem;margin-bottom:.5rem;border-collapse:separate;border-spacing:.1em 0}#answers .weather td{padding:0;overflow:hidden;text-overflow:ellipsis}#answers .weather img.symbol{width:5rem;margin:auto;display:block}#main_index{margin-top:26vh}.index{text-align:center}.index .title{background:url(../img/searxng.png) no-repeat;min-height:4rem;margin:4rem auto;background-position:center;background-size:contain}.index h1{font-size:4em;visibility:hidden}.index #search,.index #search_header{margin:0 auto;background:inherit;border:inherit;padding:0;display:block}.index .search_filters{display:block;margin:1em 0}.index .category label{padding:6px 10px;border-bottom:initial!important}@media screen and (max-width: 79.75em){div.title h1{font-size:1em}#main_index{margin-top:6em}}table{border-collapse:collapse}table th,table td{text-align:center;padding:1rem .5rem;text-align:right}table tr.pref-group th{font-weight:400;text-align:right;background:var(--color-settings-table-group-background)}#main_preferences form{width:100%}#main_preferences fieldset{margin:8px;border:none}#main_preferences legend{margin:0;padding:5px 0 0;display:block;float:right;width:300px}#main_preferences input[type=text]{width:13.25rem;color:var(--color-toolkit-input-text-font);border:none;background:none repeat scroll 0 0 var(--color-toolkit-select-background);padding:.2rem .4rem;height:2rem;border-radius:5px}#main_preferences input[type=text]:hover,#main_preferences input[type=text]:focus{background-color:var(--color-toolkit-select-background-hover)}#main_preferences div.pref-group{width:100%;font-weight:400;padding:1rem .5rem;text-align:right;background:var(--color-settings-table-group-background)}#main_preferences .value{margin:0;padding:0;float:right;width:15em}#main_preferences .value select,#main_preferences .value input[type=text]{font-size:inherit!important;margin-top:0;margin-left:1rem;margin-bottom:0;margin-right:0}#main_preferences .value select{width:14rem}#main_preferences .value select:focus,#main_preferences .value input:focus{outline:none;box-shadow:0 0 1px 1px var(--color-btn-background)}#main_preferences .description{margin:0;padding:5px 0 0;float:left;width:50%;color:var(--color-settings-engine-description-font);font-size:90%}#main_preferences .bang{text-align:right;border-radius:5px;background-color:var(--color-doc-code-background);color:var(--color-doc-code);padding:.2rem;border:0 none}#main_preferences .category{margin-left:.5rem}#main_preferences .category label{border:2px solid transparent;padding:.2rem .4rem;border-radius:5px}#main_preferences .category input[type=checkbox]:checked+label{border:2px solid var(--color-categories-item-border-selected)}#main_preferences table.table_engines th.name label{cursor:pointer}#main_preferences table.table_engines th.name .engine-tooltip{margin-top:1.8rem;right:calc((100% - 85em)/2 + 10em);max-width:40rem}#main_preferences table.table_engines th.name .engine-tooltip .engine-description{margin-top:.5rem}#main_preferences table.table_engines th.name .engine-tooltip .bang{margin:.3rem}#main_preferences table.table_engines .checkbox-col,#main_preferences table.table_engines .name,#main_preferences table.table_engines .shortcut{text-align:right}#main_preferences table.cookies{width:100%;direction:ltr}#main_preferences table.cookies th,#main_preferences table.cookies td{text-align:left;font-family:monospace;font-size:1rem;padding:.5em;vertical-align:top}#main_preferences table.cookies td:first-child{word-break:keep-all;width:14rem;padding-right:1rem}#main_preferences table.cookies td:last-child{word-break:break-all}#main_preferences table.cookies>tbody>tr:nth-child(2n)>th,#main_preferences table.cookies>tbody>tr:nth-child(2n)>td{background-color:var(--color-settings-tr-hover)}#main_preferences .preferences_back{background:none repeat scroll 0 0 var(--color-btn-background);color:var(--color-btn-font);border:0 none;border-radius:10px;cursor:pointer;display:inline-block;margin:2px 4px;padding:.7em}#main_preferences .preferences_back a{color:var(--color-settings-return-font)}#main_preferences .preferences_back a:first-letter{text-transform:uppercase}#main_preferences #toggle-all-engines-container{width:max-content;margin-left:auto}#main_preferences div.selectable_url pre{width:100%}#main_preferences #copy-hash-container{display:flex;align-items:center;gap:.5rem}#main_preferences #copy-hash-container div.selectable_url pre{width:auto;flex-grow:1}#main_preferences #pref-hash-input{width:100%}@media screen and (max-width: 79.75em){.preferences_back{clear:both}.engine-tooltip{right:10em!important}}#search{padding:0;margin:0}#search_header{padding-top:1.5em;padding-left:2em;padding-right:7rem;margin:0;background:var(--color-header-background);border-bottom:1px solid var(--color-header-border);display:grid;gap:1rem 1.2rem;grid-template-columns:3rem 1fr;grid-template-areas:"logo search" "spacer categories"}.category_checkbox,.category_button{display:inline-block;position:relative;margin-left:1rem;padding:0}.category_checkbox input{display:none}.category_checkbox label{cursor:pointer;padding:.2rem 0;display:inline-flex;text-transform:capitalize;font-size:.9em;border-bottom:2px solid transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.category_checkbox label svg{padding-right:.2rem}.category_checkbox label div.category_name{margin:auto 0}.category_checkbox input[type=checkbox]:checked+label{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}button.category_button{background-color:inherit;color:var(--color-base-font);cursor:pointer;padding:.2rem 0;display:inline-flex;align-items:center;text-transform:capitalize;font-size:.9em;border:none;border-bottom:2px solid transparent}button.category_button svg{padding-right:.2rem}button.category_button.selected,button.category_button:active{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}.no-js #categories_container:has(button.category_button:focus-within) button.category_button.selected{color:var(--color-base-font);border-bottom:none}.no-js #categories_container:has(button.category_button:focus-within) button.category_button:focus-within{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}#search_logo{padding:.5rem 10px 0;grid-area:logo;display:flex;align-items:center;justify-content:center}#search_logo svg{flex:1;width:30px;height:30px;margin:.5rem 0 auto}.search_categories{grid-area:categories}.search_categories .help{display:none}.search_categories:hover .help{display:block;position:absolute;background:var(--color-base-background);padding:1rem .6rem .6rem 0;z-index:1000;width:100%;left:-.1rem}#search_view{padding:.5rem .5rem 0;grid-area:search}body.results_endpoint #search_view{padding:.5rem 2.8rem 0 0}.search_box{border-radius:.8rem;width:100%;max-width:44rem;display:inline-flex;flex-direction:row;white-space:nowrap;box-shadow:var(--color-search-shadow)}#clear_search{display:block;border-collapse:separate;box-sizing:border-box;width:1.8rem;margin:0;padding:.8rem .2rem;background:none repeat scroll 0 0 var(--color-search-background);border:none;outline:none;color:var(--color-search-font);font-size:1.1rem;z-index:1000}#clear_search:hover{color:var(--color-search-background-hover)}#clear_search.empty *,html.no-js #clear_search.hide_if_nojs{display:none}#q,#send_search{display:block;margin:0;padding:.8rem;background:none repeat scroll 0 0 var(--color-search-background);border:none;outline:none;color:var(--color-search-font);font-size:1.1rem;z-index:100}#q{width:100%;padding-right:1rem;padding-left:0!important;border-radius:0 .8rem .8rem 0}#q::-ms-clear,#q::-webkit-search-cancel-button{display:none}#send_search{border-radius:.8rem 0 0 .8rem}#send_search:hover{cursor:pointer;background-color:var(--color-search-background-hover);color:var(--color-search-background)}.no-js #clear_search,.no-js #send_search{width:auto!important;border-right:1px solid var(--color-search-border)}.search_filters{margin-top:.6rem;margin-left:0;margin-bottom:0;margin-right:10.6rem;display:flex;overflow-x:auto;overscroll-behavior-inline:contain}.search_filters select{background-color:inherit}.search_filters select:hover,.search_filters select:focus{color:var(--color-base-font)}@media screen and (max-width: 79.75em){#search_header{padding:1.5em .5rem 0;column-gap:.5rem}.search_filters{margin-top:.6rem;margin-left:0;margin-bottom:0;margin-right:3.5rem}#categories{font-size:90%;clear:both}}@media screen and (max-width: 79.75em) and (hover: none){#main_index #categories_container,#main_results #categories_container{width:max-content}#main_index #categories_container .category_checkbox,#main_results #categories_container .category_checkbox{display:inline-block;width:auto}#main_index #categories,#main_results #categories{width:100%;text-align:right;overflow:scroll hidden;-webkit-overflow-scrolling:touch}}@media screen and (max-width: 50em){#search_header{width:100%;margin:0;padding:.1rem 0 0;gap:0 0;grid-template-areas:"logo search" "categories categories"}.search_logo{padding:0}.search_box{width:100%}#q{width:100%;flex:1}.search_filters{margin:0 10px;padding:.5rem 0}.category{display:inline-block;width:auto;margin:0}.category svg{display:none}.category_checkbox label,.category_button{padding:1rem!important;margin:0!important}#search_view:focus-within{display:block;background-color:var(--color-search-background);position:absolute;top:0;height:100%;width:100%;z-index:2000}#search_view:focus-within .search_box{border-bottom:1px solid var(--color-search-border);width:100%;border-radius:0;box-shadow:none}#search_view:focus-within .search_box #send_search{margin-left:0!important}#search_view:focus-within .search_box *{border:none;border-radius:0;box-shadow:none}#main_results #q:placeholder-shown~#send_search{margin-left:2.6rem;transition:margin .1s}}@media screen and (max-width: 20rem){#search_header{grid-template-areas:"search search" "categories categories"}#search_logo{display:none}}#categories{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}#categories::-webkit-scrollbar{width:0;height:0}#categories_container{position:relative}.favicon img{height:1.5rem;width:1.5rem;border-radius:10%;background-color:var(--color-favicon-background-color);border:1px solid var(--color-favicon-border-color);display:flex}@media screen and (min-width: 50em){.center-alignment-yes #main_results{--center-page-width: 48rem}}@media screen and (width >= 62rem){.center-alignment-yes #main_results{--center-page-width: 60rem}}@media screen and (min-width: 79.75em){.center-alignment-yes #main_results{--center-page-width: 73rem}}@media screen and (min-width: 50em) and (max-width: 79.75em){.center-alignment-yes #main_results #results{grid-template-columns:60% calc(40% - 5rem);margin-left:0;margin-right:0}.center-alignment-yes #main_results #urls{margin-right:3rem}.center-alignment-yes #main_results #sidebar{margin-left:1rem}.center-alignment-yes #main_results #backToTop{right:calc(60% + 1rem)}}@media screen and (min-width: 79.75em){.center-alignment-yes #main_results{display:flex;flex-direction:column;align-items:center}.center-alignment-yes #main_results #search{width:100%;display:flex;flex-direction:column;align-items:center}.center-alignment-yes #main_results #search_header{grid-template-columns:calc(50% - 4.5rem - var(--center-page-width) / 2) 3rem var(--center-page-width);grid-template-areas:"na logo search" "na spacer categories";column-gap:1.2rem;width:100%;padding-left:0;padding-right:0}.center-alignment-yes #main_results .search_filters{margin-right:.5rem;width:var(--center-page-width)}.center-alignment-yes #main_results #results{margin-left:2rem;margin-right:10rem}.center-alignment-yes #main_results #results.only_template_images,.center-alignment-yes #main_results #results.image-detail-open{align-self:flex-start}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open){margin-right:1.5rem;grid-template-columns:calc(var(--center-page-width) - 5rem - 25rem) 25rem}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open) #backToTop{right:calc(50% - 25rem - 5rem + 1rem + var(--center-page-width) / 2)}.center-alignment-yes #main_results #results .result .content{max-width:inherit}.center-alignment-yes #main_results #urls{margin-right:0}.center-alignment-yes #main_results #sidebar{margin-left:0}}.sxng-icon-set{display:inline-block;vertical-align:bottom;line-height:1;text-decoration:inherit;transform:scaleX(-1)}.sxng-icon-set-small{width:1rem;height:1rem;display:inline-block;vertical-align:bottom;line-height:1;text-decoration:inherit;transform:scaleX(-1)}.sxng-icon-set-big{width:1.5rem;height:1.5rem;display:inline-block;vertical-align:bottom;line-height:1;text-decoration:inherit;transform:scaleX(-1)}html{font-family:sans-serif;font-size:.9em;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:var(--color-base-font);background-color:var(--color-base-background);padding:0;margin:0;scroll-behavior:smooth}body,main{padding:0;margin:0}body{display:flex;flex-direction:column;height:100vh;margin:0}@supports (height: 100dvh){body{height:100dvh}}main{width:100%;margin-bottom:2rem;flex:1}.page_with_header{margin:2em auto;width:85em}footer{clear:both;min-height:4rem;padding:1rem 0;width:100%;text-align:center;background-color:var(--color-footer-background);border-top:1px solid var(--color-footer-border);overflow:hidden}footer p{font-size:.9em}.page_with_header .logo{height:40px}input[type=submit],#results button[type=submit],.button{padding:.7rem;display:inline-block;background:var(--color-btn-background);color:var(--color-btn-font);border-radius:10px;border:0;cursor:pointer}a{text-decoration:none;color:var(--color-url-font)}a:visited,a:visited .highlight{color:var(--color-url-visited-font)}article[data-vim-selected]{background:var(--color-result-vim-selected);border-right:.2rem solid var(--color-result-vim-arrow);border-radius:10px 0 0 10px}article.result-images[data-vim-selected]{background:var(--color-result-vim-arrow);border:none;border-radius:10px}article.result-images[data-vim-selected] .image_thumbnail{filter:opacity(60%)}article.result-images[data-vim-selected] span.title,article.result-images[data-vim-selected] span.source{color:var(--color-result-image-span-font-selected)}article[data-vim-selected].category-videos,article[data-vim-selected].category-news,article[data-vim-selected].category-map,article[data-vim-selected].category-music,article[data-vim-selected].category-files,article[data-vim-selected].category-social{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{margin:.125rem 0;padding:1rem;box-sizing:border-box;width:100%;border-right:.2rem solid transparent}.result h3{font-size:1.2rem;word-wrap:break-word;margin:.4rem 0;padding:0}.result h3 a{color:var(--color-result-link-font);font-weight:400;font-size:1.1em}.result h3 a:visited{color:var(--color-result-link-visited-font)}.result h3 a:focus,.result h3 a:hover{text-decoration:underline;border:none;outline:none}.result .cache_link,.result .proxyfied_link{font-size:smaller!important;margin-left:.5rem}.result .content,.result .stat{font-size:.9em;margin:0;padding:0;max-width:54em;word-wrap:break-word;line-height:1.24}.result .content .highlight,.result .stat .highlight{color:var(--color-result-description-highlight-font);background:inherit;font-weight:700}.result .altlink a{font-size:.9em;margin:0 10px 0 0;padding:5px 10px;border-radius:5px;background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer}.result .altlink a:hover{background:var(--color-btn-background);color:var(--color-btn-font)}.result .codelines .highlight{color:inherit;background:inherit;font-weight:400}.result .url_header{display:flex;gap:.5rem}.result .url_wrapper{display:flex;align-items:center;font-size:1rem;color:var(--color-result-url-font);flex-flow:row nowrap;overflow:hidden;margin:0;padding:0}.result .url_wrapper .url_o1{white-space:nowrap;flex-shrink:1;padding-bottom:1px}.result .url_wrapper .url_o1 .url_i1{unicode-bidi:plaintext}.result .url_wrapper .url_o1:after{content:" ";width:1ch;display:inline-block}.result .url_wrapper .url_o2{overflow:hidden;white-space:nowrap;flex:0 1 content;text-align:right;padding-bottom:1px}.result .url_wrapper .url_o2 .url_i2{float:right}.result .published_date,.result .result_length,.result .result_views,.result .result_author,.result .result_shipping,.result .result_source_country{font-size:.8em;color:var(--color-result-publishdate-font)}.result .result_price{font-size:1.2em;color:var(--color-result-description-highlight-font)}.result img.thumbnail{float:right;padding-top:.6rem;padding-left:1rem;width:7rem;height:unset}.result .break{clear:both}.result-paper .attributes,.result-packages .attributes{display:table;border-spacing:.125rem}.result-paper .attributes div,.result-packages .attributes div{display:table-row}.result-paper .attributes div span,.result-packages .attributes div span{font-size:.9rem;margin-top:.25rem;display:table-cell}.result-paper .attributes div span time,.result-packages .attributes div span time{font-size:.9rem}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{color:var(--color-base-font);min-width:10rem}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){color:var(--color-result-publishdate-font)}.result-paper .content,.result-packages .content{margin-top:.25rem}.result-paper .comments,.result-packages .comments{font-size:.9rem;margin:.25rem 0 0;padding:0;word-wrap:break-word;line-height:1.24;font-style:italic}.result-packages .attributes{margin-top:.3rem}.template_group_images{display:flex;flex-wrap:wrap}.template_group_images:after{flex-grow:10;content:""}.category-videos,.category-news,.category-map,.category-music,.category-files,.category-social{border:1px solid var(--color-result-border);margin:0 .5rem 1rem!important;border-radius:10px}.category-social .image{width:auto!important;min-width:48px;min-height:48px;padding:0 5px 25px 0!important}.audio-control audio{width:100%;padding:10px 0 0}.embedded-content iframe{width:100%;padding:10px 0 0}.result-videos img.thumbnail{float:right;padding-top:.6rem;padding-left:1rem;width:20rem;height:unset}.result-videos .content{overflow:hidden}.result-videos .embedded-video iframe{width:100%;aspect-ratio:16 / 9;padding:10px 0 0}@supports not (aspect-ratio: 1 / 1){.result-videos .embedded-video iframe{height:25.3125rem}}.engines{float:left;display:flex;flex-wrap:wrap;justify-content:flex-end;color:var(--color-result-engines-font)}.engines span{font-size:smaller;margin-top:0;margin-bottom:0;margin-left:.5rem;margin-right:0}.small_font{font-size:.8em}.highlight{color:var(--color-result-link-font-highlight);background:inherit}.empty_element{font-style:italic}.result-images{flex-grow:1;padding:.5rem .5rem 3rem;margin:.25rem;border:none!important;height:12rem;width:unset}.result-images>a{position:relative;outline:none}.result-images img{margin:0;padding:0;border:none;height:100%;width:auto;object-fit:cover;vertical-align:bottom;background:var(--color-result-image-background)}.result-images .image_resolution{position:absolute;right:0;bottom:0;background:var(--color-image-resolution-background);padding:.3rem .5rem;font-size:.9rem;color:var(--color-image-resolution-font);border-top-left-radius:.3rem}.result-images span.title,.result-images span.source{display:block;position:absolute;width:100%;font-size:.9rem;color:var(--color-result-image-span-font);padding:.5rem 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.result-images span.source{padding:1.8rem 0 0;font-size:.7rem}.result-map img.image{float:left!important;height:100px!important;width:auto!important}.result-map table{font-size:.9em;width:auto;border-collapse:separate;border-spacing:0 .35rem}.result-map table th{font-weight:inherit;width:17rem;vertical-align:top;text-align:right}.result-map table td{vertical-align:top;text-align:right}.hidden{display:none!important}#results{margin-top:1rem;margin-left:2rem;margin-bottom:0;margin-right:10rem;display:grid;grid-template:"corrections sidebar" min-content "answers sidebar" min-content "urls sidebar" 1fr "pagination sidebar" min-content / 45rem 25rem;gap:0 5rem}#results #sidebar *:first-child{margin-top:0}#urls{padding:0;grid-area:urls}#apis .wrapper{display:flex}#suggestions .wrapper{display:flex;flex-flow:column;justify-content:flex-end}#suggestions .wrapper form{display:inline-block;flex:1 1 50%}#suggestions input,#infoboxes input{padding:0;margin:3px;font-size:.9em;display:inline-block;background:transparent;color:var(--color-result-search-url-font);cursor:pointer;width:100%;text-overflow:ellipsis;overflow:hidden;text-align:left}#suggestions input[type=submit],#infoboxes input[type=submit],#suggestions .infobox .url a,#infoboxes .infobox .url a{color:var(--color-result-link-font);text-decoration:none;font-size:.9rem}#suggestions input[type=submit]:hover,#infoboxes input[type=submit]:hover,#suggestions .infobox .url a:hover,#infoboxes .infobox .url a:hover{text-decoration:underline}#corrections{grid-area:corrections;display:flex;flex-flow:row wrap;margin:0 0 1em}#corrections h4,#corrections input[type=submit]{display:inline-block;padding:.5rem;margin:.5rem}#corrections input[type=submit]{font-size:.8rem;border-radius:5px}#infoboxes .title,#suggestions .title,#search_url .title,#engines_msg .title,#apis .title{margin:2em 0 .5em;color:var(--color-base-font)}summary.title{cursor:pointer;padding-top:1em}.sidebar-collapsible{border-top:1px solid var(--color-sidebar-border);padding-bottom:.5em}#sidebar-end-collapsible{border-bottom:1px solid var(--color-sidebar-border);width:100%}#answers{grid-area:answers;background:var(--color-answer-background);padding:1rem;margin:1rem 0;margin-top:0;color:var(--color-answer-font);border-radius:10px}#answers h4{display:none}#answers span{overflow-wrap:anywhere}#answers .answer{display:flex;flex-direction:column}#answers .answer-url{margin:5px 10px 10px auto}#infoboxes form{min-width:210px}#sidebar{grid-area:sidebar;word-wrap:break-word;color:var(--color-sidebar-font)}#sidebar .infobox{margin:10px 0;border:1px solid var(--color-sidebar-border);padding:1rem;font-size:.9em;border-radius:10px}#sidebar .infobox h2{margin:0 0 .5em}#sidebar .infobox img{max-width:100%;max-height:12em;display:block;margin:0 auto;padding:0}#sidebar .infobox dt{font-weight:700}#sidebar .infobox .attributes dl{margin:.5em 0}#sidebar .infobox .attributes dt{display:inline;margin:.5em 0 .5em .25em;padding:0}#sidebar .infobox .attributes dd{display:inline;margin:.5em 0;padding:0}#sidebar .infobox input{font-size:1em}#sidebar .infobox br,#sidebar .infobox .attributes,#sidebar .infobox .urls{clear:both}#apis input{font-size:.9em;margin:0 10px 0 0;padding:5px 10px;border-radius:5px;background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer}#apis input:hover{background:var(--color-btn-background);color:var(--color-btn-font)}#engines_msg .engine-name{width:10rem}#engines_msg .response-error{color:var(--color-error)}#engines_msg .bar-chart-value{width:auto}#search_url div.selectable_url pre{float:left;width:200em}#search_url button#copy_url{float:right;padding:.4rem;margin-left:.5rem;border-radius:.3rem;display:none}#links_on_top{position:absolute;left:1rem;text-align:left;top:2.7rem;padding:0;border:0;display:flex;align-items:center;font-size:1em;color:var(--color-search-font)}#links_on_top a{display:flex;align-items:center;margin-left:1em}#links_on_top a svg{font-size:1.2em;margin-left:.125em}#links_on_top a,#links_on_top a:link *,#links_on_top a:hover *,#links_on_top a:visited *,#links_on_top a:active *{color:var(--color-search-font)}#pagination{grid-area:pagination}#pagination br{clear:both}.numbered_pagination{display:flex;flex-direction:row;justify-content:center;align-items:center;overflow:hidden}.page_number{background:transparent!important;color:var(--color-result-link-font)!important;text-decoration:underline}.page_number_current{background:transparent;color:var(--color-result-link-visited-font);border:none}#backToTop{border:1px solid var(--color-backtotop-border);margin:0;padding:0;font-size:1em;background:var(--color-backtotop-background);position:fixed;bottom:8rem;right:56.3rem;transition:opacity .5s;opacity:0;pointer-events:none;border-radius:10px}#backToTop a{display:block;margin:0;padding:.7em}#backToTop a,#backToTop a:visited,#backToTop a:hover,#backToTop a:active{color:var(--color-backtotop-font)}#results.scrolling #backToTop{opacity:1;pointer-events:all}@media screen and (width <= calc(79.75em - .5px)){#links_on_top span{display:none}}@media screen and (width <= 52rem){body.results_endpoint #links_on_top .link_on_top_about,body.results_endpoint #links_on_top .link_on_top_donate{display:none}}@media screen and (min-width: 50em) and (max-width: 79.75em){.center-alignment-no #links_on_top span{display:none}.center-alignment-no .page_with_header{margin:2rem .5rem;width:auto}.center-alignment-no #infoboxes{position:inherit;max-width:inherit}.center-alignment-no #infoboxes .infobox{clear:both}.center-alignment-no #infoboxes .infobox img{float:right;max-width:10em;margin:.5em 0 .5em .5em}.center-alignment-no #sidebar{margin:0 .5rem .125rem;padding:0;float:none;border:none;width:auto}.center-alignment-no #sidebar input{border:0}.center-alignment-no .result .thumbnail{max-width:98%}.center-alignment-no .result .url span.url{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}.center-alignment-no .result .engines{float:left;display:flex;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0}.center-alignment-no .result-images{border-bottom:none!important}.center-alignment-no .image_result,.center-alignment-no .image_result img{max-width:98%}.center-alignment-no #backToTop{display:none}.center-alignment-no #pagination{margin:2rem 0 0!important}.center-alignment-no #main_results div#results{margin:0 auto;justify-content:center;display:grid;grid-template:"corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 45rem;gap:0}}#main_results div#results.only_template_images{margin:1rem .5rem 0;display:grid;grid-template:"corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 100%;gap:0}#main_results div#results.only_template_images #sidebar{display:none}#main_results div#results.only_template_images #urls{margin:0;display:flex;flex-wrap:wrap}#main_results div#results.only_template_images #urls:after{flex-grow:10;content:""}#main_results div#results.only_template_images #backToTop{right:auto;left:1rem}#main_results div#results.only_template_images #pagination{margin-left:4rem}@media screen and (max-width: 50em){#links_on_top span{display:none}.page_with_header{margin:2rem .5rem;width:auto}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:right;max-width:10em;margin:.5em 0 .5em .5em}#sidebar{margin:0 .5rem .125rem;padding:0;float:none;border:none;width:auto}#sidebar input{border:0}.result .thumbnail{max-width:98%}.result .url span.url{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}.result .engines{float:left;display:flex;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0}.result-images{border-bottom:none!important}.image_result,.image_result img{max-width:98%}#backToTop{display:none}#pagination{margin:2rem 0 0!important}#main_results div#results{margin:0 auto;justify-content:center;display:grid;grid-template:"corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 45rem;gap:0}html{background-color:var(--color-base-background-mobile)}#main_results div#results{grid-template-columns:100%;margin:0 auto}#links_on_top{top:1.4rem;left:10px}#main_index #links_on_top{top:.5rem;left:.5rem}#results{margin:0;padding:0}#pagination{margin:2rem 1rem 0!important}article[data-vim-selected]{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{background:var(--color-result-background);border:1px solid var(--color-result-background);margin:1rem 2%;width:96%;border-radius:10px}.result-images{margin:0;height:10rem;background:var(--color-base-background-mobile);width:unset}.infobox{border:none!important;background-color:var(--color-sidebar-background)}.numbered_pagination{display:none}.result-paper .attributes,.result-packages .attributes,.result-paper .attributes div,.result-packages .attributes div{display:block}.result-paper .attributes div span,.result-packages .attributes div span{display:inline}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{font-weight:700}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){margin-right:.5rem}}@media screen and (max-width: 35em){.result-videos img.thumbnail{float:none!important}.result-videos .content{overflow:inherit}}pre code{white-space:pre-wrap}#main_results .result-keyvalue caption{padding:.8rem .5rem;font-style:italic;caption-side:bottom;background-color:var(--color-result-keyvalue-table)}#main_results .result-keyvalue .col-key{width:25%}#main_results .result-keyvalue table{word-break:break-word;table-layout:fixed;width:100%;background-color:var(--color-result-keyvalue-table)}#main_results .result-keyvalue tr.odd{background-color:var(--color-result-keyvalue-odd)}#main_results .result-keyvalue tr.even{background-color:var(--color-result-keyvalue-even)}#main_results .result-keyvalue th,#main_results .result-keyvalue td{padding:.3rem .5rem}#q,#sidebar .infobox dt bdi{direction:rtl}#urls{direction:initial;text-align:right}#urls .result .url_header{direction:rtl}#urls .result .url_wrapper{justify-content:end}#main_results div#results.only_template_images #urls{direction:rtl}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p{direction:rtl}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url{direction:ltr}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url span{direction:rtl;float:right}@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))){select{border-width:0 0 0 2rem;background-position-x:-2rem}}#vim-hotkeys-help table{direction:ltr;text-align:left}#main_preferences h1,#main_stats h1{background-position-x:100%}.bar-chart-serie1,.bar-chart-serie2{float:right}.engine-stats .engine-name,.engine-stats .engine-score,.engine-stats .result-count,.engine-stats .response-time,.engine-stats .engine-reliability{text-align:right} +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{-webkit-text-size-adjust:100%;line-height:1.15}body{margin:0}main{display:block}h1{margin:.67em 0;font-size:2em}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:#0000}abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:100%;line-height:1.15}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner{border-style:none;padding:0}[type=button]::-moz-focus-inner{border-style:none;padding:0}[type=reset]::-moz-focus-inner{border-style:none;padding:0}[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring{outline:1px dotted buttontext}[type=button]:-moz-focusring{outline:1px dotted buttontext}[type=reset]:-moz-focusring{outline:1px dotted buttontext}[type=submit]:-moz-focusring{outline:1px dotted buttontext}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;white-space:normal;max-width:100%;padding:0;display:table}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button{height:auto}[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template,[hidden]{display:none}:root{--color-base-font:#444;--color-base-font-rgb:68,68,68;--color-base-background:#fff;--color-base-background-mobile:#f2f5f8;--color-url-font:#334999;--color-url-visited-font:#9822c3;--color-header-background:#fdfbff;--color-header-border:#ddd;--color-footer-background:#fdfbff;--color-footer-border:#ddd;--color-sidebar-border:#ddd;--color-sidebar-font:#000;--color-sidebar-background:#fff;--color-backtotop-font:#444;--color-backtotop-border:#ddd;--color-backtotop-background:#fff;--color-btn-background:#3050ff;--color-btn-font:#fff;--color-show-btn-background:#bbb;--color-show-btn-font:#000;--color-search-border:#bbb;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#fff;--color-search-font:#222;--color-search-background-hover:#3050ff;--color-error:#db3434;--color-error-background:#fae1e1;--color-warning:#dbba34;--color-warning-background:#faf5e1;--color-success:#42db34;--color-success-background:#e3fae1;--color-categories-item-selected-font:#3050ff;--color-categories-item-border-selected:#3050ff;--color-autocomplete-font:#000;--color-autocomplete-border:#bbb;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#fff;--color-autocomplete-background-hover:#e3e3e3;--color-answer-font:#444;--color-answer-background:#fff;--color-result-keyvalue-col-table:#fdfbff;--color-result-keyvalue-odd:#fdfbff;--color-result-keyvalue-even:#fff;--color-result-background:#fff;--color-result-border:#ddd;--color-result-url-font:#000;--color-result-vim-selected:#f7f7f7;--color-result-vim-arrow:#000bbb;--color-result-description-highlight-font:#000;--color-result-link-font:#000bbb;--color-result-link-font-highlight:#000bbb;--color-result-link-visited-font:#9822c3;--color-result-publishdate-font:#777;--color-result-engines-font:#545454;--color-result-search-url-border:#ddd;--color-result-search-url-font:#000;--color-result-image-span-font:#444;--color-result-image-span-font-selected:#fff;--color-result-image-background:#fff;--color-settings-tr-hover:#ebebeb;--color-settings-engine-description-font:#545454;--color-settings-table-group-background:#0001;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#242424;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#545454;--color-toolkit-kbd-font:#fff;--color-toolkit-kbd-background:#000;--color-toolkit-dialog-border:#ddd;--color-toolkit-dialog-background:#fff;--color-toolkit-tabs-label-border:#fff;--color-toolkit-tabs-section-border:#ddd;--color-toolkit-select-background:#e1e1e1;--color-toolkit-select-border:#ddd;--color-toolkit-select-background-hover:#bbb;--color-toolkit-input-text-font:#222;--color-toolkit-checkbox-onoff-off-background:#ddd;--color-toolkit-checkbox-onoff-on-background:#ddd;--color-toolkit-checkbox-onoff-on-mark-background:#3050ff;--color-toolkit-checkbox-onoff-on-mark-color:#fff;--color-toolkit-checkbox-onoff-off-mark-background:#aaa;--color-toolkit-checkbox-onoff-off-mark-color:#fff;--color-toolkit-checkbox-label-background:#ddd;--color-toolkit-checkbox-label-border:#ddd;--color-toolkit-checkbox-input-border:#3050ff;--color-toolkit-engine-tooltip-border:#ddd;--color-toolkit-engine-tooltip-background:#fff;--color-toolkit-loader-border:#0003;--color-toolkit-loader-borderleft:#fff0;--color-doc-code:#003;--color-doc-code-background:#ddeaff;--color-bar-chart-primary:#5bc0de;--color-bar-chart-secondary:#deb15b;--color-image-resolution-background:#00000080;--color-image-resolution-font:#fff;--color-loading-indicator:#fff3;--color-loading-indicator-gap:#fff;--color-line-number:#64708d;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}@media (prefers-color-scheme:dark){:root.theme-auto{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#222428;--color-base-background-mobile:#222428;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#1e1e22;--color-header-border:#333;--color-footer-background:#1e1e22;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#292c34;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}}:root.theme-dark{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#222428;--color-base-background-mobile:#222428;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#1e1e22;--color-header-border:#333;--color-footer-background:#1e1e22;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#292c34;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}:root.theme-black{--color-base-font:#bbb;--color-base-font-rgb:187,187,187;--color-base-background:#000;--color-base-background-mobile:#000;--color-url-font:#8af;--color-url-visited-font:#c09cd9;--color-header-background:#000;--color-header-border:#333;--color-footer-background:#000;--color-footer-border:#333;--color-sidebar-border:#555;--color-sidebar-font:#fff;--color-sidebar-background:#000;--color-backtotop-font:#bbb;--color-backtotop-border:#333;--color-backtotop-background:#2b2e36;--color-btn-background:#58f;--color-btn-font:#222;--color-show-btn-background:#555;--color-show-btn-font:#fff;--color-search-border:#555;--color-search-shadow:0 2px 8px #22262e40;--color-search-background:#2b2e36;--color-search-font:#fff;--color-search-background-hover:#58f;--color-error:#f55b5b;--color-error-background:#390a0a;--color-warning:#f1d561;--color-warning-background:#39300a;--color-success:#79f56e;--color-success-background:#0e390a;--color-categories-item-selected-font:#58f;--color-categories-item-border-selected:#58f;--color-autocomplete-font:#fff;--color-autocomplete-border:#555;--color-autocomplete-shadow:0 2px 8px #22262e40;--color-autocomplete-background:#2b2e36;--color-autocomplete-background-hover:#1e1e22;--color-answer-font:#bbb;--color-answer-background:#26292f;--color-result-keyvalue-col-table:#1e1e22;--color-result-keyvalue-odd:#1e1e22;--color-result-keyvalue-even:#26292f;--color-result-background:#26292f;--color-result-border:#333;--color-result-url-font:#fff;--color-result-vim-selected:#1f1f23cc;--color-result-vim-arrow:#8af;--color-result-description-highlight-font:#fff;--color-result-link-font:#8af;--color-result-link-font-highlight:#8af;--color-result-link-visited-font:#c09cd9;--color-result-publishdate-font:#888;--color-result-engines-font:#a4a4a4;--color-result-search-url-border:#555;--color-result-search-url-font:#fff;--color-result-detail-font:#fff;--color-result-detail-label-font:lightgray;--color-result-detail-background:#1a1a1c;--color-result-detail-hr:#555;--color-result-detail-link:#8af;--color-result-detail-loader-border:#fff3;--color-result-detail-loader-borderleft:#0000;--color-result-image-span-font:#bbb;--color-result-image-span-font-selected:#222;--color-result-image-background:#222;--color-settings-tr-hover:#2c2c32;--color-settings-engine-description-font:#909090;--color-settings-table-group-background:#1b1b21;--color-toolkit-badge-font:#fff;--color-toolkit-badge-background:#555;--color-toolkit-kbd-font:#000;--color-toolkit-kbd-background:#fff;--color-toolkit-dialog-border:#555;--color-toolkit-dialog-background:#1e1e22;--color-toolkit-tabs-label-border:#222;--color-toolkit-tabs-section-border:#555;--color-toolkit-select-background:#313338;--color-toolkit-select-border:#555;--color-toolkit-select-background-hover:#373b49;--color-toolkit-input-text-font:#fff;--color-toolkit-checkbox-onoff-off-background:#313338;--color-toolkit-checkbox-onoff-on-background:#313338;--color-toolkit-checkbox-onoff-on-mark-background:#58f;--color-toolkit-checkbox-onoff-on-mark-color:#222;--color-toolkit-checkbox-onoff-off-mark-background:#ddd;--color-toolkit-checkbox-onoff-off-mark-color:#222;--color-toolkit-checkbox-label-background:#222;--color-toolkit-checkbox-label-border:#333;--color-toolkit-checkbox-input-border:#58f;--color-toolkit-engine-tooltip-border:#333;--color-toolkit-engine-tooltip-background:#222;--color-toolkit-loader-border:#fff3;--color-toolkit-loader-borderleft:#0000;--color-doc-code:#ddd;--color-doc-code-background:#4d5a6f;--color-favicon-background-color:#ddd;--color-favicon-border-color:#ccc}.code-highlight pre{line-height:100%}.code-highlight td.linenos .normal,.code-highlight span.linenos{color:inherit;background-color:#0000;padding-left:5px;padding-right:5px}.code-highlight td.linenos .special,.code-highlight span.linenos.special{color:#000;background-color:#ffffc0;padding-left:5px;padding-right:5px}.code-highlight .hll{background-color:#ffc}.code-highlight .c{color:#3d7b7b;font-style:italic}.code-highlight .err{border:1px solid red}.code-highlight .k{color:green;font-weight:700}.code-highlight .o{color:#666}.code-highlight .ch,.code-highlight .cm{color:#3d7b7b;font-style:italic}.code-highlight .cp{color:#9c6500}.code-highlight .cpf,.code-highlight .c1,.code-highlight .cs{color:#3d7b7b;font-style:italic}.code-highlight .gd{color:#a00000}.code-highlight .ge{font-style:italic}.code-highlight .ges{font-style:italic;font-weight:700}.code-highlight .gr{color:#e40000}.code-highlight .gh{color:navy;font-weight:700}.code-highlight .gi{color:#008400}.code-highlight .go{color:#717171}.code-highlight .gp{color:navy;font-weight:700}.code-highlight .gs{font-weight:700}.code-highlight .gu{color:purple;font-weight:700}.code-highlight .gt{color:#04d}.code-highlight .kc,.code-highlight .kd,.code-highlight .kn{color:green;font-weight:700}.code-highlight .kp{color:green}.code-highlight .kr{color:green;font-weight:700}.code-highlight .kt{color:#b00040}.code-highlight .m{color:#666}.code-highlight .s{color:#ba2121}.code-highlight .na{color:#687822}.code-highlight .nb{color:green}.code-highlight .nc{color:#00f;font-weight:700}.code-highlight .no{color:#800}.code-highlight .nd{color:#a2f}.code-highlight .ni{color:#717171;font-weight:700}.code-highlight .ne{color:#cb3f38;font-weight:700}.code-highlight .nf{color:#00f}.code-highlight .nl{color:#767600}.code-highlight .nn{color:#00f;font-weight:700}.code-highlight .nt{color:green;font-weight:700}.code-highlight .nv{color:#19177c}.code-highlight .ow{color:#a2f;font-weight:700}.code-highlight .w{color:#bbb}.code-highlight .mb,.code-highlight .mf,.code-highlight .mh,.code-highlight .mi,.code-highlight .mo{color:#666}.code-highlight .sa,.code-highlight .sb,.code-highlight .sc,.code-highlight .dl{color:#ba2121}.code-highlight .sd{color:#ba2121;font-style:italic}.code-highlight .s2{color:#ba2121}.code-highlight .se{color:#aa5d1f;font-weight:700}.code-highlight .sh{color:#ba2121}.code-highlight .si{color:#a45a77;font-weight:700}.code-highlight .sx{color:green}.code-highlight .sr{color:#a45a77}.code-highlight .s1{color:#ba2121}.code-highlight .ss{color:#19177c}.code-highlight .bp{color:green}.code-highlight .fm{color:#00f}.code-highlight .vc,.code-highlight .vg,.code-highlight .vi,.code-highlight .vm{color:#19177c}.code-highlight .il{color:#666}.codelines{margin:.125rem 0 0;padding:1rem 0 0}.code-highlight pre{margin:0;padding:0 0 .75rem;overflow:auto}.code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;text-align:right;margin-right:8px}.code-highlight .linenos::selection{background:0 0}.code-highlight span.linenos{color:var(--color-line-number)}@media (prefers-color-scheme:dark){:root.theme-auto .code-highlight pre{line-height:100%}:root.theme-auto .code-highlight td.linenos .normal,:root.theme-auto .code-highlight span.linenos{color:#3c4354;background-color:#0000;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight td.linenos .special,:root.theme-auto .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight .hll{background-color:#6e7681}:root.theme-auto .code-highlight .c{color:#7e8aa1}:root.theme-auto .code-highlight .err{color:#f88f7f}:root.theme-auto .code-highlight .esc,:root.theme-auto .code-highlight .g{color:#d4d2c8}:root.theme-auto .code-highlight .k{color:#ffad66}:root.theme-auto .code-highlight .l{color:#d5ff80}:root.theme-auto .code-highlight .n{color:#d4d2c8}:root.theme-auto .code-highlight .o{color:#ffad66}:root.theme-auto .code-highlight .x,:root.theme-auto .code-highlight .p{color:#d4d2c8}:root.theme-auto .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-auto .code-highlight .cm{color:#7e8aa1}:root.theme-auto .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-auto .code-highlight .cpf,:root.theme-auto .code-highlight .c1{color:#7e8aa1}:root.theme-auto .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-auto .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-auto .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-auto .code-highlight .ges{color:#d4d2c8}:root.theme-auto .code-highlight .gr{color:#f88f7f}:root.theme-auto .code-highlight .gh{color:#d4d2c8}:root.theme-auto .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-auto .code-highlight .go{color:#7e8aa1}:root.theme-auto .code-highlight .gp{color:#d4d2c8}:root.theme-auto .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-auto .code-highlight .gu{color:#d4d2c8}:root.theme-auto .code-highlight .gt{color:#f88f7f}:root.theme-auto .code-highlight .kc,:root.theme-auto .code-highlight .kd,:root.theme-auto .code-highlight .kn,:root.theme-auto .code-highlight .kp,:root.theme-auto .code-highlight .kr{color:#ffad66}:root.theme-auto .code-highlight .kt{color:#73d0ff}:root.theme-auto .code-highlight .ld{color:#d5ff80}:root.theme-auto .code-highlight .m{color:#dfbfff}:root.theme-auto .code-highlight .s{color:#d5ff80}:root.theme-auto .code-highlight .na,:root.theme-auto .code-highlight .nb{color:#ffd173}:root.theme-auto .code-highlight .nc{color:#73d0ff}:root.theme-auto .code-highlight .no{color:#ffd173}:root.theme-auto .code-highlight .nd{color:#7e8aa1;font-style:italic;font-weight:700}:root.theme-auto .code-highlight .ni{color:#95e6cb}:root.theme-auto .code-highlight .ne{color:#73d0ff}:root.theme-auto .code-highlight .nf{color:#ffd173}:root.theme-auto .code-highlight .nl,:root.theme-auto .code-highlight .nn,:root.theme-auto .code-highlight .nx{color:#d4d2c8}:root.theme-auto .code-highlight .py{color:#ffd173}:root.theme-auto .code-highlight .nt{color:#5ccfe6}:root.theme-auto .code-highlight .nv{color:#d4d2c8}:root.theme-auto .code-highlight .ow{color:#ffad66}:root.theme-auto .code-highlight .pm,:root.theme-auto .code-highlight .w{color:#d4d2c8}:root.theme-auto .code-highlight .mb,:root.theme-auto .code-highlight .mf,:root.theme-auto .code-highlight .mh,:root.theme-auto .code-highlight .mi,:root.theme-auto .code-highlight .mo{color:#dfbfff}:root.theme-auto .code-highlight .sa{color:#f29e74}:root.theme-auto .code-highlight .sb,:root.theme-auto .code-highlight .sc,:root.theme-auto .code-highlight .dl{color:#d5ff80}:root.theme-auto .code-highlight .sd{color:#7e8aa1}:root.theme-auto .code-highlight .s2{color:#d5ff80}:root.theme-auto .code-highlight .se{color:#95e6cb}:root.theme-auto .code-highlight .sh{color:#d5ff80}:root.theme-auto .code-highlight .si,:root.theme-auto .code-highlight .sx,:root.theme-auto .code-highlight .sr{color:#95e6cb}:root.theme-auto .code-highlight .s1{color:#d5ff80}:root.theme-auto .code-highlight .ss{color:#dfbfff}:root.theme-auto .code-highlight .bp{color:#5ccfe6}:root.theme-auto .code-highlight .fm{color:#ffd173}:root.theme-auto .code-highlight .vc,:root.theme-auto .code-highlight .vg,:root.theme-auto .code-highlight .vi,:root.theme-auto .code-highlight .vm{color:#d4d2c8}:root.theme-auto .code-highlight .il{color:#dfbfff}:root.theme-auto .code-highlight pre{margin:0;padding:0 0 .75rem;overflow:auto}:root.theme-auto .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;text-align:right;margin-right:8px}:root.theme-auto .code-highlight .linenos::selection{background:0 0}:root.theme-auto .code-highlight span.linenos{color:var(--color-line-number)}}:root.theme-dark .code-highlight pre{line-height:100%}:root.theme-dark .code-highlight td.linenos .normal,:root.theme-dark .code-highlight span.linenos{color:#3c4354;background-color:#0000;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight td.linenos .special,:root.theme-dark .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight .hll{background-color:#6e7681}:root.theme-dark .code-highlight .c{color:#7e8aa1}:root.theme-dark .code-highlight .err{color:#f88f7f}:root.theme-dark .code-highlight .esc,:root.theme-dark .code-highlight .g{color:#d4d2c8}:root.theme-dark .code-highlight .k{color:#ffad66}:root.theme-dark .code-highlight .l{color:#d5ff80}:root.theme-dark .code-highlight .n{color:#d4d2c8}:root.theme-dark .code-highlight .o{color:#ffad66}:root.theme-dark .code-highlight .x,:root.theme-dark .code-highlight .p{color:#d4d2c8}:root.theme-dark .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-dark .code-highlight .cm{color:#7e8aa1}:root.theme-dark .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-dark .code-highlight .cpf,:root.theme-dark .code-highlight .c1{color:#7e8aa1}:root.theme-dark .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-dark .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-dark .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-dark .code-highlight .ges{color:#d4d2c8}:root.theme-dark .code-highlight .gr{color:#f88f7f}:root.theme-dark .code-highlight .gh{color:#d4d2c8}:root.theme-dark .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-dark .code-highlight .go{color:#7e8aa1}:root.theme-dark .code-highlight .gp{color:#d4d2c8}:root.theme-dark .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-dark .code-highlight .gu{color:#d4d2c8}:root.theme-dark .code-highlight .gt{color:#f88f7f}:root.theme-dark .code-highlight .kc,:root.theme-dark .code-highlight .kd,:root.theme-dark .code-highlight .kn,:root.theme-dark .code-highlight .kp,:root.theme-dark .code-highlight .kr{color:#ffad66}:root.theme-dark .code-highlight .kt{color:#73d0ff}:root.theme-dark .code-highlight .ld{color:#d5ff80}:root.theme-dark .code-highlight .m{color:#dfbfff}:root.theme-dark .code-highlight .s{color:#d5ff80}:root.theme-dark .code-highlight .na,:root.theme-dark .code-highlight .nb{color:#ffd173}:root.theme-dark .code-highlight .nc{color:#73d0ff}:root.theme-dark .code-highlight .no{color:#ffd173}:root.theme-dark .code-highlight .nd{color:#7e8aa1;font-style:italic;font-weight:700}:root.theme-dark .code-highlight .ni{color:#95e6cb}:root.theme-dark .code-highlight .ne{color:#73d0ff}:root.theme-dark .code-highlight .nf{color:#ffd173}:root.theme-dark .code-highlight .nl,:root.theme-dark .code-highlight .nn,:root.theme-dark .code-highlight .nx{color:#d4d2c8}:root.theme-dark .code-highlight .py{color:#ffd173}:root.theme-dark .code-highlight .nt{color:#5ccfe6}:root.theme-dark .code-highlight .nv{color:#d4d2c8}:root.theme-dark .code-highlight .ow{color:#ffad66}:root.theme-dark .code-highlight .pm,:root.theme-dark .code-highlight .w{color:#d4d2c8}:root.theme-dark .code-highlight .mb,:root.theme-dark .code-highlight .mf,:root.theme-dark .code-highlight .mh,:root.theme-dark .code-highlight .mi,:root.theme-dark .code-highlight .mo{color:#dfbfff}:root.theme-dark .code-highlight .sa{color:#f29e74}:root.theme-dark .code-highlight .sb,:root.theme-dark .code-highlight .sc,:root.theme-dark .code-highlight .dl{color:#d5ff80}:root.theme-dark .code-highlight .sd{color:#7e8aa1}:root.theme-dark .code-highlight .s2{color:#d5ff80}:root.theme-dark .code-highlight .se{color:#95e6cb}:root.theme-dark .code-highlight .sh{color:#d5ff80}:root.theme-dark .code-highlight .si,:root.theme-dark .code-highlight .sx,:root.theme-dark .code-highlight .sr{color:#95e6cb}:root.theme-dark .code-highlight .s1{color:#d5ff80}:root.theme-dark .code-highlight .ss{color:#dfbfff}:root.theme-dark .code-highlight .bp{color:#5ccfe6}:root.theme-dark .code-highlight .fm{color:#ffd173}:root.theme-dark .code-highlight .vc,:root.theme-dark .code-highlight .vg,:root.theme-dark .code-highlight .vi,:root.theme-dark .code-highlight .vm{color:#d4d2c8}:root.theme-dark .code-highlight .il{color:#dfbfff}:root.theme-dark .code-highlight pre{margin:0;padding:0 0 .75rem;overflow:auto}:root.theme-dark .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;text-align:right;margin-right:8px}:root.theme-dark .code-highlight .linenos::selection{background:0 0}:root.theme-dark .code-highlight span.linenos{color:var(--color-line-number)}html.no-js .hide_if_nojs,html.js .show_if_nojs{display:none}.center{text-align:center}.right{float:right}.left{float:left}.invisible{display:none!important}.list-unstyled{list-style-type:none}.list-unstyled li{margin-top:4px;margin-bottom:4px}.danger{background-color:var(--color-error-background)}.warning{background:var(--color-warning-background)}.success{background:var(--color-success-background)}.badge{color:var(--color-toolkit-badge-font);background-color:var(--color-toolkit-badge-background);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:5px;min-width:10px;padding:1px 5px;display:inline-block}kbd{color:var(--color-toolkit-kbd-font);background:var(--color-toolkit-kbd-background);margin:1px;padding:2px 4px;font-size:90%}table{width:100%}table.striped tr{border-bottom:1px solid var(--color-settings-tr-hover)}th{padding:.4em}td{padding:0 4px}tr:hover{background:var(--color-settings-tr-hover)!important}div.selectable_url{border:1px solid var(--color-result-search-url-border);color:var(--color-result-search-url-font);border-radius:5px;height:1.2em;margin:.1em;padding:4px;line-height:1.2em;display:block;overflow:hidden}div.selectable_url pre{word-break:break-all;-webkit-user-select:all;user-select:all;margin:.1em;font-size:.8em;display:block}.dialog-error{border:1px solid var(--color-toolkit-dialog-border);text-align:right;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error);border-radius:10px;margin:0 0 1em;padding:1rem;display:flex;position:relative}.dialog-error .close{float:left;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-error ul,.dialog-error ol,.dialog-error p{margin:1px 0 0}.dialog-error table{width:auto}.dialog-error tr{vertical-align:text-top}.dialog-error tr:hover{background:0 0!important}.dialog-error td{padding:0 0 0 1rem}.dialog-error h4{margin-top:.3em;margin-bottom:.3em}.dialog-error-block{border:1px solid var(--color-toolkit-dialog-border);text-align:right;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error);border-radius:10px;margin:0 0 1em;padding:1rem;display:block;position:relative}.dialog-error-block .close{float:left;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-error-block ul,.dialog-error-block ol,.dialog-error-block p{margin:1px 0 0}.dialog-error-block table{width:auto}.dialog-error-block tr{vertical-align:text-top}.dialog-error-block tr:hover{background:0 0!important}.dialog-error-block td{padding:0 0 0 1rem}.dialog-error-block h4{margin-top:.3em;margin-bottom:.3em}.dialog-warning{border:1px solid var(--color-toolkit-dialog-border);text-align:right;color:var(--color-warning);background:var(--color-warning-background);border-color:var(--color-warning);border-radius:10px;margin:0 0 1em;padding:1rem;display:flex;position:relative}.dialog-warning .close{float:left;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-warning ul,.dialog-warning ol,.dialog-warning p{margin:1px 0 0}.dialog-warning table{width:auto}.dialog-warning tr{vertical-align:text-top}.dialog-warning tr:hover{background:0 0!important}.dialog-warning td{padding:0 0 0 1rem}.dialog-warning h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal{border:1px solid var(--color-toolkit-dialog-border);text-align:right;background:var(--color-toolkit-dialog-background);z-index:5000;border-radius:10px;margin:0 auto;padding:1rem;display:block;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.dialog-modal .close{float:left;color:inherit;font-size:1.5em;position:relative;top:-3px}.dialog-modal ul,.dialog-modal ol,.dialog-modal p{margin:1px 0 0}.dialog-modal table{width:auto}.dialog-modal tr{vertical-align:text-top}.dialog-modal tr:hover{background:0 0!important}.dialog-modal td{padding:0 0 0 1rem}.dialog-modal h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal h3{margin-top:0}.btn-collapse{cursor:pointer}.scrollx{border:none;margin:0;padding:0;display:block;overflow:auto hidden}.tabs .tabs>label{font-size:90%}ul.tabs{border-bottom:1px solid var(--color-toolkit-tabs-section-border);padding-left:0;list-style:none}ul.tabs li{display:flex}.tabs{flex-wrap:wrap;width:100%;min-width:100%;display:flex}.tabs>*{order:2}.tabs>input[type=radio]{display:none}.tabs>label,.tabs>li>a{letter-spacing:.5px;text-transform:uppercase;border:solid var(--color-toolkit-tabs-label-border);color:unset;-webkit-user-select:none;user-select:none;cursor:pointer;border-width:0 0 2px;order:1;margin:0 .7em;padding:.7em}.tabs>label.active,.tabs>li>a.active{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}.tabs>label:hover,.tabs>li>a:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}.tabs>section{box-sizing:border-box;border-top:1px solid var(--color-toolkit-tabs-section-border);min-width:100%;padding:.7rem 0;display:none}.tabs>label:last-of-type{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font);letter-spacing:-.1px}.tabs>section:last-of-type{display:block}html body .tabs>input:checked~section{display:none}html body .tabs>input:checked~label{position:inherit;background:inherit;color:inherit;border-bottom:2px solid #0000;font-weight:400}html body .tabs>input:checked~label:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}html body .tabs>input:checked+label{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}html body .tabs>input:checked+label+section{display:block}select{height:2.4rem;color:var(--color-search-font);z-index:100;margin:0 0 0 1rem;font-size:.9rem;padding:.2rem!important}select:hover,select:focus{cursor:pointer}@supports (background-position-x:100%) and (appearance:none){select{appearance:none;background:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E) calc(100% + 2rem) 0/2rem no-repeat content-box border-box;background-color:var(--color-toolkit-select-background);text-overflow:ellipsis;border-width:0 2rem 0 0;border-color:#0000;border-radius:5px;outline:none}select:hover,select:focus{background-color:var(--color-toolkit-select-background-hover)}select option{background-color:var(--color-base-background)}@media (prefers-color-scheme:dark){html.theme-auto select,html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}input.checkbox-onoff[type=checkbox]{appearance:none;cursor:pointer;border-radius:10px;width:2.5em;height:.7em;margin:0 16px;display:inline-block;position:relative;box-shadow:none!important}input.checkbox-onoff[type=checkbox]:focus,input.checkbox-onoff[type=checkbox]:hover{outline:none}input.checkbox-onoff[type=checkbox]:focus:after{content:"";border:1px solid var(--color-btn-background);width:3.5em;height:1.65em;box-shadow:var(--color-btn-background)0 0 3px;z-index:1200;border-radius:12px;position:absolute;top:-.55em;left:-.6em}input.checkbox-onoff[type=checkbox]:before{border-radius:50%;justify-content:center;align-items:center;width:1.875em;height:1.875em;font-size:.75em;display:flex;position:absolute;top:-.5em}input.checkbox-onoff[type=checkbox],input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked{background:var(--color-toolkit-checkbox-onoff-off-background)}input.checkbox-onoff[type=checkbox]:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked:before{content:"✕";color:var(--color-toolkit-checkbox-onoff-off-mark-color);background:var(--color-toolkit-checkbox-onoff-off-mark-background);left:-.5em}input.checkbox-onoff[type=checkbox]:checked,input.checkbox-onoff.reversed-checkbox[type=checkbox]{background:var(--color-toolkit-checkbox-onoff-on-background)}input.checkbox-onoff[type=checkbox]:checked:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:before{content:"✓";color:var(--color-toolkit-checkbox-onoff-on-mark-color);background:var(--color-toolkit-checkbox-onoff-on-mark-background);left:calc(100% - 1.5em)}@supports (transform:rotate(-45deg)){input[type=checkbox]:not(.checkbox-onoff){appearance:none;cursor:pointer;border:2px solid var(--color-toolkit-checkbox-input-border);border-radius:.3em;width:20px;height:20px;position:relative;top:0;left:0}input[type=checkbox]:not(.checkbox-onoff):after{content:"";border:3px solid var(--color-toolkit-checkbox-label-border);opacity:0;background:0 0;border-top:none;border-right:none;width:9px;height:5px;position:absolute;top:3px;left:2px;transform:rotate(-45deg)}input[type=checkbox]:not(.checkbox-onoff):checked:after{border-color:var(--color-toolkit-checkbox-input-border);opacity:1}input[type=checkbox][disabled]:not(.checkbox-onoff){border:inherit;cursor:inherit;background-color:#0000!important}input.checkbox[type=checkbox]:not(:checked,[disabled],.checkbox-onoff):hover:after{opacity:.5}}@media screen and (max-width:50em){.tabs>label{width:100%}}.loader,.loader:after{border-radius:50%;width:2em;height:2em}.loader{text-indent:-9999em;border-top:.5em solid var(--color-toolkit-loader-border);border-right:.5em solid var(--color-toolkit-loader-border);border-bottom:.5em solid var(--color-toolkit-loader-border);border-left:.5em solid var(--color-toolkit-loader-borderleft);margin:1em auto;font-size:10px;animation:1.2s linear infinite load8;position:relative;transform:translateZ(0)}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.engine-tooltip{border:1px solid var(--color-toolkit-engine-tooltip-border);background:var(--color-toolkit-engine-tooltip-background);z-index:5000;text-align:left;border-radius:10px;margin:0 0 0 2rem;padding:.5rem 1rem;font-size:14px;font-weight:400;display:none;position:absolute}th:hover .engine-tooltip,td:hover .engine-tooltip,.engine-tooltip:hover{display:inline-block}.stacked-bar-chart{flex-flow:row;align-items:center;width:100%;margin:0;padding:0 .125rem 0 4rem;display:inline-flex}.stacked-bar-chart-value{text-align:right;width:3rem;padding:0 .5rem;display:inline-block;position:absolute}.stacked-bar-chart-base{flex-grow:0;flex-shrink:0;flex-basis:unset;display:flex}.stacked-bar-chart-median{flex-grow:0;flex-shrink:0;flex-basis:unset;background:var(--color-base-font);border:1px solid rgba(var(--color-base-font-rgb),.9);padding:.3rem 0;display:flex}.stacked-bar-chart-rate80{flex-grow:0;flex-shrink:0;flex-basis:unset;border:1px solid rgba(var(--color-base-font-rgb),.3);background:0 0;padding:.3rem 0;display:flex}.stacked-bar-chart-rate95{flex-grow:0;flex-shrink:0;flex-basis:unset;border-bottom:1px dotted rgba(var(--color-base-font-rgb),.5);background:0 0;padding:0;display:flex}.stacked-bar-chart-rate100{flex-grow:0;flex-shrink:0;flex-basis:unset;border-left:1px solid rgba(var(--color-base-font-rgb),.9);background:0 0;width:1px;padding:.4rem 0;display:flex}.autocomplete{text-align:right;border-radius:10px;width:44rem;max-width:calc(100% - 1rem);max-height:0;position:absolute;overflow-y:hidden}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:var(--color-autocomplete-background)}.autocomplete:empty{display:none}.autocomplete>ul{margin:0;padding:0;list-style-type:none}.autocomplete>ul>li{cursor:pointer;padding:.5rem 1rem}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus,.autocomplete>ul>li:hover{background-color:var(--color-autocomplete-background-hover)}.autocomplete>ul>li.active a:active,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:hover a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:hover a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:hover,.autocomplete>ul>li:hover a:hover{text-decoration:none}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete.open{background-color:var(--color-autocomplete-background);color:var(--color-autocomplete-font);z-index:5000;border-radius:.8rem;max-height:32rem;margin-top:3.5rem;display:block;overflow-y:auto}.autocomplete.open:empty{display:none}@media screen and (max-width:50em){.autocomplete>ul>li{padding:1rem}}#main_results #results.image-detail-open.only_template_images{width:min(98%,59.25rem)!important}#main_results #results.only_template_images.image-detail-open #backToTop{left:inherit;right:56.75rem!important}article.result-images .detail{display:none}#results.image-detail-open article.result-images[data-vim-selected] .detail{background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-background);z-index:1000;flex-direction:column;padding:4rem 3rem 3rem;transition:top 64ms ease-in;display:flex;position:fixed;inset:13rem 60rem 0 0;overflow-y:scroll}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{text-align:left;border:none;flex:1;width:100%;text-decoration:none;display:block}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{object-fit:contain;width:inherit;height:inherit;max-width:100%;min-height:inherit;background:inherit;border:none;max-height:calc(100vh - 42rem);margin:0;padding:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels{color:var(--color-result-detail-font);height:19rem}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels hr{border-top:1px solid var(--color-result-detail-hr);border-bottom:none}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4{text-overflow:ellipsis;height:2rem;margin-bottom:0;font-size:.9rem;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p{color:var(--color-result-detail-label-font);white-space:nowrap;text-overflow:ellipsis;margin:.8rem 0;font-size:.9rem;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{width:12rem;display:inline-block}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a{text-align:right}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content{height:2rem;line-height:unset;text-overflow:ellipsis;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url:hover{background:var(--color-result-detail-background);position:relative;overflow:inherit!important;text-overflow:inherit!important}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:active{color:var(--color-result-detail-link)}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover{text-decoration:underline}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close{padding:.4rem;top:1rem;right:1rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{padding:.4rem .3rem .4rem .5rem;top:1rem;left:6rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{padding:.4rem;top:1rem;left:2rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{filter:opacity(40%);z-index:1200;border-radius:50%;width:1.5rem;height:1.5rem;display:block;position:absolute}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span{text-align:center;width:1.5rem;height:1.5rem;display:block}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span:before,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span:before{vertical-align:sub}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:active{color:var(--color-result-detail-font);background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-font)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover{filter:opacity(80%)}#results.image-detail-open article.result-images[data-vim-selected] .detail .loader{border-top:.5em solid var(--color-result-detail-loader-border);border-right:.5em solid var(--color-result-detail-loader-border);border-bottom:.5em solid var(--color-result-detail-loader-border);border-left:.5em solid var(--color-result-detail-loader-borderleft);position:absolute;top:1rem;left:50%}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail{top:0}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail a.result-images-source img{max-height:calc(100vh - 25rem)}@media screen and (max-width:79.75em){#results.image-detail-open article.result-images[data-vim-selected] .detail{top:0;right:0}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{flex-direction:column;justify-content:center;display:flex}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 24rem)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{left:1rem}}@media screen and (max-width:50em){#results.image-detail-open article.result-images[data-vim-selected] .detail{padding:1rem;top:0;right:0}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 2rem);margin:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{width:inherit;margin-left:1rem}}.dialog-modal{animation-name:dialogmodal;animation-duration:.13s}@keyframes dialogmodal{0%{opacity:0}50%{opacity:.5;transform:translate(-50%,-50%)scale(1.05)}}input.checkbox-onoff[type=checkbox]:before{transition:left .25s}iframe[src^="https://w.soundcloud.com"]{height:120px}iframe[src^="https://www.deezer.com"]{height:94px}iframe[src^="https://www.mixcloud.com"]{height:250px}iframe[src^="https://bandcamp.com/EmbeddedPlayer"]{height:350px}iframe[src^="https://bandcamp.com/EmbeddedPlayer/track"]{height:120px}iframe[src^="https://genius.com/songs"]{height:65px}.info-page code{background-color:var(--color-doc-code-background);color:var(--color-doc-code);border:0;border-radius:5px;padding:.2rem;font-family:monospace}.stats_endpoint .github-issue-button{font-size:16px;display:block}.stats_endpoint .issue-hide{display:none}.stats_endpoint input[type=checked]{position:absolute}.stats_endpoint label{margin:1rem 1rem 1rem 0}.stats_endpoint .step_content{margin:1rem 1rem 1rem 2rem}.stats_endpoint .step1,.stats_endpoint .step2{visibility:hidden}.stats_endpoint .step1_delay{transition:visibility 0s linear 4s}.stats_endpoint #step1:checked~.step1,.stats_endpoint #step2:checked~.step2{visibility:visible}.engine-stats{border-spacing:0;border-collapse:collapse}.engine-stats tr td,.engine-stats tr th{border-bottom:1px solid var(--color-result-border);padding:.25rem}.engine-stats table.engine-tooltip{border-spacing:0;border-collapse:collapse}.engine-stats table.engine-tooltip td,.engine-stats table.engine-tooltip th{border:none}.engine-stats .engine-name{width:20rem}.engine-stats .engine-score{text-align:right;width:7rem}.engine-stats .engine-reliability{text-align:right}table.engine-error th.engine-error-type,table.engine-error td.engine-error-type,failed-test{width:10rem}.engine-errors{margin-top:3rem}.engine-errors table.engine-error{border:1px solid var(--color-result-border);text-align:right;max-width:1280px;margin:1rem 0 3rem}.engine-errors table.engine-error tr th,.engine-errors table.engine-error tr td{padding:.5rem}.engine-errors table.engine-error span.log_parameters{border-right:1px solid solid var(--color-result-border);margin:0 0 0 .5rem;padding:0 1rem 0 0}.bar-chart-value{text-align:right;width:3em;padding-right:.5rem;display:inline-block}.bar-chart-graph{width:calc(100% - 5rem);display:inline-block}.bar-chart-bar{border:3px solid var(--color-bar-chart-primary);margin:1px 0}.bar-chart-serie1{border:3px solid var(--color-bar-chart-primary);float:left;margin:1px 0}.bar-chart-serie2{border:3px solid var(--color-bar-chart-secondary);float:left;margin:1px 0}.bar0{border:0;width:0}.bar1{width:1%}.bar2{width:2%}.bar3{width:3%}.bar4{width:4%}.bar5{width:5%}.bar6{width:6%}.bar7{width:7%}.bar8{width:8%}.bar9{width:9%}.bar10{width:10%}.bar11{width:11%}.bar12{width:12%}.bar13{width:13%}.bar14{width:14%}.bar15{width:15%}.bar16{width:16%}.bar17{width:17%}.bar18{width:18%}.bar19{width:19%}.bar20{width:20%}.bar21{width:21%}.bar22{width:22%}.bar23{width:23%}.bar24{width:24%}.bar25{width:25%}.bar26{width:26%}.bar27{width:27%}.bar28{width:28%}.bar29{width:29%}.bar30{width:30%}.bar31{width:31%}.bar32{width:32%}.bar33{width:33%}.bar34{width:34%}.bar35{width:35%}.bar36{width:36%}.bar37{width:37%}.bar38{width:38%}.bar39{width:39%}.bar40{width:40%}.bar41{width:41%}.bar42{width:42%}.bar43{width:43%}.bar44{width:44%}.bar45{width:45%}.bar46{width:46%}.bar47{width:47%}.bar48{width:48%}.bar49{width:49%}.bar50{width:50%}.bar51{width:51%}.bar52{width:52%}.bar53{width:53%}.bar54{width:54%}.bar55{width:55%}.bar56{width:56%}.bar57{width:57%}.bar58{width:58%}.bar59{width:59%}.bar60{width:60%}.bar61{width:61%}.bar62{width:62%}.bar63{width:63%}.bar64{width:64%}.bar65{width:65%}.bar66{width:66%}.bar67{width:67%}.bar68{width:68%}.bar69{width:69%}.bar70{width:70%}.bar71{width:71%}.bar72{width:72%}.bar73{width:73%}.bar74{width:74%}.bar75{width:75%}.bar76{width:76%}.bar77{width:77%}.bar78{width:78%}.bar79{width:79%}.bar80{width:80%}.bar81{width:81%}.bar82{width:82%}.bar83{width:83%}.bar84{width:84%}.bar85{width:85%}.bar86{width:86%}.bar87{width:87%}.bar88{width:88%}.bar89{width:89%}.bar90{width:90%}.bar91{width:91%}.bar92{width:92%}.bar93{width:93%}.bar94{width:94%}.bar95{width:95%}.bar96{width:96%}.bar97{width:97%}.bar98{width:98%}.bar99{width:99%}.bar100{width:100%}.osm-map-box{width:100%;height:300px;margin:10px 0}#answers .weather summary{list-style:none;display:block}#answers .weather div.summary{background-color:var(--color-header-background);border-radius:5px;margin:0;padding:.5rem 1rem}#answers .weather table{table-layout:fixed;border-collapse:separate;border-spacing:.1em 0;margin-top:.5rem;margin-bottom:.5rem;font-size:.9rem}#answers .weather td{text-overflow:ellipsis;padding:0;overflow:hidden}#answers .weather img.symbol{width:5rem;margin:auto;display:block}#main_index{margin-top:26vh}.index{text-align:center}.index .title{background:url(../img/searxng.png) 50%/contain no-repeat;min-height:4rem;margin:4rem auto}.index h1{visibility:hidden;font-size:4em}.index #search,.index #search_header{background:inherit;border:inherit;margin:0 auto;padding:0;display:block}.index .search_filters{margin:1em 0;display:block}.index .category label{padding:6px 10px;border-bottom:initial!important}@media screen and (max-width:79.75em){div.title h1{font-size:1em}#main_index{margin-top:6em}}table{border-collapse:collapse}table th,table td{text-align:center;text-align:right;padding:1rem .5rem}table tr.pref-group th{text-align:right;background:var(--color-settings-table-group-background);font-weight:400}#main_preferences form{width:100%}#main_preferences fieldset{border:none;margin:8px}#main_preferences legend{float:right;width:300px;margin:0;padding:5px 0 0;display:block}#main_preferences input[type=text]{width:13.25rem;color:var(--color-toolkit-input-text-font);background:none repeat scroll 0 0 var(--color-toolkit-select-background);border:none;border-radius:5px;height:2rem;padding:.2rem .4rem}#main_preferences input[type=text]:hover,#main_preferences input[type=text]:focus{background-color:var(--color-toolkit-select-background-hover)}#main_preferences div.pref-group{text-align:right;background:var(--color-settings-table-group-background);width:100%;padding:1rem .5rem;font-weight:400}#main_preferences .value{float:right;width:15em;margin:0;padding:0}#main_preferences .value select,#main_preferences .value input[type=text]{margin:0 0 0 1rem;font-size:inherit!important}#main_preferences .value select{width:14rem}#main_preferences .value select:focus,#main_preferences .value input:focus{box-shadow:0 0 1px 1px var(--color-btn-background);outline:none}#main_preferences .description{float:left;width:50%;color:var(--color-settings-engine-description-font);margin:0;padding:5px 0 0;font-size:90%}#main_preferences .bang{text-align:right;background-color:var(--color-doc-code-background);color:var(--color-doc-code);border:0;border-radius:5px;padding:.2rem}#main_preferences .category{margin-left:.5rem}#main_preferences .category label{border:2px solid #0000;border-radius:5px;padding:.2rem .4rem}#main_preferences .category input[type=checkbox]:checked+label{border:2px solid var(--color-categories-item-border-selected)}#main_preferences table.table_engines th.name label{cursor:pointer}#main_preferences table.table_engines th.name .engine-tooltip{max-width:40rem;margin-top:1.8rem;right:calc(50% - 32.5em)}#main_preferences table.table_engines th.name .engine-tooltip .engine-description{margin-top:.5rem}#main_preferences table.table_engines th.name .engine-tooltip .bang{margin:.3rem}#main_preferences table.table_engines .checkbox-col,#main_preferences table.table_engines .name,#main_preferences table.table_engines .shortcut{text-align:right}#main_preferences table.cookies{direction:ltr;width:100%}#main_preferences table.cookies th,#main_preferences table.cookies td{text-align:left;vertical-align:top;padding:.5em;font-family:monospace;font-size:1rem}#main_preferences table.cookies td:first-child{word-break:keep-all;width:14rem;padding-right:1rem}#main_preferences table.cookies td:last-child{word-break:break-all}#main_preferences table.cookies>tbody>tr:nth-child(2n)>th,#main_preferences table.cookies>tbody>tr:nth-child(2n)>td{background-color:var(--color-settings-tr-hover)}#main_preferences .preferences_back{background:none repeat scroll 0 0 var(--color-btn-background);color:var(--color-btn-font);cursor:pointer;border:0;border-radius:10px;margin:2px 4px;padding:.7em;display:inline-block}#main_preferences .preferences_back a{color:var(--color-settings-return-font)}#main_preferences .preferences_back a:first-letter{text-transform:uppercase}#main_preferences #toggle-all-engines-container{width:max-content;margin-left:auto}#main_preferences div.selectable_url pre{width:100%}#main_preferences #copy-hash-container{align-items:center;gap:.5rem;display:flex}#main_preferences #copy-hash-container div.selectable_url pre{flex-grow:1;width:auto}#main_preferences #pref-hash-input{width:100%}@media screen and (max-width:79.75em){.preferences_back{clear:both}.engine-tooltip{right:10em!important}}#search{margin:0;padding:0}#search_header{background:var(--color-header-background);border-bottom:1px solid var(--color-header-border);grid-template-columns:3rem 1fr;grid-template-areas:"logo search""spacer categories";gap:1rem 1.2rem;margin:0;padding-top:1.5em;padding-left:2em;padding-right:7rem;display:grid}.category_checkbox,.category_button{margin-left:1rem;padding:0;display:inline-block;position:relative}.category_checkbox input{display:none}.category_checkbox label{cursor:pointer;text-transform:capitalize;-webkit-user-select:none;user-select:none;border-bottom:2px solid #0000;padding:.2rem 0;font-size:.9em;display:inline-flex}.category_checkbox label svg{padding-right:.2rem}.category_checkbox label div.category_name{margin:auto 0}.category_checkbox input[type=checkbox]:checked+label{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}button.category_button{background-color:inherit;color:var(--color-base-font);cursor:pointer;text-transform:capitalize;border:none;border-bottom:2px solid #0000;align-items:center;padding:.2rem 0;font-size:.9em;display:inline-flex}button.category_button svg{padding-right:.2rem}button.category_button.selected,button.category_button:active{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}.no-js #categories_container:has(button.category_button:focus-within) button.category_button.selected{color:var(--color-base-font);border-bottom:none}.no-js #categories_container:has(button.category_button:focus-within) button.category_button:focus-within{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}#search_logo{grid-area:logo;justify-content:center;align-items:center;padding:.5rem 10px 0;display:flex}#search_logo svg{flex:1;width:30px;height:30px;margin:.5rem 0 auto}.search_categories{grid-area:categories}.search_categories .help{display:none}.search_categories:hover .help{background:var(--color-base-background);z-index:1000;width:100%;padding:1rem .6rem .6rem 0;display:block;position:absolute;left:-.1rem}#search_view{grid-area:search;padding:.5rem .5rem 0}body.results_endpoint #search_view{padding:.5rem 2.8rem 0 0}.search_box{white-space:nowrap;width:100%;max-width:44rem;box-shadow:var(--color-search-shadow);border-radius:.8rem;flex-direction:row;display:inline-flex}#clear_search{border-collapse:separate;box-sizing:border-box;background:none repeat scroll 0 0 var(--color-search-background);width:1.8rem;color:var(--color-search-font);z-index:1000;border:none;outline:none;margin:0;padding:.8rem .2rem;font-size:1.1rem;display:block}#clear_search:hover{color:var(--color-search-background-hover)}#clear_search.empty *,html.no-js #clear_search.hide_if_nojs{display:none}#q,#send_search{background:none repeat scroll 0 0 var(--color-search-background);color:var(--color-search-font);z-index:100;border:none;outline:none;margin:0;padding:.8rem;font-size:1.1rem;display:block}#q{border-radius:0 .8rem .8rem 0;width:100%;padding-right:1rem;padding-left:0!important}#send_search{border-radius:.8rem 0 0 .8rem}#send_search:hover{cursor:pointer;background-color:var(--color-search-background-hover);color:var(--color-search-background)}.no-js #clear_search,.no-js #send_search{border-right:1px solid var(--color-search-border);width:auto!important}.search_filters{overscroll-behavior-inline:contain;margin:.6rem 10.6rem 0 0;display:flex;overflow-x:auto}.search_filters select{background-color:inherit}.search_filters select:hover,.search_filters select:focus{color:var(--color-base-font)}@media screen and (max-width:79.75em){#search_header{column-gap:.5rem;padding:1.5em .5rem 0}.search_filters{margin:.6rem 3.5rem 0 0}#categories{clear:both;font-size:90%}}@media screen and (max-width:79.75em) and (hover:none){#main_index #categories_container,#main_results #categories_container{width:max-content}#main_index #categories_container .category_checkbox,#main_results #categories_container .category_checkbox{width:auto;display:inline-block}#main_index #categories,#main_results #categories{text-align:right;width:100%;overflow:scroll hidden}}@media screen and (max-width:50em){#search_header{grid-template-areas:"logo search""categories categories";gap:0;width:100%;margin:0;padding:.1rem 0 0}.search_logo{padding:0}.search_box{width:100%}#q{flex:1;width:100%}.search_filters{margin:0 10px;padding:.5rem 0}.category{width:auto;margin:0;display:inline-block}.category svg{display:none}.category_checkbox label,.category_button{margin:0!important;padding:1rem!important}#search_view:focus-within{background-color:var(--color-search-background);z-index:2000;width:100%;height:100%;display:block;position:absolute;top:0}#search_view:focus-within .search_box{border-bottom:1px solid var(--color-search-border);width:100%;box-shadow:none;border-radius:0}#search_view:focus-within .search_box #send_search{margin-left:0!important}#search_view:focus-within .search_box *{box-shadow:none;border:none;border-radius:0}#main_results #q:placeholder-shown~#send_search{margin-left:2.6rem;transition:margin .1s}}@media screen and (max-width:20rem){#search_header{grid-template-areas:"search search""categories categories"}#search_logo{display:none}}#categories{-webkit-user-select:none;user-select:none}#categories_container{position:relative}.favicon img{background-color:var(--color-favicon-background-color);border:1px solid var(--color-favicon-border-color);border-radius:10%;width:1.5rem;height:1.5rem;display:flex}@media screen and (min-width:50em){.center-alignment-yes #main_results{--center-page-width:48rem}}@media screen and (min-width:62rem){.center-alignment-yes #main_results{--center-page-width:60rem}}@media screen and (min-width:79.75em){.center-alignment-yes #main_results{--center-page-width:73rem}}@media screen and (min-width:50em) and (max-width:79.75em){.center-alignment-yes #main_results #results{grid-template-columns:60% calc(40% - 5rem);margin-left:0;margin-right:0}.center-alignment-yes #main_results #urls{margin-right:3rem}.center-alignment-yes #main_results #sidebar{margin-left:1rem}.center-alignment-yes #main_results #backToTop{right:calc(60% + 1rem)}}@media screen and (min-width:79.75em){.center-alignment-yes #main_results{flex-direction:column;align-items:center;display:flex}.center-alignment-yes #main_results #search{flex-direction:column;align-items:center;width:100%;display:flex}.center-alignment-yes #main_results #search_header{grid-template-columns:calc(50% - 4.5rem - var(--center-page-width)/2)3rem var(--center-page-width);grid-template-areas:"na logo search""na spacer categories";column-gap:1.2rem;width:100%;padding-left:0;padding-right:0}.center-alignment-yes #main_results .search_filters{width:var(--center-page-width);margin-right:.5rem}.center-alignment-yes #main_results #results{margin-left:2rem;margin-right:10rem}.center-alignment-yes #main_results #results.only_template_images,.center-alignment-yes #main_results #results.image-detail-open{align-self:flex-start}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open){grid-template-columns:calc(var(--center-page-width) - 5rem - 25rem)25rem;margin-right:1.5rem}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open) #backToTop{right:calc(50% - 25rem - 5rem + 1rem + var(--center-page-width)/2)}.center-alignment-yes #main_results #results .result .content{max-width:inherit}.center-alignment-yes #main_results #urls{margin-right:0}.center-alignment-yes #main_results #sidebar{margin-left:0}}.sxng-icon-set{vertical-align:bottom;-webkit-text-decoration:inherit;text-decoration:inherit;line-height:1;display:inline-block;transform:scaleX(-1)}.sxng-icon-set-small{vertical-align:bottom;width:1rem;height:1rem;-webkit-text-decoration:inherit;text-decoration:inherit;line-height:1;display:inline-block;transform:scaleX(-1)}.sxng-icon-set-big{vertical-align:bottom;width:1.5rem;height:1.5rem;-webkit-text-decoration:inherit;text-decoration:inherit;line-height:1;display:inline-block;transform:scaleX(-1)}html{-moz-text-size-adjust:100%;text-size-adjust:100%;color:var(--color-base-font);background-color:var(--color-base-background);scroll-behavior:smooth;margin:0;padding:0;font-family:sans-serif;font-size:.9em}body,main{margin:0;padding:0}body{flex-direction:column;height:100vh;margin:0;display:flex}@supports (height:100dvh){body{height:100dvh}}main{flex:1;width:100%;margin-bottom:2rem}.page_with_header{width:85em;margin:2em auto}footer{clear:both;text-align:center;background-color:var(--color-footer-background);border-top:1px solid var(--color-footer-border);width:100%;min-height:4rem;padding:1rem 0;overflow:hidden}footer p{font-size:.9em}.page_with_header .logo{height:40px}input[type=submit],#results button[type=submit],.button{background:var(--color-btn-background);color:var(--color-btn-font);cursor:pointer;border:0;border-radius:10px;padding:.7rem;display:inline-block}a{color:var(--color-url-font);text-decoration:none}a:visited,a:visited .highlight{color:var(--color-url-visited-font)}article[data-vim-selected]{background:var(--color-result-vim-selected);border-right:.2rem solid var(--color-result-vim-arrow);border-radius:10px 0 0 10px}article.result-images[data-vim-selected]{background:var(--color-result-vim-arrow);border:none;border-radius:10px}article.result-images[data-vim-selected] .image_thumbnail{filter:opacity(60%)}article.result-images[data-vim-selected] span.title,article.result-images[data-vim-selected] span.source{color:var(--color-result-image-span-font-selected)}article[data-vim-selected].category-videos,article[data-vim-selected].category-news,article[data-vim-selected].category-map,article[data-vim-selected].category-music,article[data-vim-selected].category-files,article[data-vim-selected].category-social{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{box-sizing:border-box;border-right:.2rem solid #0000;width:100%;margin:.125rem 0;padding:1rem}.result h3{word-wrap:break-word;margin:.4rem 0;padding:0;font-size:1.2rem}.result h3 a{color:var(--color-result-link-font);font-size:1.1em;font-weight:400}.result h3 a:visited{color:var(--color-result-link-visited-font)}.result h3 a:focus,.result h3 a:hover{border:none;outline:none;text-decoration:underline}.result .cache_link,.result .proxyfied_link{margin-left:.5rem;font-size:smaller!important}.result .content,.result .stat{word-wrap:break-word;max-width:54em;margin:0;padding:0;font-size:.9em;line-height:1.24}.result .content .highlight,.result .stat .highlight{color:var(--color-result-description-highlight-font);background:inherit;font-weight:700}.result .altlink a{background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer;border-radius:5px;margin:0 10px 0 0;padding:5px 10px;font-size:.9em}.result .altlink a:hover{background:var(--color-btn-background);color:var(--color-btn-font)}.result .codelines .highlight{color:inherit;background:inherit;font-weight:400}.result .url_header{gap:.5rem;display:flex}.result .url_wrapper{color:var(--color-result-url-font);flex-flow:row;align-items:center;margin:0;padding:0;font-size:1rem;display:flex;overflow:hidden}.result .url_wrapper .url_o1{white-space:nowrap;flex-shrink:1;padding-bottom:1px}.result .url_wrapper .url_o1 .url_i1{unicode-bidi:plaintext}.result .url_wrapper .url_o1:after{content:" ";width:1ch;display:inline-block}.result .url_wrapper .url_o2{white-space:nowrap;flex:0 1 content;text-align:right;padding-bottom:1px;overflow:hidden}.result .url_wrapper .url_o2 .url_i2{float:right}.result .published_date,.result .result_length,.result .result_views,.result .result_author,.result .result_shipping,.result .result_source_country{color:var(--color-result-publishdate-font);font-size:.8em}.result .result_price{color:var(--color-result-description-highlight-font);font-size:1.2em}.result img.thumbnail{float:right;width:7rem;height:unset;padding-top:.6rem;padding-left:1rem}.result .break{clear:both}.result-paper .attributes,.result-packages .attributes{border-spacing:.125rem;display:table}.result-paper .attributes div,.result-packages .attributes div{display:table-row}.result-paper .attributes div span,.result-packages .attributes div span{margin-top:.25rem;font-size:.9rem;display:table-cell}.result-paper .attributes div span time,.result-packages .attributes div span time{font-size:.9rem}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{color:var(--color-base-font);min-width:10rem}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){color:var(--color-result-publishdate-font)}.result-paper .content,.result-packages .content{margin-top:.25rem}.result-paper .comments,.result-packages .comments{word-wrap:break-word;margin:.25rem 0 0;padding:0;font-size:.9rem;font-style:italic;line-height:1.24}.result-packages .attributes{margin-top:.3rem}.template_group_images{flex-wrap:wrap;display:flex}.template_group_images:after{content:"";flex-grow:10}.category-videos,.category-news,.category-map,.category-music,.category-files,.category-social{border:1px solid var(--color-result-border);border-radius:10px;margin:0 .5rem 1rem!important}.category-social .image{min-width:48px;min-height:48px;width:auto!important;padding:0 5px 25px 0!important}.audio-control audio,.embedded-content iframe{width:100%;padding:10px 0 0}.result-videos img.thumbnail{float:right;width:20rem;height:unset;padding-top:.6rem;padding-left:1rem}.result-videos .content{overflow:hidden}.result-videos .embedded-video iframe{aspect-ratio:16/9;width:100%;padding:10px 0 0}@supports not (aspect-ratio:1 / 1){.result-videos .embedded-video iframe{height:25.3125rem}}.engines{float:left;color:var(--color-result-engines-font);flex-wrap:wrap;justify-content:flex-end;display:flex}.engines span{margin:0 0 0 .5rem;font-size:smaller}.small_font{font-size:.8em}.highlight{color:var(--color-result-link-font-highlight);background:inherit}.empty_element{font-style:italic}.result-images{height:12rem;width:unset;flex-grow:1;margin:.25rem;padding:.5rem .5rem 3rem;border:none!important}.result-images>a{outline:none;position:relative}.result-images img{object-fit:cover;vertical-align:bottom;background:var(--color-result-image-background);border:none;width:auto;height:100%;margin:0;padding:0}.result-images .image_resolution{background:var(--color-image-resolution-background);color:var(--color-image-resolution-font);border-top-left-radius:.3rem;padding:.3rem .5rem;font-size:.9rem;position:absolute;bottom:0;right:0}.result-images span.title,.result-images span.source{width:100%;color:var(--color-result-image-span-font);text-overflow:ellipsis;white-space:nowrap;padding:.5rem 0 0;font-size:.9rem;display:block;position:absolute;overflow:hidden}.result-images span.source{padding:1.8rem 0 0;font-size:.7rem}.result-map img.image{float:left!important;width:auto!important;height:100px!important}.result-map table{border-collapse:separate;border-spacing:0 .35rem;width:auto;font-size:.9em}.result-map table th{font-weight:inherit;vertical-align:top;text-align:right;width:17rem}.result-map table td{vertical-align:top;text-align:right}.hidden{display:none!important}#results{grid-template:"corrections sidebar"min-content"answers sidebar"min-content"urls sidebar"1fr"pagination sidebar"min-content/45rem 25rem;gap:0 5rem;margin:1rem 10rem 0 2rem;display:grid}#results #sidebar :first-child{margin-top:0}#urls{grid-area:urls;padding:0}#apis .wrapper{display:flex}#suggestions .wrapper{flex-flow:column;justify-content:flex-end;display:flex}#suggestions .wrapper form{flex:50%;display:inline-block}#suggestions input,#infoboxes input{color:var(--color-result-search-url-font);cursor:pointer;text-overflow:ellipsis;text-align:left;background:0 0;width:100%;margin:3px;padding:0;font-size:.9em;display:inline-block;overflow:hidden}#suggestions input[type=submit],#infoboxes input[type=submit],#suggestions .infobox .url a,#infoboxes .infobox .url a{color:var(--color-result-link-font);font-size:.9rem;text-decoration:none}#suggestions input[type=submit]:hover,#infoboxes input[type=submit]:hover,#suggestions .infobox .url a:hover,#infoboxes .infobox .url a:hover{text-decoration:underline}#corrections{flex-flow:wrap;grid-area:corrections;margin:0 0 1em;display:flex}#corrections h4,#corrections input[type=submit]{margin:.5rem;padding:.5rem;display:inline-block}#corrections input[type=submit]{border-radius:5px;font-size:.8rem}#infoboxes .title,#suggestions .title,#search_url .title,#engines_msg .title,#apis .title{color:var(--color-base-font);margin:2em 0 .5em}summary.title{cursor:pointer;padding-top:1em}.sidebar-collapsible{border-top:1px solid var(--color-sidebar-border);padding-bottom:.5em}#sidebar-end-collapsible{border-bottom:1px solid var(--color-sidebar-border);width:100%}#answers{background:var(--color-answer-background);color:var(--color-answer-font);border-radius:10px;grid-area:answers;margin:0 0 1rem;padding:1rem}#answers h4{display:none}#answers span{overflow-wrap:anywhere}#answers .answer{flex-direction:column;display:flex}#answers .answer-url{margin:5px 10px 10px auto}#infoboxes form{min-width:210px}#sidebar{word-wrap:break-word;color:var(--color-sidebar-font);grid-area:sidebar}#sidebar .infobox{border:1px solid var(--color-sidebar-border);border-radius:10px;margin:10px 0;padding:1rem;font-size:.9em}#sidebar .infobox h2{margin:0 0 .5em}#sidebar .infobox img{max-width:100%;max-height:12em;margin:0 auto;padding:0;display:block}#sidebar .infobox dt{font-weight:700}#sidebar .infobox .attributes dl{margin:.5em 0}#sidebar .infobox .attributes dt{margin:.5em 0 .5em .25em;padding:0;display:inline}#sidebar .infobox .attributes dd{margin:.5em 0;padding:0;display:inline}#sidebar .infobox input{font-size:1em}#sidebar .infobox br,#sidebar .infobox .attributes,#sidebar .infobox .urls{clear:both}#apis input{background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer;border-radius:5px;margin:0 10px 0 0;padding:5px 10px;font-size:.9em}#apis input:hover{background:var(--color-btn-background);color:var(--color-btn-font)}#engines_msg .engine-name{width:10rem}#engines_msg .response-error{color:var(--color-error)}#engines_msg .bar-chart-value{width:auto}#search_url div.selectable_url pre{float:left;width:200em}#search_url button#copy_url{float:right;border-radius:.3rem;margin-left:.5rem;padding:.4rem;display:none}#links_on_top{text-align:left;color:var(--color-search-font);border:0;align-items:center;padding:0;font-size:1em;display:flex;position:absolute;top:2.7rem;left:1rem}#links_on_top a{align-items:center;margin-left:1em;display:flex}#links_on_top a svg{margin-left:.125em;font-size:1.2em}#links_on_top a,#links_on_top a:link *,#links_on_top a:hover *,#links_on_top a:visited *,#links_on_top a:active *{color:var(--color-search-font)}#pagination{grid-area:pagination}#pagination br{clear:both}.numbered_pagination{flex-direction:row;justify-content:center;align-items:center;display:flex;overflow:hidden}.page_number{text-decoration:underline;color:var(--color-result-link-font)!important;background:0 0!important}.page_number_current{color:var(--color-result-link-visited-font);background:0 0;border:none}#backToTop{border:1px solid var(--color-backtotop-border);background:var(--color-backtotop-background);opacity:0;pointer-events:none;border-radius:10px;margin:0;padding:0;font-size:1em;transition:opacity .5s;position:fixed;bottom:8rem;right:56.3rem}#backToTop a{margin:0;padding:.7em;display:block}#backToTop a,#backToTop a:visited,#backToTop a:hover,#backToTop a:active{color:var(--color-backtotop-font)}#results.scrolling #backToTop{opacity:1;pointer-events:all}@media screen and (max-width:calc(79.75em - .5px)){#links_on_top span{display:none}}@media screen and (max-width:52rem){body.results_endpoint #links_on_top .link_on_top_about,body.results_endpoint #links_on_top .link_on_top_donate{display:none}}@media screen and (min-width:50em) and (max-width:79.75em){.center-alignment-no #links_on_top span{display:none}.center-alignment-no .page_with_header{width:auto;margin:2rem .5rem}.center-alignment-no #infoboxes{position:inherit;max-width:inherit}.center-alignment-no #infoboxes .infobox{clear:both}.center-alignment-no #infoboxes .infobox img{float:right;max-width:10em;margin:.5em 0 .5em .5em}.center-alignment-no #sidebar{float:none;border:none;width:auto;margin:0 .5rem .125rem;padding:0}.center-alignment-no #sidebar input{border:0}.center-alignment-no .result .thumbnail{max-width:98%}.center-alignment-no .result .url span.url{white-space:nowrap;text-overflow:ellipsis;width:100%;display:block;overflow:hidden}.center-alignment-no .result .engines{float:left;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0;display:flex}.center-alignment-no .result-images{border-bottom:none!important}.center-alignment-no .image_result,.center-alignment-no .image_result img{max-width:98%}.center-alignment-no #backToTop{display:none}.center-alignment-no #pagination{margin:2rem 0 0!important}.center-alignment-no #main_results div#results{grid-template:"corrections"min-content"answers"min-content"sidebar"min-content"urls"1fr"pagination"min-content/45rem;justify-content:center;gap:0;margin:0 auto;display:grid}}#main_results div#results.only_template_images{grid-template:"corrections"min-content"answers"min-content"sidebar"min-content"urls"1fr"pagination"min-content/100%;gap:0;margin:1rem .5rem 0;display:grid}#main_results div#results.only_template_images #sidebar{display:none}#main_results div#results.only_template_images #urls{flex-wrap:wrap;margin:0;display:flex}#main_results div#results.only_template_images #urls:after{content:"";flex-grow:10}#main_results div#results.only_template_images #backToTop{left:1rem;right:auto}#main_results div#results.only_template_images #pagination{margin-left:4rem}@media screen and (max-width:50em){#links_on_top span{display:none}.page_with_header{width:auto;margin:2rem .5rem}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:right;max-width:10em;margin:.5em 0 .5em .5em}#sidebar{float:none;border:none;width:auto;margin:0 .5rem .125rem;padding:0}#sidebar input{border:0}.result .thumbnail{max-width:98%}.result .url span.url{white-space:nowrap;text-overflow:ellipsis;width:100%;display:block;overflow:hidden}.result .engines{float:left;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0;display:flex}.result-images{border-bottom:none!important}.image_result,.image_result img{max-width:98%}#backToTop{display:none}#main_results div#results{grid-template:"corrections"min-content"answers"min-content"sidebar"min-content"urls"1fr"pagination"min-content/45rem;justify-content:center;gap:0;margin:0 auto;display:grid}html{background-color:var(--color-base-background-mobile)}#main_results div#results{grid-template-columns:100%;margin:0 auto}#links_on_top{top:1.4rem;left:10px}#main_index #links_on_top{top:.5rem;left:.5rem}#results{margin:0;padding:0}#pagination{margin:2rem 1rem 0!important}article[data-vim-selected]{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{background:var(--color-result-background);border:1px solid var(--color-result-background);border-radius:10px;width:96%;margin:1rem 2%}.result-images{background:var(--color-base-background-mobile);height:10rem;width:unset;margin:0}.infobox{background-color:var(--color-sidebar-background);border:none!important}.numbered_pagination{display:none}.result-paper .attributes,.result-packages .attributes,.result-paper .attributes div,.result-packages .attributes div{display:block}.result-paper .attributes div span,.result-packages .attributes div span{display:inline}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{font-weight:700}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){margin-right:.5rem}}@media screen and (max-width:35em){.result-videos img.thumbnail{float:none!important}.result-videos .content{overflow:inherit}}pre code{white-space:pre-wrap}#main_results .result-keyvalue caption{caption-side:bottom;background-color:var(--color-result-keyvalue-table);padding:.8rem .5rem;font-style:italic}#main_results .result-keyvalue .col-key{width:25%}#main_results .result-keyvalue table{word-break:break-word;table-layout:fixed;background-color:var(--color-result-keyvalue-table);width:100%}#main_results .result-keyvalue tr.odd{background-color:var(--color-result-keyvalue-odd)}#main_results .result-keyvalue tr.even{background-color:var(--color-result-keyvalue-even)}#main_results .result-keyvalue th,#main_results .result-keyvalue td{padding:.3rem .5rem}#q,#sidebar .infobox dt bdi{direction:rtl}#urls{direction:initial;text-align:right}#urls .result .url_header{direction:rtl}#urls .result .url_wrapper{justify-content:end}#main_results div#results.only_template_images #urls,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p{direction:rtl}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url{direction:ltr}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url span{float:right;direction:rtl}@supports (background-position-x:100%) and (appearance:none){select{background-position-x:-2rem;border-width:0 0 0 2rem}}#vim-hotkeys-help table{text-align:left;direction:ltr}#main_preferences h1,#main_stats h1{background-position-x:100%}.bar-chart-serie1,.bar-chart-serie2{float:right}.engine-stats .engine-name,.engine-stats .engine-score,.engine-stats .result-count,.engine-stats .response-time,.engine-stats .engine-reliability{text-align:right} diff --git a/searx/static/themes/simple/css/searxng.min.css b/searx/static/themes/simple/css/searxng.min.css deleted file mode 100644 index 22f0c1f94..000000000 --- a/searx/static/themes/simple/css/searxng.min.css +++ /dev/null @@ -1 +0,0 @@ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--color-base-font: #444;--color-base-font-rgb: 68, 68, 68;--color-base-background: #fff;--color-base-background-mobile: #f2f5f8;--color-url-font: #334999;--color-url-visited-font: #9822c3;--color-header-background: #fdfbff;--color-header-border: #ddd;--color-footer-background: #fdfbff;--color-footer-border: #ddd;--color-sidebar-border: #ddd;--color-sidebar-font: #000;--color-sidebar-background: #fff;--color-backtotop-font: #444;--color-backtotop-border: #ddd;--color-backtotop-background: #fff;--color-btn-background: #3050ff;--color-btn-font: #fff;--color-show-btn-background: #bbb;--color-show-btn-font: #000;--color-search-border: #bbb;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #fff;--color-search-font: #222;--color-search-background-hover: #3050ff;--color-error: #db3434;--color-error-background: #fae1e1;--color-warning: #dbba34;--color-warning-background: #faf5e1;--color-success: #42db34;--color-success-background: #e3fae1;--color-categories-item-selected-font: #3050ff;--color-categories-item-border-selected: #3050ff;--color-autocomplete-font: #000;--color-autocomplete-border: #bbb;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #fff;--color-autocomplete-background-hover: #e3e3e3;--color-answer-font: #444;--color-answer-background: #fff;--color-result-keyvalue-col-table: #fdfbff;--color-result-keyvalue-odd: #fdfbff;--color-result-keyvalue-even: #fff;--color-result-background: #fff;--color-result-border: #ddd;--color-result-url-font: #000;--color-result-vim-selected: #f7f7f7;--color-result-vim-arrow: #000bbb;--color-result-description-highlight-font: #000;--color-result-link-font: #000bbb;--color-result-link-font-highlight: #000bbb;--color-result-link-visited-font: #9822c3;--color-result-publishdate-font: #777;--color-result-engines-font: #545454;--color-result-search-url-border: #ddd;--color-result-search-url-font: #000;--color-result-image-span-font: #444;--color-result-image-span-font-selected: #fff;--color-result-image-background: #fff;--color-settings-tr-hover: #ebebeb;--color-settings-engine-description-font: #545454;--color-settings-table-group-background: #0001;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #242424;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #545454;--color-toolkit-kbd-font: #fff;--color-toolkit-kbd-background: #000;--color-toolkit-dialog-border: #ddd;--color-toolkit-dialog-background: #fff;--color-toolkit-tabs-label-border: #fff;--color-toolkit-tabs-section-border: #ddd;--color-toolkit-select-background: #e1e1e1;--color-toolkit-select-border: #ddd;--color-toolkit-select-background-hover: #bbb;--color-toolkit-input-text-font: #222;--color-toolkit-checkbox-onoff-off-background: #ddd;--color-toolkit-checkbox-onoff-on-background: #ddd;--color-toolkit-checkbox-onoff-on-mark-background: #3050ff;--color-toolkit-checkbox-onoff-on-mark-color: #fff;--color-toolkit-checkbox-onoff-off-mark-background: #aaa;--color-toolkit-checkbox-onoff-off-mark-color: #fff;--color-toolkit-checkbox-label-background: #ddd;--color-toolkit-checkbox-label-border: #ddd;--color-toolkit-checkbox-input-border: #3050ff;--color-toolkit-engine-tooltip-border: #ddd;--color-toolkit-engine-tooltip-background: #fff;--color-toolkit-loader-border: rgba(0, 0, 0, .2);--color-toolkit-loader-borderleft: rgba(255, 255, 255, 0);--color-doc-code: #003;--color-doc-code-background: #ddeaff;--color-bar-chart-primary: #5bc0de;--color-bar-chart-secondary: #deb15b;--color-image-resolution-background: rgba(0, 0, 0, .5);--color-image-resolution-font: #fff;--color-loading-indicator: rgba(255, 255, 255, .2);--color-loading-indicator-gap: #fff;--color-line-number: #64708d;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}@media (prefers-color-scheme: dark){:root.theme-auto{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}}:root.theme-dark{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc}:root.theme-black{--color-base-font: #bbb;--color-base-font-rgb: 187, 187, 187;--color-base-background: #222428;--color-base-background-mobile: #222428;--color-url-font: #8af;--color-url-visited-font: #c09cd9;--color-header-background: #1e1e22;--color-header-border: #333;--color-footer-background: #1e1e22;--color-footer-border: #333;--color-sidebar-border: #555;--color-sidebar-font: #fff;--color-sidebar-background: #292c34;--color-backtotop-font: #bbb;--color-backtotop-border: #333;--color-backtotop-background: #2b2e36;--color-btn-background: #58f;--color-btn-font: #222;--color-show-btn-background: #555;--color-show-btn-font: #fff;--color-search-border: #555;--color-search-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-search-background: #2b2e36;--color-search-font: #fff;--color-search-background-hover: #58f;--color-error: #f55b5b;--color-error-background: #390a0a;--color-warning: #f1d561;--color-warning-background: #39300a;--color-success: #79f56e;--color-success-background: #0e390a;--color-categories-item-selected-font: #58f;--color-categories-item-border-selected: #58f;--color-autocomplete-font: #fff;--color-autocomplete-border: #555;--color-autocomplete-shadow: 0 2px 8px rgba(34, 38, 46, .25);--color-autocomplete-background: #2b2e36;--color-autocomplete-background-hover: #1e1e22;--color-answer-font: #bbb;--color-answer-background: #26292f;--color-result-keyvalue-col-table: #1e1e22;--color-result-keyvalue-odd: #1e1e22;--color-result-keyvalue-even: #26292f;--color-result-background: #26292f;--color-result-border: #333;--color-result-url-font: #fff;--color-result-vim-selected: #1f1f23cc;--color-result-vim-arrow: #8af;--color-result-description-highlight-font: #fff;--color-result-link-font: #8af;--color-result-link-font-highlight: #8af;--color-result-link-visited-font: #c09cd9;--color-result-publishdate-font: #888;--color-result-engines-font: #a4a4a4;--color-result-search-url-border: #555;--color-result-search-url-font: #fff;--color-result-detail-font: #fff;--color-result-detail-label-font: lightgray;--color-result-detail-background: #1a1a1c;--color-result-detail-hr: #555;--color-result-detail-link: #8af;--color-result-detail-loader-border: rgba(255, 255, 255, .2);--color-result-detail-loader-borderleft: rgba(0, 0, 0, 0);--color-result-image-span-font: #bbb;--color-result-image-span-font-selected: #222;--color-result-image-background: #222;--color-settings-tr-hover: #2c2c32;--color-settings-engine-description-font: #909090;--color-settings-table-group-background: #1b1b21;--color-toolkit-badge-font: #fff;--color-toolkit-badge-background: #555;--color-toolkit-kbd-font: #000;--color-toolkit-kbd-background: #fff;--color-toolkit-dialog-border: #555;--color-toolkit-dialog-background: #1e1e22;--color-toolkit-tabs-label-border: #222;--color-toolkit-tabs-section-border: #555;--color-toolkit-select-background: #313338;--color-toolkit-select-border: #555;--color-toolkit-select-background-hover: #373b49;--color-toolkit-input-text-font: #fff;--color-toolkit-checkbox-onoff-off-background: #313338;--color-toolkit-checkbox-onoff-on-background: #313338;--color-toolkit-checkbox-onoff-on-mark-background: #58f;--color-toolkit-checkbox-onoff-on-mark-color: #222;--color-toolkit-checkbox-onoff-off-mark-background: #ddd;--color-toolkit-checkbox-onoff-off-mark-color: #222;--color-toolkit-checkbox-label-background: #222;--color-toolkit-checkbox-label-border: #333;--color-toolkit-checkbox-input-border: #58f;--color-toolkit-engine-tooltip-border: #333;--color-toolkit-engine-tooltip-background: #222;--color-toolkit-loader-border: rgba(255, 255, 255, .2);--color-toolkit-loader-borderleft: rgba(0, 0, 0, 0);--color-doc-code: #ddd;--color-doc-code-background: #4d5a6f;--color-favicon-background-color: #ddd;--color-favicon-border-color: #ccc;--color-base-background: #000;--color-base-background-mobile: #000;--color-header-background: #000;--color-footer-background: #000;--color-sidebar-background: #000}.code-highlight pre{line-height:100%}.code-highlight td.linenos .normal,.code-highlight span.linenos{color:inherit;background-color:transparent;padding-left:5px;padding-right:5px}.code-highlight td.linenos .special,.code-highlight span.linenos.special{color:#000;background-color:#ffffc0;padding-left:5px;padding-right:5px}.code-highlight .hll{background-color:#ffc}.code-highlight .c{color:#3d7b7b;font-style:italic}.code-highlight .err{border:1px solid #F00}.code-highlight .k{color:green;font-weight:700}.code-highlight .o{color:#666}.code-highlight .ch,.code-highlight .cm{color:#3d7b7b;font-style:italic}.code-highlight .cp{color:#9c6500}.code-highlight .cpf,.code-highlight .c1,.code-highlight .cs{color:#3d7b7b;font-style:italic}.code-highlight .gd{color:#a00000}.code-highlight .ge{font-style:italic}.code-highlight .ges{font-weight:700;font-style:italic}.code-highlight .gr{color:#e40000}.code-highlight .gh{color:navy;font-weight:700}.code-highlight .gi{color:#008400}.code-highlight .go{color:#717171}.code-highlight .gp{color:navy;font-weight:700}.code-highlight .gs{font-weight:700}.code-highlight .gu{color:purple;font-weight:700}.code-highlight .gt{color:#04d}.code-highlight .kc,.code-highlight .kd,.code-highlight .kn{color:green;font-weight:700}.code-highlight .kp{color:green}.code-highlight .kr{color:green;font-weight:700}.code-highlight .kt{color:#b00040}.code-highlight .m{color:#666}.code-highlight .s{color:#ba2121}.code-highlight .na{color:#687822}.code-highlight .nb{color:green}.code-highlight .nc{color:#00f;font-weight:700}.code-highlight .no{color:#800}.code-highlight .nd{color:#a2f}.code-highlight .ni{color:#717171;font-weight:700}.code-highlight .ne{color:#cb3f38;font-weight:700}.code-highlight .nf{color:#00f}.code-highlight .nl{color:#767600}.code-highlight .nn{color:#00f;font-weight:700}.code-highlight .nt{color:green;font-weight:700}.code-highlight .nv{color:#19177c}.code-highlight .ow{color:#a2f;font-weight:700}.code-highlight .w{color:#bbb}.code-highlight .mb,.code-highlight .mf,.code-highlight .mh,.code-highlight .mi,.code-highlight .mo{color:#666}.code-highlight .sa,.code-highlight .sb,.code-highlight .sc,.code-highlight .dl{color:#ba2121}.code-highlight .sd{color:#ba2121;font-style:italic}.code-highlight .s2{color:#ba2121}.code-highlight .se{color:#aa5d1f;font-weight:700}.code-highlight .sh{color:#ba2121}.code-highlight .si{color:#a45a77;font-weight:700}.code-highlight .sx{color:green}.code-highlight .sr{color:#a45a77}.code-highlight .s1{color:#ba2121}.code-highlight .ss{color:#19177c}.code-highlight .bp{color:green}.code-highlight .fm{color:#00f}.code-highlight .vc,.code-highlight .vg,.code-highlight .vi,.code-highlight .vm{color:#19177c}.code-highlight .il{color:#666}.codelines{margin:.125rem 0 0;padding:1rem 0 0}.code-highlight pre{overflow:auto;margin:0;padding:0 0 .75rem}.code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;margin-right:8px;text-align:right}.code-highlight .linenos::selection{background:transparent}.code-highlight .linenos::-moz-selection{background:transparent}.code-highlight span.linenos{color:var(--color-line-number)}@media (prefers-color-scheme: dark){:root.theme-auto .code-highlight pre{line-height:100%}:root.theme-auto .code-highlight td.linenos .normal{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight span.linenos{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight td.linenos .special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-auto .code-highlight .hll{background-color:#6e7681}:root.theme-auto .code-highlight .c{color:#7e8aa1}:root.theme-auto .code-highlight .err{color:#f88f7f}:root.theme-auto .code-highlight .esc{color:#d4d2c8}:root.theme-auto .code-highlight .g{color:#d4d2c8}:root.theme-auto .code-highlight .k{color:#ffad66}:root.theme-auto .code-highlight .l{color:#d5ff80}:root.theme-auto .code-highlight .n{color:#d4d2c8}:root.theme-auto .code-highlight .o{color:#ffad66}:root.theme-auto .code-highlight .x{color:#d4d2c8}:root.theme-auto .code-highlight .p{color:#d4d2c8}:root.theme-auto .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-auto .code-highlight .cm{color:#7e8aa1}:root.theme-auto .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-auto .code-highlight .cpf{color:#7e8aa1}:root.theme-auto .code-highlight .c1{color:#7e8aa1}:root.theme-auto .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-auto .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-auto .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-auto .code-highlight .ges{color:#d4d2c8}:root.theme-auto .code-highlight .gr{color:#f88f7f}:root.theme-auto .code-highlight .gh{color:#d4d2c8}:root.theme-auto .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-auto .code-highlight .go{color:#7e8aa1}:root.theme-auto .code-highlight .gp{color:#d4d2c8}:root.theme-auto .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-auto .code-highlight .gu{color:#d4d2c8}:root.theme-auto .code-highlight .gt{color:#f88f7f}:root.theme-auto .code-highlight .kc{color:#ffad66}:root.theme-auto .code-highlight .kd{color:#ffad66}:root.theme-auto .code-highlight .kn{color:#ffad66}:root.theme-auto .code-highlight .kp{color:#ffad66}:root.theme-auto .code-highlight .kr{color:#ffad66}:root.theme-auto .code-highlight .kt{color:#73d0ff}:root.theme-auto .code-highlight .ld{color:#d5ff80}:root.theme-auto .code-highlight .m{color:#dfbfff}:root.theme-auto .code-highlight .s{color:#d5ff80}:root.theme-auto .code-highlight .na{color:#ffd173}:root.theme-auto .code-highlight .nb{color:#ffd173}:root.theme-auto .code-highlight .nc{color:#73d0ff}:root.theme-auto .code-highlight .no{color:#ffd173}:root.theme-auto .code-highlight .nd{color:#7e8aa1;font-weight:700;font-style:italic}:root.theme-auto .code-highlight .ni{color:#95e6cb}:root.theme-auto .code-highlight .ne{color:#73d0ff}:root.theme-auto .code-highlight .nf{color:#ffd173}:root.theme-auto .code-highlight .nl{color:#d4d2c8}:root.theme-auto .code-highlight .nn{color:#d4d2c8}:root.theme-auto .code-highlight .nx{color:#d4d2c8}:root.theme-auto .code-highlight .py{color:#ffd173}:root.theme-auto .code-highlight .nt{color:#5ccfe6}:root.theme-auto .code-highlight .nv{color:#d4d2c8}:root.theme-auto .code-highlight .ow{color:#ffad66}:root.theme-auto .code-highlight .pm{color:#d4d2c8}:root.theme-auto .code-highlight .w{color:#d4d2c8}:root.theme-auto .code-highlight .mb{color:#dfbfff}:root.theme-auto .code-highlight .mf{color:#dfbfff}:root.theme-auto .code-highlight .mh{color:#dfbfff}:root.theme-auto .code-highlight .mi{color:#dfbfff}:root.theme-auto .code-highlight .mo{color:#dfbfff}:root.theme-auto .code-highlight .sa{color:#f29e74}:root.theme-auto .code-highlight .sb{color:#d5ff80}:root.theme-auto .code-highlight .sc{color:#d5ff80}:root.theme-auto .code-highlight .dl{color:#d5ff80}:root.theme-auto .code-highlight .sd{color:#7e8aa1}:root.theme-auto .code-highlight .s2{color:#d5ff80}:root.theme-auto .code-highlight .se{color:#95e6cb}:root.theme-auto .code-highlight .sh{color:#d5ff80}:root.theme-auto .code-highlight .si{color:#95e6cb}:root.theme-auto .code-highlight .sx{color:#95e6cb}:root.theme-auto .code-highlight .sr{color:#95e6cb}:root.theme-auto .code-highlight .s1{color:#d5ff80}:root.theme-auto .code-highlight .ss{color:#dfbfff}:root.theme-auto .code-highlight .bp{color:#5ccfe6}:root.theme-auto .code-highlight .fm{color:#ffd173}:root.theme-auto .code-highlight .vc{color:#d4d2c8}:root.theme-auto .code-highlight .vg{color:#d4d2c8}:root.theme-auto .code-highlight .vi{color:#d4d2c8}:root.theme-auto .code-highlight .vm{color:#d4d2c8}:root.theme-auto .code-highlight .il{color:#dfbfff}:root.theme-auto .code-highlight pre{overflow:auto;margin:0;padding:0 0 .75rem}:root.theme-auto .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;margin-right:8px;text-align:right}:root.theme-auto .code-highlight .linenos::selection{background:transparent}:root.theme-auto .code-highlight .linenos::-moz-selection{background:transparent}:root.theme-auto .code-highlight span.linenos{color:var(--color-line-number)}}:root.theme-dark .code-highlight pre{line-height:100%}:root.theme-dark .code-highlight td.linenos .normal{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight span.linenos{color:#3c4354;background-color:transparent;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight td.linenos .special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight span.linenos.special{color:#3c4354;background-color:#ffffc0;padding-left:5px;padding-right:5px}:root.theme-dark .code-highlight .hll{background-color:#6e7681}:root.theme-dark .code-highlight .c{color:#7e8aa1}:root.theme-dark .code-highlight .err{color:#f88f7f}:root.theme-dark .code-highlight .esc{color:#d4d2c8}:root.theme-dark .code-highlight .g{color:#d4d2c8}:root.theme-dark .code-highlight .k{color:#ffad66}:root.theme-dark .code-highlight .l{color:#d5ff80}:root.theme-dark .code-highlight .n{color:#d4d2c8}:root.theme-dark .code-highlight .o{color:#ffad66}:root.theme-dark .code-highlight .x{color:#d4d2c8}:root.theme-dark .code-highlight .p{color:#d4d2c8}:root.theme-dark .code-highlight .ch{color:#f88f7f;font-style:italic}:root.theme-dark .code-highlight .cm{color:#7e8aa1}:root.theme-dark .code-highlight .cp{color:#ffad66;font-weight:700}:root.theme-dark .code-highlight .cpf{color:#7e8aa1}:root.theme-dark .code-highlight .c1{color:#7e8aa1}:root.theme-dark .code-highlight .cs{color:#7e8aa1;font-style:italic}:root.theme-dark .code-highlight .gd{color:#f88f7f;background-color:#3d1e20}:root.theme-dark .code-highlight .ge{color:#d4d2c8;font-style:italic}:root.theme-dark .code-highlight .ges{color:#d4d2c8}:root.theme-dark .code-highlight .gr{color:#f88f7f}:root.theme-dark .code-highlight .gh{color:#d4d2c8}:root.theme-dark .code-highlight .gi{color:#6ad4af;background-color:#19362c}:root.theme-dark .code-highlight .go{color:#7e8aa1}:root.theme-dark .code-highlight .gp{color:#d4d2c8}:root.theme-dark .code-highlight .gs{color:#d4d2c8;font-weight:700}:root.theme-dark .code-highlight .gu{color:#d4d2c8}:root.theme-dark .code-highlight .gt{color:#f88f7f}:root.theme-dark .code-highlight .kc{color:#ffad66}:root.theme-dark .code-highlight .kd{color:#ffad66}:root.theme-dark .code-highlight .kn{color:#ffad66}:root.theme-dark .code-highlight .kp{color:#ffad66}:root.theme-dark .code-highlight .kr{color:#ffad66}:root.theme-dark .code-highlight .kt{color:#73d0ff}:root.theme-dark .code-highlight .ld{color:#d5ff80}:root.theme-dark .code-highlight .m{color:#dfbfff}:root.theme-dark .code-highlight .s{color:#d5ff80}:root.theme-dark .code-highlight .na{color:#ffd173}:root.theme-dark .code-highlight .nb{color:#ffd173}:root.theme-dark .code-highlight .nc{color:#73d0ff}:root.theme-dark .code-highlight .no{color:#ffd173}:root.theme-dark .code-highlight .nd{color:#7e8aa1;font-weight:700;font-style:italic}:root.theme-dark .code-highlight .ni{color:#95e6cb}:root.theme-dark .code-highlight .ne{color:#73d0ff}:root.theme-dark .code-highlight .nf{color:#ffd173}:root.theme-dark .code-highlight .nl{color:#d4d2c8}:root.theme-dark .code-highlight .nn{color:#d4d2c8}:root.theme-dark .code-highlight .nx{color:#d4d2c8}:root.theme-dark .code-highlight .py{color:#ffd173}:root.theme-dark .code-highlight .nt{color:#5ccfe6}:root.theme-dark .code-highlight .nv{color:#d4d2c8}:root.theme-dark .code-highlight .ow{color:#ffad66}:root.theme-dark .code-highlight .pm{color:#d4d2c8}:root.theme-dark .code-highlight .w{color:#d4d2c8}:root.theme-dark .code-highlight .mb{color:#dfbfff}:root.theme-dark .code-highlight .mf{color:#dfbfff}:root.theme-dark .code-highlight .mh{color:#dfbfff}:root.theme-dark .code-highlight .mi{color:#dfbfff}:root.theme-dark .code-highlight .mo{color:#dfbfff}:root.theme-dark .code-highlight .sa{color:#f29e74}:root.theme-dark .code-highlight .sb{color:#d5ff80}:root.theme-dark .code-highlight .sc{color:#d5ff80}:root.theme-dark .code-highlight .dl{color:#d5ff80}:root.theme-dark .code-highlight .sd{color:#7e8aa1}:root.theme-dark .code-highlight .s2{color:#d5ff80}:root.theme-dark .code-highlight .se{color:#95e6cb}:root.theme-dark .code-highlight .sh{color:#d5ff80}:root.theme-dark .code-highlight .si{color:#95e6cb}:root.theme-dark .code-highlight .sx{color:#95e6cb}:root.theme-dark .code-highlight .sr{color:#95e6cb}:root.theme-dark .code-highlight .s1{color:#d5ff80}:root.theme-dark .code-highlight .ss{color:#dfbfff}:root.theme-dark .code-highlight .bp{color:#5ccfe6}:root.theme-dark .code-highlight .fm{color:#ffd173}:root.theme-dark .code-highlight .vc{color:#d4d2c8}:root.theme-dark .code-highlight .vg{color:#d4d2c8}:root.theme-dark .code-highlight .vi{color:#d4d2c8}:root.theme-dark .code-highlight .vm{color:#d4d2c8}:root.theme-dark .code-highlight .il{color:#dfbfff}:root.theme-dark .code-highlight pre{overflow:auto;margin:0;padding:0 0 .75rem}:root.theme-dark .code-highlight .linenos{-webkit-user-select:none;user-select:none;cursor:default;margin-right:8px;text-align:right}:root.theme-dark .code-highlight .linenos::selection{background:transparent}:root.theme-dark .code-highlight .linenos::-moz-selection{background:transparent}:root.theme-dark .code-highlight span.linenos{color:var(--color-line-number)}html.no-js .hide_if_nojs,html.js .show_if_nojs{display:none}.center{text-align:center}.right{float:right}.left{float:left}.invisible{display:none!important}.list-unstyled{list-style-type:none}.list-unstyled li{margin-top:4px;margin-bottom:4px}.danger{background-color:var(--color-error-background)}.warning{background:var(--color-warning-background)}.success{background:var(--color-success-background)}.badge{display:inline-block;color:var(--color-toolkit-badge-font);background-color:var(--color-toolkit-badge-background);text-align:center;white-space:nowrap;vertical-align:baseline;min-width:10px;padding:1px 5px;border-radius:5px}kbd{padding:2px 4px;margin:1px;font-size:90%;color:var(--color-toolkit-kbd-font);background:var(--color-toolkit-kbd-background)}table{width:100%}table.striped tr{border-bottom:1px solid var(--color-settings-tr-hover)}th{padding:.4em}td{padding:0 4px}tr:hover{background:var(--color-settings-tr-hover)!important}div.selectable_url{display:block;border:1px solid var(--color-result-search-url-border);padding:4px;color:var(--color-result-search-url-font);margin:.1em;overflow:hidden;height:1.2em;line-height:1.2em;border-radius:5px}div.selectable_url pre{display:block;font-size:.8em;word-break:break-all;margin:.1em;-webkit-user-select:all;user-select:all}.dialog-error{position:relative;display:flex;padding:1rem;margin:0 0 1em;border:1px solid var(--color-toolkit-dialog-border);text-align:left;border-radius:10px;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error)}.dialog-error .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-error ul,.dialog-error ol,.dialog-error p{margin:1px 0 0}.dialog-error table{width:auto}.dialog-error tr{vertical-align:text-top}.dialog-error tr:hover{background:transparent!important}.dialog-error td{padding:0 1em 0 0;padding-right:1rem;padding-bottom:0;padding-left:0}.dialog-error h4{margin-top:.3em;margin-bottom:.3em}.dialog-error-block{position:relative;display:flex;padding:1rem;margin:0 0 1em;border:1px solid var(--color-toolkit-dialog-border);text-align:left;border-radius:10px;display:block;color:var(--color-error);background:var(--color-error-background);border-color:var(--color-error)}.dialog-error-block .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-error-block ul,.dialog-error-block ol,.dialog-error-block p{margin:1px 0 0}.dialog-error-block table{width:auto}.dialog-error-block tr{vertical-align:text-top}.dialog-error-block tr:hover{background:transparent!important}.dialog-error-block td{padding:0 1em 0 0;padding-right:1rem;padding-bottom:0;padding-left:0}.dialog-error-block h4{margin-top:.3em;margin-bottom:.3em}.dialog-warning{position:relative;display:flex;padding:1rem;margin:0 0 1em;border:1px solid var(--color-toolkit-dialog-border);text-align:left;border-radius:10px;color:var(--color-warning);background:var(--color-warning-background);border-color:var(--color-warning)}.dialog-warning .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-warning ul,.dialog-warning ol,.dialog-warning p{margin:1px 0 0}.dialog-warning table{width:auto}.dialog-warning tr{vertical-align:text-top}.dialog-warning tr:hover{background:transparent!important}.dialog-warning td{padding:0 1em 0 0;padding-right:1rem;padding-bottom:0;padding-left:0}.dialog-warning h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal{position:relative;display:flex;padding:1rem;border:1px solid var(--color-toolkit-dialog-border);text-align:left;border-radius:10px;display:block;background:var(--color-toolkit-dialog-background);position:fixed;top:50%;left:50%;margin:0 auto;transform:translate(-50%,-50%);z-index:5000}.dialog-modal .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-modal ul,.dialog-modal ol,.dialog-modal p{margin:1px 0 0}.dialog-modal table{width:auto}.dialog-modal tr{vertical-align:text-top}.dialog-modal tr:hover{background:transparent!important}.dialog-modal td{padding:0 1em 0 0;padding-right:1rem;padding-bottom:0;padding-left:0}.dialog-modal h4{margin-top:.3em;margin-bottom:.3em}.dialog-modal h3{margin-top:0}.btn-collapse{cursor:pointer}.scrollx{overflow:auto hidden;display:block;padding:0;margin:0;border:none}.tabs .tabs>label{font-size:90%}ul.tabs{border-bottom:1px solid var(--color-toolkit-tabs-section-border);list-style:none;padding-left:0}ul.tabs li{display:flex}.tabs{display:flex;flex-wrap:wrap;width:100%;min-width:100%}.tabs>*{order:2}.tabs>input[type=radio]{display:none}.tabs>label,.tabs>li>a{order:1;padding:.7em;margin:0 .7em;letter-spacing:.5px;text-transform:uppercase;border:solid var(--color-toolkit-tabs-label-border);border-width:0 0 2px 0;color:unset;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;cursor:pointer}.tabs>label.active,.tabs>li>a.active{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}.tabs>label:hover,.tabs>li>a:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}.tabs>section{min-width:100%;padding:.7rem 0;box-sizing:border-box;border-top:1px solid var(--color-toolkit-tabs-section-border);display:none}.tabs>label:last-of-type{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font);letter-spacing:-.1px}.tabs>section:last-of-type{display:block}html body .tabs>input:checked~section{display:none}html body .tabs>input:checked~label{position:inherited;background:inherit;border-bottom:2px solid transparent;font-weight:400;color:inherit}html body .tabs>input:checked~label:hover{border-bottom:2px solid var(--color-categories-item-border-selected)}html body .tabs>input:checked+label{border-bottom:2px solid var(--color-categories-item-border-selected);background:var(--color-categories-item-selected);color:var(--color-categories-item-selected-font)}html body .tabs>input:checked+label+section{display:block}select{height:2.4rem;margin-top:0;margin-right:1rem;margin-bottom:0;margin-left:0;padding:.2rem!important;color:var(--color-search-font);font-size:.9rem;z-index:100}select:hover,select:focus{cursor:pointer}@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))){select{appearance:none;-webkit-appearance:none;-moz-appearance:none;border-width:0 2rem 0 0;border-color:transparent;background:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E) no-repeat;background-position-x:calc(100% + 2rem);background-size:2rem;background-origin:content-box;background-color:var(--color-toolkit-select-background);outline:medium none;text-overflow:ellipsis;border-radius:5px}select:hover,select:focus{background-color:var(--color-toolkit-select-background-hover)}select option{background-color:var(--color-base-background)}@media (prefers-color-scheme: dark){html.theme-auto select,html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}html.theme-dark select{background-image:url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%3E%0A%3Cg%3E%3Cpolygon%20fill%3D%22%23ddd%22%20points%3D%22128%2C192%20256%2C320%20384%2C192%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E)}}input.checkbox-onoff[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:inline-block;width:2.5em;height:.7em;box-shadow:none!important;margin:0 16px;border-radius:10px;position:relative}input.checkbox-onoff[type=checkbox]:focus,input.checkbox-onoff[type=checkbox]:hover{outline:none}input.checkbox-onoff[type=checkbox]:focus:after{content:"";position:absolute;width:3.5em;height:1.65em;border:1px solid var(--color-btn-background);border-radius:12px;box-shadow:var(--color-btn-background) 0 0 3px;z-index:1200;top:-.55em;left:-.6em}input.checkbox-onoff[type=checkbox]:before{position:absolute;top:-.5em;display:flex;justify-content:center;align-items:center;font-size:.75em;width:1.875em;height:1.875em;border-radius:50%}input.checkbox-onoff[type=checkbox],input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked{background:var(--color-toolkit-checkbox-onoff-off-background)}input.checkbox-onoff[type=checkbox]:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:checked:before{left:-.5em;content:"✕";color:var(--color-toolkit-checkbox-onoff-off-mark-color);background:var(--color-toolkit-checkbox-onoff-off-mark-background)}input.checkbox-onoff[type=checkbox]:checked,input.checkbox-onoff.reversed-checkbox[type=checkbox]{background:var(--color-toolkit-checkbox-onoff-on-background)}input.checkbox-onoff[type=checkbox]:checked:before,input.checkbox-onoff.reversed-checkbox[type=checkbox]:before{left:calc(100% - 1.5em);content:"✓";color:var(--color-toolkit-checkbox-onoff-on-mark-color);background:var(--color-toolkit-checkbox-onoff-on-mark-background)}@supports (transform: rotate(-45deg)){input[type=checkbox]:not(.checkbox-onoff){-webkit-appearance:none;-moz-appearance:none;appearance:none;width:20px;height:20px;cursor:pointer;position:relative;top:0;left:0;border:2px solid var(--color-toolkit-checkbox-input-border);border-radius:.3em}input[type=checkbox]:not(.checkbox-onoff):after{content:"";width:9px;height:5px;position:absolute;top:3px;left:2px;border:3px solid var(--color-toolkit-checkbox-label-border);border-top:none;border-right:none;background:transparent;opacity:0;transform:rotate(-45deg)}input[type=checkbox]:not(.checkbox-onoff):checked:after{border-color:var(--color-toolkit-checkbox-input-border);opacity:1}input[type=checkbox][disabled]:not(.checkbox-onoff){border:inherit;background-color:transparent!important;cursor:inherit}input.checkbox[type=checkbox]:not(:checked,[disabled],.checkbox-onoff):hover:after{opacity:.5}}@media screen and (max-width: 50em){.tabs>label{width:100%}}.loader,.loader:after{border-radius:50%;width:2em;height:2em}.loader{margin:1em auto;font-size:10px;position:relative;text-indent:-9999em;border-top:.5em solid var(--color-toolkit-loader-border);border-right:.5em solid var(--color-toolkit-loader-border);border-bottom:.5em solid var(--color-toolkit-loader-border);border-left:.5em solid var(--color-toolkit-loader-borderleft);-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.2s infinite linear;animation:load8 1.2s infinite linear}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.engine-tooltip{display:none;position:absolute;padding:.5rem 1rem;margin:0 0 0 2rem;border:1px solid var(--color-toolkit-engine-tooltip-border);background:var(--color-toolkit-engine-tooltip-background);font-size:14px;font-weight:400;z-index:5000;text-align:left;border-radius:10px}th:hover .engine-tooltip,td:hover .engine-tooltip,.engine-tooltip:hover{display:inline-block}.stacked-bar-chart{margin:0;padding:0 .125rem 0 4rem;width:100%;width:-moz-available;width:-webkit-fill-available;width:fill;flex-flow:row nowrap;align-items:center;display:inline-flex}.stacked-bar-chart-value{width:3rem;display:inline-block;position:absolute;padding:0 .5rem;text-align:right}.stacked-bar-chart-base{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset}.stacked-bar-chart-median{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:var(--color-base-font);border:1px solid rgba(var(--color-base-font-rgb),.9);padding:.3rem 0}.stacked-bar-chart-rate80{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:transparent;border:1px solid rgba(var(--color-base-font-rgb),.3);padding:.3rem 0}.stacked-bar-chart-rate95{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:transparent;border-bottom:1px dotted rgba(var(--color-base-font-rgb),.5);padding:0}.stacked-bar-chart-rate100{display:flex;flex-shrink:0;flex-grow:0;flex-basis:unset;background:transparent;border-left:1px solid rgba(var(--color-base-font-rgb),.9);padding:.4rem 0;width:1px}/*! Autocomplete.js v2.6.3 | license MIT | (c) 2017, Baptiste Donaux | http://autocomplete-js.com */.autocomplete{position:absolute;width:44rem;max-width:calc(100% - 1rem);max-height:0;overflow-y:hidden;text-align:left;border-radius:10px}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:var(--color-autocomplete-background)}.autocomplete:empty{display:none}.autocomplete>ul{list-style-type:none;margin:0;padding:0}.autocomplete>ul>li{cursor:pointer;padding:.5rem 1rem}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus,.autocomplete>ul>li:hover{background-color:var(--color-autocomplete-background-hover)}.autocomplete>ul>li.active a:active,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:hover a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:hover a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:hover,.autocomplete>ul>li:hover a:hover{text-decoration:none}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete.open{display:block;background-color:var(--color-autocomplete-background);color:var(--color-autocomplete-font);max-height:32rem;overflow-y:auto;z-index:5000;margin-top:3.5rem;border-radius:.8rem}.autocomplete.open:empty{display:none}@media screen and (max-width: 50em){.autocomplete>ul>li{padding:1rem}}#main_results #results.image-detail-open.only_template_images{width:min(98%,59.25rem)!important}#main_results #results.only_template_images.image-detail-open #backToTop{left:56.75rem!important;right:inherit}article.result-images .detail{display:none}#results.image-detail-open article.result-images[data-vim-selected] .detail{display:flex;flex-direction:column;position:fixed;left:60rem;right:0;top:13rem;transition:top 64ms ease-in 0s;bottom:0;background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-background);z-index:1000;padding:4rem 3rem 3rem;overflow-y:scroll}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{display:block;flex:1;text-align:left;width:100%;border:none;text-decoration:none}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{padding:0;margin:0;border:none;object-fit:contain;width:inherit;height:inherit;max-width:100%;min-height:inherit;max-height:calc(100vh - 42rem);background:inherit}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels{color:var(--color-result-detail-font);height:19rem}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels hr{border-top:1px solid var(--color-result-detail-hr);border-bottom:none}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4{height:2rem;overflow:hidden;text-overflow:ellipsis;font-size:.9rem;margin-bottom:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p{color:var(--color-result-detail-label-font);font-size:.9rem;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:.8rem 0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{display:inline-block;width:12rem}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels h4,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a{text-align:left}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content{height:2rem;line-height:unset;overflow:hidden;text-overflow:ellipsis}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url{white-space:nowrap;overflow:hidden hidden;text-overflow:ellipsis}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-content:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p.result-url:hover{position:relative;overflow:inherit!important;background:var(--color-result-detail-background);text-overflow:inherit!important}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:active{color:var(--color-result-detail-link)}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels a:hover{text-decoration:underline}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close{top:1rem;left:1rem;padding:.4rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{top:1rem;right:6rem;padding:.4rem .5rem .4rem .3rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{top:1rem;right:2rem;padding:.4rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous{border-radius:50%;display:block;width:1.5rem;height:1.5rem;position:absolute;filter:opacity(40%);z-index:1200}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span{display:block;width:1.5rem;height:1.5rem;text-align:center}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next span:before,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous span:before{vertical-align:sub}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:active,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:visited,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:active{color:var(--color-result-detail-font);background:var(--color-result-detail-background);border:1px solid var(--color-result-detail-font)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-close:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-previous:hover,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:focus,#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next:hover{filter:opacity(80%)}#results.image-detail-open article.result-images[data-vim-selected] .detail .loader{position:absolute;top:1rem;right:50%;border-top:.5em solid var(--color-result-detail-loader-border);border-right:.5em solid var(--color-result-detail-loader-border);border-bottom:.5em solid var(--color-result-detail-loader-border);border-left:.5em solid var(--color-result-detail-loader-borderleft)}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail{top:0}#results.image-detail-open.scrolling article.result-images[data-vim-selected] .detail a.result-images-source img{max-height:calc(100vh - 25rem)}@media screen and (max-width: 79.75em){#results.image-detail-open article.result-images[data-vim-selected] .detail{top:0;left:0}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source{display:flex;flex-direction:column;justify-content:center}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 24rem)}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-detail-next{right:1rem}}@media screen and (max-width: 50em){#results.image-detail-open article.result-images[data-vim-selected] .detail{top:0;left:0;padding:1rem}#results.image-detail-open article.result-images[data-vim-selected] .detail a.result-images-source img{width:100%;max-height:calc(100vh - 2rem);margin:0}#results.image-detail-open article.result-images[data-vim-selected] .detail .result-images-labels p span{width:inherit;margin-right:1rem}}.dialog-modal{animation-name:dialogmodal;animation-duration:.13s}@keyframes dialogmodal{0%{opacity:0}50%{opacity:.5;transform:translate(-50%,-50%) scale(1.05)}}input.checkbox-onoff[type=checkbox]:before{transition:left .25s}iframe[src^="https://w.soundcloud.com"]{height:120px}iframe[src^="https://www.deezer.com"]{height:94px}iframe[src^="https://www.mixcloud.com"]{height:250px}iframe[src^="https://bandcamp.com/EmbeddedPlayer"]{height:350px}iframe[src^="https://bandcamp.com/EmbeddedPlayer/track"]{height:120px}iframe[src^="https://genius.com/songs"]{height:65px}.info-page code{font-family:monospace;border-radius:5px;background-color:var(--color-doc-code-background);color:var(--color-doc-code);padding:.2rem;border:0 none}.stats_endpoint .github-issue-button{display:block;font-size:16px}.stats_endpoint .issue-hide{display:none}.stats_endpoint input[type=checked]{position:absolute}.stats_endpoint label{margin:1rem 1rem 1rem 0}.stats_endpoint .step_content{margin:1rem 1rem 1rem 2rem}.stats_endpoint .step1,.stats_endpoint .step2{visibility:hidden}.stats_endpoint .step1_delay{transition:visibility 0s linear 4s}.stats_endpoint #step1:checked~.step1,.stats_endpoint #step2:checked~.step2{visibility:visible}.engine-stats{border-spacing:0;border-collapse:collapse}.engine-stats tr td,.engine-stats tr th{border-bottom:1px solid var(--color-result-border);padding:.25rem}.engine-stats table.engine-tooltip{border-spacing:0;border-collapse:collapse}.engine-stats table.engine-tooltip td,.engine-stats table.engine-tooltip th{border:none}.engine-stats .engine-name{width:20rem}.engine-stats .engine-score{width:7rem;text-align:right}.engine-stats .engine-reliability{text-align:right}table.engine-error th.engine-error-type,table.engine-error td.engine-error-type,failed-test{width:10rem}.engine-errors{margin-top:3rem}.engine-errors table.engine-error{max-width:1280px;margin:1rem 0 3rem;border:1px solid var(--color-result-border);text-align:left}.engine-errors table.engine-error tr th,.engine-errors table.engine-error tr td{padding:.5rem}.engine-errors table.engine-error span.log_parameters{border-right:1px solid solid var(--color-result-border);padding:0 1rem 0 0;margin:0 0 0 .5rem}.bar-chart-value{width:3em;display:inline-block;text-align:right;padding-right:.5rem}.bar-chart-graph{width:calc(100% - 5rem);display:inline-block}.bar-chart-bar{border:3px solid var(--color-bar-chart-primary);margin:1px 0}.bar-chart-serie1{border:3px solid var(--color-bar-chart-primary);margin:1px 0;float:left}.bar-chart-serie2{border:3px solid var(--color-bar-chart-secondary);margin:1px 0;float:left}.bar0{width:0;border:0}.bar1{width:1%}.bar2{width:2%}.bar3{width:3%}.bar4{width:4%}.bar5{width:5%}.bar6{width:6%}.bar7{width:7%}.bar8{width:8%}.bar9{width:9%}.bar10{width:10%}.bar11{width:11%}.bar12{width:12%}.bar13{width:13%}.bar14{width:14%}.bar15{width:15%}.bar16{width:16%}.bar17{width:17%}.bar18{width:18%}.bar19{width:19%}.bar20{width:20%}.bar21{width:21%}.bar22{width:22%}.bar23{width:23%}.bar24{width:24%}.bar25{width:25%}.bar26{width:26%}.bar27{width:27%}.bar28{width:28%}.bar29{width:29%}.bar30{width:30%}.bar31{width:31%}.bar32{width:32%}.bar33{width:33%}.bar34{width:34%}.bar35{width:35%}.bar36{width:36%}.bar37{width:37%}.bar38{width:38%}.bar39{width:39%}.bar40{width:40%}.bar41{width:41%}.bar42{width:42%}.bar43{width:43%}.bar44{width:44%}.bar45{width:45%}.bar46{width:46%}.bar47{width:47%}.bar48{width:48%}.bar49{width:49%}.bar50{width:50%}.bar51{width:51%}.bar52{width:52%}.bar53{width:53%}.bar54{width:54%}.bar55{width:55%}.bar56{width:56%}.bar57{width:57%}.bar58{width:58%}.bar59{width:59%}.bar60{width:60%}.bar61{width:61%}.bar62{width:62%}.bar63{width:63%}.bar64{width:64%}.bar65{width:65%}.bar66{width:66%}.bar67{width:67%}.bar68{width:68%}.bar69{width:69%}.bar70{width:70%}.bar71{width:71%}.bar72{width:72%}.bar73{width:73%}.bar74{width:74%}.bar75{width:75%}.bar76{width:76%}.bar77{width:77%}.bar78{width:78%}.bar79{width:79%}.bar80{width:80%}.bar81{width:81%}.bar82{width:82%}.bar83{width:83%}.bar84{width:84%}.bar85{width:85%}.bar86{width:86%}.bar87{width:87%}.bar88{width:88%}.bar89{width:89%}.bar90{width:90%}.bar91{width:91%}.bar92{width:92%}.bar93{width:93%}.bar94{width:94%}.bar95{width:95%}.bar96{width:96%}.bar97{width:97%}.bar98{width:98%}.bar99{width:99%}.bar100{width:100%}.osm-map-box{height:300px;width:100%;margin:10px 0}#answers .weather summary{display:block;list-style:none}#answers .weather div.summary{margin:0;padding:.5rem 1rem;background-color:var(--color-header-background);border-radius:5px}#answers .weather table{font-size:.9rem;table-layout:fixed;margin-top:.5rem;margin-bottom:.5rem;border-collapse:separate;border-spacing:.1em 0}#answers .weather td{padding:0;overflow:hidden;text-overflow:ellipsis}#answers .weather img.symbol{width:5rem;margin:auto;display:block}#main_index{margin-top:26vh}.index{text-align:center}.index .title{background:url(../img/searxng.png) no-repeat;min-height:4rem;margin:4rem auto;background-position:center;background-size:contain}.index h1{font-size:4em;visibility:hidden}.index #search,.index #search_header{margin:0 auto;background:inherit;border:inherit;padding:0;display:block}.index .search_filters{display:block;margin:1em 0}.index .category label{padding:6px 10px;border-bottom:initial!important}@media screen and (max-width: 79.75em){div.title h1{font-size:1em}#main_index{margin-top:6em}}table{border-collapse:collapse}table th,table td{text-align:center;padding:1rem .5rem;text-align:left}table tr.pref-group th{font-weight:400;text-align:left;background:var(--color-settings-table-group-background)}#main_preferences form{width:100%}#main_preferences fieldset{margin:8px;border:none}#main_preferences legend{margin:0;padding:5px 0 0;display:block;float:left;width:300px}#main_preferences input[type=text]{width:13.25rem;color:var(--color-toolkit-input-text-font);border:none;background:none repeat scroll 0 0 var(--color-toolkit-select-background);padding:.2rem .4rem;height:2rem;border-radius:5px}#main_preferences input[type=text]:hover,#main_preferences input[type=text]:focus{background-color:var(--color-toolkit-select-background-hover)}#main_preferences div.pref-group{width:100%;font-weight:400;padding:1rem .5rem;text-align:left;background:var(--color-settings-table-group-background)}#main_preferences .value{margin:0;padding:0;float:left;width:15em}#main_preferences .value select,#main_preferences .value input[type=text]{font-size:inherit!important;margin-top:0;margin-right:1rem;margin-bottom:0;margin-left:0}#main_preferences .value select{width:14rem}#main_preferences .value select:focus,#main_preferences .value input:focus{outline:none;box-shadow:0 0 1px 1px var(--color-btn-background)}#main_preferences .description{margin:0;padding:5px 0 0;float:right;width:50%;color:var(--color-settings-engine-description-font);font-size:90%}#main_preferences .bang{text-align:left;border-radius:5px;background-color:var(--color-doc-code-background);color:var(--color-doc-code);padding:.2rem;border:0 none}#main_preferences .category{margin-right:.5rem}#main_preferences .category label{border:2px solid transparent;padding:.2rem .4rem;border-radius:5px}#main_preferences .category input[type=checkbox]:checked+label{border:2px solid var(--color-categories-item-border-selected)}#main_preferences table.table_engines th.name label{cursor:pointer}#main_preferences table.table_engines th.name .engine-tooltip{margin-top:1.8rem;left:calc((100% - 85em)/2 + 10em);max-width:40rem}#main_preferences table.table_engines th.name .engine-tooltip .engine-description{margin-top:.5rem}#main_preferences table.table_engines th.name .engine-tooltip .bang{margin:.3rem}#main_preferences table.table_engines .checkbox-col,#main_preferences table.table_engines .name,#main_preferences table.table_engines .shortcut{text-align:left}#main_preferences table.cookies{width:100%;direction:ltr}#main_preferences table.cookies th,#main_preferences table.cookies td{text-align:left;font-family:monospace;font-size:1rem;padding:.5em;vertical-align:top}#main_preferences table.cookies td:first-child{word-break:keep-all;width:14rem;padding-right:1rem}#main_preferences table.cookies td:last-child{word-break:break-all}#main_preferences table.cookies>tbody>tr:nth-child(2n)>th,#main_preferences table.cookies>tbody>tr:nth-child(2n)>td{background-color:var(--color-settings-tr-hover)}#main_preferences .preferences_back{background:none repeat scroll 0 0 var(--color-btn-background);color:var(--color-btn-font);border:0 none;border-radius:10px;cursor:pointer;display:inline-block;margin:2px 4px;padding:.7em}#main_preferences .preferences_back a{color:var(--color-settings-return-font)}#main_preferences .preferences_back a:first-letter{text-transform:uppercase}#main_preferences #toggle-all-engines-container{width:max-content;margin-left:auto}#main_preferences div.selectable_url pre{width:100%}#main_preferences #copy-hash-container{display:flex;align-items:center;gap:.5rem}#main_preferences #copy-hash-container div.selectable_url pre{width:auto;flex-grow:1}#main_preferences #pref-hash-input{width:100%}@media screen and (max-width: 79.75em){.preferences_back{clear:both}.engine-tooltip{left:10em!important}}#search{padding:0;margin:0}#search_header{padding-top:1.5em;padding-right:2em;padding-left:7rem;margin:0;background:var(--color-header-background);border-bottom:1px solid var(--color-header-border);display:grid;gap:1rem 1.2rem;grid-template-columns:3rem 1fr;grid-template-areas:"logo search" "spacer categories"}.category_checkbox,.category_button{display:inline-block;position:relative;margin-right:1rem;padding:0}.category_checkbox input{display:none}.category_checkbox label{cursor:pointer;padding:.2rem 0;display:inline-flex;text-transform:capitalize;font-size:.9em;border-bottom:2px solid transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.category_checkbox label svg{padding-right:.2rem}.category_checkbox label div.category_name{margin:auto 0}.category_checkbox input[type=checkbox]:checked+label{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}button.category_button{background-color:inherit;color:var(--color-base-font);cursor:pointer;padding:.2rem 0;display:inline-flex;align-items:center;text-transform:capitalize;font-size:.9em;border:none;border-bottom:2px solid transparent}button.category_button svg{padding-right:.2rem}button.category_button.selected,button.category_button:active{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}.no-js #categories_container:has(button.category_button:focus-within) button.category_button.selected{color:var(--color-base-font);border-bottom:none}.no-js #categories_container:has(button.category_button:focus-within) button.category_button:focus-within{color:var(--color-categories-item-selected-font);border-bottom:2px solid var(--color-categories-item-border-selected)}#search_logo{padding:.5rem 10px 0;grid-area:logo;display:flex;align-items:center;justify-content:center}#search_logo svg{flex:1;width:30px;height:30px;margin:.5rem 0 auto}.search_categories{grid-area:categories}.search_categories .help{display:none}.search_categories:hover .help{display:block;position:absolute;background:var(--color-base-background);padding:1rem .6rem .6rem 0;z-index:1000;width:100%;left:-.1rem}#search_view{padding:.5rem .5rem 0;grid-area:search}body.results_endpoint #search_view{padding:.5rem 2.8rem 0 0}.search_box{border-radius:.8rem;width:100%;max-width:44rem;display:inline-flex;flex-direction:row;white-space:nowrap;box-shadow:var(--color-search-shadow)}#clear_search{display:block;border-collapse:separate;box-sizing:border-box;width:1.8rem;margin:0;padding:.8rem .2rem;background:none repeat scroll 0 0 var(--color-search-background);border:none;outline:none;color:var(--color-search-font);font-size:1.1rem;z-index:1000}#clear_search:hover{color:var(--color-search-background-hover)}#clear_search.empty *,html.no-js #clear_search.hide_if_nojs{display:none}#q,#send_search{display:block;margin:0;padding:.8rem;background:none repeat scroll 0 0 var(--color-search-background);border:none;outline:none;color:var(--color-search-font);font-size:1.1rem;z-index:100}#q{width:100%;padding-left:1rem;padding-right:0!important;border-radius:.8rem 0 0 .8rem}#q::-ms-clear,#q::-webkit-search-cancel-button{display:none}#send_search{border-radius:0 .8rem .8rem 0}#send_search:hover{cursor:pointer;background-color:var(--color-search-background-hover);color:var(--color-search-background)}.no-js #clear_search,.no-js #send_search{width:auto!important;border-left:1px solid var(--color-search-border)}.search_filters{margin-top:.6rem;margin-right:0;margin-bottom:0;margin-left:10.6rem;display:flex;overflow-x:auto;overscroll-behavior-inline:contain}.search_filters select{background-color:inherit}.search_filters select:hover,.search_filters select:focus{color:var(--color-base-font)}@media screen and (max-width: 79.75em){#search_header{padding:1.5em .5rem 0;column-gap:.5rem}.search_filters{margin-top:.6rem;margin-right:0;margin-bottom:0;margin-left:3.5rem}#categories{font-size:90%;clear:both}}@media screen and (max-width: 79.75em) and (hover: none){#main_index #categories_container,#main_results #categories_container{width:max-content}#main_index #categories_container .category_checkbox,#main_results #categories_container .category_checkbox{display:inline-block;width:auto}#main_index #categories,#main_results #categories{width:100%;text-align:left;overflow:scroll hidden;-webkit-overflow-scrolling:touch}}@media screen and (max-width: 50em){#search_header{width:100%;margin:0;padding:.1rem 0 0;gap:0 0;grid-template-areas:"logo search" "categories categories"}.search_logo{padding:0}.search_box{width:100%}#q{width:100%;flex:1}.search_filters{margin:0 10px;padding:.5rem 0}.category{display:inline-block;width:auto;margin:0}.category svg{display:none}.category_checkbox label,.category_button{padding:1rem!important;margin:0!important}#search_view:focus-within{display:block;background-color:var(--color-search-background);position:absolute;top:0;height:100%;width:100%;z-index:2000}#search_view:focus-within .search_box{border-bottom:1px solid var(--color-search-border);width:100%;border-radius:0;box-shadow:none}#search_view:focus-within .search_box #send_search{margin-right:0!important}#search_view:focus-within .search_box *{border:none;border-radius:0;box-shadow:none}#main_results #q:placeholder-shown~#send_search{margin-right:2.6rem;transition:margin .1s}}@media screen and (max-width: 20rem){#search_header{grid-template-areas:"search search" "categories categories"}#search_logo{display:none}}#categories{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}#categories::-webkit-scrollbar{width:0;height:0}#categories_container{position:relative}.favicon img{height:1.5rem;width:1.5rem;border-radius:10%;background-color:var(--color-favicon-background-color);border:1px solid var(--color-favicon-border-color);display:flex}@media screen and (min-width: 50em){.center-alignment-yes #main_results{--center-page-width: 48rem}}@media screen and (width >= 62rem){.center-alignment-yes #main_results{--center-page-width: 60rem}}@media screen and (min-width: 79.75em){.center-alignment-yes #main_results{--center-page-width: 73rem}}@media screen and (min-width: 50em) and (max-width: 79.75em){.center-alignment-yes #main_results #results{grid-template-columns:60% calc(40% - 5rem);margin-left:0;margin-right:0}.center-alignment-yes #main_results #urls{margin-left:3rem}.center-alignment-yes #main_results #sidebar{margin-right:1rem}.center-alignment-yes #main_results #backToTop{left:calc(60% + 1rem)}}@media screen and (min-width: 79.75em){.center-alignment-yes #main_results{display:flex;flex-direction:column;align-items:center}.center-alignment-yes #main_results #search{width:100%;display:flex;flex-direction:column;align-items:center}.center-alignment-yes #main_results #search_header{grid-template-columns:calc(50% - 4.5rem - var(--center-page-width) / 2) 3rem var(--center-page-width);grid-template-areas:"na logo search" "na spacer categories";column-gap:1.2rem;width:100%;padding-left:0;padding-right:0}.center-alignment-yes #main_results .search_filters{margin-left:.5rem;width:var(--center-page-width)}.center-alignment-yes #main_results #results{margin-right:2rem;margin-left:10rem}.center-alignment-yes #main_results #results.only_template_images,.center-alignment-yes #main_results #results.image-detail-open{align-self:flex-start}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open){margin-left:1.5rem;grid-template-columns:calc(var(--center-page-width) - 5rem - 25rem) 25rem}.center-alignment-yes #main_results #results:not(.only_template_images,.image-detail-open) #backToTop{left:calc(50% - 25rem - 5rem + 1rem + var(--center-page-width) / 2)}.center-alignment-yes #main_results #results .result .content{max-width:inherit}.center-alignment-yes #main_results #urls{margin-left:0}.center-alignment-yes #main_results #sidebar{margin-right:0}}.sxng-icon-set{display:inline-block;vertical-align:bottom;line-height:1;text-decoration:inherit;transform:scale(1)}.sxng-icon-set-small{width:1rem;height:1rem;display:inline-block;vertical-align:bottom;line-height:1;text-decoration:inherit;transform:scale(1)}.sxng-icon-set-big{width:1.5rem;height:1.5rem;display:inline-block;vertical-align:bottom;line-height:1;text-decoration:inherit;transform:scale(1)}html{font-family:sans-serif;font-size:.9em;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:var(--color-base-font);background-color:var(--color-base-background);padding:0;margin:0;scroll-behavior:smooth}body,main{padding:0;margin:0}body{display:flex;flex-direction:column;height:100vh;margin:0}@supports (height: 100dvh){body{height:100dvh}}main{width:100%;margin-bottom:2rem;flex:1}.page_with_header{margin:2em auto;width:85em}footer{clear:both;min-height:4rem;padding:1rem 0;width:100%;text-align:center;background-color:var(--color-footer-background);border-top:1px solid var(--color-footer-border);overflow:hidden}footer p{font-size:.9em}.page_with_header .logo{height:40px}input[type=submit],#results button[type=submit],.button{padding:.7rem;display:inline-block;background:var(--color-btn-background);color:var(--color-btn-font);border-radius:10px;border:0;cursor:pointer}a{text-decoration:none;color:var(--color-url-font)}a:visited,a:visited .highlight{color:var(--color-url-visited-font)}article[data-vim-selected]{background:var(--color-result-vim-selected);border-left:.2rem solid var(--color-result-vim-arrow);border-radius:0 10px 10px 0}article.result-images[data-vim-selected]{background:var(--color-result-vim-arrow);border:none;border-radius:10px}article.result-images[data-vim-selected] .image_thumbnail{filter:opacity(60%)}article.result-images[data-vim-selected] span.title,article.result-images[data-vim-selected] span.source{color:var(--color-result-image-span-font-selected)}article[data-vim-selected].category-videos,article[data-vim-selected].category-news,article[data-vim-selected].category-map,article[data-vim-selected].category-music,article[data-vim-selected].category-files,article[data-vim-selected].category-social{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{margin:.125rem 0;padding:1rem;box-sizing:border-box;width:100%;border-left:.2rem solid transparent}.result h3{font-size:1.2rem;word-wrap:break-word;margin:.4rem 0;padding:0}.result h3 a{color:var(--color-result-link-font);font-weight:400;font-size:1.1em}.result h3 a:visited{color:var(--color-result-link-visited-font)}.result h3 a:focus,.result h3 a:hover{text-decoration:underline;border:none;outline:none}.result .cache_link,.result .proxyfied_link{font-size:smaller!important;margin-left:.5rem}.result .content,.result .stat{font-size:.9em;margin:0;padding:0;max-width:54em;word-wrap:break-word;line-height:1.24}.result .content .highlight,.result .stat .highlight{color:var(--color-result-description-highlight-font);background:inherit;font-weight:700}.result .altlink a{font-size:.9em;margin:0 10px 0 0;padding:5px 10px;border-radius:5px;background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer}.result .altlink a:hover{background:var(--color-btn-background);color:var(--color-btn-font)}.result .codelines .highlight{color:inherit;background:inherit;font-weight:400}.result .url_header{display:flex;gap:.5rem}.result .url_wrapper{display:flex;align-items:center;font-size:1rem;color:var(--color-result-url-font);flex-flow:row nowrap;overflow:hidden;margin:0;padding:0}.result .url_wrapper .url_o1{white-space:nowrap;flex-shrink:1;padding-bottom:1px}.result .url_wrapper .url_o1 .url_i1{unicode-bidi:plaintext}.result .url_wrapper .url_o1:after{content:" ";width:1ch;display:inline-block}.result .url_wrapper .url_o2{overflow:hidden;white-space:nowrap;flex:0 1 content;text-align:right;padding-bottom:1px}.result .url_wrapper .url_o2 .url_i2{float:right}.result .published_date,.result .result_length,.result .result_views,.result .result_author,.result .result_shipping,.result .result_source_country{font-size:.8em;color:var(--color-result-publishdate-font)}.result .result_price{font-size:1.2em;color:var(--color-result-description-highlight-font)}.result img.thumbnail{float:left;padding-top:.6rem;padding-right:1rem;width:7rem;height:unset}.result .break{clear:both}.result-paper .attributes,.result-packages .attributes{display:table;border-spacing:.125rem}.result-paper .attributes div,.result-packages .attributes div{display:table-row}.result-paper .attributes div span,.result-packages .attributes div span{font-size:.9rem;margin-top:.25rem;display:table-cell}.result-paper .attributes div span time,.result-packages .attributes div span time{font-size:.9rem}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{color:var(--color-base-font);min-width:10rem}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){color:var(--color-result-publishdate-font)}.result-paper .content,.result-packages .content{margin-top:.25rem}.result-paper .comments,.result-packages .comments{font-size:.9rem;margin:.25rem 0 0;padding:0;word-wrap:break-word;line-height:1.24;font-style:italic}.result-packages .attributes{margin-top:.3rem}.template_group_images{display:flex;flex-wrap:wrap}.template_group_images:after{flex-grow:10;content:""}.category-videos,.category-news,.category-map,.category-music,.category-files,.category-social{border:1px solid var(--color-result-border);margin:0 .5rem 1rem!important;border-radius:10px}.category-social .image{width:auto!important;min-width:48px;min-height:48px;padding:0 5px 25px 0!important}.audio-control audio{width:100%;padding:10px 0 0}.embedded-content iframe{width:100%;padding:10px 0 0}.result-videos img.thumbnail{float:left;padding-top:.6rem;padding-right:1rem;width:20rem;height:unset}.result-videos .content{overflow:hidden}.result-videos .embedded-video iframe{width:100%;aspect-ratio:16 / 9;padding:10px 0 0}@supports not (aspect-ratio: 1 / 1){.result-videos .embedded-video iframe{height:25.3125rem}}.engines{float:right;display:flex;flex-wrap:wrap;justify-content:flex-end;color:var(--color-result-engines-font)}.engines span{font-size:smaller;margin-top:0;margin-bottom:0;margin-right:.5rem;margin-left:0}.small_font{font-size:.8em}.highlight{color:var(--color-result-link-font-highlight);background:inherit}.empty_element{font-style:italic}.result-images{flex-grow:1;padding:.5rem .5rem 3rem;margin:.25rem;border:none!important;height:12rem;width:unset}.result-images>a{position:relative;outline:none}.result-images img{margin:0;padding:0;border:none;height:100%;width:auto;object-fit:cover;vertical-align:bottom;background:var(--color-result-image-background)}.result-images .image_resolution{position:absolute;right:0;bottom:0;background:var(--color-image-resolution-background);padding:.3rem .5rem;font-size:.9rem;color:var(--color-image-resolution-font);border-top-left-radius:.3rem}.result-images span.title,.result-images span.source{display:block;position:absolute;width:100%;font-size:.9rem;color:var(--color-result-image-span-font);padding:.5rem 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.result-images span.source{padding:1.8rem 0 0;font-size:.7rem}.result-map img.image{float:right!important;height:100px!important;width:auto!important}.result-map table{font-size:.9em;width:auto;border-collapse:separate;border-spacing:0 .35rem}.result-map table th{font-weight:inherit;width:17rem;vertical-align:top;text-align:left}.result-map table td{vertical-align:top;text-align:left}.hidden{display:none!important}#results{margin-top:1rem;margin-right:2rem;margin-bottom:0;margin-left:10rem;display:grid;grid-template:"corrections sidebar" min-content "answers sidebar" min-content "urls sidebar" 1fr "pagination sidebar" min-content / 45rem 25rem;gap:0 5rem}#results #sidebar *:first-child{margin-top:0}#urls{padding:0;grid-area:urls}#apis .wrapper{display:flex}#suggestions .wrapper{display:flex;flex-flow:column;justify-content:flex-end}#suggestions .wrapper form{display:inline-block;flex:1 1 50%}#suggestions input,#infoboxes input{padding:0;margin:3px;font-size:.9em;display:inline-block;background:transparent;color:var(--color-result-search-url-font);cursor:pointer;width:100%;text-overflow:ellipsis;overflow:hidden;text-align:left}#suggestions input[type=submit],#infoboxes input[type=submit],#suggestions .infobox .url a,#infoboxes .infobox .url a{color:var(--color-result-link-font);text-decoration:none;font-size:.9rem}#suggestions input[type=submit]:hover,#infoboxes input[type=submit]:hover,#suggestions .infobox .url a:hover,#infoboxes .infobox .url a:hover{text-decoration:underline}#corrections{grid-area:corrections;display:flex;flex-flow:row wrap;margin:0 0 1em}#corrections h4,#corrections input[type=submit]{display:inline-block;padding:.5rem;margin:.5rem}#corrections input[type=submit]{font-size:.8rem;border-radius:5px}#infoboxes .title,#suggestions .title,#search_url .title,#engines_msg .title,#apis .title{margin:2em 0 .5em;color:var(--color-base-font)}summary.title{cursor:pointer;padding-top:1em}.sidebar-collapsible{border-top:1px solid var(--color-sidebar-border);padding-bottom:.5em}#sidebar-end-collapsible{border-bottom:1px solid var(--color-sidebar-border);width:100%}#answers{grid-area:answers;background:var(--color-answer-background);padding:1rem;margin:1rem 0;margin-top:0;color:var(--color-answer-font);border-radius:10px}#answers h4{display:none}#answers span{overflow-wrap:anywhere}#answers .answer{display:flex;flex-direction:column}#answers .answer-url{margin:5px 10px 10px auto}#infoboxes form{min-width:210px}#sidebar{grid-area:sidebar;word-wrap:break-word;color:var(--color-sidebar-font)}#sidebar .infobox{margin:10px 0;border:1px solid var(--color-sidebar-border);padding:1rem;font-size:.9em;border-radius:10px}#sidebar .infobox h2{margin:0 0 .5em}#sidebar .infobox img{max-width:100%;max-height:12em;display:block;margin:0 auto;padding:0}#sidebar .infobox dt{font-weight:700}#sidebar .infobox .attributes dl{margin:.5em 0}#sidebar .infobox .attributes dt{display:inline;margin:.5em .25em .5em 0;padding:0}#sidebar .infobox .attributes dd{display:inline;margin:.5em 0;padding:0}#sidebar .infobox input{font-size:1em}#sidebar .infobox br,#sidebar .infobox .attributes,#sidebar .infobox .urls{clear:both}#apis input{font-size:.9em;margin:0 10px 0 0;padding:5px 10px;border-radius:5px;background:var(--color-show-btn-background);color:var(--color-show-btn-font);cursor:pointer}#apis input:hover{background:var(--color-btn-background);color:var(--color-btn-font)}#engines_msg .engine-name{width:10rem}#engines_msg .response-error{color:var(--color-error)}#engines_msg .bar-chart-value{width:auto}#search_url div.selectable_url pre{float:left;width:200em}#search_url button#copy_url{float:right;padding:.4rem;margin-left:.5rem;border-radius:.3rem;display:none}#links_on_top{position:absolute;right:1rem;text-align:right;top:2.7rem;padding:0;border:0;display:flex;align-items:center;font-size:1em;color:var(--color-search-font)}#links_on_top a{display:flex;align-items:center;margin-left:1em}#links_on_top a svg{font-size:1.2em;margin-right:.125em}#links_on_top a,#links_on_top a:link *,#links_on_top a:hover *,#links_on_top a:visited *,#links_on_top a:active *{color:var(--color-search-font)}#pagination{grid-area:pagination}#pagination br{clear:both}.numbered_pagination{display:flex;flex-direction:row;justify-content:center;align-items:center;overflow:hidden}.page_number{background:transparent!important;color:var(--color-result-link-font)!important;text-decoration:underline}.page_number_current{background:transparent;color:var(--color-result-link-visited-font);border:none}#backToTop{border:1px solid var(--color-backtotop-border);margin:0;padding:0;font-size:1em;background:var(--color-backtotop-background);position:fixed;bottom:8rem;left:56.3rem;transition:opacity .5s;opacity:0;pointer-events:none;border-radius:10px}#backToTop a{display:block;margin:0;padding:.7em}#backToTop a,#backToTop a:visited,#backToTop a:hover,#backToTop a:active{color:var(--color-backtotop-font)}#results.scrolling #backToTop{opacity:1;pointer-events:all}@media screen and (width <= calc(79.75em - .5px)){#links_on_top span{display:none}}@media screen and (width <= 52rem){body.results_endpoint #links_on_top .link_on_top_about,body.results_endpoint #links_on_top .link_on_top_donate{display:none}}@media screen and (min-width: 50em) and (max-width: 79.75em){.center-alignment-no #links_on_top span{display:none}.center-alignment-no .page_with_header{margin:2rem .5rem;width:auto}.center-alignment-no #infoboxes{position:inherit;max-width:inherit}.center-alignment-no #infoboxes .infobox{clear:both}.center-alignment-no #infoboxes .infobox img{float:left;max-width:10em;margin:.5em .5em .5em 0}.center-alignment-no #sidebar{margin:0 .5rem .125rem;padding:0;float:none;border:none;width:auto}.center-alignment-no #sidebar input{border:0}.center-alignment-no .result .thumbnail{max-width:98%}.center-alignment-no .result .url span.url{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}.center-alignment-no .result .engines{float:right;display:flex;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0}.center-alignment-no .result-images{border-bottom:none!important}.center-alignment-no .image_result,.center-alignment-no .image_result img{max-width:98%}.center-alignment-no #backToTop{display:none}.center-alignment-no #pagination{margin:2rem 0 0!important}.center-alignment-no #main_results div#results{margin:0 auto;justify-content:center;display:grid;grid-template:"corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 45rem;gap:0}}#main_results div#results.only_template_images{margin:1rem .5rem 0;display:grid;grid-template:"corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 100%;gap:0}#main_results div#results.only_template_images #sidebar{display:none}#main_results div#results.only_template_images #urls{margin:0;display:flex;flex-wrap:wrap}#main_results div#results.only_template_images #urls:after{flex-grow:10;content:""}#main_results div#results.only_template_images #backToTop{left:auto;right:1rem}#main_results div#results.only_template_images #pagination{margin-right:4rem}@media screen and (max-width: 50em){#links_on_top span{display:none}.page_with_header{margin:2rem .5rem;width:auto}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em;margin:.5em .5em .5em 0}#sidebar{margin:0 .5rem .125rem;padding:0;float:none;border:none;width:auto}#sidebar input{border:0}.result .thumbnail{max-width:98%}.result .url span.url{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}.result .engines{float:right;display:flex;flex-wrap:wrap;justify-content:flex-end;padding:3px 0 0}.result-images{border-bottom:none!important}.image_result,.image_result img{max-width:98%}#backToTop{display:none}#pagination{margin:2rem 0 0!important}#main_results div#results{margin:0 auto;justify-content:center;display:grid;grid-template:"corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 45rem;gap:0}html{background-color:var(--color-base-background-mobile)}#main_results div#results{grid-template-columns:100%;margin:0 auto}#links_on_top{top:1.4rem;right:10px}#main_index #links_on_top{top:.5rem;right:.5rem}#results{margin:0;padding:0}#pagination{margin:2rem 1rem 0!important}article[data-vim-selected]{border:1px solid var(--color-result-vim-arrow);border-radius:10px}.result{background:var(--color-result-background);border:1px solid var(--color-result-background);margin:1rem 2%;width:96%;border-radius:10px}.result-images{margin:0;height:10rem;background:var(--color-base-background-mobile);width:unset}.infobox{border:none!important;background-color:var(--color-sidebar-background)}.numbered_pagination{display:none}.result-paper .attributes,.result-packages .attributes,.result-paper .attributes div,.result-packages .attributes div{display:block}.result-paper .attributes div span,.result-packages .attributes div span{display:inline}.result-paper .attributes div span:first-child,.result-packages .attributes div span:first-child{font-weight:700}.result-paper .attributes div span:nth-child(2),.result-packages .attributes div span:nth-child(2){margin-left:.5rem}}@media screen and (max-width: 35em){.result-videos img.thumbnail{float:none!important}.result-videos .content{overflow:inherit}}pre code{white-space:pre-wrap}#main_results .result-keyvalue caption{padding:.8rem .5rem;font-style:italic;caption-side:bottom;background-color:var(--color-result-keyvalue-table)}#main_results .result-keyvalue .col-key{width:25%}#main_results .result-keyvalue table{word-break:break-word;table-layout:fixed;width:100%;background-color:var(--color-result-keyvalue-table)}#main_results .result-keyvalue tr.odd{background-color:var(--color-result-keyvalue-odd)}#main_results .result-keyvalue tr.even{background-color:var(--color-result-keyvalue-even)}#main_results .result-keyvalue th,#main_results .result-keyvalue td{padding:.3rem .5rem} diff --git a/searx/static/themes/simple/js/autocomplete.min.js b/searx/static/themes/simple/js/autocomplete.min.js new file mode 100644 index 000000000..7dfee8f2d --- /dev/null +++ b/searx/static/themes/simple/js/autocomplete.min.js @@ -0,0 +1,2 @@ +import{c as e,d as t,e as n,g as r}from"./searxng.core.min.js";const i=async(i,a)=>{try{let o;o=r.method===`GET`?await t(`GET`,`./autocompleter?q=${a}`):await t(`POST`,`./autocompleter`,{body:new URLSearchParams({q:a})});let s=await o.json(),c=document.querySelector(`.autocomplete`);e(c);let l=document.querySelector(`.autocomplete ul`);if(e(l),c.classList.add(`open`),l.replaceChildren(),s?.[1]?.length===0){let e=Object.assign(document.createElement(`li`),{className:`no-item-found`,textContent:r.translations?.no_item_found??`No results found`});l.append(e);return}let u=new DocumentFragment;for(let e of s[1]){let t=Object.assign(document.createElement(`li`),{textContent:e});n(`mousedown`,t,()=>{i.value=e;let t=document.querySelector(`#search`);t?.submit(),c.classList.remove(`open`)}),u.append(t)}l.append(u)}catch(e){console.error(`Error fetching autocomplete results:`,e)}},a=document.getElementById(`q`);e(a);let o;n(`input`,a,()=>{clearTimeout(o);let e=a.value,t=r.autocomplete_min??2;e.length{e===a.value&&await i(a,e)},300))});const s=document.querySelector(`.autocomplete`),c=document.querySelector(`.autocomplete ul`);c&&n(`keyup`,a,e=>{let t=[...c.children],n=t.findIndex(e=>e.classList.contains(`active`)),r=-1;switch(e.key){case`ArrowUp`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n-1+t.length)%t.length;break}case`ArrowDown`:{let e=t[n];e&&n>=0&&e.classList.remove(`active`),r=(n+1)%t.length;break}case`Tab`:case`Enter`:s&&s.classList.remove(`open`);break;default:break}if(r!==-1){let e=t[r];if(e&&(e.classList.add(`active`),!e.classList.contains(`no-item-found`))){let t=document.getElementById(`q`);t&&(t.value=e.textContent??``)}}}); +//# sourceMappingURL=autocomplete.min.js.map \ No newline at end of file diff --git a/searx/static/themes/simple/js/autocomplete.min.js.map b/searx/static/themes/simple/js/autocomplete.min.js.map new file mode 100644 index 000000000..8c4145497 --- /dev/null +++ b/searx/static/themes/simple/js/autocomplete.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"autocomplete.min.js","names":["qInput: HTMLInputElement","query: string","res: Response","timeoutId: number","autocomplete: HTMLElement | null","autocompleteList: HTMLUListElement | null","event: KeyboardEvent"],"sources":["../../../../../client/simple/src/js/main/autocomplete.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { assertElement, http, listen, settings } from \"../core/toolkit.ts\";\n\nconst fetchResults = async (qInput: HTMLInputElement, query: string): Promise => {\n try {\n let res: Response;\n\n if (settings.method === \"GET\") {\n res = await http(\"GET\", `./autocompleter?q=${query}`);\n } else {\n res = await http(\"POST\", \"./autocompleter\", { body: new URLSearchParams({ q: query }) });\n }\n\n const results = await res.json();\n\n const autocomplete = document.querySelector(\".autocomplete\");\n assertElement(autocomplete);\n\n const autocompleteList = document.querySelector(\".autocomplete ul\");\n assertElement(autocompleteList);\n\n autocomplete.classList.add(\"open\");\n autocompleteList.replaceChildren();\n\n // show an error message that no result was found\n if (results?.[1]?.length === 0) {\n const noItemFoundMessage = Object.assign(document.createElement(\"li\"), {\n className: \"no-item-found\",\n textContent: settings.translations?.no_item_found ?? \"No results found\"\n });\n autocompleteList.append(noItemFoundMessage);\n return;\n }\n\n const fragment = new DocumentFragment();\n\n for (const result of results[1]) {\n const li = Object.assign(document.createElement(\"li\"), { textContent: result });\n\n listen(\"mousedown\", li, () => {\n qInput.value = result;\n\n const form = document.querySelector(\"#search\");\n form?.submit();\n\n autocomplete.classList.remove(\"open\");\n });\n\n fragment.append(li);\n }\n\n autocompleteList.append(fragment);\n } catch (error) {\n console.error(\"Error fetching autocomplete results:\", error);\n }\n};\n\nconst qInput = document.getElementById(\"q\") as HTMLInputElement | null;\nassertElement(qInput);\n\nlet timeoutId: number;\n\nlisten(\"input\", qInput, () => {\n clearTimeout(timeoutId);\n\n const query = qInput.value;\n const minLength = settings.autocomplete_min ?? 2;\n\n if (query.length < minLength) return;\n\n timeoutId = window.setTimeout(async () => {\n if (query === qInput.value) {\n await fetchResults(qInput, query);\n }\n }, 300);\n});\n\nconst autocomplete: HTMLElement | null = document.querySelector(\".autocomplete\");\nconst autocompleteList: HTMLUListElement | null = document.querySelector(\".autocomplete ul\");\nif (autocompleteList) {\n listen(\"keyup\", qInput, (event: KeyboardEvent) => {\n const listItems = [...autocompleteList.children] as HTMLElement[];\n\n const currentIndex = listItems.findIndex((item) => item.classList.contains(\"active\"));\n let newCurrentIndex = -1;\n\n switch (event.key) {\n case \"ArrowUp\": {\n const currentItem = listItems[currentIndex];\n if (currentItem && currentIndex >= 0) {\n currentItem.classList.remove(\"active\");\n }\n // we need to add listItems.length to the index calculation here because the JavaScript modulos\n // operator doesn't work with negative numbers\n newCurrentIndex = (currentIndex - 1 + listItems.length) % listItems.length;\n break;\n }\n case \"ArrowDown\": {\n const currentItem = listItems[currentIndex];\n if (currentItem && currentIndex >= 0) {\n currentItem.classList.remove(\"active\");\n }\n newCurrentIndex = (currentIndex + 1) % listItems.length;\n break;\n }\n case \"Tab\":\n case \"Enter\":\n if (autocomplete) {\n autocomplete.classList.remove(\"open\");\n }\n break;\n default:\n break;\n }\n\n if (newCurrentIndex !== -1) {\n const selectedItem = listItems[newCurrentIndex];\n if (selectedItem) {\n selectedItem.classList.add(\"active\");\n\n if (!selectedItem.classList.contains(\"no-item-found\")) {\n const qInput = document.getElementById(\"q\") as HTMLInputElement | null;\n if (qInput) {\n qInput.value = selectedItem.textContent ?? \"\";\n }\n }\n }\n }\n });\n}\n"],"mappings":"+DAIA,MAAM,EAAe,MAAOA,EAA0BC,IAAiC,CACrF,GAAI,CACF,IAAIC,EAKF,EAHE,EAAS,SAAW,MAChB,MAAM,EAAK,MAAO,CAAC,kBAAkB,EAAE,GAAO,CAAC,CAE/C,MAAM,EAAK,OAAQ,kBAAmB,CAAE,KAAM,IAAI,gBAAgB,CAAE,EAAG,CAAO,EAAG,EAAC,CAG1F,IAAM,EAAU,MAAM,EAAI,MAAM,CAE1B,EAAe,SAAS,cAA2B,gBAAgB,CACzE,EAAc,EAAa,CAE3B,IAAM,EAAmB,SAAS,cAAgC,mBAAmB,CAOrF,GANA,EAAc,EAAiB,CAE/B,EAAa,UAAU,IAAI,OAAO,CAClC,EAAiB,iBAAiB,CAG9B,IAAU,IAAI,SAAW,EAAG,CAC9B,IAAM,EAAqB,OAAO,OAAO,SAAS,cAAc,KAAK,CAAE,CACrE,UAAW,gBACX,YAAa,EAAS,cAAc,eAAiB,kBACtD,EAAC,CACF,EAAiB,OAAO,EAAmB,CAC3C,MACD,CAED,IAAM,EAAW,IAAI,iBAErB,IAAK,IAAM,KAAU,EAAQ,GAAI,CAC/B,IAAM,EAAK,OAAO,OAAO,SAAS,cAAc,KAAK,CAAE,CAAE,YAAa,CAAQ,EAAC,CAE/E,EAAO,YAAa,EAAI,IAAM,CAC5B,EAAO,MAAQ,EAEf,IAAM,EAAO,SAAS,cAA+B,UAAU,CAC/D,GAAM,QAAQ,CAEd,EAAa,UAAU,OAAO,OAAO,AACtC,EAAC,CAEF,EAAS,OAAO,EAAG,AACpB,CAED,EAAiB,OAAO,EAAS,AAClC,OAAQ,EAAO,CACd,QAAQ,MAAM,uCAAwC,EAAM,AAC7D,CACF,EAEK,EAAS,SAAS,eAAe,IAAI,CAC3C,EAAc,EAAO,CAErB,IAAIC,EAEJ,EAAO,QAAS,EAAQ,IAAM,CAC5B,aAAa,EAAU,CAEvB,IAAM,EAAQ,EAAO,MACf,EAAY,EAAS,kBAAoB,EAE3C,EAAM,OAAS,IAEnB,EAAY,OAAO,WAAW,SAAY,CACpC,IAAU,EAAO,OACnB,MAAM,EAAa,EAAQ,EAAM,AAEpC,EAAE,IAAI,CACR,EAAC,CAEF,MAAMC,EAAmC,SAAS,cAA2B,gBAAgB,CACvFC,EAA4C,SAAS,cAAgC,mBAAmB,CAC1G,GACF,EAAO,QAAS,EAAQ,AAACC,GAAyB,CAChD,IAAM,EAAY,CAAC,GAAG,EAAiB,QAAS,EAE1C,EAAe,EAAU,UAAU,AAAC,GAAS,EAAK,UAAU,SAAS,SAAS,CAAC,CACjF,EAAkB,GAEtB,OAAQ,EAAM,IAAd,CACE,IAAK,UAAW,CACd,IAAM,EAAc,EAAU,GAC1B,GAAe,GAAgB,GACjC,EAAY,UAAU,OAAO,SAAS,CAIxC,GAAmB,EAAe,EAAI,EAAU,QAAU,EAAU,OACpE,KACD,CACD,IAAK,YAAa,CAChB,IAAM,EAAc,EAAU,GAC1B,GAAe,GAAgB,GACjC,EAAY,UAAU,OAAO,SAAS,CAExC,GAAmB,EAAe,GAAK,EAAU,OACjD,KACD,CACD,IAAK,MACL,IAAK,QACC,GACF,EAAa,UAAU,OAAO,OAAO,CAEvC,MACF,QACE,KACH,CAED,GAAI,IAAoB,GAAI,CAC1B,IAAM,EAAe,EAAU,GAC/B,GAAI,IACF,EAAa,UAAU,IAAI,SAAS,CAEhC,CAAC,EAAa,UAAU,SAAS,gBAAgB,EAAE,CACrD,IAAM,EAAS,SAAS,eAAe,IAAI,CACvC,IACF,EAAO,MAAQ,EAAa,aAAe,GAE9C,CAEJ,CACF,EAAC"} \ No newline at end of file diff --git a/searx/static/themes/simple/js/infinite_scroll.min.js b/searx/static/themes/simple/js/infinite_scroll.min.js new file mode 100644 index 000000000..d9e7547e9 --- /dev/null +++ b/searx/static/themes/simple/js/infinite_scroll.min.js @@ -0,0 +1,2 @@ +import{c as e,d as t,g as n}from"./searxng.core.min.js";const r=()=>Object.assign(document.createElement(`div`),{className:`loader`}),i=async(i,a)=>{let o=document.querySelector(`#search`);e(o);let s=document.querySelector(`#pagination form.next_page`);e(s);let c=o.getAttribute(`action`);if(!c)throw Error(`Form action not defined`);let l=document.querySelector(`#pagination`);e(l),l.replaceChildren(r());try{let e=await t(`POST`,c,{body:new FormData(s)}),n=await e.text();if(!n)return;let r=new DOMParser().parseFromString(n,`text/html`),o=r.querySelectorAll(`#urls article`),l=r.querySelector(`#pagination`);document.querySelector(`#pagination`)?.remove();let u=document.querySelector(`#urls`);if(!u)throw Error(`URLs element not found`);if(o.length>0&&!i&&u.appendChild(document.createElement(`hr`)),u.append(...Array.from(o)),l){let e=document.querySelector(`#results`);e?.appendChild(l),a()}}catch(e){console.error(`Error loading next page:`,e);let t=Object.assign(document.createElement(`div`),{textContent:n.translations?.error_loading_next_page??`Error loading next page`,className:`dialog-error`});t.setAttribute(`role`,`alert`),document.querySelector(`#pagination`)?.replaceChildren(t)}},a=document.getElementById(`results`);if(!a)throw Error(`Results element not found`);const o=a.classList.contains(`only_template_images`),s=`article.result:last-child`,c={rootMargin:`320px`},l=new IntersectionObserver(e=>{let[t]=e;t?.isIntersecting&&(l.unobserve(t.target),i(o,()=>{let e=document.querySelector(s);e&&l.observe(e)}).then(()=>{}))},c),u=document.querySelector(s);u&&l.observe(u); +//# sourceMappingURL=infinite_scroll.min.js.map \ No newline at end of file diff --git a/searx/static/themes/simple/js/infinite_scroll.min.js.map b/searx/static/themes/simple/js/infinite_scroll.min.js.map new file mode 100644 index 000000000..50800dc86 --- /dev/null +++ b/searx/static/themes/simple/js/infinite_scroll.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"infinite_scroll.min.js","names":["onlyImages: boolean","callback: () => void","resultsElement: HTMLElement | null","intersectionObserveOptions: IntersectionObserverInit","observer: IntersectionObserver","entries: IntersectionObserverEntry[]","initialObservedElement: HTMLElement | null"],"sources":["../../../../../client/simple/src/js/main/infinite_scroll.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { assertElement, http, settings } from \"../core/toolkit.ts\";\n\nconst newLoadSpinner = (): HTMLDivElement => {\n return Object.assign(document.createElement(\"div\"), {\n className: \"loader\"\n });\n};\n\nconst loadNextPage = async (onlyImages: boolean, callback: () => void): Promise => {\n const searchForm = document.querySelector(\"#search\");\n assertElement(searchForm);\n\n const form = document.querySelector(\"#pagination form.next_page\");\n assertElement(form);\n\n const action = searchForm.getAttribute(\"action\");\n if (!action) {\n throw new Error(\"Form action not defined\");\n }\n\n const paginationElement = document.querySelector(\"#pagination\");\n assertElement(paginationElement);\n\n paginationElement.replaceChildren(newLoadSpinner());\n\n try {\n const res = await http(\"POST\", action, { body: new FormData(form) });\n const nextPage = await res.text();\n if (!nextPage) return;\n\n const nextPageDoc = new DOMParser().parseFromString(nextPage, \"text/html\");\n const articleList = nextPageDoc.querySelectorAll(\"#urls article\");\n const nextPaginationElement = nextPageDoc.querySelector(\"#pagination\");\n\n document.querySelector(\"#pagination\")?.remove();\n\n const urlsElement = document.querySelector(\"#urls\");\n if (!urlsElement) {\n throw new Error(\"URLs element not found\");\n }\n\n if (articleList.length > 0 && !onlyImages) {\n // do not add
element when there are only images\n urlsElement.appendChild(document.createElement(\"hr\"));\n }\n\n urlsElement.append(...Array.from(articleList));\n\n if (nextPaginationElement) {\n const results = document.querySelector(\"#results\");\n results?.appendChild(nextPaginationElement);\n callback();\n }\n } catch (error) {\n console.error(\"Error loading next page:\", error);\n\n const errorElement = Object.assign(document.createElement(\"div\"), {\n textContent: settings.translations?.error_loading_next_page ?? \"Error loading next page\",\n className: \"dialog-error\"\n });\n errorElement.setAttribute(\"role\", \"alert\");\n document.querySelector(\"#pagination\")?.replaceChildren(errorElement);\n }\n};\n\nconst resultsElement: HTMLElement | null = document.getElementById(\"results\");\nif (!resultsElement) {\n throw new Error(\"Results element not found\");\n}\n\nconst onlyImages: boolean = resultsElement.classList.contains(\"only_template_images\");\nconst observedSelector = \"article.result:last-child\";\n\nconst intersectionObserveOptions: IntersectionObserverInit = {\n rootMargin: \"320px\"\n};\n\nconst observer: IntersectionObserver = new IntersectionObserver((entries: IntersectionObserverEntry[]) => {\n const [paginationEntry] = entries;\n\n if (paginationEntry?.isIntersecting) {\n observer.unobserve(paginationEntry.target);\n\n loadNextPage(onlyImages, () => {\n const nextObservedElement = document.querySelector(observedSelector);\n if (nextObservedElement) {\n observer.observe(nextObservedElement);\n }\n }).then(() => {\n // wait until promise is resolved\n });\n }\n}, intersectionObserveOptions);\n\nconst initialObservedElement: HTMLElement | null = document.querySelector(observedSelector);\nif (initialObservedElement) {\n observer.observe(initialObservedElement);\n}\n"],"mappings":"wDAIA,MAAM,EAAiB,IACd,OAAO,OAAO,SAAS,cAAc,MAAM,CAAE,CAClD,UAAW,QACZ,EAAC,CAGE,EAAe,MAAOA,EAAqBC,IAAwC,CACvF,IAAM,EAAa,SAAS,cAA+B,UAAU,CACrE,EAAc,EAAW,CAEzB,IAAM,EAAO,SAAS,cAA+B,6BAA6B,CAClF,EAAc,EAAK,CAEnB,IAAM,EAAS,EAAW,aAAa,SAAS,CAChD,GAAI,CAAC,EACH,MAAU,MAAM,0BAAA,CAGlB,IAAM,EAAoB,SAAS,cAA2B,cAAc,CAC5E,EAAc,EAAkB,CAEhC,EAAkB,gBAAgB,GAAgB,CAAC,CAEnD,GAAI,CACF,IAAM,EAAM,MAAM,EAAK,OAAQ,EAAQ,CAAE,KAAM,IAAI,SAAS,EAAO,EAAC,CAC9D,EAAW,MAAM,EAAI,MAAM,CACjC,GAAI,CAAC,EAAU,OAEf,IAAM,EAAc,IAAI,YAAY,gBAAgB,EAAU,YAAY,CACpE,EAAc,EAAY,iBAA8B,gBAAgB,CACxE,EAAwB,EAAY,cAA2B,cAAc,CAEnF,SAAS,cAAc,cAAc,EAAE,QAAQ,CAE/C,IAAM,EAAc,SAAS,cAA2B,QAAQ,CAChE,GAAI,CAAC,EACH,MAAU,MAAM,yBAAA,CAUlB,GAPI,EAAY,OAAS,GAAK,CAAC,GAE7B,EAAY,YAAY,SAAS,cAAc,KAAK,CAAC,CAGvD,EAAY,OAAO,GAAG,MAAM,KAAK,EAAY,CAAC,CAE1C,EAAuB,CACzB,IAAM,EAAU,SAAS,cAA2B,WAAW,CAC/D,GAAS,YAAY,EAAsB,CAC3C,GAAU,AACX,CACF,OAAQ,EAAO,CACd,QAAQ,MAAM,2BAA4B,EAAM,CAEhD,IAAM,EAAe,OAAO,OAAO,SAAS,cAAc,MAAM,CAAE,CAChE,YAAa,EAAS,cAAc,yBAA2B,0BAC/D,UAAW,cACZ,EAAC,CACF,EAAa,aAAa,OAAQ,QAAQ,CAC1C,SAAS,cAAc,cAAc,EAAE,gBAAgB,EAAa,AACrE,CACF,EAEKC,EAAqC,SAAS,eAAe,UAAU,CAC7E,GAAI,CAAC,EACH,MAAU,MAAM,4BAAA,CAGlB,MAAMF,EAAsB,EAAe,UAAU,SAAS,uBAAuB,CAC/E,EAAmB,4BAEnBG,EAAuD,CAC3D,WAAY,OACb,EAEKC,EAAiC,IAAI,qBAAqB,AAACC,GAAyC,CACxG,GAAM,CAAC,EAAgB,CAAG,EAEtB,GAAiB,iBACnB,EAAS,UAAU,EAAgB,OAAO,CAE1C,EAAa,EAAY,IAAM,CAC7B,IAAM,EAAsB,SAAS,cAA2B,EAAiB,CAC7E,GACF,EAAS,QAAQ,EAAoB,AAExC,EAAC,CAAC,KAAK,IAAM,CAEb,EAAC,CAEL,EAAE,GAEGC,EAA6C,SAAS,cAA2B,EAAiB,CACpG,GACF,EAAS,QAAQ,EAAuB"} \ No newline at end of file diff --git a/searx/static/themes/simple/js/keyboard.min.js b/searx/static/themes/simple/js/keyboard.min.js new file mode 100644 index 000000000..dfb62f632 --- /dev/null +++ b/searx/static/themes/simple/js/keyboard.min.js @@ -0,0 +1,2 @@ +import{c as e,e as t,f as n,g as r}from"./searxng.core.min.js";const i={Escape:{key:`ESC`,fun:e=>f(e),des:`remove focus from the focused input`,cat:`Control`},c:{key:`c`,fun:()=>S(),des:`copy url of the selected result to the clipboard`,cat:`Results`},h:{key:`h`,fun:()=>x(o),des:`toggle help window`,cat:`Other`},i:{key:`i`,fun:()=>v(),des:`focus on the search input`,cat:`Control`},n:{key:`n`,fun:()=>m(),des:`go to next page`,cat:`Results`},o:{key:`o`,fun:()=>y(!1),des:`open search result`,cat:`Results`},p:{key:`p`,fun:()=>h(),des:`go to previous page`,cat:`Results`},r:{key:`r`,fun:()=>d(),des:`reload page from the server`,cat:`Control`},t:{key:`t`,fun:()=>y(!0),des:`open the result in a new tab`,cat:`Results`}},a={default:{ArrowLeft:{key:`←`,fun:()=>u(`up`)(),des:`select previous search result`,cat:`Results`},ArrowRight:{key:`→`,fun:()=>u(`down`)(),des:`select next search result`,cat:`Results`},...i},vim:{b:{key:`b`,fun:()=>g(-window.innerHeight),des:`scroll one page up`,cat:`Navigation`},d:{key:`d`,fun:()=>g(window.innerHeight/2),des:`scroll half a page down`,cat:`Navigation`},f:{key:`f`,fun:()=>g(window.innerHeight),des:`scroll one page down`,cat:`Navigation`},g:{key:`g`,fun:()=>_(-document.body.scrollHeight,`top`),des:`scroll to the top of the page`,cat:`Navigation`},j:{key:`j`,fun:()=>u(`down`)(),des:`select next search result`,cat:`Results`},k:{key:`k`,fun:()=>u(`up`)(),des:`select previous search result`,cat:`Results`},u:{key:`u`,fun:()=>g(-window.innerHeight/2),des:`scroll half a page up`,cat:`Navigation`},v:{key:`v`,fun:()=>_(document.body.scrollHeight,`bottom`),des:`scroll to the bottom of the page`,cat:`Navigation`},y:{key:`y`,fun:()=>S(),des:`copy url of the selected result to the clipboard`,cat:`Results`},...i}},o=r.hotkeys&&r.hotkeys in a?a[r.hotkeys]:a.default,s=e=>{let t=e?.closest(`.detail, .result`);return t?.classList.contains(`detail`)??!1},c=e=>e?.closest(`.result`)??void 0,l=e=>e?.classList.contains(`result-images`)??!1,u=e=>(t,r)=>{let i=e,a=document.querySelector(`.result[data-vim-selected]`);if(!a){if(a=document.querySelector(`.result`),!a)return;(e===`down`||e===`up`)&&(i=a)}let o=Array.from(document.querySelectorAll(`.result`)),s;if(typeof i!=`string`)s=i;else switch(i){case`visible`:{let e=document.documentElement.scrollTop||document.body.scrollTop,t=e+document.documentElement.clientHeight;for(let n of o){let r=n.offsetTop,i=r+n.clientHeight;if(i<=t&&r>e){s=n;break}}break}case`down`:s=o[o.indexOf(a)+1]||a;break;case`up`:s=o[o.indexOf(a)-1]||a;break;case`bottom`:s=o.at(-1);break;case`top`:default:s=o[0]}if(s){if(a.removeAttribute(`data-vim-selected`),s.setAttribute(`data-vim-selected`,`true`),!r){let e=s.querySelector(`h3 a`)||s.querySelector(`a`);e?.focus()}t||n.scrollPageToSelected?.()}},d=()=>{document.location.reload()},f=e=>{let t=e.target,r=t?.tagName?.toLowerCase();document.activeElement&&(r===`input`||r===`select`||r===`textarea`)?document.activeElement.blur():n.closeDetail?.()},p=e=>{let t=document.querySelector(e);t&&t.click()},m=()=>{p(`nav#pagination .next_page button[type="submit"]`)},h=()=>{p(`nav#pagination .previous_page button[type="submit"]`)};n.scrollPageToSelected=()=>{let e=document.querySelector(`.result[data-vim-selected]`);if(!e)return;let t=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.clientHeight,r=e.offsetTop,i=r+e.clientHeight,a=120;if(!e.previousElementSibling&&ir-a)window.scroll(window.scrollX,r-a);else{let e=t+n;e{window.scrollBy(0,e),u(`visible`)()},_=(e,t)=>{window.scrollTo(0,e),u(t)()},v=()=>{window.scrollTo(0,0);let e=document.querySelector(`#q`);if(e&&(e.focus(),e.setSelectionRange)){let t=e.value.length;e.setSelectionRange(t,t)}},y=e=>{let t=document.querySelector(`.result[data-vim-selected] h3 a`);if(t||=document.querySelector(`.result[data-vim-selected] > a`),!t)return;let n=t.getAttribute(`href`);n&&(e?window.open(n):window.location.href=n)},b=(e,t)=>{let n={};for(let e of Object.values(t)){let t=e.cat;n[t]??=[],n[t].push(e)}let r=Object.keys(n).sort((e,t)=>(n[t]?.length??0)-(n[e]?.length??0)),i=`×`;i+=`

How to navigate SearXNG with hotkeys

`,i+=``;for(let[e,t]of r.entries()){let a=n[t];if(!a||a.length===0)continue;let o=e%2==0,s=e===r.length-1;o&&(i+=``),i+=``,(!o||s)&&(i+=``)}i+=`
`,i+=`

${t}

`,i+=`
    `;for(let e of a)i+=`
  • ${e.key} ${e.des}
  • `;i+=`
`,i+=`
`,e.innerHTML=i},x=e=>{let t=document.querySelector(`#vim-hotkeys-help`);if(t)t.classList.toggle(`invisible`);else{t=Object.assign(document.createElement(`div`),{id:`vim-hotkeys-help`,className:`dialog-modal`}),b(t,e);let n=document.getElementsByTagName(`body`)[0];n&&n.appendChild(t)}},S=async()=>{let t=document.querySelector(`.result[data-vim-selected] h3 a`);e(t);let n=t.getAttribute(`href`);n&&await navigator.clipboard.writeText(n)};t(`click`,`.result`,function(e){if(!s(e.target)){u(this)(!0,!0);let t=c(e.target);t&&l(t)&&(e.preventDefault(),n.selectImage?.(t))}}),t(`focus`,`.result a`,e=>{if(!s(e.target)){let t=c(e.target);t&&!t.hasAttribute(`data-vim-selected`)&&u(t)(!0),t&&l(t)&&(e.preventDefault(),n.selectImage?.(t))}},{capture:!0}),t(`keydown`,document,e=>{if(Object.hasOwn(o,e.key)&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey){let t=e.target?.tagName?.toLowerCase();e.key===`Escape`?o[e.key]?.fun(e):(e.target===document.body||t===`a`||t===`button`)&&(e.preventDefault(),o[e.key]?.fun(e))}}),n.selectNext=u(`down`),n.selectPrevious=u(`up`); +//# sourceMappingURL=keyboard.min.js.map \ No newline at end of file diff --git a/searx/static/themes/simple/js/keyboard.min.js.map b/searx/static/themes/simple/js/keyboard.min.js.map new file mode 100644 index 000000000..6012b6d3a --- /dev/null +++ b/searx/static/themes/simple/js/keyboard.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyboard.min.js","names":["baseKeyBinding: Record","event: KeyboardEvent","keyBindingLayouts: Record>","keyBindings: Record","element?: HTMLElement","resultElement?: HTMLElement","which: HighlightResultElement | HTMLElement","noScroll?: boolean","keepFocus?: boolean","next: HTMLElement | undefined","css_selector: string","amount: number","position: number","nav: HighlightResultElement","newTab: boolean","divElement: HTMLElement","keyBindings: typeof baseKeyBinding","categories: Record","event: PointerEvent","event: FocusEvent"],"sources":["../../../../../client/simple/src/js/main/keyboard.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { assertElement, listen, mutable, settings } from \"../core/toolkit.ts\";\n\nexport type KeyBindingLayout = \"default\" | \"vim\";\n\ntype KeyBinding = {\n key: string;\n fun: (event: KeyboardEvent) => void;\n des: string;\n cat: string;\n};\n\ntype HighlightResultElement = \"down\" | \"up\" | \"visible\" | \"bottom\" | \"top\";\n\n/* common base for layouts */\nconst baseKeyBinding: Record = {\n Escape: {\n key: \"ESC\",\n fun: (event: KeyboardEvent) => removeFocus(event),\n des: \"remove focus from the focused input\",\n cat: \"Control\"\n },\n c: {\n key: \"c\",\n fun: () => copyURLToClipboard(),\n des: \"copy url of the selected result to the clipboard\",\n cat: \"Results\"\n },\n h: {\n key: \"h\",\n fun: () => toggleHelp(keyBindings),\n des: \"toggle help window\",\n cat: \"Other\"\n },\n i: {\n key: \"i\",\n fun: () => searchInputFocus(),\n des: \"focus on the search input\",\n cat: \"Control\"\n },\n n: {\n key: \"n\",\n fun: () => GoToNextPage(),\n des: \"go to next page\",\n cat: \"Results\"\n },\n o: {\n key: \"o\",\n fun: () => openResult(false),\n des: \"open search result\",\n cat: \"Results\"\n },\n p: {\n key: \"p\",\n fun: () => GoToPreviousPage(),\n des: \"go to previous page\",\n cat: \"Results\"\n },\n r: {\n key: \"r\",\n fun: () => reloadPage(),\n des: \"reload page from the server\",\n cat: \"Control\"\n },\n t: {\n key: \"t\",\n fun: () => openResult(true),\n des: \"open the result in a new tab\",\n cat: \"Results\"\n }\n};\n\nconst keyBindingLayouts: Record> = {\n // SearXNG layout\n default: {\n ArrowLeft: {\n key: \"←\",\n fun: () => highlightResult(\"up\")(),\n des: \"select previous search result\",\n cat: \"Results\"\n },\n ArrowRight: {\n key: \"→\",\n fun: () => highlightResult(\"down\")(),\n des: \"select next search result\",\n cat: \"Results\"\n },\n ...baseKeyBinding\n },\n\n // Vim-like keyboard layout\n vim: {\n b: {\n key: \"b\",\n fun: () => scrollPage(-window.innerHeight),\n des: \"scroll one page up\",\n cat: \"Navigation\"\n },\n d: {\n key: \"d\",\n fun: () => scrollPage(window.innerHeight / 2),\n des: \"scroll half a page down\",\n cat: \"Navigation\"\n },\n f: {\n key: \"f\",\n fun: () => scrollPage(window.innerHeight),\n des: \"scroll one page down\",\n cat: \"Navigation\"\n },\n g: {\n key: \"g\",\n fun: () => scrollPageTo(-document.body.scrollHeight, \"top\"),\n des: \"scroll to the top of the page\",\n cat: \"Navigation\"\n },\n j: {\n key: \"j\",\n fun: () => highlightResult(\"down\")(),\n des: \"select next search result\",\n cat: \"Results\"\n },\n k: {\n key: \"k\",\n fun: () => highlightResult(\"up\")(),\n des: \"select previous search result\",\n cat: \"Results\"\n },\n u: {\n key: \"u\",\n fun: () => scrollPage(-window.innerHeight / 2),\n des: \"scroll half a page up\",\n cat: \"Navigation\"\n },\n v: {\n key: \"v\",\n fun: () => scrollPageTo(document.body.scrollHeight, \"bottom\"),\n des: \"scroll to the bottom of the page\",\n cat: \"Navigation\"\n },\n y: {\n key: \"y\",\n fun: () => copyURLToClipboard(),\n des: \"copy url of the selected result to the clipboard\",\n cat: \"Results\"\n },\n ...baseKeyBinding\n }\n};\n\nconst keyBindings: Record =\n settings.hotkeys && settings.hotkeys in keyBindingLayouts\n ? keyBindingLayouts[settings.hotkeys]\n : keyBindingLayouts.default;\n\nconst isElementInDetail = (element?: HTMLElement): boolean => {\n const ancestor = element?.closest(\".detail, .result\");\n return ancestor?.classList.contains(\"detail\") ?? false;\n};\n\nconst getResultElement = (element?: HTMLElement): HTMLElement | undefined => {\n return element?.closest(\".result\") ?? undefined;\n};\n\nconst isImageResult = (resultElement?: HTMLElement): boolean => {\n return resultElement?.classList.contains(\"result-images\") ?? false;\n};\n\nconst highlightResult =\n (which: HighlightResultElement | HTMLElement) =>\n (noScroll?: boolean, keepFocus?: boolean): void => {\n let effectiveWhich = which;\n let current = document.querySelector(\".result[data-vim-selected]\");\n if (!current) {\n // no selection : choose the first one\n current = document.querySelector(\".result\");\n if (!current) {\n // no first one : there are no results\n return;\n }\n // replace up/down actions by selecting first one\n if (which === \"down\" || which === \"up\") {\n effectiveWhich = current;\n }\n }\n\n const results = Array.from(document.querySelectorAll(\".result\"));\n\n let next: HTMLElement | undefined;\n\n if (typeof effectiveWhich !== \"string\") {\n next = effectiveWhich;\n } else {\n switch (effectiveWhich) {\n case \"visible\": {\n const top = document.documentElement.scrollTop || document.body.scrollTop;\n const bot = top + document.documentElement.clientHeight;\n\n for (const element of results) {\n const etop = element.offsetTop;\n const ebot = etop + element.clientHeight;\n if (ebot <= bot && etop > top) {\n next = element;\n break;\n }\n }\n break;\n }\n case \"down\":\n next = results[results.indexOf(current) + 1] || current;\n break;\n case \"up\":\n next = results[results.indexOf(current) - 1] || current;\n break;\n case \"bottom\":\n next = results.at(-1);\n break;\n // biome-ignore lint/complexity/noUselessSwitchCase: fallthrough is intended\n case \"top\":\n default:\n next = results[0];\n }\n }\n\n if (next) {\n current.removeAttribute(\"data-vim-selected\");\n next.setAttribute(\"data-vim-selected\", \"true\");\n\n if (!keepFocus) {\n const link = next.querySelector(\"h3 a\") || next.querySelector(\"a\");\n link?.focus();\n }\n\n if (!noScroll) {\n mutable.scrollPageToSelected?.();\n }\n }\n };\n\nconst reloadPage = (): void => {\n document.location.reload();\n};\n\nconst removeFocus = (event: KeyboardEvent): void => {\n const target = event.target as HTMLElement;\n const tagName = target?.tagName?.toLowerCase();\n\n if (document.activeElement && (tagName === \"input\" || tagName === \"select\" || tagName === \"textarea\")) {\n (document.activeElement as HTMLElement).blur();\n } else {\n mutable.closeDetail?.();\n }\n};\n\nconst pageButtonClick = (css_selector: string): void => {\n const button = document.querySelector(css_selector);\n if (button) {\n button.click();\n }\n};\n\nconst GoToNextPage = (): void => {\n pageButtonClick('nav#pagination .next_page button[type=\"submit\"]');\n};\n\nconst GoToPreviousPage = (): void => {\n pageButtonClick('nav#pagination .previous_page button[type=\"submit\"]');\n};\n\nmutable.scrollPageToSelected = (): void => {\n const sel = document.querySelector(\".result[data-vim-selected]\");\n if (!sel) return;\n\n const wtop = document.documentElement.scrollTop || document.body.scrollTop;\n const height = document.documentElement.clientHeight;\n const etop = sel.offsetTop;\n const ebot = etop + sel.clientHeight;\n const offset = 120;\n\n // first element ?\n if (!sel.previousElementSibling && ebot < height) {\n // set to the top of page if the first element\n // is fully included in the viewport\n window.scroll(window.scrollX, 0);\n return;\n }\n\n if (wtop > etop - offset) {\n window.scroll(window.scrollX, etop - offset);\n } else {\n const wbot = wtop + height;\n if (wbot < ebot + offset) {\n window.scroll(window.scrollX, ebot - height + offset);\n }\n }\n};\n\nconst scrollPage = (amount: number): void => {\n window.scrollBy(0, amount);\n highlightResult(\"visible\")();\n};\n\nconst scrollPageTo = (position: number, nav: HighlightResultElement): void => {\n window.scrollTo(0, position);\n highlightResult(nav)();\n};\n\nconst searchInputFocus = (): void => {\n window.scrollTo(0, 0);\n\n const q = document.querySelector(\"#q\");\n if (q) {\n q.focus();\n\n if (q.setSelectionRange) {\n const len = q.value.length;\n\n q.setSelectionRange(len, len);\n }\n }\n};\n\nconst openResult = (newTab: boolean): void => {\n let link = document.querySelector(\".result[data-vim-selected] h3 a\");\n if (!link) {\n link = document.querySelector(\".result[data-vim-selected] > a\");\n }\n if (!link) return;\n\n const url = link.getAttribute(\"href\");\n if (url) {\n if (newTab) {\n window.open(url);\n } else {\n window.location.href = url;\n }\n }\n};\n\nconst initHelpContent = (divElement: HTMLElement, keyBindings: typeof baseKeyBinding): void => {\n const categories: Record = {};\n\n for (const binding of Object.values(keyBindings)) {\n const cat = binding.cat;\n categories[cat] ??= [];\n categories[cat].push(binding);\n }\n\n const sortedCategoryKeys = Object.keys(categories).sort(\n (a, b) => (categories[b]?.length ?? 0) - (categories[a]?.length ?? 0)\n );\n\n let html = '×';\n html += \"

How to navigate SearXNG with hotkeys

\";\n html += \"\";\n\n for (const [i, categoryKey] of sortedCategoryKeys.entries()) {\n const bindings = categories[categoryKey];\n if (!bindings || bindings.length === 0) continue;\n\n const isFirst = i % 2 === 0;\n const isLast = i === sortedCategoryKeys.length - 1;\n\n if (isFirst) {\n html += \"\";\n }\n\n html += \"\";\n\n if (!isFirst || isLast) {\n html += \"\";\n }\n }\n\n html += \"
\";\n html += `

${categoryKey}

`;\n html += '
    ';\n\n for (const binding of bindings) {\n html += `
  • ${binding.key} ${binding.des}
  • `;\n }\n\n html += \"
\";\n html += \"
\";\n\n divElement.innerHTML = html;\n};\n\nconst toggleHelp = (keyBindings: typeof baseKeyBinding): void => {\n let helpPanel = document.querySelector(\"#vim-hotkeys-help\");\n if (helpPanel) {\n // toggle hidden\n helpPanel.classList.toggle(\"invisible\");\n } else {\n // first call\n helpPanel = Object.assign(document.createElement(\"div\"), {\n id: \"vim-hotkeys-help\",\n className: \"dialog-modal\"\n });\n initHelpContent(helpPanel, keyBindings);\n const body = document.getElementsByTagName(\"body\")[0];\n if (body) {\n body.appendChild(helpPanel);\n }\n }\n};\n\nconst copyURLToClipboard = async (): Promise => {\n const currentUrlElement = document.querySelector(\".result[data-vim-selected] h3 a\");\n assertElement(currentUrlElement);\n\n const url = currentUrlElement.getAttribute(\"href\");\n if (url) {\n await navigator.clipboard.writeText(url);\n }\n};\n\nlisten(\"click\", \".result\", function (this: HTMLElement, event: PointerEvent) {\n if (!isElementInDetail(event.target as HTMLElement)) {\n highlightResult(this)(true, true);\n\n const resultElement = getResultElement(event.target as HTMLElement);\n\n if (resultElement && isImageResult(resultElement)) {\n event.preventDefault();\n mutable.selectImage?.(resultElement);\n }\n }\n});\n\n// FIXME: Focus might also trigger Pointer event ^^^\nlisten(\n \"focus\",\n \".result a\",\n (event: FocusEvent) => {\n if (!isElementInDetail(event.target as HTMLElement)) {\n const resultElement = getResultElement(event.target as HTMLElement);\n\n if (resultElement && !resultElement.hasAttribute(\"data-vim-selected\")) {\n highlightResult(resultElement)(true);\n }\n\n if (resultElement && isImageResult(resultElement)) {\n event.preventDefault();\n mutable.selectImage?.(resultElement);\n }\n }\n },\n { capture: true }\n);\n\nlisten(\"keydown\", document, (event: KeyboardEvent) => {\n // check for modifiers so we don't break browser's hotkeys\n if (Object.hasOwn(keyBindings, event.key) && !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey) {\n const tagName = (event.target as HTMLElement)?.tagName?.toLowerCase();\n\n if (event.key === \"Escape\") {\n keyBindings[event.key]?.fun(event);\n } else if (event.target === document.body || tagName === \"a\" || tagName === \"button\") {\n event.preventDefault();\n keyBindings[event.key]?.fun(event);\n }\n }\n});\n\nmutable.selectNext = highlightResult(\"down\");\nmutable.selectPrevious = highlightResult(\"up\");\n"],"mappings":"+DAgBA,MAAMA,EAA6C,CACjD,OAAQ,CACN,IAAK,MACL,IAAK,AAACC,GAAyB,EAAY,EAAM,CACjD,IAAK,sCACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,GAAoB,CAC/B,IAAK,mDACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,EAAY,CAClC,IAAK,qBACL,IAAK,OACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,GAAkB,CAC7B,IAAK,4BACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,GAAc,CACzB,IAAK,kBACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,GAAM,CAC5B,IAAK,qBACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,GAAkB,CAC7B,IAAK,sBACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,GAAY,CACvB,IAAK,8BACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,GAAK,CAC3B,IAAK,+BACL,IAAK,SACN,CACF,EAEKC,EAA0E,CAE9E,QAAS,CACP,UAAW,CACT,IAAK,IACL,IAAK,IAAM,EAAgB,KAAK,EAAE,CAClC,IAAK,gCACL,IAAK,SACN,EACD,WAAY,CACV,IAAK,IACL,IAAK,IAAM,EAAgB,OAAO,EAAE,CACpC,IAAK,4BACL,IAAK,SACN,EACD,GAAG,CACJ,EAGD,IAAK,CACH,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,CAAC,OAAO,YAAY,CAC1C,IAAK,qBACL,IAAK,YACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,OAAO,YAAc,EAAE,CAC7C,IAAK,0BACL,IAAK,YACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,OAAO,YAAY,CACzC,IAAK,uBACL,IAAK,YACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAa,CAAC,SAAS,KAAK,aAAc,MAAM,CAC3D,IAAK,gCACL,IAAK,YACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAgB,OAAO,EAAE,CACpC,IAAK,4BACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAgB,KAAK,EAAE,CAClC,IAAK,gCACL,IAAK,SACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAW,CAAC,OAAO,YAAc,EAAE,CAC9C,IAAK,wBACL,IAAK,YACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,EAAa,SAAS,KAAK,aAAc,SAAS,CAC7D,IAAK,mCACL,IAAK,YACN,EACD,EAAG,CACD,IAAK,IACL,IAAK,IAAM,GAAoB,CAC/B,IAAK,mDACL,IAAK,SACN,EACD,GAAG,CACJ,CACF,EAEKC,EACJ,EAAS,SAAW,EAAS,WAAW,EACpC,EAAkB,EAAS,SAC3B,EAAkB,QAElB,EAAoB,AAACC,GAAmC,CAC5D,IAAM,EAAW,GAAS,QAAQ,mBAAmB,CACrD,OAAO,GAAU,UAAU,SAAS,SAAS,EAAI,EAClD,EAEK,EAAmB,AAACA,GACjB,GAAS,QAAQ,UAAU,EAAI,IAAA,GAGlC,EAAgB,AAACC,GACd,GAAe,UAAU,SAAS,gBAAgB,EAAI,GAGzD,EACJ,AAACC,GACD,CAACC,EAAoBC,IAA8B,CACjD,IAAI,EAAiB,EACjB,EAAU,SAAS,cAA2B,6BAA6B,CAC/E,GAAI,CAAC,EAAS,CAGZ,GADA,EAAU,SAAS,cAA2B,UAAU,CACpD,CAAC,EAEH,QAGE,IAAU,QAAU,IAAU,QAChC,EAAiB,EAEpB,CAED,IAAM,EAAU,MAAM,KAAK,SAAS,iBAA8B,UAAU,CAAC,CAEzEC,EAEJ,GAAI,OAAO,GAAmB,SAC5B,EAAO,OAEP,OAAQ,EAAR,CACE,IAAK,UAAW,CACd,IAAM,EAAM,SAAS,gBAAgB,WAAa,SAAS,KAAK,UAC1D,EAAM,EAAM,SAAS,gBAAgB,aAE3C,IAAK,IAAM,KAAW,EAAS,CAC7B,IAAM,EAAO,EAAQ,UACf,EAAO,EAAO,EAAQ,aAC5B,GAAI,GAAQ,GAAO,EAAO,EAAK,CAC7B,EAAO,EACP,KACD,CACF,CACD,KACD,CACD,IAAK,OACH,EAAO,EAAQ,EAAQ,QAAQ,EAAQ,CAAG,IAAM,EAChD,MACF,IAAK,KACH,EAAO,EAAQ,EAAQ,QAAQ,EAAQ,CAAG,IAAM,EAChD,MACF,IAAK,SACH,EAAO,EAAQ,GAAG,GAAG,CACrB,MAEF,IAAK,MACL,QACE,EAAO,EAAQ,EAClB,CAGH,GAAI,EAAM,CAIR,GAHA,EAAQ,gBAAgB,oBAAoB,CAC5C,EAAK,aAAa,oBAAqB,OAAO,CAE1C,CAAC,EAAW,CACd,IAAM,EAAO,EAAK,cAAiC,OAAO,EAAI,EAAK,cAAiC,IAAI,CACxG,GAAM,OAAO,AACd,CAEI,GACH,EAAQ,wBAAwB,AAEnC,CACF,EAEG,EAAa,IAAY,CAC7B,SAAS,SAAS,QAAQ,AAC3B,EAEK,EAAc,AAACR,GAA+B,CAClD,IAAM,EAAS,EAAM,OACf,EAAU,GAAQ,SAAS,aAAa,CAE1C,SAAS,gBAAkB,IAAY,SAAW,IAAY,UAAY,IAAY,YACvF,SAAS,cAA8B,MAAM,CAE9C,EAAQ,eAAe,AAE1B,EAEK,EAAkB,AAACS,GAA+B,CACtD,IAAM,EAAS,SAAS,cAAiC,EAAa,CAClE,GACF,EAAO,OAAO,AAEjB,EAEK,EAAe,IAAY,CAC/B,EAAgB,kDAAkD,AACnE,EAEK,EAAmB,IAAY,CACnC,EAAgB,sDAAsD,AACvE,EAED,EAAQ,qBAAuB,IAAY,CACzC,IAAM,EAAM,SAAS,cAA2B,6BAA6B,CAC7E,GAAI,CAAC,EAAK,OAEV,IAAM,EAAO,SAAS,gBAAgB,WAAa,SAAS,KAAK,UAC3D,EAAS,SAAS,gBAAgB,aAClC,EAAO,EAAI,UACX,EAAO,EAAO,EAAI,aAClB,EAAS,IAGf,GAAI,CAAC,EAAI,wBAA0B,EAAO,EAAQ,CAGhD,OAAO,OAAO,OAAO,QAAS,EAAE,CAChC,MACD,CAED,GAAI,EAAO,EAAO,EAChB,OAAO,OAAO,OAAO,QAAS,EAAO,EAAO,KACvC,CACL,IAAM,EAAO,EAAO,EAChB,EAAO,EAAO,GAChB,OAAO,OAAO,OAAO,QAAS,EAAO,EAAS,EAAO,AAExD,CACF,EAED,MAAM,EAAa,AAACC,GAAyB,CAC3C,OAAO,SAAS,EAAG,EAAO,CAC1B,EAAgB,UAAU,EAAE,AAC7B,EAEK,EAAe,CAACC,EAAkBC,IAAsC,CAC5E,OAAO,SAAS,EAAG,EAAS,CAC5B,EAAgB,EAAI,EAAE,AACvB,EAEK,EAAmB,IAAY,CACnC,OAAO,SAAS,EAAG,EAAE,CAErB,IAAM,EAAI,SAAS,cAAgC,KAAK,CACxD,GAAI,IACF,EAAE,OAAO,CAEL,EAAE,mBAAmB,CACvB,IAAM,EAAM,EAAE,MAAM,OAEpB,EAAE,kBAAkB,EAAK,EAAI,AAC9B,CAEJ,EAEK,EAAa,AAACC,GAA0B,CAC5C,IAAI,EAAO,SAAS,cAAiC,kCAAkC,CAIvF,GAFE,IAAO,SAAS,cAAiC,iCAAiC,CAEhF,CAAC,EAAM,OAEX,IAAM,EAAM,EAAK,aAAa,OAAO,CACjC,IACE,EACF,OAAO,KAAK,EAAI,CAEhB,OAAO,SAAS,KAAO,EAG5B,EAEK,EAAkB,CAACC,EAAyBC,IAA6C,CAC7F,IAAMC,EAA2C,CAAE,EAEnD,IAAK,IAAM,KAAW,OAAO,OAAO,EAAY,CAAE,CAChD,IAAM,EAAM,EAAQ,IACpB,EAAW,KAAS,CAAE,EACtB,EAAW,GAAK,KAAK,EAAQ,AAC9B,CAED,IAAM,EAAqB,OAAO,KAAK,EAAW,CAAC,KACjD,CAAC,EAAG,KAAO,EAAW,IAAI,QAAU,IAAM,EAAW,IAAI,QAAU,GACpE,CAEG,EAAO,mEACX,GAAQ,gDACR,GAAQ,UAER,IAAK,GAAM,CAAC,EAAG,EAAY,GAAI,EAAmB,SAAS,CAAE,CAC3D,IAAM,EAAW,EAAW,GAC5B,GAAI,CAAC,GAAY,EAAS,SAAW,EAAG,SAExC,IAAM,EAAU,EAAI,GAAM,EACpB,EAAS,IAAM,EAAmB,OAAS,EAE7C,IACF,GAAQ,QAGV,GAAQ,OACR,GAAQ,CAAC,IAAI,EAAE,EAAY,KAAK,CAAC,CACjC,GAAQ,6BAER,IAAK,IAAM,KAAW,EACpB,GAAQ,CAAC,SAAS,EAAE,EAAQ,IAAI,OAAO,EAAE,EAAQ,IAAI,KAAK,CAAC,CAG7D,GAAQ,QACR,GAAQ,SAEJ,CAAC,GAAW,KACd,GAAQ,QAEX,CAED,GAAQ,WAER,EAAW,UAAY,CACxB,EAEK,EAAa,AAACD,GAA6C,CAC/D,IAAI,EAAY,SAAS,cAA2B,oBAAoB,CACxE,GAAI,EAEF,EAAU,UAAU,OAAO,YAAY,KAClC,CAEL,EAAY,OAAO,OAAO,SAAS,cAAc,MAAM,CAAE,CACvD,GAAI,mBACJ,UAAW,cACZ,EAAC,CACF,EAAgB,EAAW,EAAY,CACvC,IAAM,EAAO,SAAS,qBAAqB,OAAO,CAAC,GAC/C,GACF,EAAK,YAAY,EAAU,AAE9B,CACF,EAEK,EAAqB,SAA2B,CACpD,IAAM,EAAoB,SAAS,cAAiC,kCAAkC,CACtG,EAAc,EAAkB,CAEhC,IAAM,EAAM,EAAkB,aAAa,OAAO,CAC9C,GACF,MAAM,UAAU,UAAU,UAAU,EAAI,AAE3C,EAED,EAAO,QAAS,UAAW,SAA6BE,EAAqB,CAC3E,GAAI,CAAC,EAAkB,EAAM,OAAsB,CAAE,CACnD,EAAgB,KAAK,CAAC,GAAM,GAAK,CAEjC,IAAM,EAAgB,EAAiB,EAAM,OAAsB,CAE/D,GAAiB,EAAc,EAAc,GAC/C,EAAM,gBAAgB,CACtB,EAAQ,cAAc,EAAc,CAEvC,CACF,EAAC,CAGF,EACE,QACA,YACA,AAACC,GAAsB,CACrB,GAAI,CAAC,EAAkB,EAAM,OAAsB,CAAE,CACnD,IAAM,EAAgB,EAAiB,EAAM,OAAsB,CAE/D,GAAiB,CAAC,EAAc,aAAa,oBAAoB,EACnE,EAAgB,EAAc,CAAC,GAAK,CAGlC,GAAiB,EAAc,EAAc,GAC/C,EAAM,gBAAgB,CACtB,EAAQ,cAAc,EAAc,CAEvC,CACF,EACD,CAAE,QAAS,EAAM,EAClB,CAED,EAAO,UAAW,SAAU,AAAClB,GAAyB,CAEpD,GAAI,OAAO,OAAO,EAAa,EAAM,IAAI,EAAI,CAAC,EAAM,SAAW,CAAC,EAAM,QAAU,CAAC,EAAM,UAAY,CAAC,EAAM,QAAS,CACjH,IAAM,EAAW,EAAM,QAAwB,SAAS,aAAa,CAEjE,EAAM,MAAQ,SAChB,EAAY,EAAM,MAAM,IAAI,EAAM,EACzB,EAAM,SAAW,SAAS,MAAQ,IAAY,KAAO,IAAY,YAC1E,EAAM,gBAAgB,CACtB,EAAY,EAAM,MAAM,IAAI,EAAM,CAErC,CACF,EAAC,CAEF,EAAQ,WAAa,EAAgB,OAAO,CAC5C,EAAQ,eAAiB,EAAgB,KAAK"} \ No newline at end of file diff --git a/searx/static/themes/simple/js/leaflet.js b/searx/static/themes/simple/js/leaflet.js deleted file mode 100644 index a3bf693d0..000000000 --- a/searx/static/themes/simple/js/leaflet.js +++ /dev/null @@ -1,6 +0,0 @@ -/* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var e,i,n=1,o=arguments.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.late.lng&&n.lng","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Ft=b.msPointer?"MSPointerDown":"pointerdown",Ut=b.msPointer?"MSPointerMove":"pointermove",Vt=b.msPointer?"MSPointerUp":"pointerup",qt=b.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return"touchstart"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn("wrong event specified:",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener("dblclick",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener("click",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function _e(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||"",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;othis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),"geolocation"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable()),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pe(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;sthis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ue(t){return new B(t)}var B=et.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",e=document.createElement("div");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;se.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,"click",O),this.expand(),this);setTimeout(function(){k(t,"click",O),e._preventClick=!1})}})),qe=B.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=P("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P("a",i,n);return i.innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Ie(i),S(i,"click",Re),S(i,"click",o,this),S(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=P("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P("div",e,i)),t.imperial&&(this._iScale=P("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280'+(b.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P("div","leaflet-control-attribution"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?"touchstart mousedown":"mousedown",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,ve(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i="mousedown"===t.type,S(document,i?"mousemove":"touchmove",this._onMove,this),S(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1e&&(i.push(t[n]),o=n);oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;es.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=P("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:i.xthis.options.maxZoom||nthis.options.maxZoom||void 0!==this.options.minZoom&&oi.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),zt={_initContainer:function(){this._container=P("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vi("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Z(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=qi("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){k(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(T(this._box),z(this._container,"leaflet-crosshair")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,"leaflet-grab"),z(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)e.getMaxZoom()&&1i.map(i=>d[i]); +import{b as e,e as t}from"./searxng.core.min.js";t(`click`,`.searxng_init_map`,async function(t){t.preventDefault(),this.classList.remove(`searxng_init_map`);let{View:n,OlMap:r,TileLayer:i,VectorLayer:a,OSM:o,VectorSource:s,Style:c,Stroke:l,Fill:u,Circle:d,fromLonLat:f,GeoJSON:p,Feature:m,Point:h}=await e(async()=>{let{View:e,OlMap:t,TileLayer:n,VectorLayer:r,OSM:i,VectorSource:a,Style:o,Stroke:s,Fill:c,Circle:l,fromLonLat:u,GeoJSON:d,Feature:f,Point:p}=await import(`./ol.min.js`);return{View:e,OlMap:t,TileLayer:n,VectorLayer:r,OSM:i,VectorSource:a,Style:o,Stroke:s,Fill:c,Circle:l,fromLonLat:u,GeoJSON:d,Feature:f,Point:p}},[]);e(()=>Promise.resolve({}),__vite__mapDeps([0]));let{leafletTarget:g,mapLon:_,mapLat:v,mapGeojson:y}=this.dataset,b=Number.parseFloat(_||`0`),x=Number.parseFloat(v||`0`),S=new n({maxZoom:16,enableRotation:!1}),C=new r({target:g,layers:[new i({source:new o({maxZoom:16})})],view:S});try{let e=new s({features:[new m({geometry:new h(f([b,x]))})]}),t=new a({source:e,style:new c({image:new d({radius:6,fill:new u({color:`#3050ff`})})})});C.addLayer(t)}catch(e){console.error(`Failed to create marker layer:`,e)}if(y)try{let e=new s({features:new p().readFeatures(JSON.parse(y),{dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`})}),t=new a({source:e,style:new c({stroke:new l({color:`#3050ff`,width:2}),fill:new u({color:`#3050ff33`})})});C.addLayer(t),S.fit(e.getExtent(),{padding:[20,20,20,20]})}catch(e){console.error(`Failed to create GeoJSON layer:`,e)}}); +//# sourceMappingURL=mapresult.min.js.map \ No newline at end of file diff --git a/searx/static/themes/simple/js/mapresult.min.js.map b/searx/static/themes/simple/js/mapresult.min.js.map new file mode 100644 index 000000000..07e80acac --- /dev/null +++ b/searx/static/themes/simple/js/mapresult.min.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":";iDAIA,EAAO,QAAS,oBAAqB,eAAmCA,EAAc,CACpF,EAAM,gBAAgB,CACtB,KAAK,UAAU,OAAO,mBAAmB,CAEzC,GAAM,CACJ,OACA,QACA,YACA,cACA,MACA,eACA,QACA,SACA,OACA,SACA,aACA,UACA,UACA,QACD,sBAfK,CACJ,OACA,QACA,YACA,cACA,MACA,eACA,QACA,SACA,OACA,SACA,aACA,UACA,UACA,QACD,CAAG,MAAM,OAAO,sBAdf,OACA,QACA,YACA,cACA,MACA,eACA,QACA,SACA,OACA,SACA,aACA,UACA,UACA,oBAEF,mBAAO,uBAEP,GAAM,CAAE,cAAe,EAAQ,SAAQ,SAAQ,aAAY,CAAG,KAAK,QAE7D,EAAM,OAAO,WAAW,GAAU,IAAI,CACtC,EAAM,OAAO,WAAW,GAAU,IAAI,CACtC,EAAO,IAAI,EAAK,CAAE,QAAS,GAAI,eAAgB,EAAO,GACtD,EAAM,IAAI,EAAM,CACZ,SACR,OAAQ,CAAC,IAAI,EAAU,CAAE,OAAQ,IAAI,EAAI,CAAE,QAAS,EAAI,EAAG,EAAE,EACvD,MACP,GAED,GAAI,CACF,IAAM,EAAe,IAAI,EAAa,CACpC,SAAU,CACR,IAAI,EAAQ,CACV,SAAU,IAAI,EAAM,EAAW,CAAC,EAAK,CAAI,EAAC,CAC3C,EACF,CACF,GAEK,EAAc,IAAI,EAAY,CAClC,OAAQ,EACR,MAAO,IAAI,EAAM,CACf,MAAO,IAAI,EAAO,CAChB,OAAQ,EACR,KAAM,IAAI,EAAK,CAAE,MAAO,SAAW,EACpC,EACF,EACF,GAED,EAAI,SAAS,EAAY,CAC1B,MAAQ,EAAO,CACd,QAAQ,MAAM,iCAAkC,EAAM,CAGxD,GAAI,EACF,GAAI,CACF,IAAM,EAAY,IAAI,EAAa,CACjC,SAAU,IAAI,IAAU,aAAa,KAAK,MAAM,EAAW,CAAE,CAC3D,eAAgB,YAChB,kBAAmB,WACpB,EAAC,CACH,EAEK,EAAW,IAAI,EAAY,CAC/B,OAAQ,EACR,MAAO,IAAI,EAAM,CACf,OAAQ,IAAI,EAAO,CAAE,MAAO,UAAW,MAAO,CAAG,GACjD,KAAM,IAAI,EAAK,CAAE,MAAO,WAAa,EACtC,EACF,GAED,EAAI,SAAS,EAAS,CAEtB,EAAK,IAAI,EAAU,WAAW,CAAE,CAAE,QAAS,CAAC,GAAI,GAAI,GAAI,EAAG,CAAE,EAAC,CAC/D,MAAQ,EAAO,CACd,QAAQ,MAAM,kCAAmC,EAAM,CAG5D,EAAC","names":["event: Event"],"ignoreList":[],"sources":["../../../../../client/simple/src/js/main/mapresult.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { listen } from \"../core/toolkit.ts\";\n\nlisten(\"click\", \".searxng_init_map\", async function (this: HTMLElement, event: Event) {\n event.preventDefault();\n this.classList.remove(\"searxng_init_map\");\n\n const {\n View,\n OlMap,\n TileLayer,\n VectorLayer,\n OSM,\n VectorSource,\n Style,\n Stroke,\n Fill,\n Circle,\n fromLonLat,\n GeoJSON,\n Feature,\n Point\n } = await import(\"../pkg/ol.ts\");\n import(\"ol/ol.css\");\n\n const { leafletTarget: target, mapLon, mapLat, mapGeojson } = this.dataset;\n\n const lon = Number.parseFloat(mapLon || \"0\");\n const lat = Number.parseFloat(mapLat || \"0\");\n const view = new View({ maxZoom: 16, enableRotation: false });\n const map = new OlMap({\n target: target,\n layers: [new TileLayer({ source: new OSM({ maxZoom: 16 }) })],\n view: view\n });\n\n try {\n const markerSource = new VectorSource({\n features: [\n new Feature({\n geometry: new Point(fromLonLat([lon, lat]))\n })\n ]\n });\n\n const markerLayer = new VectorLayer({\n source: markerSource,\n style: new Style({\n image: new Circle({\n radius: 6,\n fill: new Fill({ color: \"#3050ff\" })\n })\n })\n });\n\n map.addLayer(markerLayer);\n } catch (error) {\n console.error(\"Failed to create marker layer:\", error);\n }\n\n if (mapGeojson) {\n try {\n const geoSource = new VectorSource({\n features: new GeoJSON().readFeatures(JSON.parse(mapGeojson), {\n dataProjection: \"EPSG:4326\",\n featureProjection: \"EPSG:3857\"\n })\n });\n\n const geoLayer = new VectorLayer({\n source: geoSource,\n style: new Style({\n stroke: new Stroke({ color: \"#3050ff\", width: 2 }),\n fill: new Fill({ color: \"#3050ff33\" })\n })\n });\n\n map.addLayer(geoLayer);\n\n view.fit(geoSource.getExtent(), { padding: [20, 20, 20, 20] });\n } catch (error) {\n console.error(\"Failed to create GeoJSON layer:\", error);\n }\n }\n});\n"],"file":"js/mapresult.min.js"} \ No newline at end of file diff --git a/searx/static/themes/simple/js/ol.min.js b/searx/static/themes/simple/js/ol.min.js new file mode 100644 index 000000000..fe5427b91 --- /dev/null +++ b/searx/static/themes/simple/js/ol.min.js @@ -0,0 +1,8 @@ +var e={ADD:`add`,REMOVE:`remove`},t={PROPERTYCHANGE:`propertychange`},n={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},r=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}},i=r;function a(e,t,n){let r,i;n||=o;let a=0,s=e.length,c=!1;for(;a>1),i=+n(e[r],t),i<0?a=r+1:(s=r,c=!i);return c?a:~a}function o(e,t){return e>t?1:et?-1:0}function c(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i0?i-1:i}return r-1}if(n>0){for(let n=1;n0||n&&a===0)})}function p(){return!0}function m(){return!1}function h(){}function g(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return(!n||this!==r||!d(i,n))&&(r=this,n=i,t=e.apply(this,arguments)),t}}function _(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return t instanceof Promise?t:Promise.resolve(t)}return t()}function v(e){for(let t in e)delete e[t]}function y(e){let t;for(t in e)return!1;return!t}var b=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},x=b,S=class extends i{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new x(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=h,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},C=S;function w(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function T(e,t,n,r){return w(e,t,n,r,!0)}function E(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),v(e))}var D=class extends C{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(n.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i0;)this.pop()}extend(e){for(let t=0,n=e.length;tthis.getLength())throw Error(`Index out of bounds: `+t);this.unique_&&this.assertUnique_(n),this.array_.splice(t,0,n),this.updateLength_(),this.dispatchEvent(new ie(e.ADD,n,t))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n=this.getLength())return;let n=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ie(e.REMOVE,n,t)),n}setAt(t,n){let r=this.getLength();if(t>=r){this.insertAt(t,n);return}if(t<0)throw Error(`Index out of bounds: `+t);this.unique_&&this.assertUnique_(n,t);let i=this.array_[t];this.array_[t]=n,this.dispatchEvent(new ie(e.REMOVE,i,t)),this.dispatchEvent(new ie(e.ADD,n,t))}updateLength_(){this.set(re.LENGTH,this.array_.length)}assertUnique_(e,t){for(let n=0,r=this.array_.length;ni&&(c|=P.RIGHT),sa&&(c|=P.ABOVE),c===P.UNKNOWN&&(c=P.INTERSECTING),c}function F(){return[1/0,1/0,-1/0,-1/0]}function ye(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function be(e){return ye(1/0,1/0,-1/0,-1/0,e)}function xe(e,t){let n=e[0],r=e[1];return ye(n,r,n,r,t)}function Se(e,t,n,r,i){let a=be(i);return Ee(a,e,t,n,r)}function Ce(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function we(e,t){return t[0]e[2]&&(e[2]=t[2]),t[1]e[3]&&(e[3]=t[3]),e}function Te(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function Ee(e,t,n,r,i){for(;nt[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Be(e){return e[2]=o&&h<=c),!r&&a&P.RIGHT&&!(i&P.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&P.BELOW&&!(i&P.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&P.LEFT&&!(i&P.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function Ue(e,t,n,r){if(Be(e))return be(n);let i=[];if(r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a=n[2])){let t=L(n),i=Math.floor((r[0]-n[0])/t),a=i*t;e[0]-=a,e[2]-=a}return e}function Ge(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];We(e,t);let i=L(r);if(L(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function R(e,t,n){return Math.min(Math.max(e,t),n)}function Ke(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return qe(e,t,n,r)}function qe(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function Je(e){let t=e.length;for(let n=0;ni&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function Ye(e){return e*180/Math.PI}function Xe(e){return e*Math.PI/180}function Ze(e,t){let n=e%t;return n*t<0?n+t:n}function Qe(e,t,n){return e+n*(t-e)}function $e(e,t){let n=10**t;return Math.round(e*n)/n}function et(e,t){return Math.floor($e(e,t))}function tt(e,t){return Math.ceil($e(e,t))}function nt(e,t,n){if(e>=t&&eat.warn||console.warn(...e)}function ct(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function lt(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function ut(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function dt(e,t){return e[0]*=t,e[1]*=t,e}function ft(e,t){if(t.canWrapX()){let n=L(t.getExtent()),r=pt(e,t,n);r&&(e[0]-=r*n)}return e}function pt(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]r[2])&&(n||=L(r),i=Math.floor((e[0]-r[0])/n)),i}const mt={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};var ht=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global===void 0?!1:e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||mt[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}},gt=ht;const _t=6378137,vt=Math.PI*_t,yt=[-vt,-vt,vt,vt],bt=[-180,-85,180,85],xt=_t*Math.log(Math.tan(Math.PI/2));var St=class extends gt{constructor(e){super({code:e,units:`m`,extent:yt,global:!0,worldExtent:bt,getPointResolution:function(e,t){return e/Math.cosh(t[1]/_t)}})}};const Ct=[new St(`EPSG:3857`),new St(`EPSG:102100`),new St(`EPSG:102113`),new St(`EPSG:900913`),new St(`http://www.opengis.net/def/crs/EPSG/0/3857`),new St(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function wt(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;nxt?r=xt:r<-xt&&(r=-xt),t[n+1]=r}return t}function Tt(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;non&&(t=on);let r=Xe(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=Xe(e),u=un(n.number),d=Xe(u),f=nn/Math.sqrt(1-Rt*i**2),p=Vt*a**2,m=a*nt(l-d,-Math.PI,Math.PI),h=m*m,g=h*m,_=g*m,v=_*m,y=v*m,b=nn*(Jt*r-Yt*Math.sin(2*r)+Xt*Math.sin(4*r)-Zt*Math.sin(6*r)),x=Lt*f*(m+g/6*(1-s+p)+v/120*(5-18*s+c+72*p-58*Vt))+5e5,S=Lt*(b+f*o*(h/2+_/24*(5-s+9*p+4*p**2)+y/720*(61-58*s+c+600*p-330*Vt)));return n.north||(S+=1e7),[x,S]}function un(e){return(e-1)*6-180+3}const dn=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function fn(e){let t=0;for(let n of dn){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function pn(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i=s?t[o+e]:a[e]}return n})}function On(e,t){return yn(),Nn(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function kn(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();if(e.getCode()===t.getCode())return n;let r=An(e,t);return r===bn&&n}function An(e,t){let n=e.getCode(),r=t.getCode(),i=It(n,r);if(i)return i;let a=null,o=null;for(let n of gn)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(o)if(a)i=jn(a.inverse,o.forward);else{let e=It(n,s);e&&(i=jn(e,o.forward))}else{let e=It(s,r);e&&(i=jn(a.inverse,e))}return i&&(xn(e),xn(t),Ft(e,t,i)),i}function jn(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function Mn(e,t){let n=z(e),r=z(t);return An(n,r)}function Nn(e,t,n){let r=Mn(t,n);if(!r){let e=z(t).getCode(),r=z(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function Pn(e,t,n,r){let i=Mn(t,n);return Ue(e,i,void 0,r)}let Fn=null;function In(){return Fn}function Ln(e,t){return Fn?Nn(e,t,Fn):e}function Rn(e,t){return Fn?Nn(e,Fn,t):(vn&&!lt(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(vn=!1,st(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e)}function zn(e,t){return Fn?Pn(e,t,Fn):e}function Bn(e,t){return Fn?Pn(e,Fn,t):e}function Vn(e,t){if(!Fn)return e;let n=z(t).getMetersPerUnit(),r=Fn.getMetersPerUnit();return n&&r?e*n/r:e}function Hn(){wn(Ct),wn(At),Tn(At,Ct,wt,Tt)}Hn();function Un(){return[1,0,0,1,0,0]}function Wn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function B(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function Gn(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function Kn(e,t){let n=qn(t);N(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function qn(e){return e[0]*e[3]-e[1]*e[2]}const Jn=[1e5,1e5,1e5,1e5,2,2];function Yn(e){let t=`matrix(`+e.join(`, `)+`)`;return t}function Xn(e){let t=e.substring(7,e.length-1).split(`,`);return t.map(parseFloat)}function Zn(e,t){let n=Xn(e),r=Xn(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*Jn[e])!==0)return!1;return!0}function Qn(e,t,n,r,i,a,o){a||=[],o||=2;let s=0;for(let c=t;c{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return A()}closestPointXY(e,t,n,r){return A()}containsXY(e,t){return this.closestPointXY(e,t,rr,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t||=[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return A()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&be(e),this.extentRevision_=this.getRevision()}return Ve(this.extent_,e)}rotate(e,t){A()}scale(e,t,n){A()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return A()}getType(){return A()}applyTransform(e){A()}intersectsExtent(e){return A()}translate(e,t){A()}transform(e,t){let n=z(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=I(o)/I(a);Gn(nr,o[0],o[3],s,-s,0,0,0);let c=Qn(e,0,e.length,i,nr,r),l=Mn(n,t);return l?l(c,c,i):c}:Mn(n,t);return this.applyTransform(r),this}},ar=ir,or=class extends ar{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return Se(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return A()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let t=this.getSimplifiedGeometryInternal(e),n=t.getFlatCoordinates();return n.length1)d=n;else if(f>0){for(let i=0;ii&&(i=s),a=n,o=r}return i}function gr(e,t,n,r,i){for(let a=0,o=n.length;a0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;to&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r0&&m>f)&&(p<0&&h0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function Mr(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;ca&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function Br(e,t,n,r,i,a){if(n.length===0||!zr(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;tv&&(u=(d+f)/2,Br(e,t,n,r,u,h)&&(_=u,v=i)),d=f}return isNaN(_)&&(_=i[a]),s?(s.push(_,h,v),s):[_,h,v]}function Ur(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:Wr(e,t,n,r,function(e,t){return He(i,e,t)}):!1}function Kr(e,t,n,r,i){for(let a=0,o=n.length;a0}function Qr(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a1?s:2,o||=Array(s);for(let t=0;t>1;i.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function Ui(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function Wi(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function Gi(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function Ki(e){let t=Wi(e[0]),n=Wi(e[1]),r=Wi(e[2]),i=Gi(t*.222488403+n*.716873169+r*.06060791),a=500*(Gi(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-Gi(t*.016863605+n*.117638439+r*.865350722)),s=Math.atan2(o,a)*(180/Math.PI);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function qi(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=Ui(t),a=Ui(t+n/500*Math.cos(r)),o=Ui(t-n/200*Math.sin(r)),s=Hi(a*3.021973625-i*1.617392459-o*.404875592),c=Hi(a*-.943766287+i*1.916279586+o*.027607165),l=Hi(a*.069407491-i*.22898585+o*1.159737864);return[R(s+.5|0,0,255),R(c+.5|0,0,255),R(l+.5|0,0,255),e[3]]}function Ji(e){if(e===`none`)return Di;if(zi.hasOwnProperty(e))return zi[e];if(Bi>=Ri){let e=0;for(let t in zi)e++&3||(delete zi[t],--Bi)}let t=Ii(e);t.length!==4&&Fi(e);for(let n of t)isNaN(n)&&Fi(e);return zi[e]=t,++Bi,t}function Yi(e){return Array.isArray(e)?e:Ji(e)}function Xi(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}function Zi(e,t,r){let i=e,a=!0,o=!1,s=!1,c=[T(i,n.LOAD,function(){s=!0,o||t()})];return i.src&&yi?(o=!0,i.decode().then(function(){a&&t()}).catch(function(e){a&&(s?t():r())})):c.push(T(i,n.ERROR,r)),function(){a=!1,c.forEach(E)}}function Qi(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function $i(e,t){return t&&(e.src=t),e.src&&yi?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):Qi(e)}var ea=class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,n){let r=ta(e,t,n);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,n){let r=ta(e,t,n);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,n,r,i){let a=ta(e,t,n),o=a in this.cache_;this.cache_[a]=r,i&&(r.getImageState()===V.IDLE&&r.load(),r.getImageState()===V.LOADING?r.ready().then(()=>{this.patternCache_[a]=Si().createPattern(r.getImage(1),`repeat`)}):this.patternCache_[a]=Si().createPattern(r.getImage(1),`repeat`)),o||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function ta(e,t,n){let r=n?Yi(n):`null`;return t+`:`+e+`:`+r}const na=new ea;let ra=null;var ia=class extends C{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n,this.canvas_={},this.color_=i,this.imageState_=r===void 0?V.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===V.LOADED){ra||=H(1,1,void 0,{willReadFrequently:!0}),ra.drawImage(this.image_,0,0);try{ra.getImageData(0,0,1,1),this.tainted_=!1}catch{ra=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(n.CHANGE)}handleImageError_(){this.imageState_=V.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=V.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let e=this.size_[0],t=this.size_[1],n=H(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===V.IDLE){this.image_||this.initializeImage_(),this.imageState_=V.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&$i(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==V.LOADED)return;let t=this.image_,n=H(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=Li(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||=new Promise(e=>{if(this.imageState_===V.LOADED||this.imageState_===V.ERROR)e();else{let t=()=>{(this.imageState_===V.LOADED||this.imageState_===V.ERROR)&&(this.removeEventListener(n.CHANGE,t),e())};this.addEventListener(n.CHANGE,t)}}),this.ready_}};function aa(e,t,n,r,i,a){let o=t===void 0?void 0:na.get(t,n,i);return o||(o=new ia(e,e&&`src`in e?e.src||void 0:t,n,r,i),na.set(t,n,i,o,a)),a&&o&&!na.getPattern(t,n,i)&&na.set(t,n,i,o,a),o}var oa=ia;function sa(e){return e?Array.isArray(e)?Xi(e):typeof e==`object`&&`src`in e?ca(e):e:null}function ca(e){if(!e.offset||!e.size)return na.getPattern(e.src,`anonymous`,e.color);let t=e.src+`:`+e.offset,n=na.getPattern(t,void 0,e.color);if(n)return n;let r=na.get(e.src,`anonymous`,null);if(r.getImageState()!==V.LOADED)return null;let i=H(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),aa(i.canvas,t,void 0,V.LOADED,e.color,!0),na.getPattern(t,void 0,e.color)}var la=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},ua=la;const da=`ol-hidden`,fa=`ol-unselectable`,pa=`ol-collapsed`,ma=new RegExp([`^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)`,`(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?`,`(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))`,`(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))`,`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(``),`i`),ha=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],ga={normal:400,bold:700},_a=function(e){let t=e.match(ma);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=ha.length;ee.trim().replace(/^['"]|['"]$/g,``)),n},va=`10px sans-serif`,ya=`#000`,ba=`round`,xa=[],Sa=0,Ca=`round`,wa=10,Ta=`#000`,Ea=`center`,Da=`middle`,Oa=[0,0,0,0],ka=1,Aa=new ne;let ja=null,Ma;const Na={},Pa=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function Fa(e,t,n){return`${e} ${t} 16px "${n}"`}const Ia=(function(){let e=100,t,n;async function r(e){await n.ready;let t=await n.load(e);if(t.length===0)return!1;let r=_a(e),i=r.families[0].toLowerCase(),a=r.weight;return t.some(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),n=ga[e.weight]||e.weight;return t===i&&e.style===r.style&&n==a})}async function i(){await n.ready;let a=!0,o=Aa.getProperties(),s=Object.keys(o).filter(t=>o[t]=0;--t){let n=s[t],i=o[n];iMath.max(t,za(e,n)),0);return n[t]=r,r}function Va(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===` +`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=za(f,d);n.push(p),o+=p;let m=La(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function Ha(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),Ua(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function Ua(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;ee*this.pixelRatio_),lineDashOffset:(i||Sa)*this.pixelRatio_,lineJoin:a===void 0?Ca:a,lineWidth:(o===void 0?ka:o)*this.pixelRatio_,miterLimit:s===void 0?wa:s,strokeStyle:sa(e||Ta)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();if(!t)this.textFillState_=null;else{let e=t.getColor();this.textFillState_={fillStyle:sa(e||ya)}}let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?ba:t,lineDash:r||xa,lineDashOffset:i||Sa,lineJoin:a===void 0?Ca:a,lineWidth:o===void 0?ka:o,miterLimit:s===void 0?wa:s,strokeStyle:sa(e||Ta)}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?va:r,textAlign:u===void 0?Ea:u,textBaseline:d===void 0?Da:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o===void 0?!1:o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}},Ga=Wa;const Ka=.5,qa={Point:ao,LineString:no,Polygon:so,MultiPoint:oo,MultiLineString:ro,MultiPolygon:io,GeometryCollection:to,Circle:Za};function Ja(e,t){return parseInt(M(e),10)-parseInt(M(t),10)}function Ya(e,t){let n=Xa(e,t);return n*n}function Xa(e,t){return Ka*e/t}function Za(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Circle`);s.setFillStrokeStyle(a,o),s.drawCircle(t,r,i)}let s=n.getText();if(s&&s.getText()){let i=e.getBuilder(n.getZIndex(),`Text`);i.setTextStyle(s),i.drawText(t,r)}}function Qa(e,t,n,r,i,a,o,s){let c=[],l=n.getImage();if(l){let e=!0,t=l.getImageState();t==V.LOADED||t==V.ERROR?e=!1:t==V.IDLE&&l.load(),e&&c.push(l.ready())}let u=n.getFill();u&&u.loading()&&c.push(u.ready());let d=c.length>0;return d&&Promise.all(c).then(()=>i(null)),$a(e,t,n,r,a,o,s),d}function $a(e,t,n,r,i,a,o){let s=n.getGeometryFunction()(t);if(!s)return;let c=s.simplifyTransformed(r,i),l=n.getRenderer();if(l)eo(e,c,n,t,o);else{let r=qa[c.getType()];r(e,c,n,t,o,a)}}function eo(e,t,n,r,i){if(t.getType()==`GeometryCollection`){let a=t.getGeometries();for(let t=0,o=a.length;t=200&&s.status<300){let e=t.getType();try{let r;e==`text`||e==`json`?r=s.responseText:e==`xml`?r=s.responseXML||s.responseText:e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}catch{o()}}else o()},s.onerror=o,s.send()}function uo(e,t){return function(n,r,i,a,o){lo(e,t,n,r,i,(e,t)=>{this.addFeatures(e),a!==void 0&&a(e)},()=>{this.changed(),o!==void 0&&o()})}}function fo(e,t){return[[-1/0,-1/0,1/0,1/0]]}function po(e,t,n,r){let i=[],a=F();for(let o=0,s=n.length;oe.clone())}var go=mo,_o=class e extends ur{constructor(e,t,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&n)this.setFlatCoordinates(t,e),this.ends_=n;else{let t=e,n=[],r=[];for(let e=0,i=t.length;e{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);let r=this.simplifiedGeometry_.getFlatCoordinates(),i;switch(this.type_){case`LineString`:r.length=Or(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,r,0),i=[r.length];break;case`MultiLineString`:i=[],r.length=kr(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,r,0,i);break;case`Polygon`:i=[],r.length=Mr(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),r,0,i);break;default:}return i&&(this.simplifiedGeometry_=new e(this.type_,r,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};wo.prototype.getFlatCoordinates=wo.prototype.getOrientedFlatCoordinates;var To=wo;function Eo(e,t,n=0,r=e.length-1,i=Oo){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));Eo(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Do(e,n,t),i(e[r],a)>0&&Do(e,n,r);o0;)s--}i(e[n],a)===0?Do(e,n,s):(s++,Do(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function Do(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Oo(e,t){return et?1:0}var ko=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!Vo(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=Ho(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,jo(n,this.toBBox),jo(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=Ho([e,t]),this.data.height=e.height+1,this.data.leaf=!1,jo(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=Mo(e,0,o,this.toBBox),s=Mo(e,o,n,this.toBBox),c=zo(t,s),l=Io(t)+Io(s);c=t;r--){let t=e.children[r];No(o,e.leaf?i(t):t),s+=Lo(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)No(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():jo(e[t],this.toBBox)}};function Ao(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r=e.minX&&t.maxY>=e.minY}function Ho(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Uo(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Eo(e,o,t,n,i),a.push(t,o,o,n)}}var Wo=class{constructor(e){this.rbush_=new ko(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[M(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;re):null}var Jo=Ko,Yo={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`},Xo=class extends x{constructor(e,t,n){super(e),this.feature=t,this.features=n}},Zo=class extends Jo{constructor(e){e||={},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0?!0:e.wrapX}),this.on,this.once,this.un,this.loader_=h,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(N(this.format_,"`format` must be set when `url` is set"),this.loader_=uo(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?fo:e.strategy;let t=e.useSpatialIndex===void 0?!0:e.useSpatialIndex;this.featuresRtree_=t?new Go:null,this.loadedExtentsRtree_=new Go,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new oe(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=M(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new Xo(Yo.ADDFEATURE,e))}setupChangeEvents_(e,r){r instanceof To||(this.featureChangeKeys_[e]=[w(r,n.CHANGE,this.handleFeatureChange_,this),w(r,t.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let n=!0;if(t.getId()!==void 0){let e=String(t.getId());if(!(e in this.idIndex_))this.idIndex_[e]=t;else if(t instanceof To){let r=this.idIndex_[e];r instanceof To?Array.isArray(r)?r.push(t):this.idIndex_[e]=[r,t]:n=!1}else n=!1}return n&&(N(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t{n||(n=!0,this.addFeature(e.element),n=!1)}),t.addEventListener(e.REMOVE,e=>{n||(n=!0,this.removeFeature(e.element),n=!1)}),this.featuresCollection_=t}clear(e){if(e){for(let e in this.featureChangeKeys_){let t=this.featureChangeKeys_[e];t.forEach(E)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(let e in this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)}),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new Xo(Yo.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){let r=n.getGeometry();if(r instanceof To||r.intersectsCoordinate(e))return t(n)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(n){let r=n.getGeometry();if(r instanceof To||r.intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),y(this.nullGeometryFeatures_)||u(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){let n=t&&t.canWrapX()&&this.getWrapX();if(!n)return this.featuresRtree_.getInExtent(e);let r=Ge(e,t);return[].concat(...r.map(e=>this.featuresRtree_.getInExtent(e)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];return t||=p,this.featuresRtree_.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry(),c=o;if(o=t instanceof To?0:t.closestPointXY(n,r,a,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new Xo(Yo.FEATURESLOADEND,void 0,e))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Xo(Yo.FEATURESLOADERROR))}),r.insert(a,{extent:a.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n=t.forEachInExtent(e,function(t){if(Ce(t.extent,e))return t});n&&t.remove(n)}removeFeatures(e){let t=!1;for(let n=0,r=e.length;n{this.patternImage_=null}),t.getImageState()===V.IDLE&&t.load(),t.getImageState()===V.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?M(e):typeof e==`object`&&`src`in e?e.src+`:`+e.offset:Yi(e).toString():``}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}},es=$o,ts=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}},ns=ts;function rs(e){return e[0]>0&&e[1]>0}function os(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function ss(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var cs=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=ss(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return A()}getImage(e){return A()}getHitDetectionImage(){return A()}getPixelRatio(e){return 1}getImageState(){return A()}getImageSize(){return A()}getOrigin(){return A()}getSize(){return A()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=ss(e)}listenImageChange(e){A()}load(){A()}unlistenImageChange(e){A()}ready(){return Promise.resolve()}},ls=cs,us=class e extends ls{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView===void 0?!1:e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?V.LOADING:V.LOADED,this.imageState_===V.LOADING&&this.ready().then(()=>this.imageState_=V.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=na.get(n,null,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=H(i,i);this.draw_(t,a,e),r=a.canvas,na.set(n,null,null,new oa(r,void 0,null,V.LOADED,null))}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(rs&&(this.instructions.push([U.CUSTOM,s,l,e,n,Tr,i]),this.hitDetectionInstructions.push([U.CUSTOM,s,l,e,r||n,Tr,i]));break;case`Point`:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([U.CUSTOM,s,l,e,n,void 0,i]),this.hitDetectionInstructions.push([U.CUSTOM,s,l,e,r||n,void 0,i]);break;default:}this.endGeometry(t)}beginGeometry(e,t,n){this.beginGeometryInstruction1_=[U.BEGIN_GEOMETRY,t,0,e,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[U.BEGIN_GEOMETRY,t,0,e,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0;return t}setFillStrokeStyle(e,t){let n=this.state;this.fillStyleToState(e,n),this.strokeStyleToState(t,n)}createFill(e){let t=e.fillStyle,n=[U.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(e.fillPatternScale),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[U.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){let n=e.fillStyle;(typeof n!=`string`||e.currentFillStyle!=n)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=n||e.currentLineCap!=r||i!=e.currentLineDash&&!d(e.currentLineDash,i)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=c)&&(t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[U.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=pe(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;fe(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},As=ks,js=class extends As{constructor(e,t,n,r){super(e,t,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,n){if(!this.image_||this.maxExtent&&!he(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,i);this.instructions.push([U.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([U.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,n){if(!this.image_)return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=[];for(let t=0,n=r.length;t=e){let t=(e-s+d)/d,f=Qe(n,l,t),p=Qe(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s0&&a.push(c),a}function Rs(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;de&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p,c>s?[l,d]:[a,o]}const zs={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};var Bs=class extends As{constructor(e,t,n,r){super(e,t,n,r),this.labels_=null,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ya]={fillStyle:ya},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,n){let r=this.textFillState_,i=this.textStrokeState_,a=this.textState_;if(this.text_===``||!a||!r&&!i)return;let o=this.coordinates,s=o.length,c=e.getType(),l=null,u=e.getStride();if(a.placement===`line`&&(c==`LineString`||c==`MultiLineString`||c==`Polygon`||c==`MultiPolygon`)){if(!ze(this.maxExtent,e.getExtent()))return;let r;if(l=e.getFlatCoordinates(),c==`LineString`)r=[l.length];else if(c==`MultiLineString`)r=e.getEnds();else if(c==`Polygon`)r=e.getEnds().slice(0,1);else if(c==`MultiPolygon`){let t=e.getEndss();r=[];for(let e=0,n=t.length;e{let r=o[(e+n)*2]===l[n*u]&&o[(e+n)*2+1]===l[n*u+1];return r||--e,r})}this.saveTextStates_();let d=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,f=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,n);let p=a.padding;if(p!=Oa&&(a.scale[0]<0||a.scale[1]<0)){let e=a.padding[0],t=a.padding[1],n=a.padding[2],r=a.padding[3];a.scale[0]<0&&(t=-t,r=-r),a.scale[1]<0&&(e=-e,n=-n),p=[e,t,n,r]}let m=this.pixelRatio;this.instructions.push([U.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==Oa?Oa:p.map(function(e){return e*m}),d,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);let h=1/m,g=d?d.slice(0):null;g&&(g[1]=ya),this.hitDetectionInstructions.push([U.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[h,h],NaN,this.declutterMode_,this.declutterImageWithText_,p,g,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ya:this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||Ea,justify:t.justify,textBaseline:t.textBaseline||Da,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=zs[r.textBaseline],l=this.textOffsetY_*s,u=this.text_,d=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([U.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,l,i,d*s,u,a,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([U.DRAW_CHARS,e,t,c,r.overflow,o&&ya,r.maxAngle,s,l,i,d*s,u,a,1/s,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=sa(t.getColor()||ya)):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||ba,i.lineDash=e?e.slice():xa,i.lineDashOffset=t===void 0?Sa:t,i.lineJoin=a.getLineJoin()||Ca,i.lineWidth=n===void 0?ka:n,i.miterLimit=r===void 0?wa:r,i.strokeStyle=sa(a.getColor()||Ta)}n=this.textState_;let o=e.getFont()||va;Ia(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||Da,n.backgroundFill=e.getBackgroundFill(),n.backgroundStroke=e.getBackgroundStroke(),n.padding=e.getPadding()||Oa,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u===void 0?!1:u,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:M(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle==`string`?r.fillStyle:`|`+M(r.fillStyle):``}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},Vs=Bs;const Hs={Circle:Is,Default:As,Image:Ms,LineString:Ps,Polygon:Is,Text:Vs};var Us=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];if(i===void 0){let e=Hs[t];i=new e(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i}return i}},Ws=Us;function Gs(e,t,n,r,i,a,o,s,c,l,u,d,f=!0){let p=e[t],m=e[t+1],h=0,g=0,_=0,v=0;function y(){h=p,g=m,t+=r,p=e[t],m=e[t+1],v+=_,_=Math.sqrt((p-h)*(p-h)+(m-g)*(m-g))}do y();while(te[2]}else O=x>E;let k=Math.PI,A=[],j=C+r===t;t=C,_=0,v=w,p=e[t],m=e[t+1];let M;if(j){y(),M=Math.atan2(m-g,p-h),O&&(M+=M>0?-k:k);let e=(E+x)/2,t=(D+S)/2;return A[0]=[e,t,(T-a)/2,M,i],A}i=i.replace(/\n/g,` `);for(let e=0,d=i.length;e0?-k:k),M!==void 0){let e=f-M;if(e+=e>k?-2*k:e<-k?2*k:0,Math.abs(e)>o)return null}M=f;let x=e,S=0;for(;e{if(typeof Si()[t]==`function`)return this.push_(t),this.pushMethodArgs_},set:(e,t,n)=>(this.push_(t,n),!0)})}push_(...e){let t=this.instructions_,n=this.zIndex+this.offset_;t[n]||(t[n]=[]),t[n].push(...e)}pushMethodArgs_=(...e)=>(this.push_(e),this);pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let n=0,r=t.length;n0&&e.push(` +`,``),e.push(t,``),e}function rc(e,t,n){return n%2==0&&(e+=t),e}var ic=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Un(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=i?new qs:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?zs[s.justify]:tc(Array.isArray(e)?e[0]:e,s.textAlign||Ea),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(` +`).reduce(nc,[]),{width:p,height:m,widths:h,heights:g,lineWidths:_}=Va(s,f),v=p+d,y=[],b=(v+2)*l[0],x=(m+d)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(l[0]!=1||l[1]!=1)&&y.push(`scale`,l),r&&(y.push(`strokeStyle`,a.strokeStyle),y.push(`lineWidth`,d),y.push(`lineCap`,a.lineCap),y.push(`lineJoin`,a.lineJoin),y.push(`miterLimit`,a.miterLimit),y.push(`setLineDash`,[a.lineDash]),y.push(`lineDashOffset`,a.lineDashOffset)),n&&y.push(`fillStyle`,o.fillStyle),y.push(`textBaseline`,`middle`),y.push(`textAlign`,`center`);let C=.5-u,w=u*v+C*d,T=[],E=[],D=0,O=0,k=0,A=0,j;for(let e=0,t=f.length;ee?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(Ys[0]=S,Qs[0]=S,Ys[1]=C,Xs[1]=C,Xs[0]=S+b,Zs[0]=Xs[0],Zs[1]=C+x,Qs[1]=Zs[1]);let w;return u===0?ye(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),Js):(w=Gn(Un(),n,r,1,1,u,-n,-r),B(w,Ys),B(w,Xs),B(w,Zs),B(w,Qs),ye(Math.min(Ys[0],Xs[0],Zs[0],Qs[0]),Math.min(Ys[1],Xs[1],Zs[1],Qs[1]),Math.max(Ys[0],Xs[0],Zs[0],Qs[0]),Math.max(Ys[1],Xs[1],Zs[1],Qs[1]),Js)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:Js[0],minY:Js[1],maxX:Js[2],maxY:Js[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0,u=c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0;return u&&(s&&this.replayTextBackground_(e,Ys,Xs,Zs,Qs,a,o),Ha(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=B(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),t!==1&&e.scale(t,t),e.rotate(this.viewRotation_)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],t[1]&&(e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=tc(Array.isArray(e)?e[0]:e,i.textAlign||Ea),l=zs[i.textBaseline||Da],u=o&&o.lineWidth?o.lineWidth:0,d=a.width/s-2*i.scale[0],f=c*d+2*(.5-c)*u,p=l*a.height/s+2*(.5-l)*u;return{label:a,anchorX:f,anchorY:p}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&d(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||=[],l=Qn(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Wn(this.renderedTransform_,n));let u=0,f=r.length,p=0,m,h,g,_,v,y,b,x,S,C,w,T,E,D=0,O=0,k=this.coordinateCache_,A=this.viewRotation_,j=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,M={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},ee=this.instructions!=r||this.overlaps?0:200,te,ne,re,ie;for(;uee&&(this.fill_(e),D=0),O>ee&&(e.stroke(),O=0),!D&&!O&&(e.beginPath(),v=NaN,y=NaN),++u;break;case U.CIRCLE:p=n[1];let r=l[p],d=l[p+1],f=l[p+2],ae=l[p+3],oe=f-r,N=ae-d,se=Math.sqrt(oe*oe+N*N);e.moveTo(r+se,d),e.arc(r,d,se,0,2*Math.PI,!0),++u;break;case U.CLOSE_PATH:e.closePath(),++u;break;case U.CUSTOM:p=n[1],m=n[2];let ce=n[3],le=n[4],P=n[5];M.geometry=ce,M.feature=te,u in k||(k[u]=[]);let ue=k[u];P?P(l,p,m,2,ue):(ue[0]=l[p],ue[1]=l[p+1],ue.length=2),c&&(c.zIndex=n[6]),le(ue,M),++u;break;case U.DRAW_IMAGE:p=n[1],m=n[2],S=n[3],h=n[4],g=n[5];let de=n[6],fe=n[7],pe=n[8],me=n[9],he=n[10],ge=n[11],_e=n[12],ve=n[13];_=n[14]||`declutter`;let F=n[15];if(!S&&n.length>=20){C=n[19],w=n[20],T=n[21],E=n[22];let e=this.drawLabelWithPointPlacement_(C,w,T,E);S=e.label,n[3]=S;let t=n[23];h=(e.anchorX-t)*this.pixelRatio,n[4]=h;let r=n[24];g=(e.anchorY-r)*this.pixelRatio,n[5]=g,de=S.height,n[6]=de,ve=S.width,n[13]=ve}let ye;n.length>25&&(ye=n[25]);let be,xe,Se;n.length>17?(be=n[16],xe=n[17],Se=n[18]):(be=Oa,xe=null,Se=null),he&&j?ge+=A:!he&&!j&&(ge-=A);let Ce=0;for(;p!sc.includes(e));var lc=class{constructor(e,t,n,r,i,a,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Un(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(i,o)}clip(e,t){let n=this.getClipCoords(t);e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(n[2],n[3]),e.lineTo(n[4],n[5]),e.lineTo(n[6],n[7]),e.clip()}createExecutors_(e,t){for(let n in e){let r=this.executorsByZIndex_[n];r===void 0&&(r={},this.executorsByZIndex_[n]=r);let i=e[n];for(let e in i){let n=i[e];r[e]=new ac(this.resolution_,this.pixelRatio_,this.overlaps_,n,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let n=this.executorsByZIndex_[t];for(let t=0,r=e.length;t0){if(!a||n===`none`||p!==`Image`&&p!==`Text`||a.includes(e)){let n=(f[c]-3)/4,a=r-n%s,o=r-(n/s|0),l=i(e,t,a*a+o*o);if(l)return l}u.clearRect(0,0,s,s);break}}let h=Object.keys(this.executorsByZIndex_).map(Number);h.sort(o);let g,_,v,y,b;for(g=h.length-1;g>=0;--g){let e=h[g].toString();for(v=this.executorsByZIndex_[e],_=oc.length-1;_>=0;--_)if(p=oc[_],y=v[p],y!==void 0&&(b=y.executeHitDetection(u,c,n,m,d),b))return b}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let n=t[0],r=t[1],i=t[2],a=t[3],o=[n,r,n,a,i,a,i,r];return Qn(o,0,8,2,e,o),o}isEmpty(){return y(this.executorsByZIndex_)}execute(e,t,n,r,i,a,c){let l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(c?s:o),a||=oc;let u=oc.length;for(let o=0,s=l.length;op.execute(e,t,n,r,i,c)),d&&s.restore(),a){a.offset();let e=l[o]*u+oc.indexOf(f);this.deferredZIndexContexts_[e]||(this.deferredZIndexContexts_[e]=[]),this.deferredZIndexContexts_[e].push(a)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(o);for(let n=0,r=t.length;n{e.draw(this.renderedContext_),e.clear()}),e[t[n]].length=0}};const uc={};function dc(e){if(uc[e]!==void 0)return uc[e];let t=e*2+1,n=e*e,r=Array(n+1);for(let i=0;i<=e;++i)for(let a=0;a<=e;++a){let o=i*i+a*a;if(o>n)break;let s=r[o];s||(s=[],r[o]=s),s.push(((e+i)*t+(e+a))*4+3),i>0&&s.push(((e-i)*t+(e+a))*4+3),a>0&&(s.push(((e+i)*t+(e-a))*4+3),i>0&&s.push(((e-i)*t+(e-a))*4+3))}let i=[];for(let e=0,t=r.length;e0,"A defined and non-empty `src` or `image` must be provided"),N(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let s;if(e.src===void 0?a!==void 0&&(s=`complete`in a?a.complete?a.src?V.LOADED:V.IDLE:V.LOADING:V.LOADED):s=V.IDLE,this.color_=e.color===void 0?null:Yi(e.color),this.iconImage_=aa(a,o,this.crossOrigin_,s,this.color_),this.offset_=e.offset===void 0?[0,0]:e.offset,this.offsetOrigin_=e.offsetOrigin===void 0?`top-left`:e.offsetOrigin,this.origin_=null,this.size_=e.size===void 0?null:e.size,this.initialOptions_,e.width!==void 0||e.height!==void 0){let t,n;if(e.size)[t,n]=e.size;else{let r=this.getImage(1);if(r.width&&r.height)t=r.width,n=r.height;else if(r instanceof HTMLImageElement){this.initialOptions_=e;let t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;let n=this.iconImage_.getSize();this.setScale(pc(n[0],n[1],e.width,e.height))};this.listenImageChange(t);return}}t!==void 0&&this.setScale(pc(t,n,e.width,e.height))}}clone(){let t,n,r;return this.initialOptions_?(n=this.initialOptions_.width,r=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:n,height:r,size:this.size_===null?void 0:this.size_.slice(),src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if(this.anchorXUnits_==`fraction`||this.anchorYUnits_==`fraction`){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==`fraction`&&(e[0]*=t[0]),this.anchorYUnits_==`fraction`&&(e[1]*=t[1])}if(this.anchorOrigin_!=`top-left`){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==`top-right`||this.anchorOrigin_==`bottom-right`)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==`bottom-left`||this.anchorOrigin_==`bottom-right`)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]-t[0]/n[0],e[1]+t[1]/n[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!=`top-left`){let t=this.getSize(),n=this.iconImage_.getSize();if(!t||!n)return null;e=e.slice(),(this.offsetOrigin_==`top-right`||this.offsetOrigin_==`bottom-right`)&&(e[0]=n[0]-t[0]-e[0]),(this.offsetOrigin_==`bottom-left`||this.offsetOrigin_==`bottom-right`)&&(e[1]=n[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==V.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){let e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==V.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(n.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(n.CHANGE,e)}ready(){return this.iconImage_.ready()}},hc=mc;const gc=.5;function _c(e,t,n,r,i,a,s,c,l){let u=l?zn(i,l):i,d=e[0]*gc,f=e[1]*gc,p=H(d,f);p.imageSmoothingEnabled=!1;let m=p.canvas,h=new Ga(p,gc,i,null,s,c,l?An(In(),l):null),g=n.length,_=Math.floor((256*256*256-1)/g),v={};for(let e=1;e<=g;++e){let t=n[e-1],i=t.getStyleFunction()||r;if(!i)continue;let o=i(t,a);if(!o)continue;Array.isArray(o)||(o=[o]);let s=e*_,c=s.toString(16).padStart(7,`#00000`);for(let e=0,n=o.length;ethis.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return A()}getData(e){return null}prepareFrame(e){return A()}renderFrame(e,t){return A()}forEachFeatureAtCoordinate(e,t,n,r,i){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){let t=e.target;(t.getState()===V.LOADED||t.getState()===V.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=V.LOADED&&t!=V.ERROR&&e.addEventListener(n.CHANGE,this.boundHandleImageChange_),t==V.IDLE&&(e.load(),t=e.getState()),t==V.LOADED}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&e.getSourceState()===`ready`&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}},Cc=Sc;const wc=[];let Tc=null;function Ec(){Tc=H(1,1,void 0,{willReadFrequently:!0})}var Dc=class extends Cc{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Un(),this.pixelTransform=Un(),this.inversePixelTransform=Un(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,n){Tc||Ec(),Tc.clearRect(0,0,1,1);let r;try{Tc.drawImage(e,t,n,1,1,0,0,1,1),r=Tc.getImageData(0,0,1,1).data}catch{return Tc=null,null}return r}getBackground(e){let t=this.getLayer(),n=t.getBackground();return typeof n==`function`&&(n=n(e.viewState.resolution)),n||void 0}useContainer(e,t,n){let r=this.getLayer().getClassName(),i,a;if(e&&e.className===r&&(!n||e&&e.style.backgroundColor&&d(Yi(e.style.backgroundColor),Yi(n)))){let t=e.firstElementChild;t instanceof HTMLCanvasElement&&(a=t.getContext(`2d`))}if(a&&Zn(a.canvas.style.transform,t)?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){i=document.createElement(`div`),i.className=r;let e=i.style;e.position=`absolute`,e.width=`100%`,e.height=`100%`,a=H();let t=a.canvas;i.appendChild(t),e=t.style,e.position=`absolute`,e.left=`0`,e.transformOrigin=`top left`,this.container=i,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){let r=Le(n),i=Re(n),a=je(n),o=Ae(n);B(t.coordinateToPixelTransform,r),B(t.coordinateToPixelTransform,i),B(t.coordinateToPixelTransform,a),B(t.coordinateToPixelTransform,o);let s=this.inversePixelTransform;B(s,r),B(s,i),B(s,a),B(s,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}prepareContainer(e,t){let n=e.extent,r=e.viewState.resolution,i=e.viewState.rotation,a=e.pixelRatio,o=Math.round(L(n)/r*a),s=Math.round(I(n)/r*a);Gn(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/a,1/a,i,-o/2,-s/2),Kn(this.inversePixelTransform,this.pixelTransform);let c=Yn(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){let e=this.context.canvas;e.width!=o||e.height!=s?(e.width=o,e.height=s):this.context.clearRect(0,0,o,s),c!==e.style.transform&&(e.style.transform=c)}}dispatchRenderEvent_(e,t,n){let r=this.getLayer();if(r.hasListener(e)){let i=new bc(e,this.inversePixelTransform,n,t);r.dispatchEvent(i)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(fi.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(fi.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new qs),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(fi.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(fi.POSTRENDER,this.context,e))}getRenderTransform(e,t,n,r,i,a,o){let s=i/2,c=a/2,l=r/t,u=-l,d=-e[0]+o,f=-e[1];return Gn(this.tempTransform,s,c,l,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}},Oc=Dc,kc=class extends Oc{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=F(),this.wrappedRenderedExtent_=F(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,t,n){let r=t.extent,i=t.viewState,a=i.center,o=i.resolution,s=i.projection,c=i.rotation,l=s.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=t.pixelRatio,p=t.viewHints,m=!(p[Cs.ANIMATING]||p[Cs.INTERACTING]),h=this.context,g=Math.round(L(r)/o*f),_=Math.round(I(r)/o*f),v=u.getWrapX()&&s.canWrapX(),y=v?L(l):null,b=v?Math.ceil((r[2]-l[2])/y)+1:1,x=v?Math.floor((r[0]-l[0])/y):0;do{let r=this.getRenderTransform(a,o,0,f,g,_,x*y);t.declutter&&(r=r.slice(0)),e.execute(h,[h.canvas.width,h.canvas.height],r,c,m,n===void 0?oc:n?sc:cc,n?d&&t.declutter[d]:void 0)}while(++x{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let e=this.frameState.size.slice(),t=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,i=this.renderedProjection_,a=this.wrappedRenderedExtent_,o=this.getLayer(),s=[],c=e[0]*gc,l=e[1]*gc;s.push(this.getRenderTransform(t,n,r,gc,c,l,0).slice());let u=o.getSource(),d=i.getExtent();if(u.getWrapX()&&i.canWrapX()&&!ge(d,a)){let e=a[0],i=L(d),o=0,u;for(;ed[2];)++o,u=i*o,s.push(this.getRenderTransform(t,n,r,gc,c,l,u).slice()),e-=i}let f=In();this.hitDetectionImageData_=_c(e,s,this.renderedFeatures_,o.getStyleFunction(),a,n,r,Ya(n,this.renderedPixelRatio_),f?i:null)}t(vc(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,n,r,i){if(!this.replayGroup_)return;let a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),c={},l=function(e,t,n){let a=M(e),o=c[a];if(o){if(o!==!0&&ne.value):null)}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),n=t.getSource();if(!n)return!1;let r=e.viewHints[Cs.ANIMATING],i=e.viewHints[Cs.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let s=e.extent,c=e.viewState,l=c.projection,u=c.resolution,f=e.pixelRatio,p=t.getRevision(),m=t.getRenderBuffer(),h=t.getRenderOrder();h===void 0&&(h=Ja);let g=c.center.slice(),_=fe(s,m*u),v=_.slice(),y=[_.slice()],b=l.getExtent();if(n.getWrapX()&&l.canWrapX()&&!ge(b,e.extent)){let e=L(b),t=Math.max(L(_)/2,e);_[0]=b[0]-t,_[2]=b[2]+t,ft(g,l);let n=We(y[0],l);n[0]b[0]&&n[2]>b[2]&&y.push([n[0]-e,n[1],n[2]-e,n[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==h&&this.renderedFrameDeclutter_===!!e.declutter&&ge(this.wrappedRenderedExtent_,_))return d(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let x=new Ws(Xa(u,f),_,u,f),S=In(),C;if(S){for(let e=0,t=y.length;e{let r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,u)),r){let t=this.renderFeature(e,w,r,x,C,this.getLayer().getDeclutter(),n);T&&=!t}},D=zn(_,l),O=n.getFeaturesInExtent(D);h&&O.sort(h);for(let e=0,t=O.length;e`,GreaterThanOrEqualTo:`>=`,LessThan:`<`,LessThanOrEqualTo:`<=`,Multiply:`*`,Divide:`/`,Add:`+`,Subtract:`-`,Clamp:`clamp`,Mod:`%`,Pow:`^`,Abs:`abs`,Floor:`floor`,Ceil:`ceil`,Round:`round`,Sin:`sin`,Cos:`cos`,Atan:`atan`,Sqrt:`sqrt`,Match:`match`,Between:`between`,Interpolate:`interpolate`,Coalesce:`coalesce`,Case:`case`,In:`in`,Number:`number`,String:`string`,Array:`array`,Color:`color`,Id:`id`,Band:`band`,Palette:`palette`,ToString:`to-string`,Has:`has`},Kc={[q.Get]:X(J(1,1/0),qc),[q.Var]:X(J(1,1),Jc),[q.Has]:X(J(1,1/0),qc),[q.Id]:X(Yc,Qc),[q.Concat]:X(J(2,1/0),Y(Nc)),[q.GeometryType]:X(Xc,Qc),[q.LineMetric]:X(Qc),[q.Resolution]:X(Zc,Qc),[q.Zoom]:X(Zc,Qc),[q.Time]:X(Zc,Qc),[q.Any]:X(J(2,1/0),Y(Mc)),[q.All]:X(J(2,1/0),Y(Mc)),[q.Not]:X(J(1,1),Y(Mc)),[q.Equal]:X(J(2,2),Y(Lc)),[q.NotEqual]:X(J(2,2),Y(Lc)),[q.GreaterThan]:X(J(2,2),Y(W)),[q.GreaterThanOrEqualTo]:X(J(2,2),Y(W)),[q.LessThan]:X(J(2,2),Y(W)),[q.LessThanOrEqualTo]:X(J(2,2),Y(W)),[q.Multiply]:X(J(2,1/0),$c),[q.Coalesce]:X(J(2,1/0),$c),[q.Divide]:X(J(2,2),Y(W)),[q.Add]:X(J(2,1/0),Y(W)),[q.Subtract]:X(J(2,2),Y(W)),[q.Clamp]:X(J(3,3),Y(W)),[q.Mod]:X(J(2,2),Y(W)),[q.Pow]:X(J(2,2),Y(W)),[q.Abs]:X(J(1,1),Y(W)),[q.Floor]:X(J(1,1),Y(W)),[q.Ceil]:X(J(1,1),Y(W)),[q.Round]:X(J(1,1),Y(W)),[q.Sin]:X(J(1,1),Y(W)),[q.Cos]:X(J(1,1),Y(W)),[q.Atan]:X(J(1,2),Y(W)),[q.Sqrt]:X(J(1,1),Y(W)),[q.Match]:X(J(4,1/0),tl,nl),[q.Between]:X(J(3,3),Y(W)),[q.Interpolate]:X(J(6,1/0),tl,rl),[q.Case]:X(J(3,1/0),el,il),[q.In]:X(J(2,2),al),[q.Number]:X(J(1,1/0),Y(Lc)),[q.String]:X(J(1,1/0),Y(Lc)),[q.Array]:X(J(1,1/0),Y(W)),[q.Color]:X(J(1,4),Y(W)),[q.Band]:X(J(1,3),Y(W)),[q.Palette]:X(J(2,2),ol),[q.ToString]:X(J(1,1),Y(Mc|W|Nc|Pc))};function qc(e,t,n){let r=e.length-1,i=Array(r);for(let t=0;tt){let n=t===1/0?`${e} or more`:`${e} to ${t}`;throw Error(`expected ${n} arguments for ${a}, got ${o}`)}}}function $c(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;ae.featureId;case q.GeometryType:return e=>e.geometryType;case q.Concat:{let n=e.args.map(e=>dl(e,t));return e=>``.concat(...n.map(t=>t(e).toString()))}case q.Resolution:return e=>e.resolution;case q.Any:case q.All:case q.Between:case q.In:case q.Not:return hl(e,t);case q.Equal:case q.NotEqual:case q.LessThan:case q.LessThanOrEqualTo:case q.GreaterThan:case q.GreaterThanOrEqualTo:return ml(e,t);case q.Multiply:case q.Divide:case q.Add:case q.Subtract:case q.Clamp:case q.Mod:case q.Pow:case q.Abs:case q.Floor:case q.Ceil:case q.Round:case q.Sin:case q.Cos:case q.Atan:case q.Sqrt:return gl(e,t);case q.Case:return _l(e,t);case q.Match:return vl(e,t);case q.Interpolate:return yl(e,t);case q.ToString:return bl(e,t);default:throw Error(`Unsupported operator ${n}`)}}function fl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n{for(let t=0;t{for(let t=0;t{let n=e.args,i=t.properties[r];for(let e=1,t=n.length;ee.variables[r];case q.Has:return t=>{let n=e.args;if(!(r in t.properties))return!1;let i=t.properties[r];for(let e=1,t=n.length;er(e)===i(e);case q.NotEqual:return e=>r(e)!==i(e);case q.LessThan:return e=>r(e)r(e)<=i(e);case q.GreaterThan:return e=>r(e)>i(e);case q.GreaterThanOrEqualTo:return e=>r(e)>=i(e);default:throw Error(`Unsupported comparison operator ${n}`)}}function hl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n{for(let t=0;t{for(let t=0;t{let t=i[0](e),n=i[1](e),r=i[2](e);return t>=n&&t<=r};case q.In:return e=>{let t=i[0](e);for(let n=1;n!i[0](e);default:throw Error(`Unsupported logical operator ${n}`)}}function gl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n{let t=1;for(let n=0;ni[0](e)/i[1](e);case q.Add:return e=>{let t=0;for(let n=0;ni[0](e)-i[1](e);case q.Clamp:return e=>{let t=i[0](e),n=i[1](e);if(tr?r:t};case q.Mod:return e=>i[0](e)%i[1](e);case q.Pow:return e=>i[0](e)**+i[1](e);case q.Abs:return e=>Math.abs(i[0](e));case q.Floor:return e=>Math.floor(i[0](e));case q.Ceil:return e=>Math.ceil(i[0](e));case q.Round:return e=>Math.round(i[0](e));case q.Sin:return e=>Math.sin(i[0](e));case q.Cos:return e=>Math.cos(i[0](e));case q.Atan:return r===2?e=>Math.atan2(i[0](e),i[1](e)):e=>Math.atan(i[0](e));case q.Sqrt:return e=>Math.sqrt(i[0](e));default:throw Error(`Unsupported numeric operator ${n}`)}}function _l(e,t){let n=e.args.length,r=Array(n);for(let i=0;i{for(let t=0;t{let t=r[0](e);for(let i=1;i{let t=r[0](e),i=r[1](e),a,o;for(let s=2;s=i)return s===2?c:l?Sl(t,i,a,o,n,c):xl(t,i,a,o,n,c);a=n,o=c}return o}}function bl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n{let n=i[0](t);return e.args[0].type===Pc?Xi(n):n.toString()};default:throw Error(`Unsupported convert operator ${n}`)}}function xl(e,t,n,r,i,a){let o=i-n;if(o===0)return r;let s=t-n,c=e===1?s/o:(e**+s-1)/(e**+o-1);return r+c*(a-r)}function Sl(e,t,n,r,i,a){let o=i-n;if(o===0)return r;let s=Ki(r),c=Ki(a),l=c[2]-s[2];l>180?l-=360:l<-180&&(l+=360);let u=[xl(e,t,n,s[0],i,c[0]),xl(e,t,n,s[1],i,c[1]),s[2]+xl(e,t,n,0,i,l),xl(e,t,n,r[3],i,a[3])];return qi(u)}function Cl(e){return!0}function wl(e){let t=Gc(),n=El(e,t),r=ll();return function(e,i){if(r.properties=e.getPropertiesInternal(),r.resolution=i,t.featureId){let t=e.getId();t===void 0?r.featureId=null:r.featureId=t}return t.geometryType&&(r.geometryType=cl(e.getGeometry())),n(r)}}function Tl(e){let t=Gc(),n=e.length,r=Array(n);for(let i=0;inull;r=zl(e,t+`fill-color`,n)}if(!r)return null;let i=new es;return function(e){let t=r(e);return t===Di?null:(i.setColor(t),i)}}function kl(e,t,n){let r=Fl(e,t+`stroke-width`,n),i=zl(e,t+`stroke-color`,n);if(!r&&!i)return null;let a=Il(e,t+`stroke-line-cap`,n),o=Il(e,t+`stroke-line-join`,n),s=Bl(e,t+`stroke-line-dash`,n),c=Fl(e,t+`stroke-line-dash-offset`,n),l=Fl(e,t+`stroke-miter-limit`,n),u=new ns;return function(e){if(i){let t=i(e);if(t===Di)return null;u.setColor(t)}if(r&&u.setWidth(r(e)),a){let t=a(e);if(t!==`butt`&&t!==`round`&&t!==`square`)throw Error(`Expected butt, round, or square line cap`);u.setLineCap(t)}if(o){let t=o(e);if(t!==`bevel`&&t!==`round`&&t!==`miter`)throw Error(`Expected bevel, round, or miter line join`);u.setLineJoin(t)}return s&&u.setLineDash(s(e)),c&&u.setLineDashOffset(c(e)),l&&u.setMiterLimit(l(e)),u}}function Al(e,t){let n=`text-`,r=Il(e,n+`value`,t);if(!r)return null;let i=Ol(e,n,t),a=Ol(e,n+`background-`,t),o=kl(e,n,t),s=kl(e,n+`background-`,t),c=Il(e,n+`font`,t),l=Fl(e,n+`max-angle`,t),u=Fl(e,n+`offset-x`,t),d=Fl(e,n+`offset-y`,t),f=Rl(e,n+`overflow`,t),p=Il(e,n+`placement`,t),m=Fl(e,n+`repeat`,t),h=Ul(e,n+`scale`,t),g=Rl(e,n+`rotate-with-view`,t),_=Fl(e,n+`rotation`,t),v=Il(e,n+`align`,t),y=Il(e,n+`justify`,t),b=Il(e,n+`baseline`,t),x=Rl(e,n+`keep-upright`,t),S=Bl(e,n+`padding`,t),C=Xl(e,n+`declutter-mode`),w=new Ss({declutterMode:C});return function(e){if(w.setText(r(e)),i&&w.setFill(i(e)),a&&w.setBackgroundFill(a(e)),o&&w.setStroke(o(e)),s&&w.setBackgroundStroke(s(e)),c&&w.setFont(c(e)),l&&w.setMaxAngle(l(e)),u&&w.setOffsetX(u(e)),d&&w.setOffsetY(d(e)),f&&w.setOverflow(f(e)),p){let t=p(e);if(t!==`point`&&t!==`line`)throw Error(`Expected point or line for text-placement`);w.setPlacement(t)}if(m&&w.setRepeat(m(e)),h&&w.setScale(h(e)),g&&w.setRotateWithView(g(e)),_&&w.setRotation(_(e)),v){let t=v(e);if(t!==`left`&&t!==`center`&&t!==`right`&&t!==`end`&&t!==`start`)throw Error(`Expected left, right, center, start, or end for text-align`);w.setTextAlign(t)}if(y){let t=y(e);if(t!==`left`&&t!==`right`&&t!==`center`)throw Error(`Expected left, right, or center for text-justify`);w.setJustify(t)}if(b){let t=b(e);if(t!==`bottom`&&t!==`top`&&t!==`middle`&&t!==`alphabetic`&&t!==`hanging`)throw Error(`Expected bottom, top, middle, alphabetic, or hanging for text-baseline`);w.setTextBaseline(t)}return S&&w.setPadding(S(e)),x&&w.setKeepUpright(x(e)),w}}function jl(e,t){return`icon-src`in e?Ml(e,t):`shape-points`in e?Nl(e,t):`circle-radius`in e?Pl(e,t):null}function Ml(e,t){let n=`icon-`,r=n+`src`,i=$l(e[r],r),a=Vl(e,n+`anchor`,t),o=Ul(e,n+`scale`,t),s=Fl(e,n+`opacity`,t),c=Vl(e,n+`displacement`,t),l=Fl(e,n+`rotation`,t),u=Rl(e,n+`rotate-with-view`,t),d=ql(e,n+`anchor-origin`),f=Jl(e,n+`anchor-x-units`),p=Jl(e,n+`anchor-y-units`),m=Zl(e,n+`color`),h=Kl(e,n+`cross-origin`),g=Yl(e,n+`offset`),_=ql(e,n+`offset-origin`),v=Wl(e,n+`width`),y=Wl(e,n+`height`),b=Gl(e,n+`size`),x=Xl(e,n+`declutter-mode`),S=new hc({src:i,anchorOrigin:d,anchorXUnits:f,anchorYUnits:p,color:m,crossOrigin:h,offset:g,offsetOrigin:_,height:y,width:v,size:b,declutterMode:x});return function(e){return s&&S.setOpacity(s(e)),c&&S.setDisplacement(c(e)),l&&S.setRotation(l(e)),u&&S.setRotateWithView(u(e)),o&&S.setScale(o(e)),a&&S.setAnchor(a(e)),S}}function Nl(e,t){let n=`shape-`,r=n+`points`,i=n+`radius`,a=eu(e[r],r),o=eu(e[i],i),s=Ol(e,n,t),c=kl(e,n,t),l=Ul(e,n+`scale`,t),u=Vl(e,n+`displacement`,t),d=Fl(e,n+`rotation`,t),f=Rl(e,n+`rotate-with-view`,t),p=Wl(e,n+`radius2`),m=Wl(e,n+`angle`),h=Xl(e,n+`declutter-mode`),g=new ds({points:a,radius:o,radius2:p,angle:m,declutterMode:h});return function(e){return s&&g.setFill(s(e)),c&&g.setStroke(c(e)),u&&g.setDisplacement(u(e)),d&&g.setRotation(d(e)),f&&g.setRotateWithView(f(e)),l&&g.setScale(l(e)),g}}function Pl(e,t){let n=`circle-`,r=Ol(e,n,t),i=kl(e,n,t),a=Fl(e,n+`radius`,t),o=Ul(e,n+`scale`,t),s=Vl(e,n+`displacement`,t),c=Fl(e,n+`rotation`,t),l=Rl(e,n+`rotate-with-view`,t),u=Xl(e,n+`declutter-mode`),d=new ps({radius:5,declutterMode:u});return function(e){return a&&d.setRadius(a(e)),r&&d.setFill(r(e)),i&&d.setStroke(i(e)),s&&d.setDisplacement(s(e)),c&&d.setRotation(c(e)),l&&d.setRotateWithView(l(e)),o&&d.setScale(o(e)),d}}function Fl(e,t,n){if(!(t in e))return;let r=ul(e[t],W,n);return function(e){return eu(r(e),t)}}function Il(e,t,n){if(!(t in e))return null;let r=ul(e[t],Nc,n);return function(e){return $l(r(e),t)}}function Ll(e,t,n){let r=Il(e,t+`pattern-src`,n),i=Hl(e,t+`pattern-offset`,n),a=Hl(e,t+`pattern-size`,n),o=zl(e,t+`color`,n);return function(e){return{src:r(e),offset:i&&i(e),size:a&&a(e),color:o&&o(e)}}}function Rl(e,t,n){if(!(t in e))return null;let r=ul(e[t],Mc,n);return function(e){let n=r(e);if(typeof n!=`boolean`)throw Error(`Expected a boolean for ${t}`);return n}}function zl(e,t,n){if(!(t in e))return null;let r=ul(e[t],Pc,n);return function(e){return tu(r(e),t)}}function Bl(e,t,n){if(!(t in e))return null;let r=ul(e[t],Fc,n);return function(e){return Ql(r(e),t)}}function Vl(e,t,n){if(!(t in e))return null;let r=ul(e[t],Fc,n);return function(e){let n=Ql(r(e),t);if(n.length!==2)throw Error(`Expected two numbers for ${t}`);return n}}function Hl(e,t,n){if(!(t in e))return null;let r=ul(e[t],Fc,n);return function(e){return nu(r(e),t)}}function Ul(e,t,n){if(!(t in e))return null;let r=ul(e[t],Fc|W,n);return function(e){return ru(r(e),t)}}function Wl(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`number`)throw Error(`Expected a number for ${t}`);return n}}function Gl(e,t){let n=e[t];if(n!==void 0){if(typeof n==`number`)return ss(n);if(!Array.isArray(n)||n.length!==2||typeof n[0]!=`number`||typeof n[1]!=`number`)throw Error(`Expected a number or size array for ${t}`);return n}}function Kl(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);return n}}function ql(e,t){let n=e[t];if(n!==void 0){if(n!==`bottom-left`&&n!==`bottom-right`&&n!==`top-left`&&n!==`top-right`)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return n}}function Jl(e,t){let n=e[t];if(n!==void 0){if(n!==`pixels`&&n!==`fraction`)throw Error(`Expected pixels or fraction for ${t}`);return n}}function Yl(e,t){let n=e[t];if(n!==void 0)return Ql(n,t)}function Xl(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);if(n!==`declutter`&&n!==`obstacle`&&n!==`none`)throw Error(`Expected declutter, obstacle, or none for ${t}`);return n}}function Zl(e,t){let n=e[t];if(n!==void 0)return tu(n,t)}function Ql(e,t){if(!Array.isArray(e))throw Error(`Expected an array for ${t}`);let n=e.length;for(let r=0;r4)throw Error(`Expected a color with 3 or 4 values for ${t}`);return n}function nu(e,t){let n=Ql(e,t);if(n.length!==2)throw Error(`Expected an array of two numbers for ${t}`);return n}function ru(e,t){return typeof e==`number`?e:nu(e,t)}var iu={CENTER:`center`,RESOLUTION:`resolution`,ROTATION:`rotation`};function au(e,t,n){return(function(r,i,a,o,s){if(!r)return;if(!i&&!t)return r;let c=t?0:a[0]*i,l=t?0:a[1]*i,u=s?s[0]:0,d=s?s[1]:0,f=e[0]+c/2+u,p=e[2]-c/2+u,m=e[1]+l/2+d,h=e[3]-l/2+d;f>p&&(f=(p+f)/2,p=f),m>h&&(m=(h+m)/2,h=m);let g=R(r[0],f,p),_=R(r[1],m,h);if(o&&n&&i){let e=30*i;g+=-e*Math.log(1+Math.max(0,f-r[0])/e)+e*Math.log(1+Math.max(0,r[0]-p)/e),_+=-e*Math.log(1+Math.max(0,m-r[1])/e)+e*Math.log(1+Math.max(0,r[1]-h)/e)}return[g,_]})}function ou(e){return e}function su(e){return e**3}function cu(e){return 1-su(1-e)}function lu(e){return 3*e*e-2*e*e*e}function uu(e){return e}function du(e,t,n,r){let i=L(t)/n[0],a=I(t)/n[1];return r?Math.min(e,Math.max(i,a)):Math.min(e,Math.min(i,a))}function fu(e,t,n){let r=Math.min(e,t),i=50;return r*=Math.log(1+i*Math.max(0,e/t-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/e-1))/i+1),R(r,n/2,t*2)}function pu(e,t,n,r){return t=t===void 0?!0:t,(function(i,a,o,s){if(i!==void 0){let l=e[0],u=e[e.length-1],d=n?du(l,n,o,r):l;if(s)return t?fu(i,d,u):R(i,u,d);let f=Math.min(d,i),p=Math.floor(c(e,f,a));return e[p]>d&&p1&&typeof arguments[t-1]==`function`&&(n=arguments[t-1],--t);let r=0;for(;r0}getInteracting(){return this.hints_[Cs.INTERACTING]>0}cancelAnimations(){this.setHint(Cs.ANIMATING,-this.hints_[Cs.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t=0;--n){let r=this.animations_[n],i=!0;for(let n=0,a=r.length;n0?o/a.duration:1;s>=1?(a.complete=!0,s=1):i=!1;let c=a.easing(s);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],n=a.targetCenter[0],r=a.targetCenter[1];this.nextCenter_=a.targetCenter;let i=e+c*(n-e),o=t+c*(r-t);this.targetCenter_=[i,o]}if(a.sourceResolution&&a.targetResolution){let e=c===1?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(n,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(a.sourceRotation!==void 0&&a.targetRotation!==void 0){let e=c===1?Ze(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(i){this.animations_[n]=null,this.setHint(Cs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=r[0].callback;e&&wu(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n,r=this.getCenterInternal();return r!==void 0&&(n=[r[0]-t[0],r[1]-t[1]],ut(n,e-this.getRotation()),ct(n,t)),n}calculateCenterZoom(e,t){let n,r=this.getCenterInternal(),i=this.getResolution();if(r!==void 0&&i!==void 0){let a=t[0]-e*(t[0]-r[0])/i,o=t[1]-e*(t[1]-r[1])/i;n=[a,o]}return n}getViewportSize_(e){let t=this.viewportSize_;if(e){let n=t[0],r=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(n*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){let e=this.getCenterInternal();return e&&Ln(e,this.getProjection())}getCenterInternal(){return this.get(iu.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get(`constrainResolution`)}getHints(e){return e===void 0?this.hints_.slice():(e[0]=this.hints_[0],e[1]=this.hints_[1],e)}calculateExtent(e){let t=this.calculateExtentInternal(e);return zn(t,this.getProjection())}calculateExtentInternal(e){e||=this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();N(t,`The view center is not defined`);let n=this.getResolution();N(n!==void 0,`The view resolution is not defined`);let r=this.getRotation();return N(r!==void 0,`The view rotation is not defined`),Pe(t,n,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(iu.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(Bn(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t||=this.getViewportSizeMinusPadding_();let n=L(e)/t[0],r=I(e)/t[1];return Math.max(n,r)}getResolutionForValueFunction(e){e||=2;let t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(t/n)/Math.log(e);return(function(n){let i=t/e**+(n*r);return i})}getRotation(){return this.get(iu.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/t;return(function(e){let r=Math.log(n/e)/t/i;return r})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){let e=this.getViewportSizeMinusPadding_();r=ku(r,this.getViewportSize_(),[e[0]/2+i[3],e[1]/2+i[0]],t,n)}return{center:r.slice(0),projection:e===void 0?null:e,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,r;if(this.resolutions_){let i=c(this.resolutions_,e,1);t=i,n=this.resolutions_[i],r=i==this.resolutions_.length-1?2:n/this.resolutions_[i+1]}else n=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(n/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];let t=R(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/n**+R(e-t,0,1)}return this.maxResolution_/this.zoomFactor_**+(e-this.minZoom_)}fit(e,t){let n;if(N(Array.isArray(e)||typeof e.getSimplifiedGeometry==`function`,"Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){N(!Be(e),"Cannot fit empty extent provided as `geometry`");let t=Bn(e,this.getProjection());n=ai(t)}else if(e.getType()===`Circle`){let t=Bn(e.getExtent(),this.getProjection());n=ai(t),n.rotate(this.getRotation(),Me(t))}else{let t=In();n=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(n,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),n=Math.cos(t),r=Math.sin(-t),i=e.getFlatCoordinates(),a=e.getStride(),o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e=0,t=i.length;e{this.dispatchEvent(`sourceready`)},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t,n=this.getMapInternal();!e&&n&&(e=n.getView()),t=e instanceof Au?{viewState:e.getState(),extent:e.calculateExtent()}:e,!t.layerStatesArray&&n&&(t.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(e=>e.layer===this),!r)return!1}else r=this.getLayerState();let i=this.getExtent();return Pu(r,t.viewState)&&(!i||ze(i,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];let t=this.getSource()?.getAttributions();if(!t)return[];let n=e instanceof Au?e.getViewStateAndExtent():e,r=t(n);return Array.isArray(r)||(r=[r]),r}render(e,t){let n=this.getRenderer();return n.prepareFrame(e)?(this.rendered=!0,n.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){let t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(Z.MAP,e)}getMapInternal(){return this.get(Z.MAP)}setMap(e){this.mapPrecomposeKey_&&(E(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(E(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=w(e,fi.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=w(this,n.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){let t=e.frameState.layerStatesArray,n=this.getLayerState(!1);N(!t.some(e=>e.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(n)}setSource(e){this.set(Z.SOURCE,e)}getRenderer(){return this.renderer_||=this.createRenderer(),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}};function Pu(e,t){if(!e.visible)return!1;let n=t.resolution;if(n=e.maxResolution)return!1;let r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}var Fu=Nu;const Iu={RENDER_ORDER:`renderOrder`};var Lu=class extends Fu{constructor(e){e||={};let t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer===void 0?100:e.renderBuffer,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating===void 0?!1:e.updateWhileAnimating,this.updateWhileInteracting_=e.updateWhileInteracting===void 0?!1:e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Iu.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){let n=this.getDeclutter();n in e.declutter||(e.declutter[n]=new ko(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(Iu.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?_s:e;let t=Ru(e);this.styleFunction_=e===null?void 0:hs(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}};function Ru(e){if(e===void 0)return _s;if(!e)return null;if(typeof e==`function`||e instanceof ys)return e;if(!Array.isArray(e))return Tl([e]);if(e.length===0)return[];let t=e.length,n=e[0];if(n instanceof ys){let n=Array(t);for(let r=0;re)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){A()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:su(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}},Uu=Hu,Wu=class extends Uu{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r,this.src_=n,this.key=n,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=Q.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=Q.ERROR,this.unlistenImage_(),this.image_=Gu(),this.changed()}handleImageLoad_(){let e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=Q.LOADED:this.state=Q.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==Q.ERROR&&(this.state=Q.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Q.IDLE&&(this.state=Q.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Zi(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function Gu(){let e=H(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var Ku=Wu,qu=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Ju=qu,Yu=class extends x{constructor(e,t,n){super(e),this.map=t,this.frameState=n===void 0?null:n}},Xu=Yu,Zu=class extends Xu{constructor(e,t,n,r,i,a){super(e,t,i),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=r===void 0?!1:r,this.activePointers=a}get pixel(){return this.pixel_||=this.map.getEventPixel(this.originalEvent),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||=this.map.getCoordinateFromPixel(this.pixel),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),`preventDefault`in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),`stopPropagation`in this.originalEvent&&this.originalEvent.stopPropagation()}},Qu=Zu,$={SINGLECLICK:`singleclick`,CLICK:n.CLICK,DBLCLICK:n.DBLCLICK,POINTERDRAG:`pointerdrag`,POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},$u={POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},ed=class extends C{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;let r=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=r,this.pointerdownListenerKey_=w(r,$u.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=w(r,$u.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(n.TOUCHMOVE,this.boundHandleTouchMove_,bi?{passive:!1}:!1)}emulateClick_(e){let t=new Qu($.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_===void 0?this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let t=new Qu($.SINGLECLICK,this.map_,e);this.dispatchEvent(t)},250):(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Qu($.DBLCLICK,this.map_,e),this.dispatchEvent(t))}updateActivePointers_(e){let t=e,n=t.pointerId;if(t.type==$.POINTERUP||t.type==$.POINTERCANCEL){for(let e in delete this.trackedTouches_[n],this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else (t.type==$.POINTERDOWN||t.type==$.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new Qu($.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);let t=new Qu($.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,`target`,{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){let e=this.map_.getOwnerDocument();this.dragListenerKeys_.push(w(e,$.POINTERMOVE,this.handlePointerMove_,this),w(e,$.POINTERUP,this.handlePointerUp_,this),w(this.element_,$.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==e&&this.dragListenerKeys_.push(w(this.element_.getRootNode(),$.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new Qu($.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Qu($.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!=`boolean`||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(E(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(n.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(E(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(E),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},td=ed,nd={POSTRENDER:`postrender`,MOVESTART:`movestart`,MOVEEND:`moveend`,LOADSTART:`loadstart`,LOADEND:`loadend`},rd={LAYERGROUP:`layergroup`,SIZE:`size`,TARGET:`target`,VIEW:`view`};const id=1/0;var ad=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,v(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let r=this.keyFunction_(n);return delete this.queuedElements_[r],n}enqueue(e){N(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let t=this.priorityFunction_(e);return t==id?!1:(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){let t=this.elements_,n=this.priorities_,r=t.length,i=t[e],a=n[e],o=e;for(;e>1;){let i=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),o=ae;){let e=this.getParentIndex_(t);if(r[e]>a)n[t]=n[e],r[t]=r[e],t=e;else break}n[t]=i,r[t]=a}reprioritize(){let e=this.priorityFunction_,t=this.elements_,n=this.priorities_,r=0,i=t.length,a,o,s;for(o=0;oe.apply(null,t),e=>e[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);if(t){let t=e[0];t.addEventListener(n.CHANGE,this.boundHandleTileChange_)}return t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,r=t.getState();if(r===Q.LOADED||r===Q.ERROR||r===Q.EMPTY){r!==Q.ERROR&&t.removeEventListener(n.CHANGE,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0;for(;this.tilesLoading_0;){let e=this.dequeue()[0],t=e.getKey(),r=e.getState();r===Q.IDLE&&!(t in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[t]=!0,++this.tilesLoading_,++n,e.load())}}},cd=sd;function ld(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return id;let a=e.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}var ud=class extends ne{constructor(e){super();let t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents=`auto`),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let e=0,t=this.listenerKeys.length;et.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(e=>n.add(e)):n.add(this.attributions_)),!this.overrideCollapsible_){let e=!t.some(e=>e.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(e)}return Array.from(n)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display=`none`,this.renderedVisible_=!1);return}let t=await Promise.all(this.collectSourceAttributions_(e).map(e=>_(()=>e))),n=t.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?``:`none`,this.renderedVisible_=n),!d(t,this.renderedAttributions_)){Ti(this.ulElement_);for(let e=0,n=t.length;e0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:cu}):t.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let n=t.viewState.rotation;if(n!=this.rotation_){let e=`rotate(`+n+`rad)`;if(this.autoHide_){let e=this.element.classList.contains(da);!e&&n===0?this.element.classList.add(da):e&&n!==0&&this.element.classList.remove(da)}this.label_.style.transform=e}this.rotation_=n}},hd=md,gd=class extends dd{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target});let t=e.className===void 0?`ol-zoom`:e.className,r=e.delta===void 0?1:e.delta,i=e.zoomInClassName===void 0?t+`-in`:e.zoomInClassName,a=e.zoomOutClassName===void 0?t+`-out`:e.zoomOutClassName,o=e.zoomInLabel===void 0?`+`:e.zoomInLabel,s=e.zoomOutLabel===void 0?`–`:e.zoomOutLabel,c=e.zoomInTipLabel===void 0?`Zoom in`:e.zoomInTipLabel,l=e.zoomOutTipLabel===void 0?`Zoom out`:e.zoomOutTipLabel,u=document.createElement(`button`);u.className=i,u.setAttribute(`type`,`button`),u.title=c,u.appendChild(typeof o==`string`?document.createTextNode(o):o),u.addEventListener(n.CLICK,this.handleClick_.bind(this,r),!1);let d=document.createElement(`button`);d.className=a,d.setAttribute(`type`,`button`),d.title=l,d.appendChild(typeof s==`string`?document.createTextNode(s):s),d.addEventListener(n.CLICK,this.handleClick_.bind(this,-r),!1);let f=t+` ol-unselectable ol-control`,p=this.element;p.className=f,p.appendChild(u),p.appendChild(d),this.duration_=e.duration===void 0?250:e.duration}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap(),n=t.getView();if(!n)return;let r=n.getZoom();if(r!==void 0){let t=n.getConstrainedZoom(r+e);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:t,duration:this.duration_,easing:cu})):n.setZoom(t)}}},_d=gd;function vd(e){e||={};let t=new oe,n=e.zoom===void 0?!0:e.zoom;n&&t.push(new _d(e.zoomOptions));let r=e.rotate===void 0?!0:e.rotate;r&&t.push(new hd(e.rotateOptions));let i=e.attribution===void 0?!0:e.attribution;return i&&t.push(new pd(e.attributionOptions)),t}var yd={ACTIVE:`active`},bd=class extends ne{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(yd.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(yd.ACTIVE,e)}setMap(e){this.map_=e}};function xd(e,t,n){let r=e.getCenterInternal();if(r){let i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n===void 0?250:n,easing:uu,center:e.getConstrainedCenter(i)})}}function Sd(e,t,n,r){let i=e.getZoom();if(i===void 0)return;let a=e.getConstrainedZoom(i+t),o=e.getResolutionForZoom(a);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:n,duration:r===void 0?250:r,easing:cu})}var Cd=bd,wd=class extends Cd{constructor(e){super(),e||={},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?250:e.duration}handleEvent(e){let t=!1;if(e.type==$.DBLCLICK){let n=e.originalEvent,r=e.map,i=e.coordinate,a=n.shiftKey?-this.delta_:this.delta_,o=r.getView();Sd(o,a,i,this.duration_),n.preventDefault(),t=!0}return!t}},Td=wd;function Ed(e){let t=arguments;return function(e){let n=!0;for(let r=0,i=t.length;r0}}else if(e.type==$.POINTERDOWN){let n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==$.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}};function zd(e){let t=e.length,n=0,r=0;for(let i=0;i0&&this.condition_(e)){let t=e.map,n=t.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},Hd=Vd,Ud=class extends Bd{constructor(e){e||={},super({stopDown:m}),this.condition_=e.condition?e.condition:Dd,this.lastAngle_=void 0,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){if(!Id(e))return;let t=e.map,n=t.getView();if(n.getConstraints().rotation===gu)return;let r=t.getSize(),i=e.pixel,a=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){let e=a-this.lastAngle_;n.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){if(!Id(e))return!0;let t=e.map,n=t.getView();return n.endInteraction(this.duration_),!1}handleDownEvent(e){if(!Id(e))return!1;if(jd(e)&&this.condition_(e)){let t=e.map;return t.getView().beginInteraction(),this.lastAngle_=void 0,!0}return!1}},Wd=Ud,Gd=class extends i{constructor(e){super(),this.geometry_=null,this.element_=document.createElement(`div`),this.element_.style.position=`absolute`,this.element_.style.pointerEvents=`auto`,this.element_.className=`ol-box `+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let e=this.startPixel_,t=this.endPixel_,n=`px`,r=this.element_.style;r.left=Math.min(e[0],t[0])+n,r.top=Math.min(e[1],t[1])+n,r.width=Math.abs(t[0]-e[0])+n,r.height=Math.abs(t[1]-e[1])+n}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left=`inherit`,e.top=`inherit`,e.width=`inherit`,e.height=`inherit`}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;let e=this.startPixel_,t=this.endPixel_,n=[e,[e[0],t[1]],t,[t[0],e[1]]],r=n.map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new ii([r])}getGeometry(){return this.geometry_}},Kd=Gd;const qd={BOXSTART:`boxstart`,BOXDRAG:`boxdrag`,BOXEND:`boxend`,BOXCANCEL:`boxcancel`};var Jd=class extends x{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}},Yd=class extends Bd{constructor(e){super(),this.on,this.once,this.un,e??={},this.box_=new Kd(e.className||`ol-dragbox`),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??jd,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];return r*r+i*i>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Jd(qd.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Jd(t?qd.BOXEND:qd.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Jd(qd.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Jd(qd.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){let t=this.getMap();t&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Jd(qd.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}},Xd=Yd,Zd=class extends Xd{constructor(e){e||={};let t=e.condition?e.condition:Pd;super({condition:t,className:e.className||`ol-dragzoom`,minArea:e.minArea}),this.duration_=e.duration===void 0?200:e.duration,this.out_=e.out===void 0?!1:e.out}onBoxEnd(e){let t=this.getMap(),n=t.getView(),r=this.getGeometry();if(this.out_){let e=n.rotatedExtentForGeometry(r),t=n.getResolutionForExtentInternal(e),i=n.getResolution()/t;r=r.clone(),r.scale(i*i)}n.fitInternal(r,{duration:this.duration_,easing:cu})}},Qd=Zd,$d={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,DOWN:`ArrowDown`},ef=class extends Cd{constructor(e){super(),e||={},this.defaultCondition_=function(e){return Md(e)&&Fd(e)},this.condition_=e.condition===void 0?this.defaultCondition_:e.condition,this.duration_=e.duration===void 0?100:e.duration,this.pixelDelta_=e.pixelDelta===void 0?128:e.pixelDelta}handleEvent(e){let t=!1;if(e.type==n.KEYDOWN){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r==$d.DOWN||r==$d.LEFT||r==$d.RIGHT||r==$d.UP)){let i=e.map,a=i.getView(),o=a.getResolution()*this.pixelDelta_,s=0,c=0;r==$d.DOWN?c=-o:r==$d.LEFT?s=-o:r==$d.RIGHT?s=o:c=o;let l=[s,c];ut(l,a.getRotation()),xd(a,l,this.duration_),n.preventDefault(),t=!0}}return!t}},tf=ef,nf=class extends Cd{constructor(e){super(),e||={},this.condition_=e.condition?e.condition:function(e){return!Nd(e)&&Fd(e)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?100:e.duration}handleEvent(e){let t=!1;if(e.type==n.KEYDOWN||e.type==n.KEYPRESS){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r===`+`||r===`-`)){let i=e.map,a=r===`+`?this.delta_:-this.delta_,o=i.getView();Sd(o,a,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}},rf=nf;const af=40,sf=300;var cf=class extends Cd{constructor(e){e||={},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta===void 0?1:e.maxDelta,this.duration_=e.duration===void 0?250:e.duration,this.timeout_=e.timeout===void 0?80:e.timeout,this.useAnchor_=e.useAnchor===void 0?!0:e.useAnchor,this.constrainResolution_=e.constrainResolution===void 0?!1:e.constrainResolution;let t=e.condition?e.condition:Ad;this.condition_=e.onFocusOnly?Ed(kd,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let e=this.getMap();if(!e)return;let t=e.getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e))return!0;let t=e.type;if(t!==n.WHEEL)return!0;let r=e.map,i=e.originalEvent;i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let a=i.deltaY;switch(i.deltaMode){case WheelEvent.DOM_DELTA_LINE:a*=af;break;case WheelEvent.DOM_DELTA_PAGE:a*=sf;break;default:}if(a===0)return!1;this.lastDelta_=a;let o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?`trackpad`:`wheel`);let s=r.getView();if(this.mode_===`trackpad`&&!(s.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_?r.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=a;let c=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),c),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-R(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Sd(t,n,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}},lf=cf,uf=class extends Bd{constructor(e){e||={};let t=e;t.stopDown||=m,super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold===void 0?.3:e.threshold,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){let t=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(this.lastAngle_!==void 0){let e=i-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=i;let a=e.map,o=a.getView();o.getConstraints().rotation!==gu&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(zd(this.targetPointers))),this.rotating_&&(a.render(),o.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map,n=t.getView();return n.endInteraction(this.duration_),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}},df=uf,ff=class extends Bd{constructor(e){e||={};let t=e;t.stopDown||=m,super(t),this.anchor_=null,this.duration_=e.duration===void 0?400:e.duration,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,a=n.clientY-r.clientY,o=Math.sqrt(i*i+a*a);this.lastDistance_!==void 0&&(t=this.lastDistance_/o),this.lastDistance_=o;let s=e.map,c=s.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(zd(this.targetPointers))),s.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map,n=t.getView(),r=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}},pf=ff;function mf(e){e||={};let t=new oe,n=new Ju(-.005,.05,100),r=e.altShiftDragRotate===void 0?!0:e.altShiftDragRotate;r&&t.push(new Wd);let i=e.doubleClickZoom===void 0?!0:e.doubleClickZoom;i&&t.push(new Td({delta:e.zoomDelta,duration:e.zoomDuration}));let a=e.dragPan===void 0?!0:e.dragPan;a&&t.push(new Hd({onFocusOnly:e.onFocusOnly,kinetic:n}));let o=e.pinchRotate===void 0?!0:e.pinchRotate;o&&t.push(new df);let s=e.pinchZoom===void 0?!0:e.pinchZoom;s&&t.push(new pf({duration:e.zoomDuration}));let c=e.keyboard===void 0?!0:e.keyboard;c&&(t.push(new tf),t.push(new rf({delta:e.zoomDelta,duration:e.zoomDuration})));let l=e.mouseWheelZoom===void 0?!0:e.mouseWheelZoom;l&&t.push(new lf({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration}));let u=e.shiftDragZoom===void 0?!0:e.shiftDragZoom;return u&&t.push(new Qd({duration:e.zoomDuration})),t}var hf=class extends x{constructor(e,t){super(e),this.layer=t}};const gf={LAYERS:`layers`};var _f=class r extends Mu{constructor(e){e||={};let t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(gf.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new oe(n.slice(),{unique:!0}):N(typeof n.getArray==`function`,"Expected `layers` to be an array or a `Collection`"):n=new oe(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(E),this.layersListenerKeys_.length=0;let t=this.getLayers();for(let n in this.layersListenerKeys_.push(w(t,e.ADD,this.handleLayersAdd_,this),w(t,e.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[n].forEach(E);v(this.listenerKeys_);let n=t.getArray();for(let e=0,t=n.length;e=0;--i){let a=m[i],d=a.layer;if(d.hasRenderer()&&Pu(a,l)&&o.call(s,d)){let i=d.getRenderer(),o=d.getSource();if(i&&o){let s=o.getWrapX()?f:e,l=u.bind(null,a.managed);_[0]=s[0]+p[r][0],_[1]=s[1]+p[r][1],c=i.forEachFeatureAtCoordinate(_,t,n,l,g)}if(c)return c}}if(g.length===0)return;let v=1/g.length;return g.forEach((e,t)=>e.distanceSq+=t*v),g.sort((e,t)=>e.distanceSq-t.distanceSq),g.some(e=>c=e.callback(e.feature,e.layer,e.geometry)),c}hasFeatureAtCoordinate(e,t,n,r,i,a){let o=this.forEachFeatureAtCoordinate(e,t,n,r,p,this,i,a);return o!==void 0}getMap(){return this.map_}renderFrame(e){A()}scheduleExpireIconCache(e){na.canExpireCache()&&e.postRenderFunctions.push(bf)}};function bf(e,t){na.expire()}var xf=yf,Sf=class extends xf{constructor(e){super(e),this.fontChangeListenerKey_=w(Aa,t.PROPERTYCHANGE,e.redrawText,e),this.element_=document.createElement(`div`);let n=this.element_.style;n.position=`absolute`,n.width=`100%`,n.height=`100%`,n.zIndex=`0`,this.element_.className=fa+` ol-layers`;let r=e.getViewport();r.insertBefore(this.element_,r.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let n=this.getMap();if(n.hasListener(e)){let r=new bc(e,void 0,t);n.dispatchEvent(r)}}disposeInternal(){E(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display=`none`,this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(fi.PRECOMPOSE,e);let t=e.layerStatesArray.sort((e,t)=>e.zIndex-t.zIndex),n=t.some(e=>e.layer instanceof zu&&e.layer.getDeclutter());n&&(e.declutter={});let r=e.viewState;this.children_.length=0;let i=[],a=null;for(let n=0,o=t.length;n=0;--n){let r=t[n],i=r.layer;i.getDeclutter()&&i.renderDeclutter(e,r)}t.forEach(t=>t.layer.renderDeferred(e))}}},Cf=Sf;function wf(e){if(e instanceof Fu){e.setMapInternal(null);return}e instanceof vf&&e.getLayers().forEach(wf)}function Tf(e,t){if(e instanceof Fu){e.setMapInternal(t);return}if(e instanceof vf){let n=e.getLayers().getArray();for(let e=0,r=n.length;ethis.updateSize()),this.controls=n.controls||vd(),this.interactions=n.interactions||mf({onFocusOnly:!0}),this.overlays_=n.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new cd(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(rd.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(rd.VIEW,this.handleViewChanged_),this.addChangeListener(rd.SIZE,this.handleSizeChanged_),this.addChangeListener(rd.TARGET,this.handleTargetChanged_),this.setProperties(n.values);let r=this;t.view&&!(t.view instanceof Au)&&t.view.then(function(e){r.setView(new Au(e))}),this.controls.addEventListener(e.ADD,e=>{e.element.setMap(this)}),this.controls.addEventListener(e.REMOVE,e=>{e.element.setMap(null)}),this.interactions.addEventListener(e.ADD,e=>{e.element.setMap(this)}),this.interactions.addEventListener(e.REMOVE,e=>{e.element.setMap(null)}),this.overlays_.addEventListener(e.ADD,e=>{this.addOverlayInternal_(e.element)}),this.overlays_.addEventListener(e.REMOVE,e=>{let t=e.element.getId();t!==void 0&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}),this.controls.forEach(e=>{e.setMap(this)}),this.interactions.forEach(e=>{e.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){let t=this.getLayerGroup().getLayers();t.push(e)}handleLayerAdd_(e){Tf(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,n){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(e);n=n===void 0?{}:n;let i=n.hitTolerance===void 0?0:n.hitTolerance,a=n.layerFilter===void 0?p:n.layerFilter,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,o,t,null,a,null)}getFeaturesAtPixel(e,t){let n=[];return this.forEachFeatureAtPixel(e,function(e){n.push(e)},t),n}getAllLayers(){let e=[];function t(n){n.forEach(function(n){n instanceof vf?t(n.getLayers()):e.push(n)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let n=this.getCoordinateFromPixelInternal(e);t=t===void 0?{}:t;let r=t.layerFilter===void 0?p:t.layerFilter,i=t.hitTolerance===void 0?0:t.hitTolerance,a=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_,n=t.getBoundingClientRect(),r=this.getSize(),i=n.width/r[0],a=n.height/r[1],o=`changedTouches`in e?e.changedTouches[0]:e;return[(o.clientX-n.left)/i,(o.clientY-n.top)/a]}getTarget(){return this.get(rd.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Ln(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?B(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return t===void 0?null:t}getInteractions(){return this.interactions}getLayerGroup(){return this.get(rd.LAYERGROUP)}setLayers(e){let t=this.getLayerGroup();if(e instanceof oe){t.setLayers(e);return}let n=t.getLayers();n.clear(),n.extend(e)}getLayers(){let e=this.getLayerGroup().getLayers();return e}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t=0;n--){let r=t[n];if(r.getMap()!==this||!r.getActive()||!this.getTargetElement())continue;let i=r.handleEvent(e);if(!i||e.propagationStopped)break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let n=this.maxTilesLoading_,r=n;if(e){let t=e.viewHints;if(t[Cs.ANIMATING]||t[Cs.INTERACTING]){let t=Date.now()-e.time>8;n=t?0:8,r=t?0:2}}t.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0)}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new hf(`removelayer`,t)),this.set(rd.LAYERGROUP,e)}setSize(e){this.set(rd.SIZE,e)}setTarget(e){this.set(rd.TARGET,e)}setView(e){if(!e||e instanceof Au){this.set(rd.VIEW,e);return}this.set(rd.VIEW,new Au);let t=this;e.then(function(e){t.setView(new Au(e))})}updateSize(){let e=this.getTargetElement(),t;if(e){let n=getComputedStyle(e),r=e.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),i=e.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(r)&&!isNaN(i)&&(t=[Math.max(0,r),Math.max(0,i)],!rs(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&st(`No map visible because the map container's width or height are 0.`))}let n=this.getSize();t&&(!n||!d(t,n))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){let t=this.getView();t&&t.setViewportSize(e)}};function Df(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget==`string`?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let n={},r=e.layers&&typeof e.layers.getLayers==`function`?e.layers:new vf({layers:e.layers});n[rd.LAYERGROUP]=r,n[rd.TARGET]=e.target,n[rd.VIEW]=e.view instanceof Au?e.view:new Au;let i;e.controls!==void 0&&(Array.isArray(e.controls)?i=new oe(e.controls.slice()):(N(typeof e.controls.getArray==`function`,"Expected `controls` to be an array or an `ol/Collection.js`"),i=e.controls));let a;e.interactions!==void 0&&(Array.isArray(e.interactions)?a=new oe(e.interactions.slice()):(N(typeof e.interactions.getArray==`function`,"Expected `interactions` to be an array or an `ol/Collection.js`"),a=e.interactions));let o;return e.overlays===void 0?o=new oe:Array.isArray(e.overlays)?o=new oe(e.overlays.slice()):(N(typeof e.overlays.getArray==`function`,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=e.overlays),{controls:i,interactions:a,keyboardEventTarget:t,overlays:o,values:n}}var Of=Ef,kf=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}};function Af(e,t,n,r,i){return i===void 0?new kf(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}var jf=kf,Mf=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=le,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?z(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=z(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return A()}readFeature(e,t){return A()}readFeatures(e,t){return A()}readGeometry(e,t){return A()}readProjection(e){return A()}writeFeature(e,t){return A()}writeFeatures(e,t){return A()}writeGeometry(e,t){return A()}},Nf=Mf;function Pf(e,t,n){let r=n?z(n.featureProjection):null,i=n?z(n.dataProjection):null,a=e;if(r&&i&&!kn(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(Mn(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals,r=function(e){for(let n=0,r=e.length;nLf({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return Pf(new To(r,r===`Polygon`?If(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function Rf(e,t){if(!e)return null;if(Array.isArray(e)){let n=e.map(e=>Rf(e,t));return new go(n)}let n=Ff[e.type];return Pf(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var zf=class extends Nf{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(Bf(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(Bf(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return A()}readFeaturesFromObject(e,t){return A()}readGeometry(e,t){return this.readGeometryFromObject(Bf(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return A()}readProjection(e){return this.readProjectionFromObject(Bf(e))}readProjectionFromObject(e){return A()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return A()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return A()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return A()}};function Bf(e){if(typeof e==`string`){let t=JSON.parse(e);return t||null}return e===null?null:e}var Vf=zf,Hf=class extends Vf{constructor(e){e||={},super(),this.dataProjection=z(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=z(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=Uf(n.geometry,t);if(this.featureClass===To)return Lf({geometry:r,id:n.id,properties:n.properties},t);let i=new le;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&i.setGeometryName(n.geometry_name),i.setGeometry(Rf(r,t)),`id`in n&&i.setId(n.id),n.properties&&i.setProperties(n.properties,!0),i}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e2||Math.abs(e[t*4+3]-.75*255)>2}function gp(){if(fp===void 0){let e=H(6,6,pp);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,mp(e,4,5,4,0),mp(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;fp=hp(t,0)||hp(t,4)||hp(t,8),Ci(e),pp.push(e.canvas)}return fp}function _p(e,t,n,r){let i=Nn(n,t,e),a=Cn(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||he(c,i)){let t=Cn(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function vp(e,t,n,r){let i=Me(n),a=_p(e,t,i,r);return(!isFinite(a)||a<=0)&&Oe(n,function(n){return a=_p(e,t,n,r),isFinite(a)&&a>0}),a}function yp(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=H(Math.round(n*e),Math.round(n*t),pp);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=F();c.forEach(function(e,t,n){we(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){if(_=H(Math.round(L(g)*v),Math.round(I(g)*v),pp),d||(_.imageSmoothingEnabled=!1),i&&p){let e=(i[0]-g[0])*v,t=-(i[3]-g[3])*v,n=L(i)*v,r=I(i)*v;_.rect(e,t,n,r),_.clip()}c.forEach(function(e,t,n){if(e.image.width>0&&e.image.height>0){if(e.clipExtent){_.save();let t=(e.clipExtent[0]-g[0])*v,n=-(e.clipExtent[3]-g[3])*v,r=L(e.clipExtent)*v,i=I(e.clipExtent)*v;_.rect(d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),_.clip()}let t=(e.extent[0]-g[0])*v,n=-(e.extent[3]-g[3])*v,r=L(e.extent)*v,i=I(e.extent)*v;_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),e.clipExtent&&_.restore()}})}let b=Le(o);return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),E=o,D=s;o=0,s=0,l-=E,u-=D,f-=E,p-=D;let O=[[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]],k=Je(O);if(!k)return;if(m.save(),m.beginPath(),gp()||!d){m.moveTo(S,C);let e=4,t=v-S,n=x-C;for(let r=0;rB(o,Nn(e,this.targetProj_,this.sourceProj_))):Mn(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&L(r)>=L(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?L(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?L(this.targetProj_.getExtent()):null;let l=Le(n),u=Re(n),d=je(n),f=Ae(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=bp+(a?Math.max(0,Math.ceil(Math.log2(ke(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]),i=Math.max(n[0][0],n[1][0],n[2][0]);i-r.5&&u<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){let i=ue([e,t,n,r]),a=L(i)/this.targetWorldWidth_;p=a>xp||p}!f&&this.sourceProj_.isGlobal()&&u&&(p=u>xp||p)}if(!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!ze(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(s[0])||!isFinite(s[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;if(f){let e=(Ze(i[0],d)+Ze(o[0],d))/2;a=e-Ze(r[0],d)}else a=(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1],c=a*a+s*s;p=c>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=F();return this.triangles_.forEach(function(t,n,r){let i=t.source;Te(e,i[0]),Te(e,i[1]),Te(e,i[2])}),e}getTriangles(){return this.triangles_}},Cp=Sp;const wp=.5;var Tp=class extends Uu{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,Q.IDLE,d),this.renderEdges_=u===void 0?!1:u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?Ie(f,p):f;if(ke(h)===0){this.state=Q.EMPTY;return}let g=e.getExtent();g&&(m=m?Ie(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=vp(e,n,h,_);if(!isFinite(v)||v<=0){this.state=Q.EMPTY;return}let y=l===void 0?wp:l;if(this.triangulation_=new Cp(e,n,h,m,v*y,_),this.triangulation_.getTriangles().length===0){this.state=Q.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(b[1]=R(b[1],m[1],m[3]),b[3]=R(b[3],m[1],m[3])):b=Ie(b,m)),!ke(b))this.state=Q.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=L(g),r=Math.floor((b[0]-g[0])/n));let i=Ge(b.slice(),e,!0);i.forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=c(this.sourceZ_,e,t,o);if(i){let e=r*n;this.sourceTiles_.push({tile:i,offset:e})}}++r}),this.sourceTiles_.length===0&&(this.state=Q.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==Q.LOADED){let r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=t.offset,r[2]+=t.offset;let i=this.clipExtent_?.slice();i&&(i[0]+=t.offset,i[2]+=t.offset),e.push({extent:r,clipExtent:i,image:n.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=Q.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=yp(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=Q.LOADED}this.changed()}load(){if(this.state==Q.IDLE){this.state=Q.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let r=t.getState();if(r==Q.IDLE||r==Q.LOADING){e++;let r=w(t,n.CHANGE,n=>{let i=t.getState();(i==Q.LOADED||i==Q.ERROR||i==Q.EMPTY)&&(E(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},t,n){let r=e.getState();r==Q.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(E),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Ci(this.canvas_.getContext(`2d`)),pp.push(this.canvas_),this.canvas_=null),super.release()}},Ep=Tp,Dp=class{constructor(e){this.highWaterMark=e===void 0?2048:e,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let e=this.pop();e instanceof i&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){let n=this.entries_[e];return N(n!==void 0,`Tried to get a value for a key that does not exist in the cache`),n===this.newest_?n.value_:(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n,n.value_)}remove(e){let t=this.entries_[e];return N(t!==void 0,`Tried to get a value for a key that does not exist in the cache`),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){let e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){N(!(e in this.entries_),`Tried to set a value for a key that is used already`);let n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}},Op=Dp;function kp(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function Ap(e,t,n){return e+`/`+t+`/`+n}function jp(e){return Mp(e[0],e[1],e[2])}function Mp(e,t,n){return(t<n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return a?a.containsXY(r,i):!0}function Pp(e,t,n,r,i){return`${M(e)},${t},${Ap(n,r,i)}`}function Fp(e,t,n){if(!(n in e))return e[n]=new Set([t]),!0;let r=e[n],i=r.has(t);return i||r.add(t),!i}function Ip(e,t,n){let r=e[n];return r?r.delete(t):!1}function Lp(e,t){let n=e.layerStatesArray[e.layerIndex];n.extent&&(t=Ie(t,Bn(n.extent,e.viewState.projection)));let r=n.layer.getRenderSource();if(!r.getWrapX()){let n=r.getTileGridForProjection(e.viewState.projection).getExtent();n&&(t=Ie(t,n))}return t}var Rp=class extends Oc{constructor(e,t){super(e),t||={},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=F(),this.tempTileRange_=new jf(0,0,0,0),this.tempTileCoord_=kp(0,0,0);let n=t.cacheSize===void 0?512:t.cacheSize;this.tileCache_=new Op(n),this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(e,t,n,r){let i=this.tileCache_,a=this.getLayer(),o=a.getSource(),s=Pp(o,o.getKey(),e,t,n),c;if(i.containsKey(s))c=i.get(s);else{if(c=o.getTile(e,t,n,r.pixelRatio,r.viewState.projection),!c)return null;i.set(s,c)}return c}getTile(e,t,n,r){let i=this.getOrCreateTile(e,t,n,r);return i||null}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=B(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!he(i,r))return null;let a=t.viewState,o=n.getRenderSource(),s=o.getTileGridForProjection(a.projection),c=o.getTilePixelRatio(t.pixelRatio);for(let e=s.getZForResolution(a.resolution);e>=s.getMinZoom();--e){let n=s.getTileCoordForCoordAndZ(r,e),i=this.getTile(e,n[1],n[2],t);if(!i||i.getState()!==Q.LOADED)continue;let l=s.getOrigin(e),u=ss(s.getTileSize(e)),d=s.getResolution(e),f;if(i instanceof Ku||i instanceof Ep)f=i.getImage();else if(i instanceof dp){if(f=sp(i.getData()),!f)continue}else continue;let p=Math.floor(c*((r[0]-l[0])/d-n[1]*u[0])),m=Math.floor(c*((l[1]-r[1])/d-n[2]*u[1])),h=Math.round(c*o.getGutterForProjection(a.projection));return this.getImageData(f,p+h,m+h)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;let t=this.getLayer().getSource();if(!t)return!1;let n=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===t.getKey()&&this.tileCache_.clear()):this.renderedSourceRevision_=n,!0}enqueueTiles(e,t,n,r,i){let a=e.viewState,o=this.getLayer(),s=o.getRenderSource(),c=s.getTileGridForProjection(a.projection),l=M(s);l in e.wantedTiles||(e.wantedTiles[l]={});let u=e.wantedTiles[l],d=o.getMapInternal(),f=Math.max(n-i,c.getMinZoom(),c.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):c.getResolution(0)),s.zDirection)),p=a.rotation,m=p?Fe(a.center,a.resolution,p,e.size):void 0;for(let i=n;i>=f;--i){let n=c.getTileRangeForExtentAndZ(t,i,this.tempTileRange_),a=c.getResolution(i);for(let t=n.minX;t<=n.maxX;++t)for(let o=n.minY;o<=n.maxY;++o){if(p&&!c.tileCoordIntersectsViewport([i,t,o],m))continue;let n=this.getTile(i,t,o,e);if(!n)continue;let s=Fp(r,n,i);if(!s)continue;let d=n.getKey();if(u[d]=!0,n.getState()===Q.IDLE&&!e.tileQueue.isKeyQueued(d)){let r=kp(i,t,o,this.tempTileCoord_);e.tileQueue.enqueue([n,l,c.getTileCoordCenter(r),a])}}}}findStaleTile_(e,t){let n=this.tileCache_,r=e[0],i=e[1],a=e[2],o=this.getStaleKeys();for(let e=0;e0&&setTimeout(()=>{this.enqueueTiles(e,T,f-1,C,w-1)},0),!(f in C))return this.container;let E=M(this),D=e.time;for(let t of C[f]){let n=t.getState();if(n===Q.EMPTY)continue;let r=t.tileCoord;if(n===Q.LOADED){let e=t.getAlpha(E,D);if(e===1){t.endTransition(E);continue}}n!==Q.ERROR&&(this.renderComplete=!1);let i=this.findStaleTile_(r,C);if(i){Ip(C,t,f),e.animate=!0;continue}let a=this.findAltTiles_(d,r,f+1,C);if(a)continue;let o=d.getMinZoom();for(let e=f-1;e>=o;--e){let t=this.findAltTiles_(d,r,e,C);if(t)break}}let O=p/a*c/g,k=this.getRenderContext(e);Gn(this.tempTransform,_/2,v/2,O,O,0,-_/2,-v/2),n.extent&&this.clipUnrotated(k,e,y),u.getInterpolate()||(k.imageSmoothingEnabled=!1),this.preRender(k,e);let A=Object.keys(C).map(Number);A.sort(o);let j,ee=[],te=[];for(let t=A.length-1;t>=0;--t){let n=A[t],r=u.getTilePixelSize(n,c,i),a=d.getResolution(n),o=a/p,s=r[0]*o*O,l=r[1]*o*O,f=d.getTileCoordForCoordAndZ(Le(S),n),m=d.getTileCoordExtent(f),h=B(this.tempTransform,[g*(m[0]-S[0])/p,g*(S[3]-m[3])/p]),_=g*u.getGutterForProjection(i);for(let t of C[n]){if(t.getState()!==Q.LOADED)continue;let r=t.tileCoord,i=f[1]-r[1],a=Math.round(h[0]-(i-1)*s),o=f[2]-r[2],c=Math.round(h[1]-(o-1)*l),d=Math.round(h[0]-i*s),p=Math.round(h[1]-o*l),m=a-d,g=c-p,v=A.length===1,y=!1;j=[d,p,d+m,p,d+m,p+g,d,p+g];for(let e=0,t=ee.length;e{let n=M(u),r=t.wantedTiles[n],i=r?Object.keys(r).length:0;this.updateCacheSize(i),this.tileCache_.expireCache()};e.postRenderFunctions.push(t)}return this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,n,r,i,a,o,s){let c;if(e instanceof dp){if(c=sp(e.getData()),!c)throw Error(`Rendering array data is not yet supported`)}else c=this.getTileImage(e);if(!c)return;let l=this.getRenderContext(t),u=M(this),d=t.layerStatesArray[t.layerIndex],f=d.opacity*(s?e.getAlpha(u,t.time):1),p=f!==l.globalAlpha;p&&(l.save(),l.globalAlpha=f),l.drawImage(c,o,o,c.width-2*o,c.height-2*o,n,r,i,a),p&&l.restore(),f===d.opacity?s&&e.endTransition(u):t.animate=!0}getImage(){let e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,n){let r=M(t);r in e||(e[r]={}),e[r][n.getKey()]=!0}},zp=Rp,Bp={PRELOAD:`preload`,USE_INTERIM_TILES_ON_ERROR:`useInterimTilesOnError`},Vp=class extends Fu{constructor(e){e||={};let t=Object.assign({},e),n=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(e.preload===void 0?0:e.preload),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0?!0:e.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Bp.PRELOAD)}setPreload(e){this.set(Bp.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Bp.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Bp.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}},Hp=Vp,Up=class extends Hp{constructor(e){super(e)}createRenderer(){return new zp(this,{cacheSize:this.getCacheSize()})}},Wp=Up;const Gp=[0,0,0],Kp=5;var qp=class{constructor(e){this.minZoom=e.minZoom===void 0?0:e.minZoom,this.resolutions_=e.resolutions,N(f(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let e=0,n=this.resolutions_.length-1;e{let r=new jf(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(n){let e=this.getTileRangeForExtentAndZ(n,t);r.minX=Math.max(e.minX,r.minX),r.maxX=Math.min(e.maxX,r.maxX),r.minY=Math.max(e.minY,r.minY),r.maxY=Math.min(e.maxY,r.maxY)}return r})}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=Af(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]this.maxZoom||t0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;ethis.getTileInternal(e,t,n,r,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=s,d}getTileInternal(e,t,n,r,i){let a=this.getKey();return this.createTile_(e,t,n,r,i,a)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=z(e);if(n){let e=M(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function vm(e,t){e.getImage().src=t}var ym=_m,bm=class extends ym{constructor(e){e||={};let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid===void 0?Qp({extent:tm(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}):e.tileGrid;super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter}getGutter(){return this.gutter_}},xm=bm;const Sm=`© OpenStreetMap contributors.`;var Cm=class extends xm{constructor(e){e||={};let t;t=e.attributions===void 0?[Sm]:e.attributions;let n=e.crossOrigin===void 0?`anonymous`:e.crossOrigin,r=e.url===void 0?`https://tile.openstreetmap.org/{z}/{x}/{y}.png`:e.url;super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,interpolate:e.interpolate,maxZoom:e.maxZoom===void 0?19:e.maxZoom,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:r,wrapX:e.wrapX,zDirection:e.zDirection})}},wm=Cm;export{ps as Circle,le as Feature,es as Fill,op as GeoJSON,wm as OSM,Of as OlMap,Lr as Point,ns as Stroke,ys as Style,Wp as TileLayer,Vu as VectorLayer,Qo as VectorSource,Au as View,F as createEmpty,On as fromLonLat}; +//# sourceMappingURL=ol.min.js.map \ No newline at end of file diff --git a/searx/static/themes/simple/js/ol.min.js.map b/searx/static/themes/simple/js/ol.min.js.map new file mode 100644 index 000000000..12ef0097b --- /dev/null +++ b/searx/static/themes/simple/js/ol.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ol.min.js","names":["extend","equals","arrayEquals","Disposable","Event","EventTarget","EventType","Event","Observable","ObjectEventType","Property","Event","BaseObject","CollectionEventType","BaseObject","clone","EventType","coordinates","Relationship","isEmpty","intersects","wrapX","equals","scale","wrapX","RADIUS","EXTENT","Projection","METERS_PER_UNIT","Projection","PROJECTIONS","cache","get","add","add","get","fromLonLat","a2","Projection","makeUTMTransforms","makeUTMProjection","disable","addProj","addTransformFunc","getProj","makeProjection","projection","toEPSG4326","getTransformFunc","makeTransforms","equals","EPSG3857_PROJECTIONS","EPSG4326_PROJECTIONS","transform","toString","fromString","equivalent","transform","rotate","scale","tmpTransform","createTransform","BaseObject","transform","clone","extent","getProjection","scale","composeTransform","Geometry","coordinates","rotate","scale","transform","linearRingss","squaredDx","tmpPoint","squaredDistance","coordinates","coordinates","squaredDistance","SimpleGeometry","coordinates","linearRingArea","SimpleGeometry","coordinates","squaredDistance","squaredDx","forEachSegment","reverseCoordinates","SimpleGeometry","coordinates","linearRing","extend","linearRingsArea","Point","LinearRing","linearRings","isEmpty","SimpleGeometry","coordinates","extend","forEachSegment","canvasPool","EventType","getCacheKey","ImageState","EventTarget","ImageState","EventType","get","iconImageCache","iconCache","ImageState","getIconImage","BaseObject","cache","transform","scale","context","VectorContext","transform","createTransform","composeTransform","equals","transform","loading","ImageState","xhr","all","Geometry","EventType","SimpleGeometry","coordinates","ends","extend","layout","LineString","SimpleGeometry","coordinates","extend","squaredDistance","squaredDx","Point","SimpleGeometry","coordinates","extend","linearRingssArea","linearRingssCenter","MultiPoint","Polygon","createTransform","linearRingssCenter","extend","transform","getProjection","scale","composeTransform","intersects","level","extend","RBush","RBush_","BaseObject","getProjection","self","Event","Source","allStrategy","RBush","Collection","VectorEventType","RenderFeature","EventType","ObjectEventType","CollectionEventType","extend","getIconImage","ImageState","scale","ImageStyle","ImageState","scale","iconImageCache","IconImage","add","RegularShape","scale","Fill","Stroke","CircleStyle","Fill","scale","VectorContext","coordinates","Relationship","CanvasInstruction","fillInstruction","equals","CanvasBuilder","CanvasInstruction","CanvasBuilder","CanvasInstruction","CanvasBuilder","CanvasInstruction","coordinates","CanvasBuilder","coordinates","p1","p2","p3","CanvasInstruction","scale","PolygonBuilder","Builder","ImageBuilder","LineStringBuilder","TextBuilder","scale","measureAndCacheTextWidth","cache","rotate","render","createTransform","ZIndexContext","scale","text","p1","p2","p3","p4","fillInstruction","strokeInstruction","transform","composeTransform","applyTransform","intersects","equals","transformSetFromArray","CanvasInstruction","render","i","ii","createTransform","transform","Executor","composeTransform","i","result","context","ImageStyle","scale","ImageState","getIconImage","image","EventType","transforms","CanvasImmediateRenderer","Icon","i","geometry","Event","Observable","ImageState","EventType","canvasPool","LayerRenderer","createTransform","transform","equals","equivalent","applyTransform","composeTransform","toTransformString","RenderEvent","RenderEventType","ZIndexContext","CanvasLayerRenderer","ViewHint","transform","canvasPool","render","RenderEventType","intersectsExtent","transforms","userProjection","getSquaredRenderTolerance","defaultRenderOrder","wrapCoordinateX","wrapExtentX","equals","CanvasBuilderGroup","getRenderTolerance","extent","userExtent","ExecutorGroup","colorFromString","context","always","context","Style","Fill","Stroke","Text","Icon","RegularShape","Circle","none","BaseObject","ViewProperty","ViewHint","rotateCoordinate","addCoordinate","isEmpty","polygonFromExtent","userProjection","equals","centerNone","rotationNone","coordinatesEqual","BaseObject","LayerProperty","BaseLayer","LayerProperty","EventType","View","layerState","RenderEventType","Property","Layer","toStyleFunction","Style","BaseVectorLayer","CanvasVectorLayerRenderer","EventTarget","EventType","TileState","Tile","TileState","Event","MapEvent","EventType","Target","PointerEventType","EventType","MapBrowserEvent","MapBrowserEventType","newEvent","PriorityQueue","EventType","TileState","BaseObject","MapEventType","Control","EventType","equals","Control","EventType","transform","contains","Control","EventType","Collection","Zoom","Rotate","Attribution","BaseObject","InteractionProperty","Interaction","MapBrowserEventType","Interaction","MapBrowserEventType","PointerInteraction","centroid","centroidFromPointers","map","scaleCoordinate","rotateCoordinate","PointerInteraction","Disposable","coordinates","Polygon","Event","PointerInteraction","RenderBox","DragBox","Interaction","EventType","Key","rotateCoordinate","Interaction","EventType","Interaction","EventType","PointerInteraction","centroidFromPointers","PointerInteraction","centroidFromPointers","defaults","Collection","Kinetic","DragRotate","DoubleClickZoom","DragPan","PinchRotate","PinchZoom","KeyboardPan","KeyboardZoom","MouseWheelZoom","DragZoom","Event","BaseLayer","Collection","CollectionEventType","ObjectEventType","EventType","Disposable","composeTransform","wrapX","coordinates","callback","iconImageCache","MapRenderer","ObjectEventType","RenderEvent","RenderEventType","BaseVectorLayer","Layer","LayerGroup","BaseObject","createTransform","defaultControls","defaultInteractions","TileQueue","MapProperty","View","CollectionEventType","applyTransform","Collection","MapBrowserEvent","PointerEventType","EventType","ViewHint","RenderEventType","MapEvent","MapEventType","CompositeMapRenderer","MapBrowserEventHandler","MapBrowserEventType","ObjectEventType","isEmpty","equalsExtent","equals","createOrUpdate","Feature","getProjection","equivalentProjection","transform","coordinates","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","geometry","RenderFeature","GeometryCollection","Geometry","FeatureFormat","JSONFeature","getProjection","RenderFeature","Feature","coordinates","geometry","Tile","TileState","self","width","height","xPos","yPos","source","applyMatrix","Tile","TileState","Triangulation","renderReprojected","EventType","state","Disposable","createOrUpdate","CanvasLayerRenderer","TileRange","createTileCoord","cacheSize","LRUCache","applyTransform","TileState","ImageTile","ReprojTile","DataTile","composeTransform","dx","dy","i","frameState","Layer","cacheSize","TileProperty","BaseTileLayer","CanvasTileLayerRenderer","TileRange","createOrUpdateTileRange","scale","createOrUpdateTileCoord","TileGrid","getProjection","tileCoordHash","Source","getTileGridForProjection","scaleSize","Event","TileSource","TileState","TileEventType","UrlTile","ImageTile","getTileGridForProjection","TileState","EventType","ReprojTile","z","x","y","pixelRatio","render","getProjection","TileImage","XYZ"],"sources":["../../../../../client/simple/node_modules/ol/CollectionEventType.js","../../../../../client/simple/node_modules/ol/ObjectEventType.js","../../../../../client/simple/node_modules/ol/events/EventType.js","../../../../../client/simple/node_modules/ol/Disposable.js","../../../../../client/simple/node_modules/ol/array.js","../../../../../client/simple/node_modules/ol/functions.js","../../../../../client/simple/node_modules/ol/obj.js","../../../../../client/simple/node_modules/ol/events/Event.js","../../../../../client/simple/node_modules/ol/events/Target.js","../../../../../client/simple/node_modules/ol/events.js","../../../../../client/simple/node_modules/ol/Observable.js","../../../../../client/simple/node_modules/ol/util.js","../../../../../client/simple/node_modules/ol/Object.js","../../../../../client/simple/node_modules/ol/Collection.js","../../../../../client/simple/node_modules/ol/asserts.js","../../../../../client/simple/node_modules/ol/Feature.js","../../../../../client/simple/node_modules/ol/extent/Relationship.js","../../../../../client/simple/node_modules/ol/extent.js","../../../../../client/simple/node_modules/ol/math.js","../../../../../client/simple/node_modules/ol/sphere.js","../../../../../client/simple/node_modules/ol/console.js","../../../../../client/simple/node_modules/ol/coordinate.js","../../../../../client/simple/node_modules/ol/proj/Units.js","../../../../../client/simple/node_modules/ol/proj/Projection.js","../../../../../client/simple/node_modules/ol/proj/epsg3857.js","../../../../../client/simple/node_modules/ol/proj/epsg4326.js","../../../../../client/simple/node_modules/ol/proj/projections.js","../../../../../client/simple/node_modules/ol/proj/transforms.js","../../../../../client/simple/node_modules/ol/proj/utm.js","../../../../../client/simple/node_modules/ol/proj.js","../../../../../client/simple/node_modules/ol/transform.js","../../../../../client/simple/node_modules/ol/geom/flat/transform.js","../../../../../client/simple/node_modules/ol/geom/Geometry.js","../../../../../client/simple/node_modules/ol/geom/SimpleGeometry.js","../../../../../client/simple/node_modules/ol/geom/flat/area.js","../../../../../client/simple/node_modules/ol/geom/flat/closest.js","../../../../../client/simple/node_modules/ol/geom/flat/deflate.js","../../../../../client/simple/node_modules/ol/geom/flat/inflate.js","../../../../../client/simple/node_modules/ol/geom/flat/simplify.js","../../../../../client/simple/node_modules/ol/geom/LinearRing.js","../../../../../client/simple/node_modules/ol/geom/Point.js","../../../../../client/simple/node_modules/ol/geom/flat/contains.js","../../../../../client/simple/node_modules/ol/geom/flat/interiorpoint.js","../../../../../client/simple/node_modules/ol/geom/flat/segments.js","../../../../../client/simple/node_modules/ol/geom/flat/intersectsextent.js","../../../../../client/simple/node_modules/ol/geom/flat/reverse.js","../../../../../client/simple/node_modules/ol/geom/flat/orient.js","../../../../../client/simple/node_modules/ol/geom/Polygon.js","../../../../../client/simple/node_modules/ol/geom/flat/interpolate.js","../../../../../client/simple/node_modules/ol/geom/flat/length.js","../../../../../client/simple/node_modules/ol/geom/LineString.js","../../../../../client/simple/node_modules/ol/render/EventType.js","../../../../../client/simple/node_modules/ol/has.js","../../../../../client/simple/node_modules/ol/ImageState.js","../../../../../client/simple/node_modules/ol/dom.js","../../../../../client/simple/node_modules/ol/color.js","../../../../../client/simple/node_modules/ol/Image.js","../../../../../client/simple/node_modules/ol/style/IconImageCache.js","../../../../../client/simple/node_modules/ol/style/IconImage.js","../../../../../client/simple/node_modules/ol/colorlike.js","../../../../../client/simple/node_modules/ol/render/VectorContext.js","../../../../../client/simple/node_modules/ol/css.js","../../../../../client/simple/node_modules/ol/render/canvas.js","../../../../../client/simple/node_modules/ol/render/canvas/Immediate.js","../../../../../client/simple/node_modules/ol/renderer/vector.js","../../../../../client/simple/node_modules/ol/featureloader.js","../../../../../client/simple/node_modules/ol/loadingstrategy.js","../../../../../client/simple/node_modules/ol/geom/flat/center.js","../../../../../client/simple/node_modules/ol/geom/GeometryCollection.js","../../../../../client/simple/node_modules/ol/geom/MultiLineString.js","../../../../../client/simple/node_modules/ol/geom/MultiPoint.js","../../../../../client/simple/node_modules/ol/geom/MultiPolygon.js","../../../../../client/simple/node_modules/ol/render/Feature.js","../../../../../client/simple/node_modules/quickselect/index.js","../../../../../client/simple/node_modules/rbush/index.js","../../../../../client/simple/node_modules/ol/structs/RBush.js","../../../../../client/simple/node_modules/ol/source/Source.js","../../../../../client/simple/node_modules/ol/source/VectorEventType.js","../../../../../client/simple/node_modules/ol/source/Vector.js","../../../../../client/simple/node_modules/ol/style/Fill.js","../../../../../client/simple/node_modules/ol/style/Stroke.js","../../../../../client/simple/node_modules/ol/size.js","../../../../../client/simple/node_modules/ol/style/Image.js","../../../../../client/simple/node_modules/ol/style/RegularShape.js","../../../../../client/simple/node_modules/ol/style/Circle.js","../../../../../client/simple/node_modules/ol/style/Style.js","../../../../../client/simple/node_modules/ol/style/Text.js","../../../../../client/simple/node_modules/ol/ViewHint.js","../../../../../client/simple/node_modules/ol/render/canvas/Instruction.js","../../../../../client/simple/node_modules/ol/render/canvas/Builder.js","../../../../../client/simple/node_modules/ol/render/canvas/ImageBuilder.js","../../../../../client/simple/node_modules/ol/render/canvas/LineStringBuilder.js","../../../../../client/simple/node_modules/ol/render/canvas/PolygonBuilder.js","../../../../../client/simple/node_modules/ol/geom/flat/linechunk.js","../../../../../client/simple/node_modules/ol/geom/flat/straightchunk.js","../../../../../client/simple/node_modules/ol/render/canvas/TextBuilder.js","../../../../../client/simple/node_modules/ol/render/canvas/BuilderGroup.js","../../../../../client/simple/node_modules/ol/geom/flat/textpath.js","../../../../../client/simple/node_modules/ol/render/canvas/ZIndexContext.js","../../../../../client/simple/node_modules/ol/render/canvas/Executor.js","../../../../../client/simple/node_modules/ol/render/canvas/ExecutorGroup.js","../../../../../client/simple/node_modules/ol/style/Icon.js","../../../../../client/simple/node_modules/ol/render/canvas/hitdetect.js","../../../../../client/simple/node_modules/ol/render/Event.js","../../../../../client/simple/node_modules/ol/renderer/Layer.js","../../../../../client/simple/node_modules/ol/renderer/canvas/Layer.js","../../../../../client/simple/node_modules/ol/renderer/canvas/VectorLayer.js","../../../../../client/simple/node_modules/ol/expr/expression.js","../../../../../client/simple/node_modules/ol/expr/cpu.js","../../../../../client/simple/node_modules/ol/render/canvas/style.js","../../../../../client/simple/node_modules/ol/ViewProperty.js","../../../../../client/simple/node_modules/ol/centerconstraint.js","../../../../../client/simple/node_modules/ol/easing.js","../../../../../client/simple/node_modules/ol/resolutionconstraint.js","../../../../../client/simple/node_modules/ol/rotationconstraint.js","../../../../../client/simple/node_modules/ol/tilegrid/common.js","../../../../../client/simple/node_modules/ol/View.js","../../../../../client/simple/node_modules/ol/layer/Property.js","../../../../../client/simple/node_modules/ol/layer/Base.js","../../../../../client/simple/node_modules/ol/layer/Layer.js","../../../../../client/simple/node_modules/ol/layer/BaseVector.js","../../../../../client/simple/node_modules/ol/layer/Vector.js","../../../../../client/simple/node_modules/ol/TileState.js","../../../../../client/simple/node_modules/ol/Tile.js","../../../../../client/simple/node_modules/ol/ImageTile.js","../../../../../client/simple/node_modules/ol/Kinetic.js","../../../../../client/simple/node_modules/ol/MapEvent.js","../../../../../client/simple/node_modules/ol/MapBrowserEvent.js","../../../../../client/simple/node_modules/ol/MapBrowserEventType.js","../../../../../client/simple/node_modules/ol/pointer/EventType.js","../../../../../client/simple/node_modules/ol/MapBrowserEventHandler.js","../../../../../client/simple/node_modules/ol/MapEventType.js","../../../../../client/simple/node_modules/ol/MapProperty.js","../../../../../client/simple/node_modules/ol/structs/PriorityQueue.js","../../../../../client/simple/node_modules/ol/TileQueue.js","../../../../../client/simple/node_modules/ol/control/Control.js","../../../../../client/simple/node_modules/ol/control/Attribution.js","../../../../../client/simple/node_modules/ol/control/Rotate.js","../../../../../client/simple/node_modules/ol/control/Zoom.js","../../../../../client/simple/node_modules/ol/control/defaults.js","../../../../../client/simple/node_modules/ol/interaction/Property.js","../../../../../client/simple/node_modules/ol/interaction/Interaction.js","../../../../../client/simple/node_modules/ol/interaction/DoubleClickZoom.js","../../../../../client/simple/node_modules/ol/events/condition.js","../../../../../client/simple/node_modules/ol/interaction/Pointer.js","../../../../../client/simple/node_modules/ol/interaction/DragPan.js","../../../../../client/simple/node_modules/ol/interaction/DragRotate.js","../../../../../client/simple/node_modules/ol/render/Box.js","../../../../../client/simple/node_modules/ol/interaction/DragBox.js","../../../../../client/simple/node_modules/ol/interaction/DragZoom.js","../../../../../client/simple/node_modules/ol/events/Key.js","../../../../../client/simple/node_modules/ol/interaction/KeyboardPan.js","../../../../../client/simple/node_modules/ol/interaction/KeyboardZoom.js","../../../../../client/simple/node_modules/ol/interaction/MouseWheelZoom.js","../../../../../client/simple/node_modules/ol/interaction/PinchRotate.js","../../../../../client/simple/node_modules/ol/interaction/PinchZoom.js","../../../../../client/simple/node_modules/ol/interaction/defaults.js","../../../../../client/simple/node_modules/ol/layer/Group.js","../../../../../client/simple/node_modules/ol/renderer/Map.js","../../../../../client/simple/node_modules/ol/renderer/Composite.js","../../../../../client/simple/node_modules/ol/Map.js","../../../../../client/simple/node_modules/ol/TileRange.js","../../../../../client/simple/node_modules/ol/format/Feature.js","../../../../../client/simple/node_modules/ol/format/JSONFeature.js","../../../../../client/simple/node_modules/ol/format/GeoJSON.js","../../../../../client/simple/node_modules/ol/DataTile.js","../../../../../client/simple/node_modules/ol/reproj.js","../../../../../client/simple/node_modules/ol/reproj/Triangulation.js","../../../../../client/simple/node_modules/ol/reproj/common.js","../../../../../client/simple/node_modules/ol/reproj/Tile.js","../../../../../client/simple/node_modules/ol/structs/LRUCache.js","../../../../../client/simple/node_modules/ol/tilecoord.js","../../../../../client/simple/node_modules/ol/renderer/canvas/TileLayer.js","../../../../../client/simple/node_modules/ol/layer/TileProperty.js","../../../../../client/simple/node_modules/ol/layer/BaseTile.js","../../../../../client/simple/node_modules/ol/layer/Tile.js","../../../../../client/simple/node_modules/ol/tilegrid/TileGrid.js","../../../../../client/simple/node_modules/ol/tilegrid.js","../../../../../client/simple/node_modules/ol/uri.js","../../../../../client/simple/node_modules/ol/tileurlfunction.js","../../../../../client/simple/node_modules/ol/source/Tile.js","../../../../../client/simple/node_modules/ol/source/TileEventType.js","../../../../../client/simple/node_modules/ol/source/UrlTile.js","../../../../../client/simple/node_modules/ol/source/TileImage.js","../../../../../client/simple/node_modules/ol/source/XYZ.js","../../../../../client/simple/node_modules/ol/source/OSM.js"],"sourcesContent":["/**\n * @module ol/CollectionEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when an item is added to the collection.\n * @event module:ol/Collection.CollectionEvent#add\n * @api\n */\n ADD: 'add',\n /**\n * Triggered when an item is removed from the collection.\n * @event module:ol/Collection.CollectionEvent#remove\n * @api\n */\n REMOVE: 'remove',\n};\n","/**\n * @module ol/ObjectEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a property is changed.\n * @event module:ol/Object.ObjectEvent#propertychange\n * @api\n */\n PROPERTYCHANGE: 'propertychange',\n};\n\n/**\n * @typedef {'propertychange'} Types\n */\n","/**\n * @module ol/events/EventType\n */\n\n/**\n * @enum {string}\n * @const\n */\nexport default {\n /**\n * Generic change event. Triggered when the revision counter is increased.\n * @event module:ol/events/Event~BaseEvent#change\n * @api\n */\n CHANGE: 'change',\n\n /**\n * Generic error event. Triggered when an error occurs.\n * @event module:ol/events/Event~BaseEvent#error\n * @api\n */\n ERROR: 'error',\n\n BLUR: 'blur',\n CLEAR: 'clear',\n CONTEXTMENU: 'contextmenu',\n CLICK: 'click',\n DBLCLICK: 'dblclick',\n DRAGENTER: 'dragenter',\n DRAGOVER: 'dragover',\n DROP: 'drop',\n FOCUS: 'focus',\n KEYDOWN: 'keydown',\n KEYPRESS: 'keypress',\n LOAD: 'load',\n RESIZE: 'resize',\n TOUCHMOVE: 'touchmove',\n WHEEL: 'wheel',\n};\n","/**\n * @module ol/Disposable\n */\n\n/**\n * @classdesc\n * Objects that need to clean up after themselves.\n */\nclass Disposable {\n constructor() {\n /**\n * The object has already been disposed.\n * @type {boolean}\n * @protected\n */\n this.disposed = false;\n }\n\n /**\n * Clean up.\n */\n dispose() {\n if (!this.disposed) {\n this.disposed = true;\n this.disposeInternal();\n }\n }\n\n /**\n * Extension point for disposable objects.\n * @protected\n */\n disposeInternal() {}\n}\n\nexport default Disposable;\n","/**\n * @module ol/array\n */\n\n/**\n * Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.\n * https://github.com/darkskyapp/binary-search\n *\n * @param {Array<*>} haystack Items to search through.\n * @param {*} needle The item to look for.\n * @param {Function} [comparator] Comparator function.\n * @return {number} The index of the item if found, -1 if not.\n */\nexport function binarySearch(haystack, needle, comparator) {\n let mid, cmp;\n comparator = comparator || ascending;\n let low = 0;\n let high = haystack.length;\n let found = false;\n\n while (low < high) {\n /* Note that \"(low + high) >>> 1\" may overflow, and results in a typecast\n * to double (which gives the wrong results). */\n mid = low + ((high - low) >> 1);\n cmp = +comparator(haystack[mid], needle);\n\n if (cmp < 0.0) {\n /* Too low. */\n low = mid + 1;\n } else {\n /* Key found or too high */\n high = mid;\n found = !cmp;\n }\n }\n\n /* Key not found. */\n return found ? low : ~low;\n}\n\n/**\n * Compare function sorting arrays in ascending order. Safe to use for numeric values.\n * @param {*} a The first object to be compared.\n * @param {*} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n * argument is less than, equal to, or greater than the second.\n */\nexport function ascending(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}\n\n/**\n * Compare function sorting arrays in descending order. Safe to use for numeric values.\n * @param {*} a The first object to be compared.\n * @param {*} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n * argument is greater than, equal to, or less than the second.\n */\nexport function descending(a, b) {\n return a < b ? 1 : a > b ? -1 : 0;\n}\n\n/**\n * {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution} can use a function\n * of this type to determine which nearest resolution to use.\n *\n * This function takes a `{number}` representing a value between two array entries,\n * a `{number}` representing the value of the nearest higher entry and\n * a `{number}` representing the value of the nearest lower entry\n * as arguments and returns a `{number}`. If a negative number or zero is returned\n * the lower value will be used, if a positive number is returned the higher value\n * will be used.\n * @typedef {function(number, number, number): number} NearestDirectionFunction\n * @api\n */\n\n/**\n * @param {Array} arr Array in descending order.\n * @param {number} target Target.\n * @param {number|NearestDirectionFunction} direction\n * 0 means return the nearest,\n * > 0 means return the largest nearest,\n * < 0 means return the smallest nearest.\n * @return {number} Index.\n */\nexport function linearFindNearest(arr, target, direction) {\n if (arr[0] <= target) {\n return 0;\n }\n\n const n = arr.length;\n if (target <= arr[n - 1]) {\n return n - 1;\n }\n\n if (typeof direction === 'function') {\n for (let i = 1; i < n; ++i) {\n const candidate = arr[i];\n if (candidate === target) {\n return i;\n }\n if (candidate < target) {\n if (direction(target, arr[i - 1], candidate) > 0) {\n return i - 1;\n }\n return i;\n }\n }\n return n - 1;\n }\n\n if (direction > 0) {\n for (let i = 1; i < n; ++i) {\n if (arr[i] < target) {\n return i - 1;\n }\n }\n return n - 1;\n }\n\n if (direction < 0) {\n for (let i = 1; i < n; ++i) {\n if (arr[i] <= target) {\n return i;\n }\n }\n return n - 1;\n }\n\n for (let i = 1; i < n; ++i) {\n if (arr[i] == target) {\n return i;\n }\n if (arr[i] < target) {\n if (arr[i - 1] - target < target - arr[i]) {\n return i - 1;\n }\n return i;\n }\n }\n return n - 1;\n}\n\n/**\n * @param {Array<*>} arr Array.\n * @param {number} begin Begin index.\n * @param {number} end End index.\n */\nexport function reverseSubArray(arr, begin, end) {\n while (begin < end) {\n const tmp = arr[begin];\n arr[begin] = arr[end];\n arr[end] = tmp;\n ++begin;\n --end;\n }\n}\n\n/**\n * @param {Array} arr The array to modify.\n * @param {!Array|VALUE} data The elements or arrays of elements to add to arr.\n * @template VALUE\n */\nexport function extend(arr, data) {\n const extension = Array.isArray(data) ? data : [data];\n const length = extension.length;\n for (let i = 0; i < length; i++) {\n arr[arr.length] = extension[i];\n }\n}\n\n/**\n * @param {Array} arr The array to modify.\n * @param {VALUE} obj The element to remove.\n * @template VALUE\n * @return {boolean} If the element was removed.\n */\nexport function remove(arr, obj) {\n const i = arr.indexOf(obj);\n const found = i > -1;\n if (found) {\n arr.splice(i, 1);\n }\n return found;\n}\n\n/**\n * @param {Array|Uint8ClampedArray} arr1 The first array to compare.\n * @param {Array|Uint8ClampedArray} arr2 The second array to compare.\n * @return {boolean} Whether the two arrays are equal.\n */\nexport function equals(arr1, arr2) {\n const len1 = arr1.length;\n if (len1 !== arr2.length) {\n return false;\n }\n for (let i = 0; i < len1; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Sort the passed array such that the relative order of equal elements is preserved.\n * See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.\n * @param {Array<*>} arr The array to sort (modifies original).\n * @param {!function(*, *): number} compareFnc Comparison function.\n * @api\n */\nexport function stableSort(arr, compareFnc) {\n const length = arr.length;\n const tmp = Array(arr.length);\n let i;\n for (i = 0; i < length; i++) {\n tmp[i] = {index: i, value: arr[i]};\n }\n tmp.sort(function (a, b) {\n return compareFnc(a.value, b.value) || a.index - b.index;\n });\n for (i = 0; i < arr.length; i++) {\n arr[i] = tmp[i].value;\n }\n}\n\n/**\n * @param {Array<*>} arr The array to test.\n * @param {Function} [func] Comparison function.\n * @param {boolean} [strict] Strictly sorted (default false).\n * @return {boolean} Return index.\n */\nexport function isSorted(arr, func, strict) {\n const compare = func || ascending;\n return arr.every(function (currentVal, index) {\n if (index === 0) {\n return true;\n }\n const res = compare(arr[index - 1], currentVal);\n return !(res > 0 || (strict && res === 0));\n });\n}\n","/**\n * @module ol/functions\n */\n\nimport {equals as arrayEquals} from './array.js';\n\n/**\n * Always returns true.\n * @return {boolean} true.\n */\nexport function TRUE() {\n return true;\n}\n\n/**\n * Always returns false.\n * @return {boolean} false.\n */\nexport function FALSE() {\n return false;\n}\n\n/**\n * A reusable function, used e.g. as a default for callbacks.\n *\n * @return {void} Nothing.\n */\nexport function VOID() {}\n\n/**\n * Wrap a function in another function that remembers the last return. If the\n * returned function is called twice in a row with the same arguments and the same\n * this object, it will return the value from the first call in the second call.\n *\n * @param {function(...any): ReturnType} fn The function to memoize.\n * @return {function(...any): ReturnType} The memoized function.\n * @template ReturnType\n */\nexport function memoizeOne(fn) {\n /** @type {ReturnType} */\n let lastResult;\n\n /** @type {Array|undefined} */\n let lastArgs;\n\n let lastThis;\n\n /**\n * @this {*} Only need to know if `this` changed, don't care what type\n * @return {ReturnType} Memoized value\n */\n return function () {\n const nextArgs = Array.prototype.slice.call(arguments);\n if (!lastArgs || this !== lastThis || !arrayEquals(nextArgs, lastArgs)) {\n lastThis = this;\n lastArgs = nextArgs;\n lastResult = fn.apply(this, arguments);\n }\n return lastResult;\n };\n}\n\n/**\n * @template T\n * @param {function(): (T | Promise)} getter A function that returns a value or a promise for a value.\n * @return {Promise} A promise for the value.\n */\nexport function toPromise(getter) {\n function promiseGetter() {\n let value;\n try {\n value = getter();\n } catch (err) {\n return Promise.reject(err);\n }\n if (value instanceof Promise) {\n return value;\n }\n return Promise.resolve(value);\n }\n return promiseGetter();\n}\n","/**\n * @module ol/obj\n */\n\n/**\n * Removes all properties from an object.\n * @param {Object} object The object to clear.\n */\nexport function clear(object) {\n for (const property in object) {\n delete object[property];\n }\n}\n\n/**\n * Determine if an object has any properties.\n * @param {Object} object The object to check.\n * @return {boolean} The object is empty.\n */\nexport function isEmpty(object) {\n let property;\n for (property in object) {\n return false;\n }\n return !property;\n}\n","/**\n * @module ol/events/Event\n */\n\n/**\n * @classdesc\n * Stripped down implementation of the W3C DOM Level 2 Event interface.\n * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.\n *\n * This implementation only provides `type` and `target` properties, and\n * `stopPropagation` and `preventDefault` methods. It is meant as base class\n * for higher level events defined in the library, and works with\n * {@link module:ol/events/Target~Target}.\n */\nclass BaseEvent {\n /**\n * @param {string} type Type.\n */\n constructor(type) {\n /**\n * @type {boolean}\n */\n this.propagationStopped;\n\n /**\n * @type {boolean}\n */\n this.defaultPrevented;\n\n /**\n * The event type.\n * @type {string}\n * @api\n */\n this.type = type;\n\n /**\n * The event target.\n * @type {Object}\n * @api\n */\n this.target = null;\n }\n\n /**\n * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events\n * will be fired.\n * @api\n */\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n /**\n * Stop event propagation.\n * @api\n */\n stopPropagation() {\n this.propagationStopped = true;\n }\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function stopPropagation(evt) {\n evt.stopPropagation();\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nexport function preventDefault(evt) {\n evt.preventDefault();\n}\n\nexport default BaseEvent;\n","/**\n * @module ol/events/Target\n */\nimport Disposable from '../Disposable.js';\nimport {VOID} from '../functions.js';\nimport {clear} from '../obj.js';\nimport Event from './Event.js';\n\n/**\n * @typedef {EventTarget|Target} EventTargetLike\n */\n\n/**\n * @classdesc\n * A simplified implementation of the W3C DOM Level 2 EventTarget interface.\n * See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.\n *\n * There are two important simplifications compared to the specification:\n *\n * 1. The handling of `useCapture` in `addEventListener` and\n * `removeEventListener`. There is no real capture model.\n * 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.\n * There is no event target hierarchy. When a listener calls\n * `stopPropagation` or `preventDefault` on an event object, it means that no\n * more listeners after this one will be called. Same as when the listener\n * returns false.\n */\nclass Target extends Disposable {\n /**\n * @param {*} [target] Default event target for dispatched events.\n */\n constructor(target) {\n super();\n\n /**\n * @private\n * @type {*}\n */\n this.eventTarget_ = target;\n\n /**\n * @private\n * @type {Object|null}\n */\n this.pendingRemovals_ = null;\n\n /**\n * @private\n * @type {Object|null}\n */\n this.dispatching_ = null;\n\n /**\n * @private\n * @type {Object>|null}\n */\n this.listeners_ = null;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n addEventListener(type, listener) {\n if (!type || !listener) {\n return;\n }\n const listeners = this.listeners_ || (this.listeners_ = {});\n const listenersForType = listeners[type] || (listeners[type] = []);\n if (!listenersForType.includes(listener)) {\n listenersForType.push(listener);\n }\n }\n\n /**\n * Dispatches an event and calls all listeners listening for events\n * of this type. The event parameter can either be a string or an\n * Object with a `type` property.\n *\n * @param {import(\"./Event.js\").default|string} event Event object.\n * @return {boolean|undefined} `false` if anyone called preventDefault on the\n * event object or if any of the listeners returned false.\n * @api\n */\n dispatchEvent(event) {\n const isString = typeof event === 'string';\n const type = isString ? event : event.type;\n const listeners = this.listeners_ && this.listeners_[type];\n if (!listeners) {\n return;\n }\n\n const evt = isString ? new Event(event) : /** @type {Event} */ (event);\n if (!evt.target) {\n evt.target = this.eventTarget_ || this;\n }\n const dispatching = this.dispatching_ || (this.dispatching_ = {});\n const pendingRemovals =\n this.pendingRemovals_ || (this.pendingRemovals_ = {});\n if (!(type in dispatching)) {\n dispatching[type] = 0;\n pendingRemovals[type] = 0;\n }\n ++dispatching[type];\n let propagate;\n for (let i = 0, ii = listeners.length; i < ii; ++i) {\n if ('handleEvent' in listeners[i]) {\n propagate = /** @type {import(\"../events.js\").ListenerObject} */ (\n listeners[i]\n ).handleEvent(evt);\n } else {\n propagate = /** @type {import(\"../events.js\").ListenerFunction} */ (\n listeners[i]\n ).call(this, evt);\n }\n if (propagate === false || evt.propagationStopped) {\n propagate = false;\n break;\n }\n }\n if (--dispatching[type] === 0) {\n let pr = pendingRemovals[type];\n delete pendingRemovals[type];\n while (pr--) {\n this.removeEventListener(type, VOID);\n }\n delete dispatching[type];\n }\n return propagate;\n }\n\n /**\n * Clean up.\n * @override\n */\n disposeInternal() {\n this.listeners_ && clear(this.listeners_);\n }\n\n /**\n * Get the listeners for a specified event type. Listeners are returned in the\n * order that they will be called in.\n *\n * @param {string} type Type.\n * @return {Array|undefined} Listeners.\n */\n getListeners(type) {\n return (this.listeners_ && this.listeners_[type]) || undefined;\n }\n\n /**\n * @param {string} [type] Type. If not provided,\n * `true` will be returned if this event target has any listeners.\n * @return {boolean} Has listeners.\n */\n hasListener(type) {\n if (!this.listeners_) {\n return false;\n }\n return type\n ? type in this.listeners_\n : Object.keys(this.listeners_).length > 0;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n removeEventListener(type, listener) {\n if (!this.listeners_) {\n return;\n }\n const listeners = this.listeners_[type];\n if (!listeners) {\n return;\n }\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n if (this.pendingRemovals_ && type in this.pendingRemovals_) {\n // make listener a no-op, and remove later in #dispatchEvent()\n listeners[index] = VOID;\n ++this.pendingRemovals_[type];\n } else {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n delete this.listeners_[type];\n }\n }\n }\n }\n}\n\nexport default Target;\n","/**\n * @module ol/events\n */\nimport {clear} from './obj.js';\n\n/**\n * Key to use with {@link module:ol/Observable.unByKey}.\n * @typedef {Object} EventsKey\n * @property {ListenerFunction} listener Listener.\n * @property {import(\"./events/Target.js\").EventTargetLike} target Target.\n * @property {string} type Type.\n * @api\n */\n\n/**\n * Listener function. This function is called with an event object as argument.\n * When the function returns `false`, event propagation will stop.\n *\n * @typedef {function((Event|import(\"./events/Event.js\").default)): (void|boolean)} ListenerFunction\n * @api\n */\n\n/**\n * @typedef {Object} ListenerObject\n * @property {ListenerFunction} handleEvent HandleEvent listener function.\n */\n\n/**\n * @typedef {ListenerFunction|ListenerObject} Listener\n */\n\n/**\n * Registers an event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` to a `this` object, and returns\n * a key for use with {@link module:ol/events.unlistenByKey}.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @param {boolean} [once] If true, add the listener as one-off listener.\n * @return {EventsKey} Unique key for the listener.\n */\nexport function listen(target, type, listener, thisArg, once) {\n if (once) {\n const originalListener = listener;\n /**\n * @param {Event|import('./events/Event.js').default} event The event\n * @return {void|boolean} When the function returns `false`, event propagation will stop.\n * @this {typeof target}\n */\n listener = function (event) {\n target.removeEventListener(type, listener);\n return originalListener.call(thisArg ?? this, event);\n };\n } else if (thisArg && thisArg !== target) {\n listener = listener.bind(thisArg);\n }\n const eventsKey = {\n target: target,\n type: type,\n listener: listener,\n };\n target.addEventListener(type, listener);\n return eventsKey;\n}\n\n/**\n * Registers a one-off event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` as self-unregistering listener\n * to a `this` object, and returns a key for use with\n * {@link module:ol/events.unlistenByKey} in case the listener needs to be\n * unregistered before it is called.\n *\n * When {@link module:ol/events.listen} is called with the same arguments after this\n * function, the self-unregistering listener will be turned into a permanent\n * listener.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @return {EventsKey} Key for unlistenByKey.\n */\nexport function listenOnce(target, type, listener, thisArg) {\n return listen(target, type, listener, thisArg, true);\n}\n\n/**\n * Unregisters event listeners on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * The argument passed to this function is the key returned from\n * {@link module:ol/events.listen} or {@link module:ol/events.listenOnce}.\n *\n * @param {EventsKey} key The key.\n */\nexport function unlistenByKey(key) {\n if (key && key.target) {\n key.target.removeEventListener(key.type, key.listener);\n clear(key);\n }\n}\n","/**\n * @module ol/Observable\n */\nimport EventType from './events/EventType.js';\nimport EventTarget from './events/Target.js';\nimport {listen, listenOnce, unlistenByKey} from './events.js';\n\n/***\n * @template {string} Type\n * @template {Event|import(\"./events/Event.js\").default} EventClass\n * @template Return\n * @typedef {(type: Type, listener: (event: EventClass) => ?) => Return} OnSignature\n */\n\n/***\n * @template {string} Type\n * @template Return\n * @typedef {(type: Type[], listener: (event: Event|import(\"./events/Event\").default) => ?) => Return extends void ? void : Return[]} CombinedOnSignature\n */\n\n/**\n * @typedef {'change'|'error'} EventTypes\n */\n\n/***\n * @template Return\n * @typedef {OnSignature & CombinedOnSignature} ObservableOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * An event target providing convenient methods for listener registration\n * and unregistration. A generic `change` event is always available through\n * {@link module:ol/Observable~Observable#changed}.\n *\n * @fires import(\"./events/Event.js\").default\n * @api\n */\nclass Observable extends EventTarget {\n constructor() {\n super();\n\n this.on =\n /** @type {ObservableOnSignature} */ (\n this.onInternal\n );\n\n this.once =\n /** @type {ObservableOnSignature} */ (\n this.onceInternal\n );\n\n this.un = /** @type {ObservableOnSignature} */ (this.unInternal);\n\n /**\n * @private\n * @type {number}\n */\n this.revision_ = 0;\n }\n\n /**\n * Increases the revision counter and dispatches a 'change' event.\n * @api\n */\n changed() {\n ++this.revision_;\n this.dispatchEvent(EventType.CHANGE);\n }\n\n /**\n * Get the version number for this object. Each time the object is modified,\n * its version number will be incremented.\n * @return {number} Revision.\n * @api\n */\n getRevision() {\n return this.revision_;\n }\n\n /**\n * @param {string|Array} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array} Event key.\n * @protected\n */\n onInternal(type, listener) {\n if (Array.isArray(type)) {\n const len = type.length;\n const keys = new Array(len);\n for (let i = 0; i < len; ++i) {\n keys[i] = listen(this, type[i], listener);\n }\n return keys;\n }\n return listen(this, /** @type {string} */ (type), listener);\n }\n\n /**\n * @param {string|Array} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array} Event key.\n * @protected\n */\n onceInternal(type, listener) {\n let key;\n if (Array.isArray(type)) {\n const len = type.length;\n key = new Array(len);\n for (let i = 0; i < len; ++i) {\n key[i] = listenOnce(this, type[i], listener);\n }\n } else {\n key = listenOnce(this, /** @type {string} */ (type), listener);\n }\n /** @type {Object} */ (listener).ol_key = key;\n return key;\n }\n\n /**\n * Unlisten for a certain type of event.\n * @param {string|Array} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @protected\n */\n unInternal(type, listener) {\n const key = /** @type {Object} */ (listener).ol_key;\n if (key) {\n unByKey(key);\n } else if (Array.isArray(type)) {\n for (let i = 0, ii = type.length; i < ii; ++i) {\n this.removeEventListener(type[i], listener);\n }\n } else {\n this.removeEventListener(type, listener);\n }\n }\n}\n\n/**\n * Listen for a certain type of event.\n * @function\n * @param {string|Array} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.on;\n\n/**\n * Listen once for a certain type of event.\n * @function\n * @param {string|Array} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.once;\n\n/**\n * Unlisten for a certain type of event.\n * @function\n * @param {string|Array} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @api\n */\nObservable.prototype.un;\n\n/**\n * Removes an event listener using the key returned by `on()` or `once()`.\n * @param {import(\"./events.js\").EventsKey|Array} key The key returned by `on()`\n * or `once()` (or an array of keys).\n * @api\n */\nexport function unByKey(key) {\n if (Array.isArray(key)) {\n for (let i = 0, ii = key.length; i < ii; ++i) {\n unlistenByKey(key[i]);\n }\n } else {\n unlistenByKey(/** @type {import(\"./events.js\").EventsKey} */ (key));\n }\n}\n\nexport default Observable;\n","/**\n * @module ol/util\n */\n\n/**\n * @return {never} Any return.\n */\nexport function abstract() {\n throw new Error('Unimplemented abstract method.');\n}\n\n/**\n * Counter for getUid.\n * @type {number}\n * @private\n */\nlet uidCounter_ = 0;\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. Unique IDs are generated\n * as a strictly increasing sequence. Adapted from goog.getUid.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {string} The unique ID for the object.\n * @api\n */\nexport function getUid(obj) {\n return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));\n}\n\n/**\n * OpenLayers version.\n * @type {string}\n */\nexport const VERSION = '10.6.1';\n","/**\n * @module ol/Object\n */\nimport ObjectEventType from './ObjectEventType.js';\nimport Observable from './Observable.js';\nimport Event from './events/Event.js';\nimport {isEmpty} from './obj.js';\nimport {getUid} from './util.js';\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.\n */\nexport class ObjectEvent extends Event {\n /**\n * @param {string} type The event type.\n * @param {string} key The property name.\n * @param {*} oldValue The old value for `key`.\n */\n constructor(type, key, oldValue) {\n super(type);\n\n /**\n * The name of the property whose value is changing.\n * @type {string}\n * @api\n */\n this.key = key;\n\n /**\n * The old value. To get the new value use `e.target.get(e.key)` where\n * `e` is the event object.\n * @type {*}\n * @api\n */\n this.oldValue = oldValue;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").CombinedOnSignature} ObjectOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Most non-trivial classes inherit from this.\n *\n * This extends {@link module:ol/Observable~Observable} with observable\n * properties, where each property is observable as well as the object as a\n * whole.\n *\n * Classes that inherit from this have pre-defined properties, to which you can\n * add your owns. The pre-defined properties are listed in this documentation as\n * 'Observable Properties', and have their own accessors; for example,\n * {@link module:ol/Map~Map} has a `target` property, accessed with\n * `getTarget()` and changed with `setTarget()`. Not all properties are however\n * settable. There are also general-purpose accessors `get()` and `set()`. For\n * example, `get('target')` is equivalent to `getTarget()`.\n *\n * The `set` accessors trigger a change event, and you can monitor this by\n * registering a listener. For example, {@link module:ol/View~View} has a\n * `center` property, so `view.on('change:center', function(evt) {...});` would\n * call the function whenever the value of the center property changes. Within\n * the function, `evt.target` would be the view, so `evt.target.getCenter()`\n * would return the new center.\n *\n * You can add your own observable properties with\n * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.\n * You can listen for changes on that property value with\n * `object.on('change:prop', listener)`. You can get a list of all\n * properties with {@link module:ol/Object~BaseObject#getProperties}.\n *\n * Note that the observable properties are separate from standard JS properties.\n * You can, for example, give your map object a title with\n * `map.title='New title'` and with `map.set('title', 'Another title')`. The\n * first will be a `hasOwnProperty`; the second will appear in\n * `getProperties()`. Only the second is observable.\n *\n * Properties can be deleted by using the unset method. E.g.\n * object.unset('foo').\n *\n * @fires ObjectEvent\n * @api\n */\nclass BaseObject extends Observable {\n /**\n * @param {Object} [values] An object with key-value pairs.\n */\n constructor(values) {\n super();\n\n /***\n * @type {ObjectOnSignature}\n */\n this.on;\n\n /***\n * @type {ObjectOnSignature}\n */\n this.once;\n\n /***\n * @type {ObjectOnSignature}\n */\n this.un;\n\n // Call {@link module:ol/util.getUid} to ensure that the order of objects' ids is\n // the same as the order in which they were created. This also helps to\n // ensure that object properties are always added in the same order, which\n // helps many JavaScript engines generate faster code.\n getUid(this);\n\n /**\n * @private\n * @type {Object|null}\n */\n this.values_ = null;\n\n if (values !== undefined) {\n this.setProperties(values);\n }\n }\n\n /**\n * Gets a value.\n * @param {string} key Key name.\n * @return {*} Value.\n * @api\n */\n get(key) {\n let value;\n if (this.values_ && this.values_.hasOwnProperty(key)) {\n value = this.values_[key];\n }\n return value;\n }\n\n /**\n * Get a list of object property names.\n * @return {Array} List of property names.\n * @api\n */\n getKeys() {\n return (this.values_ && Object.keys(this.values_)) || [];\n }\n\n /**\n * Get an object of all property names and values.\n * @return {Object} Object.\n * @api\n */\n getProperties() {\n return (this.values_ && Object.assign({}, this.values_)) || {};\n }\n\n /**\n * Get an object of all property names and values.\n * @return {Object?} Object.\n */\n getPropertiesInternal() {\n return this.values_;\n }\n\n /**\n * @return {boolean} The object has properties.\n */\n hasProperties() {\n return !!this.values_;\n }\n\n /**\n * @param {string} key Key name.\n * @param {*} oldValue Old value.\n */\n notify(key, oldValue) {\n let eventType;\n eventType = `change:${key}`;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n eventType = ObjectEventType.PROPERTYCHANGE;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n addChangeListener(key, listener) {\n this.addEventListener(`change:${key}`, listener);\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n removeChangeListener(key, listener) {\n this.removeEventListener(`change:${key}`, listener);\n }\n\n /**\n * Sets a value.\n * @param {string} key Key name.\n * @param {*} value Value.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n set(key, value, silent) {\n const values = this.values_ || (this.values_ = {});\n if (silent) {\n values[key] = value;\n } else {\n const oldValue = values[key];\n values[key] = value;\n if (oldValue !== value) {\n this.notify(key, oldValue);\n }\n }\n }\n\n /**\n * Sets a collection of key-value pairs. Note that this changes any existing\n * properties and adds new ones (it does not remove any existing properties).\n * @param {Object} values Values.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n setProperties(values, silent) {\n for (const key in values) {\n this.set(key, values[key], silent);\n }\n }\n\n /**\n * Apply any properties from another object without triggering events.\n * @param {BaseObject} source The source object.\n * @protected\n */\n applyProperties(source) {\n if (!source.values_) {\n return;\n }\n Object.assign(this.values_ || (this.values_ = {}), source.values_);\n }\n\n /**\n * Unsets a property.\n * @param {string} key Key name.\n * @param {boolean} [silent] Unset without triggering an event.\n * @api\n */\n unset(key, silent) {\n if (this.values_ && key in this.values_) {\n const oldValue = this.values_[key];\n delete this.values_[key];\n if (isEmpty(this.values_)) {\n this.values_ = null;\n }\n if (!silent) {\n this.notify(key, oldValue);\n }\n }\n }\n}\n\nexport default BaseObject;\n","/**\n * @module ol/Collection\n */\nimport CollectionEventType from './CollectionEventType.js';\nimport BaseObject from './Object.js';\nimport Event from './events/Event.js';\n\n/**\n * @enum {string}\n * @private\n */\nconst Property = {\n LENGTH: 'length',\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Collection~Collection} instances are instances of this\n * type.\n * @template T\n */\nexport class CollectionEvent extends Event {\n /**\n * @param {import(\"./CollectionEventType.js\").default} type Type.\n * @param {T} element Element.\n * @param {number} index The index of the added or removed element.\n */\n constructor(type, element, index) {\n super(type);\n\n /**\n * The element that is added to or removed from the collection.\n * @type {T}\n * @api\n */\n this.element = element;\n\n /**\n * The index of the added or removed element.\n * @type {number}\n * @api\n */\n this.index = index;\n }\n}\n\n/***\n * @template T\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature<'add'|'remove', CollectionEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature} CollectionOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {boolean} [unique=false] Disallow the same item from being added to\n * the collection twice.\n */\n\n/**\n * @classdesc\n * An expanded version of standard JS Array, adding convenience methods for\n * manipulation. Add and remove changes to the Collection trigger a Collection\n * event. Note that this does not cover changes to the objects _within_ the\n * Collection; they trigger events on the appropriate object, not on the\n * Collection as a whole.\n *\n * @fires CollectionEvent\n *\n * @template T\n * @api\n */\nclass Collection extends BaseObject {\n /**\n * @param {Array} [array] Array.\n * @param {Options} [options] Collection options.\n */\n constructor(array, options) {\n super();\n\n /***\n * @type {CollectionOnSignature}\n */\n this.on;\n\n /***\n * @type {CollectionOnSignature}\n */\n this.once;\n\n /***\n * @type {CollectionOnSignature}\n */\n this.un;\n\n options = options || {};\n\n /**\n * @private\n * @type {boolean}\n */\n this.unique_ = !!options.unique;\n\n /**\n * @private\n * @type {!Array}\n */\n this.array_ = array ? array : [];\n\n if (this.unique_) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n this.assertUnique_(this.array_[i], i);\n }\n }\n\n this.updateLength_();\n }\n\n /**\n * Remove all elements from the collection.\n * @api\n */\n clear() {\n while (this.getLength() > 0) {\n this.pop();\n }\n }\n\n /**\n * Add elements to the collection. This pushes each item in the provided array\n * to the end of the collection.\n * @param {!Array} arr Array.\n * @return {Collection} This collection.\n * @api\n */\n extend(arr) {\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n this.push(arr[i]);\n }\n return this;\n }\n\n /**\n * Iterate over each element, calling the provided callback.\n * @param {function(T, number, Array): *} f The function to call\n * for every element. This function takes 3 arguments (the element, the\n * index and the array). The return value is ignored.\n * @api\n */\n forEach(f) {\n const array = this.array_;\n for (let i = 0, ii = array.length; i < ii; ++i) {\n f(array[i], i, array);\n }\n }\n\n /**\n * Get a reference to the underlying Array object. Warning: if the array\n * is mutated, no events will be dispatched by the collection, and the\n * collection's \"length\" property won't be in sync with the actual length\n * of the array.\n * @return {!Array} Array.\n * @api\n */\n getArray() {\n return this.array_;\n }\n\n /**\n * Get the element at the provided index.\n * @param {number} index Index.\n * @return {T} Element.\n * @api\n */\n item(index) {\n return this.array_[index];\n }\n\n /**\n * Get the length of this collection.\n * @return {number} The length of the array.\n * @observable\n * @api\n */\n getLength() {\n return this.get(Property.LENGTH);\n }\n\n /**\n * Insert an element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n insertAt(index, elem) {\n if (index < 0 || index > this.getLength()) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n this.array_.splice(index, 0, elem);\n this.updateLength_();\n this.dispatchEvent(\n new CollectionEvent(CollectionEventType.ADD, elem, index),\n );\n }\n\n /**\n * Remove the last element of the collection and return it.\n * Return `undefined` if the collection is empty.\n * @return {T|undefined} Element.\n * @api\n */\n pop() {\n return this.removeAt(this.getLength() - 1);\n }\n\n /**\n * Insert the provided element at the end of the collection.\n * @param {T} elem Element.\n * @return {number} New length of the collection.\n * @api\n */\n push(elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n const n = this.getLength();\n this.insertAt(n, elem);\n return this.getLength();\n }\n\n /**\n * Remove the first occurrence of an element from the collection.\n * @param {T} elem Element.\n * @return {T|undefined} The removed element or undefined if none found.\n * @api\n */\n remove(elem) {\n const arr = this.array_;\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n if (arr[i] === elem) {\n return this.removeAt(i);\n }\n }\n return undefined;\n }\n\n /**\n * Remove the element at the provided index and return it.\n * Return `undefined` if the collection does not contain this index.\n * @param {number} index Index.\n * @return {T|undefined} Value.\n * @api\n */\n removeAt(index) {\n if (index < 0 || index >= this.getLength()) {\n return undefined;\n }\n const prev = this.array_[index];\n this.array_.splice(index, 1);\n this.updateLength_();\n this.dispatchEvent(\n /** @type {CollectionEvent} */ (\n new CollectionEvent(CollectionEventType.REMOVE, prev, index)\n ),\n );\n return prev;\n }\n\n /**\n * Set the element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n setAt(index, elem) {\n const n = this.getLength();\n if (index >= n) {\n this.insertAt(index, elem);\n return;\n }\n if (index < 0) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem, index);\n }\n const prev = this.array_[index];\n this.array_[index] = elem;\n this.dispatchEvent(\n /** @type {CollectionEvent} */ (\n new CollectionEvent(CollectionEventType.REMOVE, prev, index)\n ),\n );\n this.dispatchEvent(\n /** @type {CollectionEvent} */ (\n new CollectionEvent(CollectionEventType.ADD, elem, index)\n ),\n );\n }\n\n /**\n * @private\n */\n updateLength_() {\n this.set(Property.LENGTH, this.array_.length);\n }\n\n /**\n * @private\n * @param {T} elem Element.\n * @param {number} [except] Optional index to ignore.\n */\n assertUnique_(elem, except) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n if (this.array_[i] === elem && i !== except) {\n throw new Error('Duplicate item added to a unique collection');\n }\n }\n }\n}\n\nexport default Collection;\n","/**\n * @module ol/asserts\n */\n\n/**\n * @param {*} assertion Assertion we expected to be truthy.\n * @param {string} errorMessage Error message.\n */\nexport function assert(assertion, errorMessage) {\n if (!assertion) {\n throw new Error(errorMessage);\n }\n}\n","/**\n * @module ol/Feature\n */\nimport BaseObject from './Object.js';\nimport {assert} from './asserts.js';\nimport EventType from './events/EventType.js';\nimport {listen, unlistenByKey} from './events.js';\n\n/**\n * @typedef {typeof Feature|typeof import(\"./render/Feature.js\").default} FeatureClass\n */\n\n/**\n * @typedef {Feature|import(\"./render/Feature.js\").default} FeatureLike\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature &\n * import(\"./Observable\").OnSignature &\n * import(\"./Observable\").CombinedOnSignature} FeatureOnSignature\n */\n\n/***\n * @template {import(\"./geom/Geometry.js\").default} [Geometry=import(\"./geom/Geometry.js\").default]\n * @typedef {Object & { geometry?: Geometry }} ObjectWithGeometry\n */\n\n/**\n * @classdesc\n * A vector object for geographic features with a geometry and other\n * attribute properties, similar to the features in vector file formats like\n * GeoJSON.\n *\n * Features can be styled individually with `setStyle`; otherwise they use the\n * style of their vector layer.\n *\n * Note that attribute properties are set as {@link module:ol/Object~BaseObject} properties on\n * the feature object, so they are observable, and have get/set accessors.\n *\n * Typically, a feature has a single geometry property. You can set the\n * geometry using the `setGeometry` method and get it with `getGeometry`.\n * It is possible to store more than one geometry on a feature using attribute\n * properties. By default, the geometry used for rendering is identified by\n * the property name `geometry`. If you want to use another geometry property\n * for rendering, use the `setGeometryName` method to change the attribute\n * property associated with the geometry for the feature. For example:\n *\n * ```js\n *\n * import Feature from 'ol/Feature.js';\n * import Polygon from 'ol/geom/Polygon.js';\n * import Point from 'ol/geom/Point.js';\n *\n * const feature = new Feature({\n * geometry: new Polygon(polyCoords),\n * labelPoint: new Point(labelCoords),\n * name: 'My Polygon',\n * });\n *\n * // get the polygon geometry\n * const poly = feature.getGeometry();\n *\n * // Render the feature as a point using the coordinates from labelPoint\n * feature.setGeometryName('labelPoint');\n *\n * // get the point geometry\n * const point = feature.getGeometry();\n * ```\n *\n * @api\n * @template {import(\"./geom/Geometry.js\").default} [Geometry=import(\"./geom/Geometry.js\").default]\n */\nclass Feature extends BaseObject {\n /**\n * @param {Geometry|ObjectWithGeometry} [geometryOrProperties]\n * You may pass a Geometry object directly, or an object literal containing\n * properties. If you pass an object literal, you may include a Geometry\n * associated with a `geometry` key.\n */\n constructor(geometryOrProperties) {\n super();\n\n /***\n * @type {FeatureOnSignature}\n */\n this.on;\n\n /***\n * @type {FeatureOnSignature}\n */\n this.once;\n\n /***\n * @type {FeatureOnSignature}\n */\n this.un;\n\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = undefined;\n\n /**\n * @type {string}\n * @private\n */\n this.geometryName_ = 'geometry';\n\n /**\n * User provided style.\n * @private\n * @type {import(\"./style/Style.js\").StyleLike}\n */\n this.style_ = null;\n\n /**\n * @private\n * @type {import(\"./style/Style.js\").StyleFunction|undefined}\n */\n this.styleFunction_ = undefined;\n\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.geometryChangeKey_ = null;\n\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n\n if (geometryOrProperties) {\n if (\n typeof (\n /** @type {?} */ (geometryOrProperties).getSimplifiedGeometry\n ) === 'function'\n ) {\n const geometry = /** @type {Geometry} */ (geometryOrProperties);\n this.setGeometry(geometry);\n } else {\n /** @type {Object} */\n const properties = geometryOrProperties;\n this.setProperties(properties);\n }\n }\n }\n\n /**\n * Clone this feature. If the original feature has a geometry it\n * is also cloned. The feature id is not set in the clone.\n * @return {Feature} The clone.\n * @api\n */\n clone() {\n const clone = /** @type {Feature} */ (\n new Feature(this.hasProperties() ? this.getProperties() : null)\n );\n clone.setGeometryName(this.getGeometryName());\n const geometry = this.getGeometry();\n if (geometry) {\n clone.setGeometry(/** @type {Geometry} */ (geometry.clone()));\n }\n const style = this.getStyle();\n if (style) {\n clone.setStyle(style);\n }\n return clone;\n }\n\n /**\n * Get the feature's default geometry. A feature may have any number of named\n * geometries. The \"default\" geometry (the one that is rendered by default) is\n * set when calling {@link module:ol/Feature~Feature#setGeometry}.\n * @return {Geometry|undefined} The default geometry for the feature.\n * @api\n * @observable\n */\n getGeometry() {\n return /** @type {Geometry|undefined} */ (this.get(this.geometryName_));\n }\n\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is either set when reading data from a remote source or set explicitly by\n * calling {@link module:ol/Feature~Feature#setId}.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id_;\n }\n\n /**\n * Get the name of the feature's default geometry. By default, the default\n * geometry is named `geometry`.\n * @return {string} Get the property name associated with the default geometry\n * for this feature.\n * @api\n */\n getGeometryName() {\n return this.geometryName_;\n }\n\n /**\n * Get the feature's style. Will return what was provided to the\n * {@link module:ol/Feature~Feature#setStyle} method.\n * @return {import(\"./style/Style.js\").StyleLike|undefined} The feature style.\n * @api\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * Get the feature's style function.\n * @return {import(\"./style/Style.js\").StyleFunction|undefined} Return a function\n * representing the current style of this feature.\n * @api\n */\n getStyleFunction() {\n return this.styleFunction_;\n }\n\n /**\n * @private\n */\n handleGeometryChange_() {\n this.changed();\n }\n\n /**\n * @private\n */\n handleGeometryChanged_() {\n if (this.geometryChangeKey_) {\n unlistenByKey(this.geometryChangeKey_);\n this.geometryChangeKey_ = null;\n }\n const geometry = this.getGeometry();\n if (geometry) {\n this.geometryChangeKey_ = listen(\n geometry,\n EventType.CHANGE,\n this.handleGeometryChange_,\n this,\n );\n }\n this.changed();\n }\n\n /**\n * Set the default geometry for the feature. This will update the property\n * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.\n * @param {Geometry|undefined} geometry The new geometry.\n * @api\n * @observable\n */\n setGeometry(geometry) {\n this.set(this.geometryName_, geometry);\n }\n\n /**\n * Set the style for the feature to override the layer style. This can be a\n * single style object, an array of styles, or a function that takes a\n * resolution and returns an array of styles. To unset the feature style, call\n * `setStyle()` without arguments or a falsey value.\n * @param {import(\"./style/Style.js\").StyleLike} [style] Style for this feature.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setStyle(style) {\n this.style_ = style;\n this.styleFunction_ = !style ? undefined : createStyleFunction(style);\n this.changed();\n }\n\n /**\n * Set the feature id. The feature id is considered stable and may be used when\n * requesting features or comparing identifiers returned from a remote source.\n * The feature id can be used with the\n * {@link module:ol/source/Vector~VectorSource#getFeatureById} method.\n * @param {number|string|undefined} id The feature id.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setId(id) {\n this.id_ = id;\n this.changed();\n }\n\n /**\n * Set the property name to be used when getting the feature's default geometry.\n * When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with\n * this name will be returned.\n * @param {string} name The property name of the default geometry.\n * @api\n */\n setGeometryName(name) {\n this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.geometryName_ = name;\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.handleGeometryChanged_();\n }\n}\n\n/**\n * Convert the provided object into a feature style function. Functions passed\n * through unchanged. Arrays of Style or single style objects wrapped\n * in a new feature style function.\n * @param {!import(\"./style/Style.js\").StyleFunction|!Array|!import(\"./style/Style.js\").default} obj\n * A feature style function, a single style, or an array of styles.\n * @return {import(\"./style/Style.js\").StyleFunction} A style function.\n */\nexport function createStyleFunction(obj) {\n if (typeof obj === 'function') {\n return obj;\n }\n /**\n * @type {Array}\n */\n let styles;\n if (Array.isArray(obj)) {\n styles = obj;\n } else {\n assert(\n typeof (/** @type {?} */ (obj).getZIndex) === 'function',\n 'Expected an `ol/style/Style` or an array of `ol/style/Style.js`',\n );\n const style = /** @type {import(\"./style/Style.js\").default} */ (obj);\n styles = [style];\n }\n return function () {\n return styles;\n };\n}\nexport default Feature;\n","/**\n * @module ol/extent/Relationship\n */\n\n/**\n * Relationship to an extent.\n * @enum {number}\n */\nexport default {\n UNKNOWN: 0,\n INTERSECTING: 1,\n ABOVE: 2,\n RIGHT: 4,\n BELOW: 8,\n LEFT: 16,\n};\n","/**\n * @module ol/extent\n */\nimport Relationship from './extent/Relationship.js';\n\n/**\n * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.\n * @typedef {Array} Extent\n * @api\n */\n\n/**\n * Extent corner.\n * @typedef {'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'} Corner\n */\n\n/**\n * Build an extent that includes all given coordinates.\n *\n * @param {Array} coordinates Coordinates.\n * @return {Extent} Bounding extent.\n * @api\n */\nexport function boundingExtent(coordinates) {\n const extent = createEmpty();\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Array} xs Xs.\n * @param {Array} ys Ys.\n * @param {Extent} [dest] Destination extent.\n * @private\n * @return {Extent} Extent.\n */\nfunction _boundingExtentXYs(xs, ys, dest) {\n const minX = Math.min.apply(null, xs);\n const minY = Math.min.apply(null, ys);\n const maxX = Math.max.apply(null, xs);\n const maxY = Math.max.apply(null, ys);\n return createOrUpdate(minX, minY, maxX, maxY, dest);\n}\n\n/**\n * Return extent increased by the provided value.\n * @param {Extent} extent Extent.\n * @param {number} value The amount by which the extent should be buffered.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n * @api\n */\nexport function buffer(extent, value, dest) {\n if (dest) {\n dest[0] = extent[0] - value;\n dest[1] = extent[1] - value;\n dest[2] = extent[2] + value;\n dest[3] = extent[3] + value;\n return dest;\n }\n return [\n extent[0] - value,\n extent[1] - value,\n extent[2] + value,\n extent[3] + value,\n ];\n}\n\n/**\n * Creates a clone of an extent.\n *\n * @param {Extent} extent Extent to clone.\n * @param {Extent} [dest] Extent.\n * @return {Extent} The clone.\n */\nexport function clone(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n }\n return extent.slice();\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {number} Closest squared distance.\n */\nexport function closestSquaredDistanceXY(extent, x, y) {\n let dx, dy;\n if (x < extent[0]) {\n dx = extent[0] - x;\n } else if (extent[2] < x) {\n dx = x - extent[2];\n } else {\n dx = 0;\n }\n if (y < extent[1]) {\n dy = extent[1] - y;\n } else if (extent[3] < y) {\n dy = y - extent[3];\n } else {\n dy = 0;\n }\n return dx * dx + dy * dy;\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} The coordinate is contained in the extent.\n * @api\n */\nexport function containsCoordinate(extent, coordinate) {\n return containsXY(extent, coordinate[0], coordinate[1]);\n}\n\n/**\n * Check if one extent contains another.\n *\n * An extent is deemed contained if it lies completely within the other extent,\n * including if they share one or more edges.\n *\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The second extent is contained by or on the edge of the\n * first.\n * @api\n */\nexport function containsExtent(extent1, extent2) {\n return (\n extent1[0] <= extent2[0] &&\n extent2[2] <= extent1[2] &&\n extent1[1] <= extent2[1] &&\n extent2[3] <= extent1[3]\n );\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {number} x X coordinate.\n * @param {number} y Y coordinate.\n * @return {boolean} The x, y values are contained in the extent.\n * @api\n */\nexport function containsXY(extent, x, y) {\n return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];\n}\n\n/**\n * Get the relationship between a coordinate and extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate The coordinate.\n * @return {import(\"./extent/Relationship.js\").default} The relationship (bitwise compare with\n * import(\"./extent/Relationship.js\").Relationship).\n */\nexport function coordinateRelationship(extent, coordinate) {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const x = coordinate[0];\n const y = coordinate[1];\n let relationship = Relationship.UNKNOWN;\n if (x < minX) {\n relationship = relationship | Relationship.LEFT;\n } else if (x > maxX) {\n relationship = relationship | Relationship.RIGHT;\n }\n if (y < minY) {\n relationship = relationship | Relationship.BELOW;\n } else if (y > maxY) {\n relationship = relationship | Relationship.ABOVE;\n }\n if (relationship === Relationship.UNKNOWN) {\n relationship = Relationship.INTERSECTING;\n }\n return relationship;\n}\n\n/**\n * Create an empty extent.\n * @return {Extent} Empty extent.\n * @api\n */\nexport function createEmpty() {\n return [Infinity, Infinity, -Infinity, -Infinity];\n}\n\n/**\n * Create a new extent or update the provided extent.\n * @param {number} minX Minimum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxX Maximum X.\n * @param {number} maxY Maximum Y.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdate(minX, minY, maxX, maxY, dest) {\n if (dest) {\n dest[0] = minX;\n dest[1] = minY;\n dest[2] = maxX;\n dest[3] = maxY;\n return dest;\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * Create a new empty extent or make the provided one empty.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateEmpty(dest) {\n return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, dest);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinate(coordinate, dest) {\n const x = coordinate[0];\n const y = coordinate[1];\n return createOrUpdate(x, y, x, y, dest);\n}\n\n/**\n * @param {Array} coordinates Coordinates.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromCoordinates(coordinates, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendCoordinates(extent, coordinates);\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromFlatCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n dest,\n) {\n const extent = createOrUpdateEmpty(dest);\n return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);\n}\n\n/**\n * @param {Array>} rings Rings.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function createOrUpdateFromRings(rings, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendRings(extent, rings);\n}\n\n/**\n * Determine if two extents are equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The two extents are equivalent.\n * @api\n */\nexport function equals(extent1, extent2) {\n return (\n extent1[0] == extent2[0] &&\n extent1[2] == extent2[2] &&\n extent1[1] == extent2[1] &&\n extent1[3] == extent2[3]\n );\n}\n\n/**\n * Determine if two extents are approximately equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {number} tolerance Tolerance in extent coordinate units.\n * @return {boolean} The two extents differ by less than the tolerance.\n */\nexport function approximatelyEquals(extent1, extent2, tolerance) {\n return (\n Math.abs(extent1[0] - extent2[0]) < tolerance &&\n Math.abs(extent1[2] - extent2[2]) < tolerance &&\n Math.abs(extent1[1] - extent2[1]) < tolerance &&\n Math.abs(extent1[3] - extent2[3]) < tolerance\n );\n}\n\n/**\n * Modify an extent to include another extent.\n * @param {Extent} extent1 The extent to be modified.\n * @param {Extent} extent2 The extent that will be included in the first.\n * @return {Extent} A reference to the first (extended) extent.\n * @api\n */\nexport function extend(extent1, extent2) {\n if (extent2[0] < extent1[0]) {\n extent1[0] = extent2[0];\n }\n if (extent2[2] > extent1[2]) {\n extent1[2] = extent2[2];\n }\n if (extent2[1] < extent1[1]) {\n extent1[1] = extent2[1];\n }\n if (extent2[3] > extent1[3]) {\n extent1[3] = extent2[3];\n }\n return extent1;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n */\nexport function extendCoordinate(extent, coordinate) {\n if (coordinate[0] < extent[0]) {\n extent[0] = coordinate[0];\n }\n if (coordinate[0] > extent[2]) {\n extent[2] = coordinate[0];\n }\n if (coordinate[1] < extent[1]) {\n extent[1] = coordinate[1];\n }\n if (coordinate[1] > extent[3]) {\n extent[3] = coordinate[1];\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array} coordinates Coordinates.\n * @return {Extent} Extent.\n */\nexport function extendCoordinates(extent, coordinates) {\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Extent} Extent.\n */\nexport function extendFlatCoordinates(\n extent,\n flatCoordinates,\n offset,\n end,\n stride,\n) {\n for (; offset < end; offset += stride) {\n extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array>} rings Rings.\n * @return {Extent} Extent.\n */\nexport function extendRings(extent, rings) {\n for (let i = 0, ii = rings.length; i < ii; ++i) {\n extendCoordinates(extent, rings[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n */\nexport function extendXY(extent, x, y) {\n extent[0] = Math.min(extent[0], x);\n extent[1] = Math.min(extent[1], y);\n extent[2] = Math.max(extent[2], x);\n extent[3] = Math.max(extent[3], y);\n}\n\n/**\n * This function calls `callback` for each corner of the extent. If the\n * callback returns a truthy value the function returns that value\n * immediately. Otherwise the function returns `false`.\n * @param {Extent} extent Extent.\n * @param {function(import(\"./coordinate.js\").Coordinate): S} callback Callback.\n * @return {S|boolean} Value.\n * @template S\n */\nexport function forEachCorner(extent, callback) {\n let val;\n val = callback(getBottomLeft(extent));\n if (val) {\n return val;\n }\n val = callback(getBottomRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopLeft(extent));\n if (val) {\n return val;\n }\n return false;\n}\n\n/**\n * Get the size of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Area.\n * @api\n */\nexport function getArea(extent) {\n let area = 0;\n if (!isEmpty(extent)) {\n area = getWidth(extent) * getHeight(extent);\n }\n return area;\n}\n\n/**\n * Get the bottom left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom left coordinate.\n * @api\n */\nexport function getBottomLeft(extent) {\n return [extent[0], extent[1]];\n}\n\n/**\n * Get the bottom right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom right coordinate.\n * @api\n */\nexport function getBottomRight(extent) {\n return [extent[2], extent[1]];\n}\n\n/**\n * Get the center coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Center.\n * @api\n */\nexport function getCenter(extent) {\n return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];\n}\n\n/**\n * Get a corner coordinate of an extent.\n * @param {Extent} extent Extent.\n * @param {Corner} corner Corner.\n * @return {import(\"./coordinate.js\").Coordinate} Corner coordinate.\n */\nexport function getCorner(extent, corner) {\n let coordinate;\n if (corner === 'bottom-left') {\n coordinate = getBottomLeft(extent);\n } else if (corner === 'bottom-right') {\n coordinate = getBottomRight(extent);\n } else if (corner === 'top-left') {\n coordinate = getTopLeft(extent);\n } else if (corner === 'top-right') {\n coordinate = getTopRight(extent);\n } else {\n throw new Error('Invalid corner');\n }\n return coordinate;\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Enlarged area.\n */\nexport function getEnlargedArea(extent1, extent2) {\n const minX = Math.min(extent1[0], extent2[0]);\n const minY = Math.min(extent1[1], extent2[1]);\n const maxX = Math.max(extent1[2], extent2[2]);\n const maxY = Math.max(extent1[3], extent2[3]);\n return (maxX - minX) * (maxY - minY);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nexport function getForViewAndSize(center, resolution, rotation, size, dest) {\n const [x0, y0, x1, y1, x2, y2, x3, y3] = getRotatedViewport(\n center,\n resolution,\n rotation,\n size,\n );\n return createOrUpdate(\n Math.min(x0, x1, x2, x3),\n Math.min(y0, y1, y2, y3),\n Math.max(x0, x1, x2, x3),\n Math.max(y0, y1, y2, y3),\n dest,\n );\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @return {Array} Linear ring representing the viewport.\n */\nexport function getRotatedViewport(center, resolution, rotation, size) {\n const dx = (resolution * size[0]) / 2;\n const dy = (resolution * size[1]) / 2;\n const cosRotation = Math.cos(rotation);\n const sinRotation = Math.sin(rotation);\n const xCos = dx * cosRotation;\n const xSin = dx * sinRotation;\n const yCos = dy * cosRotation;\n const ySin = dy * sinRotation;\n const x = center[0];\n const y = center[1];\n return [\n x - xCos + ySin,\n y - xSin - yCos,\n x - xCos - ySin,\n y - xSin + yCos,\n x + xCos - ySin,\n y + xSin + yCos,\n x + xCos + ySin,\n y + xSin - yCos,\n x - xCos + ySin,\n y - xSin - yCos,\n ];\n}\n\n/**\n * Get the height of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Height.\n * @api\n */\nexport function getHeight(extent) {\n return extent[3] - extent[1];\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Intersection area.\n */\nexport function getIntersectionArea(extent1, extent2) {\n const intersection = getIntersection(extent1, extent2);\n return getArea(intersection);\n}\n\n/**\n * Get the intersection of two extents.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {Extent} [dest] Optional extent to populate with intersection.\n * @return {Extent} Intersecting extent.\n * @api\n */\nexport function getIntersection(extent1, extent2, dest) {\n const intersection = dest ? dest : createEmpty();\n if (intersects(extent1, extent2)) {\n if (extent1[0] > extent2[0]) {\n intersection[0] = extent1[0];\n } else {\n intersection[0] = extent2[0];\n }\n if (extent1[1] > extent2[1]) {\n intersection[1] = extent1[1];\n } else {\n intersection[1] = extent2[1];\n }\n if (extent1[2] < extent2[2]) {\n intersection[2] = extent1[2];\n } else {\n intersection[2] = extent2[2];\n }\n if (extent1[3] < extent2[3]) {\n intersection[3] = extent1[3];\n } else {\n intersection[3] = extent2[3];\n }\n } else {\n createOrUpdateEmpty(intersection);\n }\n return intersection;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @return {number} Margin.\n */\nexport function getMargin(extent) {\n return getWidth(extent) + getHeight(extent);\n}\n\n/**\n * Get the size (width, height) of an extent.\n * @param {Extent} extent The extent.\n * @return {import(\"./size.js\").Size} The extent size.\n * @api\n */\nexport function getSize(extent) {\n return [extent[2] - extent[0], extent[3] - extent[1]];\n}\n\n/**\n * Get the top left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top left coordinate.\n * @api\n */\nexport function getTopLeft(extent) {\n return [extent[0], extent[3]];\n}\n\n/**\n * Get the top right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top right coordinate.\n * @api\n */\nexport function getTopRight(extent) {\n return [extent[2], extent[3]];\n}\n\n/**\n * Get the width of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Width.\n * @api\n */\nexport function getWidth(extent) {\n return extent[2] - extent[0];\n}\n\n/**\n * Determine if one extent intersects another.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent.\n * @return {boolean} The two extents intersect.\n * @api\n */\nexport function intersects(extent1, extent2) {\n return (\n extent1[0] <= extent2[2] &&\n extent1[2] >= extent2[0] &&\n extent1[1] <= extent2[3] &&\n extent1[3] >= extent2[1]\n );\n}\n\n/**\n * Determine if an extent is empty.\n * @param {Extent} extent Extent.\n * @return {boolean} Is empty.\n * @api\n */\nexport function isEmpty(extent) {\n return extent[2] < extent[0] || extent[3] < extent[1];\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nexport function returnOrUpdate(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} value Value.\n */\nexport function scaleFromCenter(extent, value) {\n const deltaX = ((extent[2] - extent[0]) / 2) * (value - 1);\n const deltaY = ((extent[3] - extent[1]) / 2) * (value - 1);\n extent[0] -= deltaX;\n extent[2] += deltaX;\n extent[1] -= deltaY;\n extent[3] += deltaY;\n}\n\n/**\n * Determine if the segment between two coordinates intersects (crosses,\n * touches, or is contained by) the provided extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} start Segment start coordinate.\n * @param {import(\"./coordinate.js\").Coordinate} end Segment end coordinate.\n * @return {boolean} The segment intersects the extent.\n */\nexport function intersectsSegment(extent, start, end) {\n let intersects = false;\n const startRel = coordinateRelationship(extent, start);\n const endRel = coordinateRelationship(extent, end);\n if (\n startRel === Relationship.INTERSECTING ||\n endRel === Relationship.INTERSECTING\n ) {\n intersects = true;\n } else {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const startX = start[0];\n const startY = start[1];\n const endX = end[0];\n const endY = end[1];\n const slope = (endY - startY) / (endX - startX);\n let x, y;\n if (!!(endRel & Relationship.ABOVE) && !(startRel & Relationship.ABOVE)) {\n // potentially intersects top\n x = endX - (endY - maxY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.RIGHT) &&\n !(startRel & Relationship.RIGHT)\n ) {\n // potentially intersects right\n y = endY - (endX - maxX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.BELOW) &&\n !(startRel & Relationship.BELOW)\n ) {\n // potentially intersects bottom\n x = endX - (endY - minY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (\n !intersects &&\n !!(endRel & Relationship.LEFT) &&\n !(startRel & Relationship.LEFT)\n ) {\n // potentially intersects left\n y = endY - (endX - minX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n }\n return intersects;\n}\n\n/**\n * Apply a transform function to the extent.\n * @param {Extent} extent Extent.\n * @param {import(\"./proj.js\").TransformFunction} transformFn Transform function.\n * Called with `[minX, minY, maxX, maxY]` extent coordinates.\n * @param {Extent} [dest] Destination extent.\n * @param {number} [stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {Extent} Extent.\n * @api\n */\nexport function applyTransform(extent, transformFn, dest, stops) {\n if (isEmpty(extent)) {\n return createOrUpdateEmpty(dest);\n }\n let coordinates = [];\n if (stops > 1) {\n const width = extent[2] - extent[0];\n const height = extent[3] - extent[1];\n for (let i = 0; i < stops; ++i) {\n coordinates.push(\n extent[0] + (width * i) / stops,\n extent[1],\n extent[2],\n extent[1] + (height * i) / stops,\n extent[2] - (width * i) / stops,\n extent[3],\n extent[0],\n extent[3] - (height * i) / stops,\n );\n }\n } else {\n coordinates = [\n extent[0],\n extent[1],\n extent[2],\n extent[1],\n extent[2],\n extent[3],\n extent[0],\n extent[3],\n ];\n }\n transformFn(coordinates, coordinates, 2);\n const xs = [];\n const ys = [];\n for (let i = 0, l = coordinates.length; i < l; i += 2) {\n xs.push(coordinates[i]);\n ys.push(coordinates[i + 1]);\n }\n return _boundingExtentXYs(xs, ys, dest);\n}\n\n/**\n * Modifies the provided extent in-place to be within the real world\n * extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Extent} The extent within the real world extent.\n */\nexport function wrapX(extent, projection) {\n const projectionExtent = projection.getExtent();\n const center = getCenter(extent);\n if (\n projection.canWrapX() &&\n (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])\n ) {\n const worldWidth = getWidth(projectionExtent);\n const worldsAway = Math.floor(\n (center[0] - projectionExtent[0]) / worldWidth,\n );\n const offset = worldsAway * worldWidth;\n extent[0] -= offset;\n extent[2] -= offset;\n }\n return extent;\n}\n\n/**\n * Fits the extent to the real world\n *\n * If the extent does not cross the anti meridian, this will return the extent in an array\n * If the extent crosses the anti meridian, the extent will be sliced, so each part fits within the\n * real world\n *\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @param {boolean} [multiWorld] Return all worlds\n * @return {Array} The extent within the real world extent.\n */\nexport function wrapAndSliceX(extent, projection, multiWorld) {\n if (projection.canWrapX()) {\n const projectionExtent = projection.getExtent();\n\n if (!isFinite(extent[0]) || !isFinite(extent[2])) {\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n }\n\n wrapX(extent, projection);\n const worldWidth = getWidth(projectionExtent);\n\n if (getWidth(extent) > worldWidth && !multiWorld) {\n // the extent wraps around on itself\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n }\n if (extent[0] < projectionExtent[0]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [\n [extent[0] + worldWidth, extent[1], projectionExtent[2], extent[3]],\n [projectionExtent[0], extent[1], extent[2], extent[3]],\n ];\n }\n if (extent[2] > projectionExtent[2]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [\n [extent[0], extent[1], projectionExtent[2], extent[3]],\n [projectionExtent[0], extent[1], extent[2] - worldWidth, extent[3]],\n ];\n }\n }\n\n return [extent];\n}\n","/**\n * @module ol/math\n */\n\n/**\n * Takes a number and clamps it to within the provided bounds.\n * @param {number} value The input number.\n * @param {number} min The minimum value to return.\n * @param {number} max The maximum value to return.\n * @return {number} The input number if it is within bounds, or the nearest\n * number within the bounds.\n */\nexport function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * Returns the square of the closest distance between the point (x, y) and the\n * line segment (x1, y1) to (x2, y2).\n * @param {number} x X.\n * @param {number} y Y.\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nexport function squaredSegmentDistance(x, y, x1, y1, x2, y2) {\n const dx = x2 - x1;\n const dy = y2 - y1;\n if (dx !== 0 || dy !== 0) {\n const t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n x1 = x2;\n y1 = y2;\n } else if (t > 0) {\n x1 += dx * t;\n y1 += dy * t;\n }\n }\n return squaredDistance(x, y, x1, y1);\n}\n\n/**\n * Returns the square of the distance between the points (x1, y1) and (x2, y2).\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nexport function squaredDistance(x1, y1, x2, y2) {\n const dx = x2 - x1;\n const dy = y2 - y1;\n return dx * dx + dy * dy;\n}\n\n/**\n * Solves system of linear equations using Gaussian elimination method.\n *\n * @param {Array>} mat Augmented matrix (n x n + 1 column)\n * in row-major order.\n * @return {Array|null} The resulting vector.\n */\nexport function solveLinearSystem(mat) {\n const n = mat.length;\n\n for (let i = 0; i < n; i++) {\n // Find max in the i-th column (ignoring i - 1 first rows)\n let maxRow = i;\n let maxEl = Math.abs(mat[i][i]);\n for (let r = i + 1; r < n; r++) {\n const absValue = Math.abs(mat[r][i]);\n if (absValue > maxEl) {\n maxEl = absValue;\n maxRow = r;\n }\n }\n\n if (maxEl === 0) {\n return null; // matrix is singular\n }\n\n // Swap max row with i-th (current) row\n const tmp = mat[maxRow];\n mat[maxRow] = mat[i];\n mat[i] = tmp;\n\n // Subtract the i-th row to make all the remaining rows 0 in the i-th column\n for (let j = i + 1; j < n; j++) {\n const coef = -mat[j][i] / mat[i][i];\n for (let k = i; k < n + 1; k++) {\n if (i == k) {\n mat[j][k] = 0;\n } else {\n mat[j][k] += coef * mat[i][k];\n }\n }\n }\n }\n\n // Solve Ax=b for upper triangular matrix A (mat)\n const x = new Array(n);\n for (let l = n - 1; l >= 0; l--) {\n x[l] = mat[l][n] / mat[l][l];\n for (let m = l - 1; m >= 0; m--) {\n mat[m][n] -= mat[m][l] * x[l];\n }\n }\n return x;\n}\n\n/**\n * Converts radians to to degrees.\n *\n * @param {number} angleInRadians Angle in radians.\n * @return {number} Angle in degrees.\n */\nexport function toDegrees(angleInRadians) {\n return (angleInRadians * 180) / Math.PI;\n}\n\n/**\n * Converts degrees to radians.\n *\n * @param {number} angleInDegrees Angle in degrees.\n * @return {number} Angle in radians.\n */\nexport function toRadians(angleInDegrees) {\n return (angleInDegrees * Math.PI) / 180;\n}\n\n/**\n * Returns the modulo of a / b, depending on the sign of b.\n *\n * @param {number} a Dividend.\n * @param {number} b Divisor.\n * @return {number} Modulo.\n */\nexport function modulo(a, b) {\n const r = a % b;\n return r * b < 0 ? r + b : r;\n}\n\n/**\n * Calculates the linearly interpolated value of x between a and b.\n *\n * @param {number} a Number\n * @param {number} b Number\n * @param {number} x Value to be interpolated.\n * @return {number} Interpolated value.\n */\nexport function lerp(a, b, x) {\n return a + x * (b - a);\n}\n\n/**\n * Returns a number with a limited number of decimal digits.\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The input number with a limited number of decimal digits.\n */\nexport function toFixed(n, decimals) {\n const factor = Math.pow(10, decimals);\n return Math.round(n * factor) / factor;\n}\n\n/**\n * Rounds a number to the nearest integer value considering only the given number\n * of decimal digits (with rounding on the final digit).\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The nearest integer.\n */\nexport function round(n, decimals) {\n return Math.round(toFixed(n, decimals));\n}\n\n/**\n * Rounds a number to the next smaller integer considering only the given number\n * of decimal digits (with rounding on the final digit).\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The next smaller integer.\n */\nexport function floor(n, decimals) {\n return Math.floor(toFixed(n, decimals));\n}\n\n/**\n * Rounds a number to the next bigger integer considering only the given number\n * of decimal digits (with rounding on the final digit).\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The next bigger integer.\n */\nexport function ceil(n, decimals) {\n return Math.ceil(toFixed(n, decimals));\n}\n\n/**\n * Wraps a number between some minimum and maximum values.\n * @param {number} n The number to wrap.\n * @param {number} min The minimum of the range (inclusive).\n * @param {number} max The maximum of the range (exclusive).\n * @return {number} The wrapped number.\n */\nexport function wrap(n, min, max) {\n if (n >= min && n < max) {\n return n;\n }\n const range = max - min;\n return ((((n - min) % range) + range) % range) + min;\n}\n","/**\n * @module ol/sphere\n */\nimport {toDegrees, toRadians} from './math.js';\n\n/**\n * Object literal with options for the {@link getLength} or {@link getArea}\n * functions.\n * @typedef {Object} SphereMetricOptions\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857']\n * Projection of the geometry. By default, the geometry is assumed to be in\n * Web Mercator.\n * @property {number} [radius=6371008.8] Sphere radius. By default, the\n * [mean Earth radius](https://en.wikipedia.org/wiki/Earth_radius#Mean_radius)\n * for the WGS84 ellipsoid is used.\n */\n\n/**\n * The mean Earth radius (1/3 * (2a + b)) for the WGS84 ellipsoid.\n * https://en.wikipedia.org/wiki/Earth_radius#Mean_radius\n * @type {number}\n */\nexport const DEFAULT_RADIUS = 6371008.8;\n\n/**\n * Get the great circle distance (in meters) between two geographic coordinates.\n * @param {Array} c1 Starting coordinate.\n * @param {Array} c2 Ending coordinate.\n * @param {number} [radius] The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {number} The great circle distance between the points (in meters).\n * @api\n */\nexport function getDistance(c1, c2, radius) {\n radius = radius || DEFAULT_RADIUS;\n const lat1 = toRadians(c1[1]);\n const lat2 = toRadians(c2[1]);\n const deltaLatBy2 = (lat2 - lat1) / 2;\n const deltaLonBy2 = toRadians(c2[0] - c1[0]) / 2;\n const a =\n Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) +\n Math.sin(deltaLonBy2) *\n Math.sin(deltaLonBy2) *\n Math.cos(lat1) *\n Math.cos(lat2);\n return 2 * radius * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n}\n\n/**\n * Get the cumulative great circle length of linestring coordinates (geographic).\n * @param {Array} coordinates Linestring coordinates.\n * @param {number} radius The sphere radius to use.\n * @return {number} The length (in meters).\n */\nfunction getLengthInternal(coordinates, radius) {\n let length = 0;\n for (let i = 0, ii = coordinates.length; i < ii - 1; ++i) {\n length += getDistance(coordinates[i], coordinates[i + 1], radius);\n }\n return length;\n}\n\n/**\n * Get the spherical length of a geometry. This length is the sum of the\n * great circle distances between coordinates. For polygons, the length is\n * the sum of all rings. For points, the length is zero. For multi-part\n * geometries, the length is the sum of the length of each part.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions} [options] Options for the\n * length calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical length (in meters).\n * @api\n */\nexport function getLength(geometry, options) {\n options = options || {};\n const radius = options.radius || DEFAULT_RADIUS;\n const projection = options.projection || 'EPSG:3857';\n const type = geometry.getType();\n if (type !== 'GeometryCollection') {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n let length = 0;\n let coordinates, coords, i, ii, j, jj;\n switch (type) {\n case 'Point':\n case 'MultiPoint': {\n break;\n }\n case 'LineString':\n case 'LinearRing': {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (\n geometry\n ).getCoordinates();\n length = getLengthInternal(coordinates, radius);\n break;\n }\n case 'MultiLineString':\n case 'Polygon': {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (\n geometry\n ).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n length += getLengthInternal(coordinates[i], radius);\n }\n break;\n }\n case 'MultiPolygon': {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (\n geometry\n ).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n for (j = 0, jj = coords.length; j < jj; ++j) {\n length += getLengthInternal(coords[j], radius);\n }\n }\n break;\n }\n case 'GeometryCollection': {\n const geometries =\n /** @type {import(\"./geom/GeometryCollection.js\").default} */ (\n geometry\n ).getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n length += getLength(geometries[i], options);\n }\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return length;\n}\n\n/**\n * Returns the spherical area for a list of coordinates.\n *\n * [Reference](https://trs.jpl.nasa.gov/handle/2014/40409)\n * Robert. G. Chamberlain and William H. Duquette, \"Some Algorithms for\n * Polygons on a Sphere\", JPL Publication 07-03, Jet Propulsion\n * Laboratory, Pasadena, CA, June 2007\n *\n * @param {Array} coordinates List of coordinates of a linear\n * ring. If the ring is oriented clockwise, the area will be positive,\n * otherwise it will be negative.\n * @param {number} radius The sphere radius.\n * @return {number} Area (in square meters).\n */\nfunction getAreaInternal(coordinates, radius) {\n let area = 0;\n const len = coordinates.length;\n let x1 = coordinates[len - 1][0];\n let y1 = coordinates[len - 1][1];\n for (let i = 0; i < len; i++) {\n const x2 = coordinates[i][0];\n const y2 = coordinates[i][1];\n area +=\n toRadians(x2 - x1) *\n (2 + Math.sin(toRadians(y1)) + Math.sin(toRadians(y2)));\n x1 = x2;\n y1 = y2;\n }\n return (area * radius * radius) / 2.0;\n}\n\n/**\n * Get the spherical area of a geometry. This is the area (in meters) assuming\n * that polygon edges are segments of great circles on a sphere.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions} [options] Options for the area\n * calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical area (in square meters).\n * @api\n */\nexport function getArea(geometry, options) {\n options = options || {};\n const radius = options.radius || DEFAULT_RADIUS;\n const projection = options.projection || 'EPSG:3857';\n const type = geometry.getType();\n if (type !== 'GeometryCollection') {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n let area = 0;\n let coordinates, coords, i, ii, j, jj;\n switch (type) {\n case 'Point':\n case 'MultiPoint':\n case 'LineString':\n case 'MultiLineString':\n case 'LinearRing': {\n break;\n }\n case 'Polygon': {\n coordinates = /** @type {import(\"./geom/Polygon.js\").default} */ (\n geometry\n ).getCoordinates();\n area = Math.abs(getAreaInternal(coordinates[0], radius));\n for (i = 1, ii = coordinates.length; i < ii; ++i) {\n area -= Math.abs(getAreaInternal(coordinates[i], radius));\n }\n break;\n }\n case 'MultiPolygon': {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */ (\n geometry\n ).getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n area += Math.abs(getAreaInternal(coords[0], radius));\n for (j = 1, jj = coords.length; j < jj; ++j) {\n area -= Math.abs(getAreaInternal(coords[j], radius));\n }\n }\n break;\n }\n case 'GeometryCollection': {\n const geometries =\n /** @type {import(\"./geom/GeometryCollection.js\").default} */ (\n geometry\n ).getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n area += getArea(geometries[i], options);\n }\n break;\n }\n default: {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return area;\n}\n\n/**\n * Returns the coordinate at the given distance and bearing from `c1`.\n *\n * @param {import(\"./coordinate.js\").Coordinate} c1 The origin point (`[lon, lat]` in degrees).\n * @param {number} distance The great-circle distance between the origin\n * point and the target point.\n * @param {number} bearing The bearing (in radians).\n * @param {number} [radius] The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {import(\"./coordinate.js\").Coordinate} The target point.\n */\nexport function offset(c1, distance, bearing, radius) {\n radius = radius || DEFAULT_RADIUS;\n const lat1 = toRadians(c1[1]);\n const lon1 = toRadians(c1[0]);\n const dByR = distance / radius;\n const lat = Math.asin(\n Math.sin(lat1) * Math.cos(dByR) +\n Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing),\n );\n const lon =\n lon1 +\n Math.atan2(\n Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1),\n Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat),\n );\n return [toDegrees(lon), toDegrees(lat)];\n}\n","/**\n * @module ol/console\n */\n\n/**\n * @typedef {'info'|'warn'|'error'|'none'} Level\n */\n\n/**\n * @type {Object}\n */\nconst levels = {\n info: 1,\n warn: 2,\n error: 3,\n none: 4,\n};\n\n/**\n * @type {number}\n */\nlet level = levels.info;\n\n/**\n * Set the logging level. By default, the level is set to 'info' and all\n * messages will be logged. Set to 'warn' to only display warnings and errors.\n * Set to 'error' to only display errors. Set to 'none' to silence all messages.\n *\n * @param {Level} l The new level.\n */\nexport function setLevel(l) {\n level = levels[l];\n}\n\n/**\n * @param {...any} args Arguments to log\n */\nexport function log(...args) {\n if (level > levels.info) {\n return;\n }\n console.log(...args); // eslint-disable-line no-console\n}\n\n/**\n * @param {...any} args Arguments to log\n */\nexport function warn(...args) {\n if (level > levels.warn) {\n return;\n }\n console.warn(...args); // eslint-disable-line no-console\n}\n\n/**\n * @param {...any} args Arguments to log\n */\nexport function error(...args) {\n if (level > levels.error) {\n return;\n }\n console.error(...args); // eslint-disable-line no-console\n}\n","/**\n * @module ol/coordinate\n */\nimport {getWidth} from './extent.js';\nimport {modulo, toFixed} from './math.js';\nimport {padNumber} from './string.js';\n\n/**\n * An array of numbers representing an `xy`, `xyz` or `xyzm` coordinate.\n * Example: `[16, 48]`.\n * @typedef {Array} Coordinate\n * @api\n */\n\n/**\n * A function that takes a {@link module:ol/coordinate~Coordinate} and\n * transforms it into a `{string}`.\n *\n * @typedef {function((Coordinate|undefined)): string} CoordinateFormat\n * @api\n */\n\n/**\n * Add `delta` to `coordinate`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {add} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * add(coord, [-2, 4]);\n * // coord is now [5.85, 51.983333]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {Coordinate} delta Delta.\n * @return {Coordinate} The input coordinate adjusted by\n * the given delta.\n * @api\n */\nexport function add(coordinate, delta) {\n coordinate[0] += +delta[0];\n coordinate[1] += +delta[1];\n return coordinate;\n}\n\n/**\n * Calculates the point closest to the passed coordinate on the passed circle.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {import(\"./geom/Circle.js\").default} circle The circle.\n * @return {Coordinate} Closest point on the circumference.\n */\nexport function closestOnCircle(coordinate, circle) {\n const r = circle.getRadius();\n const center = circle.getCenter();\n const x0 = center[0];\n const y0 = center[1];\n const x1 = coordinate[0];\n const y1 = coordinate[1];\n\n let dx = x1 - x0;\n const dy = y1 - y0;\n if (dx === 0 && dy === 0) {\n dx = 1;\n }\n const d = Math.sqrt(dx * dx + dy * dy);\n\n const x = x0 + (r * dx) / d;\n const y = y0 + (r * dy) / d;\n\n return [x, y];\n}\n\n/**\n * Calculates the point closest to the passed coordinate on the passed segment.\n * This is the foot of the perpendicular of the coordinate to the segment when\n * the foot is on the segment, or the closest segment coordinate when the foot\n * is outside the segment.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {Array} segment The two coordinates\n * of the segment.\n * @return {Coordinate} The foot of the perpendicular of\n * the coordinate to the segment.\n */\nexport function closestOnSegment(coordinate, segment) {\n const x0 = coordinate[0];\n const y0 = coordinate[1];\n const start = segment[0];\n const end = segment[1];\n const x1 = start[0];\n const y1 = start[1];\n const x2 = end[0];\n const y2 = end[1];\n const dx = x2 - x1;\n const dy = y2 - y1;\n const along =\n dx === 0 && dy === 0\n ? 0\n : (dx * (x0 - x1) + dy * (y0 - y1)) / (dx * dx + dy * dy || 0);\n let x, y;\n if (along <= 0) {\n x = x1;\n y = y1;\n } else if (along >= 1) {\n x = x2;\n y = y2;\n } else {\n x = x1 + along * dx;\n y = y1 + along * dy;\n }\n return [x, y];\n}\n\n/**\n * Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be\n * used to format\n * a {Coordinate} to a string.\n *\n * Example without specifying the fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const stringifyFunc = createStringXY();\n * const out = stringifyFunc(coord);\n * // out is now '8, 48'\n *\n * Example with explicitly specifying 2 fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const stringifyFunc = createStringXY(2);\n * const out = stringifyFunc(coord);\n * // out is now '7.85, 47.98'\n *\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {CoordinateFormat} Coordinate format.\n * @api\n */\nexport function createStringXY(fractionDigits) {\n return (\n /**\n * @param {Coordinate} coordinate Coordinate.\n * @return {string} String XY.\n */\n function (coordinate) {\n return toStringXY(coordinate, fractionDigits);\n }\n );\n}\n\n/**\n * @param {string} hemispheres Hemispheres.\n * @param {number} degrees Degrees.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} String.\n */\nexport function degreesToStringHDMS(hemispheres, degrees, fractionDigits) {\n const normalizedDegrees = modulo(degrees + 180, 360) - 180;\n const x = Math.abs(3600 * normalizedDegrees);\n const decimals = fractionDigits || 0;\n\n let deg = Math.floor(x / 3600);\n let min = Math.floor((x - deg * 3600) / 60);\n let sec = toFixed(x - deg * 3600 - min * 60, decimals);\n\n if (sec >= 60) {\n sec = 0;\n min += 1;\n }\n\n if (min >= 60) {\n min = 0;\n deg += 1;\n }\n\n let hdms = deg + '\\u00b0';\n if (min !== 0 || sec !== 0) {\n hdms += ' ' + padNumber(min, 2) + '\\u2032';\n }\n if (sec !== 0) {\n hdms += ' ' + padNumber(sec, 2, decimals) + '\\u2033';\n }\n if (normalizedDegrees !== 0) {\n hdms += ' ' + hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);\n }\n\n return hdms;\n}\n\n/**\n * Transforms the given {@link module:ol/coordinate~Coordinate} to a string\n * using the given string template. The strings `{x}` and `{y}` in the template\n * will be replaced with the first and second coordinate values respectively.\n *\n * Example without specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const template = 'Coordinate is ({x}|{y}).';\n * const out = format(coord, template);\n * // out is now 'Coordinate is (8|48).'\n *\n * Example explicitly specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const template = 'Coordinate is ({x}|{y}).';\n * const out = format(coord, template, 2);\n * // out is now 'Coordinate is (7.85|47.98).'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {string} template A template string with `{x}` and `{y}` placeholders\n * that will be replaced by first and second coordinate values.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Formatted coordinate.\n * @api\n */\nexport function format(coordinate, template, fractionDigits) {\n if (coordinate) {\n return template\n .replace('{x}', coordinate[0].toFixed(fractionDigits))\n .replace('{y}', coordinate[1].toFixed(fractionDigits));\n }\n return '';\n}\n\n/**\n * @param {Coordinate} coordinate1 First coordinate.\n * @param {Coordinate} coordinate2 Second coordinate.\n * @return {boolean} The two coordinates are equal.\n */\nexport function equals(coordinate1, coordinate2) {\n let equals = true;\n for (let i = coordinate1.length - 1; i >= 0; --i) {\n if (coordinate1[i] != coordinate2[i]) {\n equals = false;\n break;\n }\n }\n return equals;\n}\n\n/**\n * Rotate `coordinate` by `angle`. `coordinate` is modified in place and\n * returned by the function.\n *\n * Example:\n *\n * import {rotate} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const rotateRadians = Math.PI / 2; // 90 degrees\n * rotate(coord, rotateRadians);\n * // coord is now [-47.983333, 7.85]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} angle Angle in radian.\n * @return {Coordinate} Coordinate.\n * @api\n */\nexport function rotate(coordinate, angle) {\n const cosAngle = Math.cos(angle);\n const sinAngle = Math.sin(angle);\n const x = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n const y = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n coordinate[0] = x;\n coordinate[1] = y;\n return coordinate;\n}\n\n/**\n * Scale `coordinate` by `scale`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {scale as scaleCoordinate} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const scale = 1.2;\n * scaleCoordinate(coord, scale);\n * // coord is now [9.42, 57.5799996]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} scale Scale factor.\n * @return {Coordinate} Coordinate.\n */\nexport function scale(coordinate, scale) {\n coordinate[0] *= scale;\n coordinate[1] *= scale;\n return coordinate;\n}\n\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Squared distance between coord1 and coord2.\n */\nexport function squaredDistance(coord1, coord2) {\n const dx = coord1[0] - coord2[0];\n const dy = coord1[1] - coord2[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Distance between coord1 and coord2.\n */\nexport function distance(coord1, coord2) {\n return Math.sqrt(squaredDistance(coord1, coord2));\n}\n\n/**\n * Calculate the squared distance from a coordinate to a line segment.\n *\n * @param {Coordinate} coordinate Coordinate of the point.\n * @param {Array} segment Line segment (2\n * coordinates).\n * @return {number} Squared distance from the point to the line segment.\n */\nexport function squaredDistanceToSegment(coordinate, segment) {\n return squaredDistance(coordinate, closestOnSegment(coordinate, segment));\n}\n\n/**\n * Format a geographic coordinate with the hemisphere, degrees, minutes, and\n * seconds.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringHDMS} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringHDMS(coord);\n * // out is now '47° 58′ 60″ N 7° 50′ 60″ E'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringHDMS} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringHDMS(coord, 1);\n * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Hemisphere, degrees, minutes and seconds.\n * @api\n */\nexport function toStringHDMS(coordinate, fractionDigits) {\n if (coordinate) {\n return (\n degreesToStringHDMS('NS', coordinate[1], fractionDigits) +\n ' ' +\n degreesToStringHDMS('EW', coordinate[0], fractionDigits)\n );\n }\n return '';\n}\n\n/**\n * Format a coordinate as a comma delimited string.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringXY(coord);\n * // out is now '8, 48'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringXY(coord, 1);\n * // out is now '7.8, 48.0'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} XY.\n * @api\n */\nexport function toStringXY(coordinate, fractionDigits) {\n return format(coordinate, '{x}, {y}', fractionDigits);\n}\n\n/**\n * Modifies the provided coordinate in-place to be within the real world\n * extent. The lower projection extent boundary is inclusive, the upper one\n * exclusive.\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {Coordinate} The coordinate within the real world extent.\n */\nexport function wrapX(coordinate, projection) {\n if (projection.canWrapX()) {\n const worldWidth = getWidth(projection.getExtent());\n const worldsAway = getWorldsAway(coordinate, projection, worldWidth);\n if (worldsAway) {\n coordinate[0] -= worldsAway * worldWidth;\n }\n }\n return coordinate;\n}\n/**\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {number} [sourceExtentWidth] Width of the source extent.\n * @return {number} Offset in world widths.\n */\nexport function getWorldsAway(coordinate, projection, sourceExtentWidth) {\n const projectionExtent = projection.getExtent();\n let worldsAway = 0;\n if (\n projection.canWrapX() &&\n (coordinate[0] < projectionExtent[0] || coordinate[0] > projectionExtent[2])\n ) {\n sourceExtentWidth = sourceExtentWidth || getWidth(projectionExtent);\n worldsAway = Math.floor(\n (coordinate[0] - projectionExtent[0]) / sourceExtentWidth,\n );\n }\n return worldsAway;\n}\n","/**\n * @module ol/proj/Units\n */\n\n/**\n * @typedef {'radians' | 'degrees' | 'ft' | 'm' | 'pixels' | 'tile-pixels' | 'us-ft'} Units\n * Projection units.\n */\n\n/**\n * See http://duff.ess.washington.edu/data/raster/drg/docs/geotiff.txt\n * @type {Object}\n */\nconst unitByCode = {\n '9001': 'm',\n '9002': 'ft',\n '9003': 'us-ft',\n '9101': 'radians',\n '9102': 'degrees',\n};\n\n/**\n * @param {number} code Unit code.\n * @return {Units} Units.\n */\nexport function fromCode(code) {\n return unitByCode[code];\n}\n\n/**\n * @typedef {Object} MetersPerUnitLookup\n * @property {number} radians Radians\n * @property {number} degrees Degrees\n * @property {number} ft Feet\n * @property {number} m Meters\n * @property {number} us-ft US feet\n */\n\n/**\n * Meters per unit lookup table.\n * @const\n * @type {MetersPerUnitLookup}\n * @api\n */\nexport const METERS_PER_UNIT = {\n // use the radius of the Normal sphere\n 'radians': 6370997 / (2 * Math.PI),\n 'degrees': (2 * Math.PI * 6370997) / 360,\n 'ft': 0.3048,\n 'm': 1,\n 'us-ft': 1200 / 3937,\n};\n","/**\n * @module ol/proj/Projection\n */\nimport {METERS_PER_UNIT} from './Units.js';\n\n/**\n * The function is called with a `number` view resolution and a\n * {@link module:ol/coordinate~Coordinate} as arguments, and returns the `number` resolution\n * in projection units at the passed coordinate.\n * @typedef {function(number, import(\"../coordinate.js\").Coordinate):number} GetPointResolution\n * @api\n */\n\n/**\n * @typedef {Object} Options\n * @property {string} code The SRS identifier code, e.g. `EPSG:4326`.\n * @property {import(\"./Units.js\").Units} [units] Units. Required unless a\n * proj4 projection is defined for `code`.\n * @property {import(\"../extent.js\").Extent} [extent] The validity extent for the SRS.\n * @property {string} [axisOrientation='enu'] The axis orientation as specified in Proj4.\n * @property {boolean} [global=false] Whether the projection is valid for the whole globe.\n * @property {number} [metersPerUnit] The meters per unit for the SRS.\n * If not provided, the `units` are used to get the meters per unit from the {@link METERS_PER_UNIT}\n * lookup table.\n * @property {import(\"../extent.js\").Extent} [worldExtent] The world extent for the SRS.\n * @property {GetPointResolution} [getPointResolution]\n * Function to determine resolution at a point. The function is called with a\n * `number` view resolution and a {@link module:ol/coordinate~Coordinate} as arguments, and returns\n * the `number` resolution in projection units at the passed coordinate. If this is `undefined`,\n * the default {@link module:ol/proj.getPointResolution} function will be used.\n */\n\n/**\n * @classdesc\n * In most cases, you should not need to create instances of this class.\n * Instead, where projection information is required, you can use a string\n * projection code or identifier (e.g. `EPSG:4326`) instead of a projection\n * instance.\n *\n * The library includes support for transforming coordinates between the following\n * projections:\n *\n * WGS 84 / Geographic - Using codes `EPSG:4326`, `CRS:84`, `urn:ogc:def:crs:EPSG:6.6:4326`,\n * `urn:ogc:def:crs:OGC:1.3:CRS84`, `urn:ogc:def:crs:OGC:2:84`, `http://www.opengis.net/gml/srs/epsg.xml#4326`,\n * or `urn:x-ogc:def:crs:EPSG:4326`\n * WGS 84 / Spherical Mercator - Using codes `EPSG:3857`, `EPSG:102100`, `EPSG:102113`, `EPSG:900913`,\n * `urn:ogc:def:crs:EPSG:6.18:3:3857`, or `http://www.opengis.net/gml/srs/epsg.xml#3857`\n * WGS 84 / UTM zones - Using codes `EPSG:32601` through `EPSG:32660` for northern zones\n * and `EPSG:32701` through `EPSG:32760` for southern zones. Note that the built-in UTM transforms\n * are lower accuracy (with errors on the order of 0.1 m) than those that you might get in a\n * library like [proj4js](https://github.com/proj4js/proj4js).\n *\n * For additional projection support, or to use higher accuracy transforms than the built-in ones, you can use\n * the [proj4js](https://github.com/proj4js/proj4js) library. With `proj4js`, after adding any new projection\n * definitions, call the {@link module:ol/proj/proj4.register} function.\n *\n * You can use the {@link module:ol/proj.get} function to retrieve a projection instance\n * for one of the registered projections.\n *\n * @api\n */\nclass Projection {\n /**\n * @param {Options} options Projection options.\n */\n constructor(options) {\n /**\n * @private\n * @type {string}\n */\n this.code_ = options.code;\n\n /**\n * Units of projected coordinates. When set to `TILE_PIXELS`, a\n * `this.extent_` and `this.worldExtent_` must be configured properly for each\n * tile.\n * @private\n * @type {import(\"./Units.js\").Units}\n */\n this.units_ = /** @type {import(\"./Units.js\").Units} */ (options.units);\n\n /**\n * Validity extent of the projection in projected coordinates. For projections\n * with `TILE_PIXELS` units, this is the extent of the tile in\n * tile pixel space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = options.extent !== undefined ? options.extent : null;\n\n /**\n * Extent of the world in EPSG:4326. For projections with\n * `TILE_PIXELS` units, this is the extent of the tile in\n * projected coordinate space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.worldExtent_ =\n options.worldExtent !== undefined ? options.worldExtent : null;\n\n /**\n * @private\n * @type {string}\n */\n this.axisOrientation_ =\n options.axisOrientation !== undefined ? options.axisOrientation : 'enu';\n\n /**\n * @private\n * @type {boolean}\n */\n this.global_ = options.global !== undefined ? options.global : false;\n\n /**\n * @private\n * @type {boolean}\n */\n this.canWrapX_ = !!(this.global_ && this.extent_);\n\n /**\n * @private\n * @type {GetPointResolution|undefined}\n */\n this.getPointResolutionFunc_ = options.getPointResolution;\n\n /**\n * @private\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n this.defaultTileGrid_ = null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.metersPerUnit_ = options.metersPerUnit;\n }\n\n /**\n * @return {boolean} The projection is suitable for wrapping the x-axis\n */\n canWrapX() {\n return this.canWrapX_;\n }\n\n /**\n * Get the code for this projection, e.g. 'EPSG:4326'.\n * @return {string} Code.\n * @api\n */\n getCode() {\n return this.code_;\n }\n\n /**\n * Get the validity extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getExtent() {\n return this.extent_;\n }\n\n /**\n * Get the units of this projection.\n * @return {import(\"./Units.js\").Units} Units.\n * @api\n */\n getUnits() {\n return this.units_;\n }\n\n /**\n * Get the amount of meters per unit of this projection. If the projection is\n * not configured with `metersPerUnit` or a units identifier, the return is\n * `undefined`.\n * @return {number|undefined} Meters.\n * @api\n */\n getMetersPerUnit() {\n return this.metersPerUnit_ || METERS_PER_UNIT[this.units_];\n }\n\n /**\n * Get the world extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getWorldExtent() {\n return this.worldExtent_;\n }\n\n /**\n * Get the axis orientation of this projection.\n * Example values are:\n * enu - the default easting, northing, elevation.\n * neu - northing, easting, up - useful for \"lat/long\" geographic coordinates,\n * or south orientated transverse mercator.\n * wnu - westing, northing, up - some planetary coordinate systems have\n * \"west positive\" coordinate systems\n * @return {string} Axis orientation.\n * @api\n */\n getAxisOrientation() {\n return this.axisOrientation_;\n }\n\n /**\n * Is this projection a global projection which spans the whole world?\n * @return {boolean} Whether the projection is global.\n * @api\n */\n isGlobal() {\n return this.global_;\n }\n\n /**\n * Set if the projection is a global projection which spans the whole world\n * @param {boolean} global Whether the projection is global.\n * @api\n */\n setGlobal(global) {\n this.global_ = global;\n this.canWrapX_ = !!(global && this.extent_);\n }\n\n /**\n * @return {import(\"../tilegrid/TileGrid.js\").default} The default tile grid.\n */\n getDefaultTileGrid() {\n return this.defaultTileGrid_;\n }\n\n /**\n * @param {import(\"../tilegrid/TileGrid.js\").default} tileGrid The default tile grid.\n */\n setDefaultTileGrid(tileGrid) {\n this.defaultTileGrid_ = tileGrid;\n }\n\n /**\n * Set the validity extent for this projection.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n setExtent(extent) {\n this.extent_ = extent;\n this.canWrapX_ = !!(this.global_ && extent);\n }\n\n /**\n * Set the world extent for this projection.\n * @param {import(\"../extent.js\").Extent} worldExtent World extent\n * [minlon, minlat, maxlon, maxlat].\n * @api\n */\n setWorldExtent(worldExtent) {\n this.worldExtent_ = worldExtent;\n }\n\n /**\n * Set the getPointResolution function (see {@link module:ol/proj.getPointResolution}\n * for this projection.\n * @param {function(number, import(\"../coordinate.js\").Coordinate):number} func Function\n * @api\n */\n setGetPointResolution(func) {\n this.getPointResolutionFunc_ = func;\n }\n\n /**\n * Get the custom point resolution function for this projection (if set).\n * @return {GetPointResolution|undefined} The custom point\n * resolution function (if set).\n */\n getPointResolutionFunc() {\n return this.getPointResolutionFunc_;\n }\n}\n\nexport default Projection;\n","/**\n * @module ol/proj/epsg3857\n */\nimport Projection from './Projection.js';\n\n/**\n * Radius of WGS84 sphere\n *\n * @const\n * @type {number}\n */\nexport const RADIUS = 6378137;\n\n/**\n * @const\n * @type {number}\n */\nexport const HALF_SIZE = Math.PI * RADIUS;\n\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport const EXTENT = [-HALF_SIZE, -HALF_SIZE, HALF_SIZE, HALF_SIZE];\n\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport const WORLD_EXTENT = [-180, -85, 180, 85];\n\n/**\n * Maximum safe value in y direction\n * @const\n * @type {number}\n */\nexport const MAX_SAFE_Y = RADIUS * Math.log(Math.tan(Math.PI / 2));\n\n/**\n * @classdesc\n * Projection object for web/spherical Mercator (EPSG:3857).\n */\nclass EPSG3857Projection extends Projection {\n /**\n * @param {string} code Code.\n */\n constructor(code) {\n super({\n code: code,\n units: 'm',\n extent: EXTENT,\n global: true,\n worldExtent: WORLD_EXTENT,\n getPointResolution: function (resolution, point) {\n return resolution / Math.cosh(point[1] / RADIUS);\n },\n });\n }\n}\n\n/**\n * Projections equal to EPSG:3857.\n *\n * @const\n * @type {Array}\n */\nexport const PROJECTIONS = [\n new EPSG3857Projection('EPSG:3857'),\n new EPSG3857Projection('EPSG:102100'),\n new EPSG3857Projection('EPSG:102113'),\n new EPSG3857Projection('EPSG:900913'),\n new EPSG3857Projection('http://www.opengis.net/def/crs/EPSG/0/3857'),\n new EPSG3857Projection('http://www.opengis.net/gml/srs/epsg.xml#3857'),\n];\n\n/**\n * Transformation from EPSG:4326 to EPSG:3857.\n *\n * @param {Array} input Input array of coordinate values.\n * @param {Array} [output] Output array of coordinate values.\n * @param {number} [dimension] Dimension (default is `2`).\n * @param {number} [stride] Stride (default is `dimension`).\n * @return {Array} Output array of coordinate values.\n */\nexport function fromEPSG4326(input, output, dimension, stride) {\n const length = input.length;\n dimension = dimension > 1 ? dimension : 2;\n stride = stride ?? dimension;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n } else {\n output = new Array(length);\n }\n }\n for (let i = 0; i < length; i += stride) {\n output[i] = (HALF_SIZE * input[i]) / 180;\n let y = RADIUS * Math.log(Math.tan((Math.PI * (+input[i + 1] + 90)) / 360));\n if (y > MAX_SAFE_Y) {\n y = MAX_SAFE_Y;\n } else if (y < -MAX_SAFE_Y) {\n y = -MAX_SAFE_Y;\n }\n output[i + 1] = y;\n }\n return output;\n}\n\n/**\n * Transformation from EPSG:3857 to EPSG:4326.\n *\n * @param {Array} input Input array of coordinate values.\n * @param {Array} [output] Output array of coordinate values.\n * @param {number} [dimension] Dimension (default is `2`).\n * @param {number} [stride] Stride (default is `dimension`).\n * @return {Array} Output array of coordinate values.\n */\nexport function toEPSG4326(input, output, dimension, stride) {\n const length = input.length;\n dimension = dimension > 1 ? dimension : 2;\n stride = stride ?? dimension;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n } else {\n output = new Array(length);\n }\n }\n for (let i = 0; i < length; i += stride) {\n output[i] = (180 * input[i]) / HALF_SIZE;\n output[i + 1] =\n (360 * Math.atan(Math.exp(input[i + 1] / RADIUS))) / Math.PI - 90;\n }\n return output;\n}\n","/**\n * @module ol/proj/epsg4326\n */\nimport Projection from './Projection.js';\n\n/**\n * Semi-major radius of the WGS84 ellipsoid.\n *\n * @const\n * @type {number}\n */\nexport const RADIUS = 6378137;\n\n/**\n * Extent of the EPSG:4326 projection which is the whole world.\n *\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nexport const EXTENT = [-180, -90, 180, 90];\n\n/**\n * @const\n * @type {number}\n */\nexport const METERS_PER_UNIT = (Math.PI * RADIUS) / 180;\n\n/**\n * @classdesc\n * Projection object for WGS84 geographic coordinates (EPSG:4326).\n *\n * Note that OpenLayers does not strictly comply with the EPSG definition.\n * The EPSG registry defines 4326 as a CRS for Latitude,Longitude (y,x).\n * OpenLayers treats EPSG:4326 as a pseudo-projection, with x,y coordinates.\n */\nclass EPSG4326Projection extends Projection {\n /**\n * @param {string} code Code.\n * @param {string} [axisOrientation] Axis orientation.\n */\n constructor(code, axisOrientation) {\n super({\n code: code,\n units: 'degrees',\n extent: EXTENT,\n axisOrientation: axisOrientation,\n global: true,\n metersPerUnit: METERS_PER_UNIT,\n worldExtent: EXTENT,\n });\n }\n}\n\n/**\n * Projections equal to EPSG:4326.\n *\n * @const\n * @type {Array}\n */\nexport const PROJECTIONS = [\n new EPSG4326Projection('CRS:84'),\n new EPSG4326Projection('EPSG:4326', 'neu'),\n new EPSG4326Projection('urn:ogc:def:crs:OGC:1.3:CRS84'),\n new EPSG4326Projection('urn:ogc:def:crs:OGC:2:84'),\n new EPSG4326Projection('http://www.opengis.net/def/crs/OGC/1.3/CRS84'),\n new EPSG4326Projection('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'),\n new EPSG4326Projection('http://www.opengis.net/def/crs/EPSG/0/4326', 'neu'),\n];\n","/**\n * @module ol/proj/projections\n */\n\n/**\n * @type {Object}\n */\nlet cache = {};\n\n/**\n * Clear the projections cache.\n */\nexport function clear() {\n cache = {};\n}\n\n/**\n * Get a cached projection by code.\n * @param {string} code The code for the projection.\n * @return {import(\"./Projection.js\").default|null} The projection (if cached).\n */\nexport function get(code) {\n return (\n cache[code] ||\n cache[code.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\\w+)$/, 'EPSG:$3')] ||\n null\n );\n}\n\n/**\n * Add a projection to the cache.\n * @param {string} code The projection code.\n * @param {import(\"./Projection.js\").default} projection The projection to cache.\n */\nexport function add(code, projection) {\n cache[code] = projection;\n}\n","/**\n * @module ol/proj/transforms\n */\nimport {isEmpty} from '../obj.js';\n\n/**\n * @private\n * @type {!Object>}\n */\nlet transforms = {};\n\n/**\n * Clear the transform cache.\n */\nexport function clear() {\n transforms = {};\n}\n\n/**\n * Registers a conversion function to convert coordinates from the source\n * projection to the destination projection.\n *\n * @param {import(\"./Projection.js\").default} source Source.\n * @param {import(\"./Projection.js\").default} destination Destination.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform.\n */\nexport function add(source, destination, transformFn) {\n const sourceCode = source.getCode();\n const destinationCode = destination.getCode();\n if (!(sourceCode in transforms)) {\n transforms[sourceCode] = {};\n }\n transforms[sourceCode][destinationCode] = transformFn;\n}\n\n/**\n * Unregisters the conversion function to convert coordinates from the source\n * projection to the destination projection. This method is used to clean up\n * cached transforms during testing.\n *\n * @param {import(\"./Projection.js\").default} source Source projection.\n * @param {import(\"./Projection.js\").default} destination Destination projection.\n * @return {import(\"../proj.js\").TransformFunction} transformFn The unregistered transform.\n */\nexport function remove(source, destination) {\n const sourceCode = source.getCode();\n const destinationCode = destination.getCode();\n const transform = transforms[sourceCode][destinationCode];\n delete transforms[sourceCode][destinationCode];\n if (isEmpty(transforms[sourceCode])) {\n delete transforms[sourceCode];\n }\n return transform;\n}\n\n/**\n * Get a transform given a source code and a destination code.\n * @param {string} sourceCode The code for the source projection.\n * @param {string} destinationCode The code for the destination projection.\n * @return {import(\"../proj.js\").TransformFunction|null} The transform function (if found).\n */\nexport function get(sourceCode, destinationCode) {\n if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {\n return transforms[sourceCode][destinationCode];\n }\n return null;\n}\n","/**\n * @module ol/proj/utm\n */\n\n/**\n * Adapted from https://github.com/Turbo87/utm\n * Copyright (c) 2012-2017 Tobias Bieniek\n *\n * The functions here provide approximate transforms to and from UTM.\n * They are not appropriate for use beyond the validity extend of a UTM\n * zone, and the accuracy of the transform decreases toward the zone\n * edges.\n */\n\nimport {toDegrees, toRadians, wrap} from '../math.js';\nimport Projection from './Projection.js';\n\n/**\n * @typedef {Object} UTMZone\n * @property {number} number The zone number (1 - 60).\n * @property {boolean} north The northern hemisphere.\n */\n\nconst K0 = 0.9996;\n\nconst E = 0.00669438;\nconst E2 = E * E;\nconst E3 = E2 * E;\nconst E_P2 = E / (1 - E);\n\nconst SQRT_E = Math.sqrt(1 - E);\nconst _E = (1 - SQRT_E) / (1 + SQRT_E);\nconst _E2 = _E * _E;\nconst _E3 = _E2 * _E;\nconst _E4 = _E3 * _E;\nconst _E5 = _E4 * _E;\n\nconst M1 = 1 - E / 4 - (3 * E2) / 64 - (5 * E3) / 256;\nconst M2 = (3 * E) / 8 + (3 * E2) / 32 + (45 * E3) / 1024;\nconst M3 = (15 * E2) / 256 + (45 * E3) / 1024;\nconst M4 = (35 * E3) / 3072;\n\nconst P2 = (3 / 2) * _E - (27 / 32) * _E3 + (269 / 512) * _E5;\nconst P3 = (21 / 16) * _E2 - (55 / 32) * _E4;\nconst P4 = (151 / 96) * _E3 - (417 / 128) * _E5;\nconst P5 = (1097 / 512) * _E4;\n\nconst R = 6378137;\n\n/**\n * @param {number} easting Easting value of coordinate.\n * @param {number} northing Northing value of coordinate.\n * @param {UTMZone} zone The UTM zone.\n * @return {import(\"../coordinate.js\").Coordinate} The transformed coordinate.\n */\nfunction toLonLat(easting, northing, zone) {\n const x = easting - 500000;\n const y = zone.north ? northing : northing - 10000000;\n\n const m = y / K0;\n const mu = m / (R * M1);\n\n const pRad =\n mu +\n P2 * Math.sin(2 * mu) +\n P3 * Math.sin(4 * mu) +\n P4 * Math.sin(6 * mu) +\n P5 * Math.sin(8 * mu);\n\n const pSin = Math.sin(pRad);\n const pSin2 = pSin * pSin;\n\n const pCos = Math.cos(pRad);\n\n const pTan = pSin / pCos;\n const pTan2 = pTan * pTan;\n const pTan4 = pTan2 * pTan2;\n\n const epSin = 1 - E * pSin2;\n const epSinSqrt = Math.sqrt(1 - E * pSin2);\n\n const n = R / epSinSqrt;\n const r = (1 - E) / epSin;\n\n const c = E_P2 * pCos ** 2;\n const c2 = c * c;\n\n const d = x / (n * K0);\n const d2 = d * d;\n const d3 = d2 * d;\n const d4 = d3 * d;\n const d5 = d4 * d;\n const d6 = d5 * d;\n\n const latitude =\n pRad -\n (pTan / r) *\n (d2 / 2 - (d4 / 24) * (5 + 3 * pTan2 + 10 * c - 4 * c2 - 9 * E_P2)) +\n (d6 / 720) * (61 + 90 * pTan2 + 298 * c + 45 * pTan4 - 252 * E_P2 - 3 * c2);\n\n let longitude =\n (d -\n (d3 / 6) * (1 + 2 * pTan2 + c) +\n (d5 / 120) * (5 - 2 * c + 28 * pTan2 - 3 * c2 + 8 * E_P2 + 24 * pTan4)) /\n pCos;\n\n longitude = wrap(\n longitude + toRadians(zoneToCentralLongitude(zone.number)),\n -Math.PI,\n Math.PI,\n );\n\n return [toDegrees(longitude), toDegrees(latitude)];\n}\n\nconst MIN_LATITUDE = -80;\nconst MAX_LATITUDE = 84;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n\n/**\n * @param {number} longitude The longitude.\n * @param {number} latitude The latitude.\n * @param {UTMZone} zone The UTM zone.\n * @return {import('../coordinate.js').Coordinate} The UTM coordinate.\n */\nfunction fromLonLat(longitude, latitude, zone) {\n longitude = wrap(longitude, MIN_LONGITUDE, MAX_LONGITUDE);\n\n if (latitude < MIN_LATITUDE) {\n latitude = MIN_LATITUDE;\n } else if (latitude > MAX_LATITUDE) {\n latitude = MAX_LATITUDE;\n }\n\n const latRad = toRadians(latitude);\n const latSin = Math.sin(latRad);\n const latCos = Math.cos(latRad);\n\n const latTan = latSin / latCos;\n const latTan2 = latTan * latTan;\n const latTan4 = latTan2 * latTan2;\n\n const lonRad = toRadians(longitude);\n const centralLon = zoneToCentralLongitude(zone.number);\n const centralLonRad = toRadians(centralLon);\n\n const n = R / Math.sqrt(1 - E * latSin ** 2);\n const c = E_P2 * latCos ** 2;\n\n const a = latCos * wrap(lonRad - centralLonRad, -Math.PI, Math.PI);\n const a2 = a * a;\n const a3 = a2 * a;\n const a4 = a3 * a;\n const a5 = a4 * a;\n const a6 = a5 * a;\n\n const m =\n R *\n (M1 * latRad -\n M2 * Math.sin(2 * latRad) +\n M3 * Math.sin(4 * latRad) -\n M4 * Math.sin(6 * latRad));\n\n const easting =\n K0 *\n n *\n (a +\n (a3 / 6) * (1 - latTan2 + c) +\n (a5 / 120) * (5 - 18 * latTan2 + latTan4 + 72 * c - 58 * E_P2)) +\n 500000;\n\n let northing =\n K0 *\n (m +\n n *\n latTan *\n (a2 / 2 +\n (a4 / 24) * (5 - latTan2 + 9 * c + 4 * c ** 2) +\n (a6 / 720) * (61 - 58 * latTan2 + latTan4 + 600 * c - 330 * E_P2)));\n\n if (!zone.north) {\n northing += 10000000;\n }\n\n return [easting, northing];\n}\n\n/**\n * @param {number} zone The zone number.\n * @return {number} The central longitude in degrees.\n */\nfunction zoneToCentralLongitude(zone) {\n return (zone - 1) * 6 - 180 + 3;\n}\n\n/**\n * @type {Array}\n */\nconst epsgRegExes = [\n /^EPSG:(\\d+)$/,\n /^urn:ogc:def:crs:EPSG::(\\d+)$/,\n /^http:\\/\\/www\\.opengis\\.net\\/def\\/crs\\/EPSG\\/0\\/(\\d+)$/,\n];\n\n/**\n * @param {string} code The projection code.\n * @return {UTMZone|null} The UTM zone info (or null if not UTM).\n */\nexport function zoneFromCode(code) {\n let epsgId = 0;\n for (const re of epsgRegExes) {\n const match = code.match(re);\n if (match) {\n epsgId = parseInt(match[1]);\n break;\n }\n }\n if (!epsgId) {\n return null;\n }\n\n let number = 0;\n let north = false;\n if (epsgId > 32700 && epsgId < 32761) {\n number = epsgId - 32700;\n } else if (epsgId > 32600 && epsgId < 32661) {\n north = true;\n number = epsgId - 32600;\n }\n if (!number) {\n return null;\n }\n\n return {number, north};\n}\n\n/**\n * @param {function(number, number, UTMZone): import('../coordinate.js').Coordinate} transformer The transformer.\n * @param {UTMZone} zone The UTM zone.\n * @return {import('../proj.js').TransformFunction} The transform function.\n */\nfunction makeTransformFunction(transformer, zone) {\n return function (input, output, dimension, stride) {\n const length = input.length;\n dimension = dimension > 1 ? dimension : 2;\n stride = stride ?? dimension;\n if (!output) {\n if (dimension > 2) {\n output = input.slice();\n } else {\n output = new Array(length);\n }\n }\n for (let i = 0; i < length; i += stride) {\n const x = input[i];\n const y = input[i + 1];\n const coord = transformer(x, y, zone);\n output[i] = coord[0];\n output[i + 1] = coord[1];\n }\n return output;\n };\n}\n\n/**\n * @param {string} code The projection code.\n * @return {import('./Projection.js').default|null} A projection or null if unable to create one.\n */\nexport function makeProjection(code) {\n const zone = zoneFromCode(code);\n if (!zone) {\n return null;\n }\n return new Projection({code, units: 'm'});\n}\n\n/**\n * @param {import('./Projection.js').default} projection The projection.\n * @return {import('../proj.js').Transforms|null} The transforms lookup or null if unable to handle projection.\n */\nexport function makeTransforms(projection) {\n const zone = zoneFromCode(projection.getCode());\n if (!zone) {\n return null;\n }\n\n return {\n forward: makeTransformFunction(fromLonLat, zone),\n inverse: makeTransformFunction(toLonLat, zone),\n };\n}\n","/**\n * @module ol/proj\n */\n\n/**\n * The ol/proj module stores:\n * a list of {@link module:ol/proj/Projection~Projection}\n * objects, one for each projection supported by the application\n * a list of transform functions needed to convert coordinates in one projection\n * into another.\n *\n * The static functions are the methods used to maintain these.\n * Each transform function can handle not only simple coordinate pairs, but also\n * large arrays of coordinates such as vector geometries.\n *\n * When loaded, the library adds projection objects for EPSG:4326 (WGS84\n * geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used\n * for example by Bing Maps or OpenStreetMap), together with the relevant\n * transform functions.\n *\n * Additional transforms may be added by using the http://proj4js.org/\n * library (version 2.2 or later). You can use the full build supplied by\n * Proj4js, or create a custom build to support those projections you need; see\n * the Proj4js website for how to do this. You also need the Proj4js definitions\n * for the required projections. These definitions can be obtained from\n * https://epsg.io/, and are a JS function, so can be loaded in a script\n * tag (as in the examples) or pasted into your application.\n *\n * After all required projection definitions are added to proj4's registry (by\n * using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4`\n * package. Existing transforms are not changed by this function. See\n * examples/wms-image-custom-proj for an example of this.\n *\n * Additional projection definitions can be registered with `proj4.defs()` any\n * time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't\n * know in advance what projections are needed, you can initially load minimal\n * support and then load whichever are requested.\n *\n * Note that Proj4js does not support projection extents. If you want to add\n * one for creating default tile grids, you can add it after the Projection\n * object has been created with `setExtent`, for example,\n * `get('EPSG:1234').setExtent(extent)`.\n *\n * In addition to Proj4js support, any transform functions can be added with\n * {@link module:ol/proj.addCoordinateTransforms}. To use this, you must first create\n * a {@link module:ol/proj/Projection~Projection} object for the new projection and add it with\n * {@link module:ol/proj.addProjection}. You can then add the forward and inverse\n * functions with {@link module:ol/proj.addCoordinateTransforms}. See\n * examples/wms-custom-proj for an example of this.\n *\n * Note that if no transforms are needed and you only need to define the\n * projection, just add a {@link module:ol/proj/Projection~Projection} with\n * {@link module:ol/proj.addProjection}. See examples/wms-no-proj for an example of\n * this.\n */\nimport {warn} from './console.js';\nimport {equals, getWorldsAway} from './coordinate.js';\nimport {applyTransform, getWidth} from './extent.js';\nimport {clamp, modulo} from './math.js';\nimport Projection from './proj/Projection.js';\nimport {METERS_PER_UNIT} from './proj/Units.js';\nimport {\n PROJECTIONS as EPSG3857_PROJECTIONS,\n fromEPSG4326,\n toEPSG4326,\n} from './proj/epsg3857.js';\nimport {PROJECTIONS as EPSG4326_PROJECTIONS} from './proj/epsg4326.js';\nimport {\n add as addProj,\n clear as clearProj,\n get as getProj,\n} from './proj/projections.js';\nimport {\n add as addTransformFunc,\n clear as clearTransformFuncs,\n get as getTransformFunc,\n} from './proj/transforms.js';\nimport {\n makeProjection as makeUTMProjection,\n makeTransforms as makeUTMTransforms,\n} from './proj/utm.js';\nimport {getDistance} from './sphere.js';\n\n/**\n * A projection as {@link module:ol/proj/Projection~Projection}, SRS identifier\n * string or undefined.\n * @typedef {Projection|string|undefined} ProjectionLike\n * @api\n */\n\n/**\n * @typedef {Object} Transforms\n * @property {TransformFunction} forward The forward transform (from geographic).\n * @property {TransformFunction} inverse The inverse transform (to geographic).\n */\n\n/**\n * @type {Array}\n */\nconst transformFactories = [makeUTMTransforms];\n\n/**\n * @type {Array}\n */\nconst projectionFactories = [makeUTMProjection];\n\n/**\n * A transform function accepts an array of input coordinate values, an optional\n * output array, and an optional dimension (default should be 2). The function\n * transforms the input coordinate values, populates the output array, and\n * returns the output array.\n *\n * @callback TransformFunction\n * @param {Array} input\n * @param {Array} [output]\n * @param {number} [dimension]\n * @param {number} [stride]\n * @return {Array}\n *\n * @api\n */\n\nexport {METERS_PER_UNIT};\n\nexport {Projection};\n\nlet showCoordinateWarning = true;\n\n/**\n * @param {boolean} [disable] Disable console info about `useGeographic()`\n */\nexport function disableCoordinateWarning(disable) {\n const hide = disable === undefined ? true : disable;\n showCoordinateWarning = !hide;\n}\n\n/**\n * @param {Array} input Input coordinate array.\n * @param {Array} [output] Output array of coordinate values.\n * @return {Array} Output coordinate array (new array, same coordinate\n * values).\n */\nexport function cloneTransform(input, output) {\n if (output !== undefined) {\n for (let i = 0, ii = input.length; i < ii; ++i) {\n output[i] = input[i];\n }\n output = output;\n } else {\n output = input.slice();\n }\n return output;\n}\n\n/**\n * @param {Array} input Input coordinate array.\n * @param {Array} [output] Output array of coordinate values.\n * @return {Array} Input coordinate array (same array as input).\n */\nexport function identityTransform(input, output) {\n if (output !== undefined && input !== output) {\n for (let i = 0, ii = input.length; i < ii; ++i) {\n output[i] = input[i];\n }\n input = output;\n }\n return input;\n}\n\n/**\n * Add a Projection object to the list of supported projections that can be\n * looked up by their code.\n *\n * @param {Projection} projection Projection instance.\n * @api\n */\nexport function addProjection(projection) {\n addProj(projection.getCode(), projection);\n addTransformFunc(projection, projection, cloneTransform);\n}\n\n/**\n * @param {Array} projections Projections.\n */\nexport function addProjections(projections) {\n projections.forEach(addProjection);\n}\n\n/**\n * Fetches a Projection object for the code specified.\n *\n * @param {ProjectionLike} projectionLike Either a code string which is\n * a combination of authority and identifier such as \"EPSG:4326\", or an\n * existing projection object, or undefined.\n * @return {Projection|null} Projection object, or null if not in list.\n * @api\n */\nexport function get(projectionLike) {\n if (!(typeof projectionLike === 'string')) {\n return projectionLike;\n }\n const projection = getProj(projectionLike);\n if (projection) {\n return projection;\n }\n for (const makeProjection of projectionFactories) {\n const projection = makeProjection(projectionLike);\n if (projection) {\n return projection;\n }\n }\n return null;\n}\n\n/**\n * Get the resolution of the point in degrees or distance units.\n * For projections with degrees as the unit this will simply return the\n * provided resolution. For other projections the point resolution is\n * by default estimated by transforming the `point` pixel to EPSG:4326,\n * measuring its width and height on the normal sphere,\n * and taking the average of the width and height.\n * A custom function can be provided for a specific projection, either\n * by setting the `getPointResolution` option in the\n * {@link module:ol/proj/Projection~Projection} constructor or by using\n * {@link module:ol/proj/Projection~Projection#setGetPointResolution} to change an existing\n * projection object.\n * @param {ProjectionLike} projection The projection.\n * @param {number} resolution Nominal resolution in projection units.\n * @param {import(\"./coordinate.js\").Coordinate} point Point to find adjusted resolution at.\n * @param {import(\"./proj/Units.js\").Units} [units] Units to get the point resolution in.\n * Default is the projection's units.\n * @return {number} Point resolution.\n * @api\n */\nexport function getPointResolution(projection, resolution, point, units) {\n projection = get(projection);\n let pointResolution;\n const getter = projection.getPointResolutionFunc();\n if (getter) {\n pointResolution = getter(resolution, point);\n if (units && units !== projection.getUnits()) {\n const metersPerUnit = projection.getMetersPerUnit();\n if (metersPerUnit) {\n pointResolution =\n (pointResolution * metersPerUnit) / METERS_PER_UNIT[units];\n }\n }\n } else {\n const projUnits = projection.getUnits();\n if ((projUnits == 'degrees' && !units) || units == 'degrees') {\n pointResolution = resolution;\n } else {\n // Estimate point resolution by transforming the center pixel to EPSG:4326,\n // measuring its width and height on the normal sphere, and taking the\n // average of the width and height.\n const toEPSG4326 = getTransformFromProjections(\n projection,\n get('EPSG:4326'),\n );\n if (!toEPSG4326 && projUnits !== 'degrees') {\n // no transform is available\n pointResolution = resolution * projection.getMetersPerUnit();\n } else {\n let vertices = [\n point[0] - resolution / 2,\n point[1],\n point[0] + resolution / 2,\n point[1],\n point[0],\n point[1] - resolution / 2,\n point[0],\n point[1] + resolution / 2,\n ];\n vertices = toEPSG4326(vertices, vertices, 2);\n const width = getDistance(vertices.slice(0, 2), vertices.slice(2, 4));\n const height = getDistance(vertices.slice(4, 6), vertices.slice(6, 8));\n pointResolution = (width + height) / 2;\n }\n const metersPerUnit = units\n ? METERS_PER_UNIT[units]\n : projection.getMetersPerUnit();\n if (metersPerUnit !== undefined) {\n pointResolution /= metersPerUnit;\n }\n }\n }\n return pointResolution;\n}\n\n/**\n * Registers transformation functions that don't alter coordinates. Those allow\n * to transform between projections with equal meaning.\n *\n * @param {Array} projections Projections.\n * @api\n */\nexport function addEquivalentProjections(projections) {\n addProjections(projections);\n projections.forEach(function (source) {\n projections.forEach(function (destination) {\n if (source !== destination) {\n addTransformFunc(source, destination, cloneTransform);\n }\n });\n });\n}\n\n/**\n * Registers transformation functions to convert coordinates in any projection\n * in projection1 to any projection in projection2.\n *\n * @param {Array} projections1 Projections with equal\n * meaning.\n * @param {Array} projections2 Projections with equal\n * meaning.\n * @param {TransformFunction} forwardTransform Transformation from any\n * projection in projection1 to any projection in projection2.\n * @param {TransformFunction} inverseTransform Transform from any projection\n * in projection2 to any projection in projection1..\n */\nexport function addEquivalentTransforms(\n projections1,\n projections2,\n forwardTransform,\n inverseTransform,\n) {\n projections1.forEach(function (projection1) {\n projections2.forEach(function (projection2) {\n addTransformFunc(projection1, projection2, forwardTransform);\n addTransformFunc(projection2, projection1, inverseTransform);\n });\n });\n}\n\n/**\n * Clear all cached projections and transforms.\n */\nexport function clearAllProjections() {\n clearProj();\n clearTransformFuncs();\n}\n\n/**\n * @param {Projection|string|undefined} projection Projection.\n * @param {string} defaultCode Default code.\n * @return {Projection} Projection.\n */\nexport function createProjection(projection, defaultCode) {\n if (!projection) {\n return get(defaultCode);\n }\n if (typeof projection === 'string') {\n return get(projection);\n }\n return /** @type {Projection} */ (projection);\n}\n\n/**\n * Creates a {@link module:ol/proj~TransformFunction} from a simple 2D coordinate transform\n * function.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} coordTransform Coordinate\n * transform.\n * @return {TransformFunction} Transform function.\n */\nexport function createTransformFromCoordinateTransform(coordTransform) {\n return (\n /**\n * @param {Array} input Input.\n * @param {Array} [output] Output.\n * @param {number} [dimension] Dimensions that should be transformed.\n * @param {number} [stride] Stride.\n * @return {Array} Output.\n */\n function (input, output, dimension, stride) {\n const length = input.length;\n dimension = dimension !== undefined ? dimension : 2;\n stride = stride ?? dimension;\n output = output !== undefined ? output : new Array(length);\n for (let i = 0; i < length; i += stride) {\n const point = coordTransform(input.slice(i, i + dimension));\n const pointLength = point.length;\n for (let j = 0, jj = stride; j < jj; ++j) {\n output[i + j] = j >= pointLength ? input[i + j] : point[j];\n }\n }\n return output;\n }\n );\n}\n\n/**\n * Registers coordinate transform functions to convert coordinates between the\n * source projection and the destination projection.\n * The forward and inverse functions convert coordinate pairs; this function\n * converts these into the functions used internally which also handle\n * extents and coordinate arrays.\n *\n * @param {ProjectionLike} source Source projection.\n * @param {ProjectionLike} destination Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} forward The forward transform\n * function (that is, from the source projection to the destination\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} inverse The inverse transform\n * function (that is, from the destination projection to the source\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}. If the transform function can only\n * transform less dimensions than the input coordinate, it is supposeed to return a coordinate\n * with only the length it can transform. The other dimensions will be taken unchanged from the\n * source.\n * @api\n */\nexport function addCoordinateTransforms(source, destination, forward, inverse) {\n const sourceProj = get(source);\n const destProj = get(destination);\n addTransformFunc(\n sourceProj,\n destProj,\n createTransformFromCoordinateTransform(forward),\n );\n addTransformFunc(\n destProj,\n sourceProj,\n createTransformFromCoordinateTransform(inverse),\n );\n}\n\n/**\n * Transforms a coordinate from longitude/latitude to a different projection.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate as longitude and latitude, i.e.\n * an array with longitude as 1st and latitude as 2nd element.\n * @param {ProjectionLike} [projection] Target projection. The\n * default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate projected to the target projection.\n * @api\n */\nexport function fromLonLat(coordinate, projection) {\n disableCoordinateWarning();\n return transform(\n coordinate,\n 'EPSG:4326',\n projection !== undefined ? projection : 'EPSG:3857',\n );\n}\n\n/**\n * Transforms a coordinate to longitude/latitude.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Projected coordinate.\n * @param {ProjectionLike} [projection] Projection of the coordinate.\n * The default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate as longitude and latitude, i.e. an array\n * with longitude as 1st and latitude as 2nd element.\n * @api\n */\nexport function toLonLat(coordinate, projection) {\n const lonLat = transform(\n coordinate,\n projection !== undefined ? projection : 'EPSG:3857',\n 'EPSG:4326',\n );\n const lon = lonLat[0];\n if (lon < -180 || lon > 180) {\n lonLat[0] = modulo(lon + 180, 360) - 180;\n }\n return lonLat;\n}\n\n/**\n * Checks if two projections are the same, that is every coordinate in one\n * projection does represent the same geographic point as the same coordinate in\n * the other projection.\n *\n * @param {Projection} projection1 Projection 1.\n * @param {Projection} projection2 Projection 2.\n * @return {boolean} Equivalent.\n * @api\n */\nexport function equivalent(projection1, projection2) {\n if (projection1 === projection2) {\n return true;\n }\n const equalUnits = projection1.getUnits() === projection2.getUnits();\n if (projection1.getCode() === projection2.getCode()) {\n return equalUnits;\n }\n const transformFunc = getTransformFromProjections(projection1, projection2);\n return transformFunc === cloneTransform && equalUnits;\n}\n\n/**\n * Searches in the list of transform functions for the function for converting\n * coordinates from the source projection to the destination projection.\n *\n * @param {Projection} source Source Projection object.\n * @param {Projection} destination Destination Projection\n * object.\n * @return {TransformFunction|null} Transform function.\n */\nexport function getTransformFromProjections(source, destination) {\n const sourceCode = source.getCode();\n const destinationCode = destination.getCode();\n let transformFunc = getTransformFunc(sourceCode, destinationCode);\n if (transformFunc) {\n return transformFunc;\n }\n\n /**\n * @type {Transforms|null}\n */\n let sourceTransforms = null;\n\n /**\n * @type {Transforms|null}\n */\n let destinationTransforms = null;\n\n // lazily add projections if we have supported transforms\n for (const makeTransforms of transformFactories) {\n if (!sourceTransforms) {\n sourceTransforms = makeTransforms(source);\n }\n if (!destinationTransforms) {\n destinationTransforms = makeTransforms(destination);\n }\n }\n\n if (!sourceTransforms && !destinationTransforms) {\n return null;\n }\n\n const intermediateCode = 'EPSG:4326';\n if (!destinationTransforms) {\n const toDestination = getTransformFunc(intermediateCode, destinationCode);\n if (toDestination) {\n transformFunc = composeTransformFuncs(\n sourceTransforms.inverse,\n toDestination,\n );\n }\n } else if (!sourceTransforms) {\n const fromSource = getTransformFunc(sourceCode, intermediateCode);\n if (fromSource) {\n transformFunc = composeTransformFuncs(\n fromSource,\n destinationTransforms.forward,\n );\n }\n } else {\n transformFunc = composeTransformFuncs(\n sourceTransforms.inverse,\n destinationTransforms.forward,\n );\n }\n\n if (transformFunc) {\n addProjection(source);\n addProjection(destination);\n addTransformFunc(source, destination, transformFunc);\n }\n\n return transformFunc;\n}\n\n/**\n * @param {TransformFunction} t1 The first transform function.\n * @param {TransformFunction} t2 The second transform function.\n * @return {TransformFunction} The composed transform function.\n */\nfunction composeTransformFuncs(t1, t2) {\n return function (input, output, dimensions, stride) {\n output = t1(input, output, dimensions, stride);\n return t2(output, output, dimensions, stride);\n };\n}\n\n/**\n * Given the projection-like objects, searches for a transformation\n * function to convert a coordinates array from the source projection to the\n * destination projection.\n *\n * @param {ProjectionLike} source Source.\n * @param {ProjectionLike} destination Destination.\n * @return {TransformFunction} Transform function.\n * @api\n */\nexport function getTransform(source, destination) {\n const sourceProjection = get(source);\n const destinationProjection = get(destination);\n return getTransformFromProjections(sourceProjection, destinationProjection);\n}\n\n/**\n * Transforms a coordinate from source projection to destination projection.\n * This returns a new coordinate (and does not modify the original). If there\n * is no available transform between the two projection, the function will throw\n * an error.\n *\n * See {@link module:ol/proj.transformExtent} for extent transformation.\n * See the transform method of {@link module:ol/geom/Geometry~Geometry} and its\n * subclasses for geometry transforms.\n *\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\nexport function transform(coordinate, source, destination) {\n const transformFunc = getTransform(source, destination);\n if (!transformFunc) {\n const sourceCode = get(source).getCode();\n const destinationCode = get(destination).getCode();\n throw new Error(\n `No transform available between ${sourceCode} and ${destinationCode}`,\n );\n }\n return transformFunc(coordinate, undefined, coordinate.length);\n}\n\n/**\n * Transforms an extent from source projection to destination projection. This\n * returns a new extent (and does not modify the original).\n *\n * @param {import(\"./extent.js\").Extent} extent The extent to transform.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @param {number} [stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {import(\"./extent.js\").Extent} The transformed extent.\n * @api\n */\nexport function transformExtent(extent, source, destination, stops) {\n const transformFunc = getTransform(source, destination);\n return applyTransform(extent, transformFunc, undefined, stops);\n}\n\n/**\n * Transforms the given point to the destination projection.\n *\n * @param {import(\"./coordinate.js\").Coordinate} point Point.\n * @param {Projection} sourceProjection Source projection.\n * @param {Projection} destinationProjection Destination projection.\n * @return {import(\"./coordinate.js\").Coordinate} Point.\n */\nexport function transformWithProjections(\n point,\n sourceProjection,\n destinationProjection,\n) {\n const transformFunc = getTransformFromProjections(\n sourceProjection,\n destinationProjection,\n );\n return transformFunc(point);\n}\n\n/**\n * @type {Projection|null}\n */\nlet userProjection = null;\n\n/**\n * Set the projection for coordinates supplied from and returned by API methods.\n * This includes all API methods except for those interacting with tile grids,\n * plus {@link import(\"./Map.js\").FrameState} and {@link import(\"./View.js\").State}.\n * @param {ProjectionLike} projection The user projection.\n * @api\n */\nexport function setUserProjection(projection) {\n userProjection = get(projection);\n}\n\n/**\n * Clear the user projection if set.\n * @api\n */\nexport function clearUserProjection() {\n userProjection = null;\n}\n\n/**\n * Get the projection for coordinates supplied from and returned by API methods.\n * @return {Projection|null} The user projection (or null if not set).\n * @api\n */\nexport function getUserProjection() {\n return userProjection;\n}\n\n/**\n * Use geographic coordinates (WGS-84 datum) in API methods.\n * This includes all API methods except for those interacting with tile grids,\n * plus {@link import(\"./Map.js\").FrameState} and {@link import(\"./View.js\").State}.\n * @api\n */\nexport function useGeographic() {\n setUserProjection('EPSG:4326');\n}\n\n/**\n * Return a coordinate transformed into the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array} coordinate Input coordinate.\n * @param {ProjectionLike} sourceProjection The input coordinate projection.\n * @return {Array} The input coordinate in the user projection.\n */\nexport function toUserCoordinate(coordinate, sourceProjection) {\n if (!userProjection) {\n return coordinate;\n }\n return transform(coordinate, sourceProjection, userProjection);\n}\n\n/**\n * Return a coordinate transformed from the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array} coordinate Input coordinate.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {Array} The input coordinate transformed.\n */\nexport function fromUserCoordinate(coordinate, destProjection) {\n if (!userProjection) {\n if (\n showCoordinateWarning &&\n !equals(coordinate, [0, 0]) &&\n coordinate[0] >= -180 &&\n coordinate[0] <= 180 &&\n coordinate[1] >= -90 &&\n coordinate[1] <= 90\n ) {\n showCoordinateWarning = false;\n warn(\n 'Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.',\n );\n }\n return coordinate;\n }\n return transform(coordinate, userProjection, destProjection);\n}\n\n/**\n * Return an extent transformed into the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} sourceProjection The input extent projection.\n * @return {import(\"./extent.js\").Extent} The input extent in the user projection.\n */\nexport function toUserExtent(extent, sourceProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, sourceProjection, userProjection);\n}\n\n/**\n * Return an extent transformed from the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {import(\"./extent.js\").Extent} The input extent transformed.\n */\nexport function fromUserExtent(extent, destProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, userProjection, destProjection);\n}\n\n/**\n * Return the resolution in user projection units per pixel. If no user projection\n * is set, or source or user projection are missing units, the original resolution\n * is returned.\n * @param {number} resolution Resolution in input projection units per pixel.\n * @param {ProjectionLike} sourceProjection The input projection.\n * @return {number} Resolution in user projection units per pixel.\n */\nexport function toUserResolution(resolution, sourceProjection) {\n if (!userProjection) {\n return resolution;\n }\n const sourceMetersPerUnit = get(sourceProjection).getMetersPerUnit();\n const userMetersPerUnit = userProjection.getMetersPerUnit();\n return sourceMetersPerUnit && userMetersPerUnit\n ? (resolution * sourceMetersPerUnit) / userMetersPerUnit\n : resolution;\n}\n\n/**\n * Return the resolution in user projection units per pixel. If no user projection\n * is set, or source or user projection are missing units, the original resolution\n * is returned.\n * @param {number} resolution Resolution in user projection units per pixel.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {number} Resolution in destination projection units per pixel.\n */\nexport function fromUserResolution(resolution, destProjection) {\n if (!userProjection) {\n return resolution;\n }\n const destMetersPerUnit = get(destProjection).getMetersPerUnit();\n const userMetersPerUnit = userProjection.getMetersPerUnit();\n return destMetersPerUnit && userMetersPerUnit\n ? (resolution * userMetersPerUnit) / destMetersPerUnit\n : resolution;\n}\n\n/**\n * Creates a safe coordinate transform function from a coordinate transform function.\n * \"Safe\" means that it can handle wrapping of x-coordinates for global projections,\n * and that coordinates exceeding the source projection validity extent's range will be\n * clamped to the validity range.\n * @param {Projection} sourceProj Source projection.\n * @param {Projection} destProj Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} transform Transform function (source to destination).\n * @return {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} Safe transform function (source to destination).\n */\nexport function createSafeCoordinateTransform(sourceProj, destProj, transform) {\n return function (coord) {\n let transformed, worldsAway;\n if (sourceProj.canWrapX()) {\n const sourceExtent = sourceProj.getExtent();\n const sourceExtentWidth = getWidth(sourceExtent);\n coord = coord.slice(0);\n worldsAway = getWorldsAway(coord, sourceProj, sourceExtentWidth);\n if (worldsAway) {\n // Move x to the real world\n coord[0] = coord[0] - worldsAway * sourceExtentWidth;\n }\n coord[0] = clamp(coord[0], sourceExtent[0], sourceExtent[2]);\n coord[1] = clamp(coord[1], sourceExtent[1], sourceExtent[3]);\n transformed = transform(coord);\n } else {\n transformed = transform(coord);\n }\n if (worldsAway && destProj.canWrapX()) {\n // Move transformed coordinate back to the offset world\n transformed[0] += worldsAway * getWidth(destProj.getExtent());\n }\n return transformed;\n };\n}\n\n/**\n * Add transforms to and from EPSG:4326 and EPSG:3857. This function is called\n * by when this module is executed and should only need to be called again after\n * `clearAllProjections()` is called (e.g. in tests).\n */\nexport function addCommon() {\n // Add transformations that don't alter coordinates to convert within set of\n // projections with equal meaning.\n addEquivalentProjections(EPSG3857_PROJECTIONS);\n addEquivalentProjections(EPSG4326_PROJECTIONS);\n // Add transformations to convert EPSG:4326 like coordinates to EPSG:3857 like\n // coordinates and back.\n addEquivalentTransforms(\n EPSG4326_PROJECTIONS,\n EPSG3857_PROJECTIONS,\n fromEPSG4326,\n toEPSG4326,\n );\n}\n\naddCommon();\n","/**\n * @module ol/transform\n */\nimport {assert} from './asserts.js';\n\n/**\n * An array representing an affine 2d transformation for use with\n * {@link module:ol/transform} functions. The array has 6 elements.\n * @typedef {!Array} Transform\n * @api\n */\n\n/**\n * Collection of affine 2d transformation functions. The functions work on an\n * array of 6 elements. The element order is compatible with the [SVGMatrix\n * interface](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) and is\n * a subset (elements a to f) of a 3×3 matrix:\n * ```\n * [ a c e ]\n * [ b d f ]\n * [ 0 0 1 ]\n * ```\n */\n\n/**\n * @private\n * @type {Transform}\n */\nconst tmp_ = new Array(6);\n\n/**\n * Create an identity transform.\n * @return {!Transform} Identity transform.\n */\nexport function create() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n/**\n * Resets the given transform to an identity transform.\n * @param {!Transform} transform Transform.\n * @return {!Transform} Transform.\n */\nexport function reset(transform) {\n return set(transform, 1, 0, 0, 1, 0, 0);\n}\n\n/**\n * Multiply the underlying matrices of two transforms and return the result in\n * the first transform.\n * @param {!Transform} transform1 Transform parameters of matrix 1.\n * @param {!Transform} transform2 Transform parameters of matrix 2.\n * @return {!Transform} transform1 multiplied with transform2.\n */\nexport function multiply(transform1, transform2) {\n const a1 = transform1[0];\n const b1 = transform1[1];\n const c1 = transform1[2];\n const d1 = transform1[3];\n const e1 = transform1[4];\n const f1 = transform1[5];\n const a2 = transform2[0];\n const b2 = transform2[1];\n const c2 = transform2[2];\n const d2 = transform2[3];\n const e2 = transform2[4];\n const f2 = transform2[5];\n\n transform1[0] = a1 * a2 + c1 * b2;\n transform1[1] = b1 * a2 + d1 * b2;\n transform1[2] = a1 * c2 + c1 * d2;\n transform1[3] = b1 * c2 + d1 * d2;\n transform1[4] = a1 * e2 + c1 * f2 + e1;\n transform1[5] = b1 * e2 + d1 * f2 + f1;\n\n return transform1;\n}\n\n/**\n * Set the transform components a-f on a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} a The a component of the transform.\n * @param {number} b The b component of the transform.\n * @param {number} c The c component of the transform.\n * @param {number} d The d component of the transform.\n * @param {number} e The e component of the transform.\n * @param {number} f The f component of the transform.\n * @return {!Transform} Matrix with transform applied.\n */\nexport function set(transform, a, b, c, d, e, f) {\n transform[0] = a;\n transform[1] = b;\n transform[2] = c;\n transform[3] = d;\n transform[4] = e;\n transform[5] = f;\n return transform;\n}\n\n/**\n * Set transform on one matrix from another matrix.\n * @param {!Transform} transform1 Matrix to set transform to.\n * @param {!Transform} transform2 Matrix to set transform from.\n * @return {!Transform} transform1 with transform from transform2 applied.\n */\nexport function setFromArray(transform1, transform2) {\n transform1[0] = transform2[0];\n transform1[1] = transform2[1];\n transform1[2] = transform2[2];\n transform1[3] = transform2[3];\n transform1[4] = transform2[4];\n transform1[5] = transform2[5];\n return transform1;\n}\n\n/**\n * Transforms the given coordinate with the given transform returning the\n * resulting, transformed coordinate. The coordinate will be modified in-place.\n *\n * @param {Transform} transform The transformation.\n * @param {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} coordinate The coordinate to transform.\n * @return {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} return coordinate so that operations can be\n * chained together.\n */\nexport function apply(transform, coordinate) {\n const x = coordinate[0];\n const y = coordinate[1];\n coordinate[0] = transform[0] * x + transform[2] * y + transform[4];\n coordinate[1] = transform[1] * x + transform[3] * y + transform[5];\n return coordinate;\n}\n\n/**\n * Applies rotation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} angle Angle in radians.\n * @return {!Transform} The rotated transform.\n */\nexport function rotate(transform, angle) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0));\n}\n\n/**\n * Applies scale to a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scaled transform.\n */\nexport function scale(transform, x, y) {\n return multiply(transform, set(tmp_, x, 0, 0, y, 0, 0));\n}\n\n/**\n * Creates a scale transform.\n * @param {!Transform} target Transform to overwrite.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scale transform.\n */\nexport function makeScale(target, x, y) {\n return set(target, x, 0, 0, y, 0, 0);\n}\n\n/**\n * Applies translation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} dx Translation x.\n * @param {number} dy Translation y.\n * @return {!Transform} The translated transform.\n */\nexport function translate(transform, dx, dy) {\n return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy));\n}\n\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative).\n * @param {!Transform} transform The transform (will be modified in place).\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {!Transform} The composite transform.\n */\nexport function compose(transform, dx1, dy1, sx, sy, angle, dx2, dy2) {\n const sin = Math.sin(angle);\n const cos = Math.cos(angle);\n transform[0] = sx * cos;\n transform[1] = sy * sin;\n transform[2] = -sx * sin;\n transform[3] = sy * cos;\n transform[4] = dx2 * sx * cos - dy2 * sx * sin + dx1;\n transform[5] = dx2 * sy * sin + dy2 * sy * cos + dy1;\n return transform;\n}\n\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative). The resulting transform\n * string can be applied as `transform` property of an HTMLElement's style.\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {string} The composite css transform.\n * @api\n */\nexport function composeCssTransform(dx1, dy1, sx, sy, angle, dx2, dy2) {\n return toString(compose(create(), dx1, dy1, sx, sy, angle, dx2, dy2));\n}\n\n/**\n * Invert the given transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (source) transform.\n */\nexport function invert(source) {\n return makeInverse(source, source);\n}\n\n/**\n * Invert the given transform.\n * @param {!Transform} target Transform to be set as the inverse of\n * the source transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (target) transform.\n */\nexport function makeInverse(target, source) {\n const det = determinant(source);\n assert(det !== 0, 'Transformation matrix cannot be inverted');\n\n const a = source[0];\n const b = source[1];\n const c = source[2];\n const d = source[3];\n const e = source[4];\n const f = source[5];\n\n target[0] = d / det;\n target[1] = -b / det;\n target[2] = -c / det;\n target[3] = a / det;\n target[4] = (c * f - d * e) / det;\n target[5] = -(a * f - b * e) / det;\n\n return target;\n}\n\n/**\n * Returns the determinant of the given matrix.\n * @param {!Transform} mat Matrix.\n * @return {number} Determinant.\n */\nexport function determinant(mat) {\n return mat[0] * mat[3] - mat[1] * mat[2];\n}\n\n/**\n * @type {Array}\n */\nconst matrixPrecision = [1e5, 1e5, 1e5, 1e5, 2, 2];\n\n/**\n * A matrix string version of the transform. This can be used\n * for CSS transforms.\n * @param {!Transform} mat Matrix.\n * @return {string} The transform as a string.\n */\nexport function toString(mat) {\n const transformString = 'matrix(' + mat.join(', ') + ')';\n return transformString;\n}\n\n/**\n * Create a transform from a CSS transform matrix string.\n * @param {string} cssTransform The CSS string to parse.\n * @return {!Transform} The transform.\n */\nfunction fromString(cssTransform) {\n const values = cssTransform.substring(7, cssTransform.length - 1).split(',');\n return values.map(parseFloat);\n}\n\n/**\n * Compare two matrices for equality.\n * @param {!string} cssTransform1 A CSS transform matrix string.\n * @param {!string} cssTransform2 A CSS transform matrix string.\n * @return {boolean} The two matrices are equal.\n */\nexport function equivalent(cssTransform1, cssTransform2) {\n const mat1 = fromString(cssTransform1);\n const mat2 = fromString(cssTransform2);\n for (let i = 0; i < 6; ++i) {\n if (Math.round((mat1[i] - mat2[i]) * matrixPrecision[i]) !== 0) {\n return false;\n }\n }\n return true;\n}\n","/**\n * @module ol/geom/flat/transform\n */\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {Array} [dest] Destination.\n * @param {number} [destinationStride] Stride of destination coordinates; if unspecified, assumed to be 2.\n * @return {Array} Transformed coordinates.\n */\nexport function transform2D(\n flatCoordinates,\n offset,\n end,\n stride,\n transform,\n dest,\n destinationStride,\n) {\n dest = dest ? dest : [];\n destinationStride = destinationStride ? destinationStride : 2;\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n const x = flatCoordinates[j];\n const y = flatCoordinates[j + 1];\n dest[i++] = transform[0] * x + transform[2] * y + transform[4];\n dest[i++] = transform[1] * x + transform[3] * y + transform[5];\n\n for (let k = 2; k < destinationStride; k++) {\n dest[i++] = flatCoordinates[j + k];\n }\n }\n\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} angle Angle.\n * @param {Array} anchor Rotation anchor point.\n * @param {Array} [dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function rotate(\n flatCoordinates,\n offset,\n end,\n stride,\n angle,\n anchor,\n dest,\n) {\n dest = dest ? dest : [];\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const anchorX = anchor[0];\n const anchorY = anchor[1];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n const deltaX = flatCoordinates[j] - anchorX;\n const deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + deltaX * cos - deltaY * sin;\n dest[i++] = anchorY + deltaX * sin + deltaY * cos;\n for (let k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n/**\n * Scale the coordinates.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} sx Scale factor in the x-direction.\n * @param {number} sy Scale factor in the y-direction.\n * @param {Array} anchor Scale anchor point.\n * @param {Array} [dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function scale(\n flatCoordinates,\n offset,\n end,\n stride,\n sx,\n sy,\n anchor,\n dest,\n) {\n dest = dest ? dest : [];\n const anchorX = anchor[0];\n const anchorY = anchor[1];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n const deltaX = flatCoordinates[j] - anchorX;\n const deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + sx * deltaX;\n dest[i++] = anchorY + sy * deltaY;\n for (let k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @param {Array} [dest] Destination.\n * @return {Array} Transformed coordinates.\n */\nexport function translate(\n flatCoordinates,\n offset,\n end,\n stride,\n deltaX,\n deltaY,\n dest,\n) {\n dest = dest ? dest : [];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n dest[i++] = flatCoordinates[j] + deltaX;\n dest[i++] = flatCoordinates[j + 1] + deltaY;\n for (let k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n","/**\n * @module ol/geom/Geometry\n */\nimport BaseObject from '../Object.js';\nimport {\n createEmpty,\n createOrUpdateEmpty,\n getHeight,\n returnOrUpdate,\n} from '../extent.js';\nimport {memoizeOne} from '../functions.js';\nimport {get as getProjection, getTransform} from '../proj.js';\nimport {\n compose as composeTransform,\n create as createTransform,\n} from '../transform.js';\nimport {abstract} from '../util.js';\nimport {transform2D} from './flat/transform.js';\n\n/**\n * @typedef {'XY' | 'XYZ' | 'XYM' | 'XYZM'} GeometryLayout\n * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z')\n * or measure ('M') coordinate is available.\n */\n\n/**\n * @typedef {'Point' | 'LineString' | 'LinearRing' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon' | 'GeometryCollection' | 'Circle'} Type\n * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`,\n * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`,\n * `'GeometryCollection'`, or `'Circle'`.\n */\n\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nconst tmpTransform = createTransform();\n\n/** @type {import('../coordinate.js').Coordinate} */\nconst tmpPoint = [NaN, NaN];\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for vector geometries.\n *\n * To get notified of changes to the geometry, register a listener for the\n * generic `change` event on your geometry instance.\n *\n * @abstract\n * @api\n */\nclass Geometry extends BaseObject {\n constructor() {\n super();\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = createEmpty();\n\n /**\n * @private\n * @type {number}\n */\n this.extentRevision_ = -1;\n\n /**\n * @protected\n * @type {number}\n */\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n\n /**\n * @protected\n * @type {number}\n */\n this.simplifiedGeometryRevision = 0;\n\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} revision The geometry revision.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n this.simplifyTransformedInternal = memoizeOne(\n (revision, squaredTolerance, transform) => {\n if (!transform) {\n return this.getSimplifiedGeometry(squaredTolerance);\n }\n const clone = this.clone();\n clone.applyTransform(transform);\n return clone.getSimplifiedGeometry(squaredTolerance);\n },\n );\n }\n\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n simplifyTransformed(squaredTolerance, transform) {\n return this.simplifyTransformedInternal(\n this.getRevision(),\n squaredTolerance,\n transform,\n );\n }\n\n /**\n * Make a complete copy of the geometry.\n * @abstract\n * @return {!Geometry} Clone.\n */\n clone() {\n return abstract();\n }\n\n /**\n * @abstract\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n return abstract();\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n containsXY(x, y) {\n return this.closestPointXY(x, y, tmpPoint, Number.MIN_VALUE) === 0;\n }\n\n /**\n * Return the closest point of the geometry to the passed point as\n * {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} point Point.\n * @param {import(\"../coordinate.js\").Coordinate} [closestPoint] Closest point.\n * @return {import(\"../coordinate.js\").Coordinate} Closest point.\n * @api\n */\n getClosestPoint(point, closestPoint) {\n closestPoint = closestPoint ? closestPoint : [NaN, NaN];\n this.closestPointXY(point[0], point[1], closestPoint, Infinity);\n return closestPoint;\n }\n\n /**\n * Returns true if this geometry includes the specified coordinate. If the\n * coordinate is on the boundary of the geometry, returns false.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains coordinate.\n * @api\n */\n intersectsCoordinate(coordinate) {\n return this.containsXY(coordinate[0], coordinate[1]);\n }\n\n /**\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n computeExtent(extent) {\n return abstract();\n }\n\n /**\n * Get the extent of the geometry.\n * @param {import(\"../extent.js\").Extent} [extent] Extent.\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n getExtent(extent) {\n if (this.extentRevision_ != this.getRevision()) {\n const extent = this.computeExtent(this.extent_);\n if (isNaN(extent[0]) || isNaN(extent[1])) {\n createOrUpdateEmpty(extent);\n }\n this.extentRevision_ = this.getRevision();\n }\n return returnOrUpdate(this.extent_, extent);\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n rotate(angle, anchor) {\n abstract();\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n scale(sx, sy, anchor) {\n abstract();\n }\n\n /**\n * Create a simplified version of this geometry. For linestrings, this uses\n * the [Douglas Peucker](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm)\n * algorithm. For polygons, a quantization-based\n * simplification is used to preserve topology.\n * @param {number} tolerance The tolerance distance for simplification.\n * @return {Geometry} A new, simplified version of the original geometry.\n * @api\n */\n simplify(tolerance) {\n return this.getSimplifiedGeometry(tolerance * tolerance);\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker\n * algorithm.\n * See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Geometry} Simplified geometry.\n */\n getSimplifiedGeometry(squaredTolerance) {\n return abstract();\n }\n\n /**\n * Get the type of this geometry.\n * @abstract\n * @return {Type} Geometry type.\n */\n getType() {\n return abstract();\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @abstract\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n */\n applyTransform(transformFn) {\n abstract();\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n */\n intersectsExtent(extent) {\n return abstract();\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @abstract\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n translate(deltaX, deltaY) {\n abstract();\n }\n\n /**\n * Transform each coordinate of the geometry from one coordinate reference\n * system to another. The geometry is modified in place.\n * For example, a line will be transformed to a line and a circle to a circle.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {this} This geometry. Note that original geometry is\n * modified in place.\n * @api\n */\n transform(source, destination) {\n /** @type {import(\"../proj/Projection.js\").default} */\n const sourceProj = getProjection(source);\n const transformFn =\n sourceProj.getUnits() == 'tile-pixels'\n ? function (inCoordinates, outCoordinates, stride) {\n const pixelExtent = sourceProj.getExtent();\n const projectedExtent = sourceProj.getWorldExtent();\n const scale = getHeight(projectedExtent) / getHeight(pixelExtent);\n composeTransform(\n tmpTransform,\n projectedExtent[0],\n projectedExtent[3],\n scale,\n -scale,\n 0,\n 0,\n 0,\n );\n const transformed = transform2D(\n inCoordinates,\n 0,\n inCoordinates.length,\n stride,\n tmpTransform,\n outCoordinates,\n );\n const projTransform = getTransform(sourceProj, destination);\n if (projTransform) {\n return projTransform(transformed, transformed, stride);\n }\n return transformed;\n }\n : getTransform(sourceProj, destination);\n this.applyTransform(transformFn);\n return this;\n }\n}\n\nexport default Geometry;\n","/**\n * @module ol/geom/SimpleGeometry\n */\nimport {createOrUpdateFromFlatCoordinates, getCenter} from '../extent.js';\nimport {abstract} from '../util.js';\nimport Geometry from './Geometry.js';\nimport {rotate, scale, transform2D, translate} from './flat/transform.js';\n\n/**\n * @classdesc\n * Abstract base class; only used for creating subclasses; do not instantiate\n * in apps, as cannot be rendered.\n *\n * @abstract\n * @api\n */\nclass SimpleGeometry extends Geometry {\n constructor() {\n super();\n\n /**\n * @protected\n * @type {import(\"./Geometry.js\").GeometryLayout}\n */\n this.layout = 'XY';\n\n /**\n * @protected\n * @type {number}\n */\n this.stride = 2;\n\n /**\n * @protected\n * @type {Array}\n */\n this.flatCoordinates;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @override\n */\n computeExtent(extent) {\n return createOrUpdateFromFlatCoordinates(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n extent,\n );\n }\n\n /**\n * @abstract\n * @return {Array<*> | null} Coordinates.\n */\n getCoordinates() {\n return abstract();\n }\n\n /**\n * Return the first coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} First coordinate.\n * @api\n */\n getFirstCoordinate() {\n return this.flatCoordinates.slice(0, this.stride);\n }\n\n /**\n * @return {Array} Flat coordinates.\n */\n getFlatCoordinates() {\n return this.flatCoordinates;\n }\n\n /**\n * Return the last coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} Last point.\n * @api\n */\n getLastCoordinate() {\n return this.flatCoordinates.slice(\n this.flatCoordinates.length - this.stride,\n );\n }\n\n /**\n * Return the {@link import(\"./Geometry.js\").GeometryLayout layout} of the geometry.\n * @return {import(\"./Geometry.js\").GeometryLayout} Layout.\n * @api\n */\n getLayout() {\n return this.layout;\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n * @override\n */\n getSimplifiedGeometry(squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n // If squaredTolerance is negative or if we know that simplification will not\n // have any effect then just return this.\n if (\n squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance <= this.simplifiedGeometryMaxMinSquaredTolerance)\n ) {\n return this;\n }\n\n const simplifiedGeometry =\n this.getSimplifiedGeometryInternal(squaredTolerance);\n const simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();\n if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {\n return simplifiedGeometry;\n }\n // Simplification did not actually remove any coordinates. We now know\n // that any calls to getSimplifiedGeometry with a squaredTolerance less\n // than or equal to the current squaredTolerance will also not have any\n // effect. This allows us to short circuit simplification (saving CPU\n // cycles) and prevents the cache of simplified geometries from filling\n // up with useless identical copies of this geometry (saving memory).\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n return this;\n }\n\n /**\n * @return {number} Stride.\n */\n getStride() {\n return this.stride;\n }\n\n /**\n * @param {import(\"./Geometry.js\").GeometryLayout} layout Layout.\n * @param {Array} flatCoordinates Flat coordinates.\n */\n setFlatCoordinates(layout, flatCoordinates) {\n this.stride = getStrideForLayout(layout);\n this.layout = layout;\n this.flatCoordinates = flatCoordinates;\n }\n\n /**\n * @abstract\n * @param {!Array<*>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n setCoordinates(coordinates, layout) {\n abstract();\n }\n\n /**\n * @param {import(\"./Geometry.js\").GeometryLayout|undefined} layout Layout.\n * @param {Array<*>} coordinates Coordinates.\n * @param {number} nesting Nesting.\n * @protected\n */\n setLayout(layout, coordinates, nesting) {\n let stride;\n if (layout) {\n stride = getStrideForLayout(layout);\n } else {\n for (let i = 0; i < nesting; ++i) {\n if (coordinates.length === 0) {\n this.layout = 'XY';\n this.stride = 2;\n return;\n }\n coordinates = /** @type {Array} */ (coordinates[0]);\n }\n stride = coordinates.length;\n layout = getLayoutForStride(stride);\n }\n this.layout = layout;\n this.stride = stride;\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n * @override\n */\n applyTransform(transformFn) {\n if (this.flatCoordinates) {\n transformFn(\n this.flatCoordinates,\n this.flatCoordinates,\n this.layout.startsWith('XYZ') ? 3 : 2,\n this.stride,\n );\n this.changed();\n }\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in counter-clockwise radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n * @override\n */\n rotate(angle, anchor) {\n const flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n const stride = this.getStride();\n rotate(\n flatCoordinates,\n 0,\n flatCoordinates.length,\n stride,\n angle,\n anchor,\n flatCoordinates,\n );\n this.changed();\n }\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n * @override\n */\n scale(sx, sy, anchor) {\n if (sy === undefined) {\n sy = sx;\n }\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n const flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n const stride = this.getStride();\n scale(\n flatCoordinates,\n 0,\n flatCoordinates.length,\n stride,\n sx,\n sy,\n anchor,\n flatCoordinates,\n );\n this.changed();\n }\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n * @override\n */\n translate(deltaX, deltaY) {\n const flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n const stride = this.getStride();\n translate(\n flatCoordinates,\n 0,\n flatCoordinates.length,\n stride,\n deltaX,\n deltaY,\n flatCoordinates,\n );\n this.changed();\n }\n }\n}\n\n/**\n * @param {number} stride Stride.\n * @return {import(\"./Geometry.js\").GeometryLayout} layout Layout.\n */\nexport function getLayoutForStride(stride) {\n let layout;\n if (stride == 2) {\n layout = 'XY';\n } else if (stride == 3) {\n layout = 'XYZ';\n } else if (stride == 4) {\n layout = 'XYZM';\n }\n return /** @type {import(\"./Geometry.js\").GeometryLayout} */ (layout);\n}\n\n/**\n * @param {import(\"./Geometry.js\").GeometryLayout} layout Layout.\n * @return {number} Stride.\n */\nexport function getStrideForLayout(layout) {\n let stride;\n if (layout == 'XY') {\n stride = 2;\n } else if (layout == 'XYZ' || layout == 'XYM') {\n stride = 3;\n } else if (layout == 'XYZM') {\n stride = 4;\n }\n return /** @type {number} */ (stride);\n}\n\n/**\n * @param {SimpleGeometry} simpleGeometry Simple geometry.\n * @param {import(\"../transform.js\").Transform} transform Transform.\n * @param {Array} [dest] Destination.\n * @return {Array} Transformed flat coordinates.\n */\nexport function transformGeom2D(simpleGeometry, transform, dest) {\n const flatCoordinates = simpleGeometry.getFlatCoordinates();\n if (!flatCoordinates) {\n return null;\n }\n const stride = simpleGeometry.getStride();\n return transform2D(\n flatCoordinates,\n 0,\n flatCoordinates.length,\n stride,\n transform,\n dest,\n );\n}\n\nexport default SimpleGeometry;\n","/**\n * @module ol/geom/flat/area\n */\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRing(flatCoordinates, offset, end, stride) {\n let twiceArea = 0;\n const x0 = flatCoordinates[end - stride];\n const y0 = flatCoordinates[end - stride + 1];\n let dx1 = 0;\n let dy1 = 0;\n for (; offset < end; offset += stride) {\n const dx2 = flatCoordinates[offset] - x0;\n const dy2 = flatCoordinates[offset + 1] - y0;\n twiceArea += dy1 * dx2 - dx1 * dy2;\n dx1 = dx2;\n dy1 = dy2;\n }\n return twiceArea / 2;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRings(flatCoordinates, offset, ends, stride) {\n let area = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n area += linearRing(flatCoordinates, offset, end, stride);\n offset = end;\n }\n return area;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nexport function linearRingss(flatCoordinates, offset, endss, stride) {\n let area = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n area += linearRings(flatCoordinates, offset, ends, stride);\n offset = ends[ends.length - 1];\n }\n return area;\n}\n","/**\n * @module ol/geom/flat/closest\n */\nimport {lerp, squaredDistance as squaredDx} from '../../math.js';\n\n/**\n * Returns the point on the 2D line segment flatCoordinates[offset1] to\n * flatCoordinates[offset2] that is closest to the point (x, y). Extra\n * dimensions are linearly interpolated.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset1 Offset 1.\n * @param {number} offset2 Offset 2.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n */\nfunction assignClosest(\n flatCoordinates,\n offset1,\n offset2,\n stride,\n x,\n y,\n closestPoint,\n) {\n const x1 = flatCoordinates[offset1];\n const y1 = flatCoordinates[offset1 + 1];\n const dx = flatCoordinates[offset2] - x1;\n const dy = flatCoordinates[offset2 + 1] - y1;\n let offset;\n if (dx === 0 && dy === 0) {\n offset = offset1;\n } else {\n const t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n offset = offset2;\n } else if (t > 0) {\n for (let i = 0; i < stride; ++i) {\n closestPoint[i] = lerp(\n flatCoordinates[offset1 + i],\n flatCoordinates[offset2 + i],\n t,\n );\n }\n closestPoint.length = stride;\n return;\n } else {\n offset = offset1;\n }\n }\n for (let i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n}\n\n/**\n * Return the squared of the largest distance between any pair of consecutive\n * coordinates.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function maxSquaredDelta(flatCoordinates, offset, end, stride, max) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n for (offset += stride; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n const squaredDelta = squaredDx(x1, y1, x2, y2);\n if (squaredDelta > max) {\n max = squaredDelta;\n }\n x1 = x2;\n y1 = y2;\n }\n return max;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function arrayMaxSquaredDelta(\n flatCoordinates,\n offset,\n ends,\n stride,\n max,\n) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n max = maxSquaredDelta(flatCoordinates, offset, end, stride, max);\n offset = end;\n }\n return max;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nexport function multiArrayMaxSquaredDelta(\n flatCoordinates,\n offset,\n endss,\n stride,\n max,\n) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n max = arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max);\n offset = ends[ends.length - 1];\n }\n return max;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array} [tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestPoint(\n flatCoordinates,\n offset,\n end,\n stride,\n maxDelta,\n isRing,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n tmpPoint,\n) {\n if (offset == end) {\n return minSquaredDistance;\n }\n let i, squaredDistance;\n if (maxDelta === 0) {\n // All points are identical, so just test the first point.\n squaredDistance = squaredDx(\n x,\n y,\n flatCoordinates[offset],\n flatCoordinates[offset + 1],\n );\n if (squaredDistance < minSquaredDistance) {\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n return minSquaredDistance;\n }\n tmpPoint = tmpPoint ? tmpPoint : [NaN, NaN];\n let index = offset + stride;\n while (index < end) {\n assignClosest(\n flatCoordinates,\n index - stride,\n index,\n stride,\n x,\n y,\n tmpPoint,\n );\n squaredDistance = squaredDx(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n index += stride;\n } else {\n // Skip ahead multiple points, because we know that all the skipped\n // points cannot be any closer than the closest point we have found so\n // far. We know this because we know how close the current point is, how\n // close the closest point we have found so far is, and the maximum\n // distance between consecutive points. For example, if we're currently\n // at distance 10, the best we've found so far is 3, and that the maximum\n // distance between consecutive points is 2, then we'll need to skip at\n // least (10 - 3) / 2 == 3 (rounded down) points to have any chance of\n // finding a closer point. We use Math.max(..., 1) to ensure that we\n // always advance at least one point, to avoid an infinite loop.\n index +=\n stride *\n Math.max(\n ((Math.sqrt(squaredDistance) - Math.sqrt(minSquaredDistance)) /\n maxDelta) |\n 0,\n 1,\n );\n }\n }\n if (isRing) {\n // Check the closing segment.\n assignClosest(\n flatCoordinates,\n end - stride,\n offset,\n stride,\n x,\n y,\n tmpPoint,\n );\n squaredDistance = squaredDx(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array} [tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestArrayPoint(\n flatCoordinates,\n offset,\n ends,\n stride,\n maxDelta,\n isRing,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n tmpPoint,\n) {\n tmpPoint = tmpPoint ? tmpPoint : [NaN, NaN];\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n minSquaredDistance = assignClosestPoint(\n flatCoordinates,\n offset,\n end,\n stride,\n maxDelta,\n isRing,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n tmpPoint,\n );\n offset = end;\n }\n return minSquaredDistance;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array} [tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nexport function assignClosestMultiArrayPoint(\n flatCoordinates,\n offset,\n endss,\n stride,\n maxDelta,\n isRing,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n tmpPoint,\n) {\n tmpPoint = tmpPoint ? tmpPoint : [NaN, NaN];\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n minSquaredDistance = assignClosestArrayPoint(\n flatCoordinates,\n offset,\n ends,\n stride,\n maxDelta,\n isRing,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n tmpPoint,\n );\n offset = ends[ends.length - 1];\n }\n return minSquaredDistance;\n}\n","/**\n * @module ol/geom/flat/deflate\n */\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nexport function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {\n for (let i = 0, ii = coordinate.length; i < ii; ++i) {\n flatCoordinates[offset++] = coordinate[i];\n }\n return offset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} coordinates Coordinates.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nexport function deflateCoordinates(\n flatCoordinates,\n offset,\n coordinates,\n stride,\n) {\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n const coordinate = coordinates[i];\n for (let j = 0; j < stride; ++j) {\n flatCoordinates[offset++] = coordinate[j];\n }\n }\n return offset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} coordinatess Coordinatess.\n * @param {number} stride Stride.\n * @param {Array} [ends] Ends.\n * @return {Array} Ends.\n */\nexport function deflateCoordinatesArray(\n flatCoordinates,\n offset,\n coordinatess,\n stride,\n ends,\n) {\n ends = ends ? ends : [];\n let i = 0;\n for (let j = 0, jj = coordinatess.length; j < jj; ++j) {\n const end = deflateCoordinates(\n flatCoordinates,\n offset,\n coordinatess[j],\n stride,\n );\n ends[i++] = end;\n offset = end;\n }\n ends.length = i;\n return ends;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>>} coordinatesss Coordinatesss.\n * @param {number} stride Stride.\n * @param {Array>} [endss] Endss.\n * @return {Array>} Endss.\n */\nexport function deflateMultiCoordinatesArray(\n flatCoordinates,\n offset,\n coordinatesss,\n stride,\n endss,\n) {\n endss = endss ? endss : [];\n let i = 0;\n for (let j = 0, jj = coordinatesss.length; j < jj; ++j) {\n const ends = deflateCoordinatesArray(\n flatCoordinates,\n offset,\n coordinatesss[j],\n stride,\n endss[i],\n );\n if (ends.length === 0) {\n ends[0] = offset;\n }\n endss[i++] = ends;\n offset = ends[ends.length - 1];\n }\n endss.length = i;\n return endss;\n}\n","/**\n * @module ol/geom/flat/inflate\n */\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Array} [coordinates] Coordinates.\n * @return {Array} Coordinates.\n */\nexport function inflateCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n coordinates,\n) {\n coordinates = coordinates !== undefined ? coordinates : [];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n coordinates[i++] = flatCoordinates.slice(j, j + stride);\n }\n coordinates.length = i;\n return coordinates;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {Array>} [coordinatess] Coordinatess.\n * @return {Array>} Coordinatess.\n */\nexport function inflateCoordinatesArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n coordinatess,\n) {\n coordinatess = coordinatess !== undefined ? coordinatess : [];\n let i = 0;\n for (let j = 0, jj = ends.length; j < jj; ++j) {\n const end = ends[j];\n coordinatess[i++] = inflateCoordinates(\n flatCoordinates,\n offset,\n end,\n stride,\n coordinatess[i],\n );\n offset = end;\n }\n coordinatess.length = i;\n return coordinatess;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array>>} [coordinatesss]\n * Coordinatesss.\n * @return {Array>>} Coordinatesss.\n */\nexport function inflateMultiCoordinatesArray(\n flatCoordinates,\n offset,\n endss,\n stride,\n coordinatesss,\n) {\n coordinatesss = coordinatesss !== undefined ? coordinatesss : [];\n let i = 0;\n for (let j = 0, jj = endss.length; j < jj; ++j) {\n const ends = endss[j];\n coordinatesss[i++] =\n ends.length === 1 && ends[0] === offset\n ? []\n : inflateCoordinatesArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n coordinatesss[i],\n );\n offset = ends[ends.length - 1];\n }\n coordinatesss.length = i;\n return coordinatesss;\n}\n","/**\n * @module ol/geom/flat/simplify\n */\n// Based on simplify-js https://github.com/mourner/simplify-js\n// Copyright (c) 2012, Vladimir Agafonkin\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n//\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n// POSSIBILITY OF SUCH DAMAGE.\n\nimport {squaredDistance, squaredSegmentDistance} from '../../math.js';\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {boolean} highQuality Highest quality.\n * @param {Array} [simplifiedFlatCoordinates] Simplified flat\n * coordinates.\n * @return {Array} Simplified line string.\n */\nexport function simplifyLineString(\n flatCoordinates,\n offset,\n end,\n stride,\n squaredTolerance,\n highQuality,\n simplifiedFlatCoordinates,\n) {\n simplifiedFlatCoordinates =\n simplifiedFlatCoordinates !== undefined ? simplifiedFlatCoordinates : [];\n if (!highQuality) {\n end = radialDistance(\n flatCoordinates,\n offset,\n end,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n );\n flatCoordinates = simplifiedFlatCoordinates;\n offset = 0;\n stride = 2;\n }\n simplifiedFlatCoordinates.length = douglasPeucker(\n flatCoordinates,\n offset,\n end,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n );\n return simplifiedFlatCoordinates;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function douglasPeucker(\n flatCoordinates,\n offset,\n end,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n) {\n const n = (end - offset) / stride;\n if (n < 3) {\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n /** @type {Array} */\n const markers = new Array(n);\n markers[0] = 1;\n markers[n - 1] = 1;\n /** @type {Array} */\n const stack = [offset, end - stride];\n let index = 0;\n while (stack.length > 0) {\n const last = stack.pop();\n const first = stack.pop();\n let maxSquaredDistance = 0;\n const x1 = flatCoordinates[first];\n const y1 = flatCoordinates[first + 1];\n const x2 = flatCoordinates[last];\n const y2 = flatCoordinates[last + 1];\n for (let i = first + stride; i < last; i += stride) {\n const x = flatCoordinates[i];\n const y = flatCoordinates[i + 1];\n const squaredDistance = squaredSegmentDistance(x, y, x1, y1, x2, y2);\n if (squaredDistance > maxSquaredDistance) {\n index = i;\n maxSquaredDistance = squaredDistance;\n }\n }\n if (maxSquaredDistance > squaredTolerance) {\n markers[(index - offset) / stride] = 1;\n if (first + stride < index) {\n stack.push(first, index);\n }\n if (index + stride < last) {\n stack.push(index, last);\n }\n }\n }\n for (let i = 0; i < n; ++i) {\n if (markers[i]) {\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + i * stride];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + i * stride + 1];\n }\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nexport function douglasPeuckerArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n simplifiedEnds,\n) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n simplifiedOffset = douglasPeucker(\n flatCoordinates,\n offset,\n end,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n );\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nexport function douglasPeuckerMultiArray(\n flatCoordinates,\n offset,\n endss,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n simplifiedEndss,\n) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n /** @type {Array} */\n const simplifiedEnds = [];\n simplifiedOffset = douglasPeuckerArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n simplifiedEnds,\n );\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function radialDistance(\n flatCoordinates,\n offset,\n end,\n stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n) {\n if (end <= offset + stride) {\n // zero or one point, no simplification possible, so copy and return\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] =\n flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n // copy first point\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n let x2 = x1;\n let y2 = y1;\n for (offset += stride; offset < end; offset += stride) {\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n if (squaredDistance(x1, y1, x2, y2) > squaredTolerance) {\n // copy point at offset\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n }\n }\n if (x2 != x1 || y2 != y1) {\n // copy last point\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {number} value Value.\n * @param {number} tolerance Tolerance.\n * @return {number} Rounded value.\n */\nexport function snap(value, tolerance) {\n return tolerance * Math.round(value / tolerance);\n}\n\n/**\n * Simplifies a line string using an algorithm designed by Tim Schaub.\n * Coordinates are snapped to the nearest value in a virtual grid and\n * consecutive duplicate coordinates are discarded. This effectively preserves\n * topology as the simplification of any subsection of a line string is\n * independent of the rest of the line string. This means that, for examples,\n * the common edge between two polygons will be simplified to the same line\n * string independently in both polygons. This implementation uses a single\n * pass over the coordinates and eliminates intermediate collinear points.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nexport function quantize(\n flatCoordinates,\n offset,\n end,\n stride,\n tolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n) {\n // do nothing if the line is empty\n if (offset == end) {\n return simplifiedOffset;\n }\n // snap the first coordinate (P1)\n let x1 = snap(flatCoordinates[offset], tolerance);\n let y1 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // add the first coordinate to the output\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n // find the next coordinate that does not snap to the same value as the first\n // coordinate (P2)\n let x2, y2;\n do {\n x2 = snap(flatCoordinates[offset], tolerance);\n y2 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n if (offset == end) {\n // all coordinates snap to the same value, the line collapses to a point\n // push the last snapped value anyway to ensure that the output contains\n // at least two points\n // FIXME should we really return at least two points anyway?\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n }\n } while (x2 == x1 && y2 == y1);\n while (offset < end) {\n // snap the next coordinate (P3)\n const x3 = snap(flatCoordinates[offset], tolerance);\n const y3 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // skip P3 if it is equal to P2\n if (x3 == x2 && y3 == y2) {\n continue;\n }\n // calculate the delta between P1 and P2\n const dx1 = x2 - x1;\n const dy1 = y2 - y1;\n // calculate the delta between P3 and P1\n const dx2 = x3 - x1;\n const dy2 = y3 - y1;\n // if P1, P2, and P3 are colinear and P3 is further from P1 than P2 is from\n // P1 in the same direction then P2 is on the straight line between P1 and\n // P3\n if (\n dx1 * dy2 == dy1 * dx2 &&\n ((dx1 < 0 && dx2 < dx1) || dx1 == dx2 || (dx1 > 0 && dx2 > dx1)) &&\n ((dy1 < 0 && dy2 < dy1) || dy1 == dy2 || (dy1 > 0 && dy2 > dy1))\n ) {\n // discard P2 and set P2 = P3\n x2 = x3;\n y2 = y3;\n continue;\n }\n // either P1, P2, and P3 are not colinear, or they are colinear but P3 is\n // between P3 and P1 or on the opposite half of the line to P2. add P2,\n // and continue with P1 = P2 and P2 = P3\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n x2 = x3;\n y2 = y3;\n }\n // add the last point (P2)\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nexport function quantizeArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n tolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n simplifiedEnds,\n) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n simplifiedOffset = quantize(\n flatCoordinates,\n offset,\n end,\n stride,\n tolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n );\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nexport function quantizeMultiArray(\n flatCoordinates,\n offset,\n endss,\n stride,\n tolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n simplifiedEndss,\n) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n /** @type {Array} */\n const simplifiedEnds = [];\n simplifiedOffset = quantizeArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n tolerance,\n simplifiedFlatCoordinates,\n simplifiedOffset,\n simplifiedEnds,\n );\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n","/**\n * @module ol/geom/LinearRing\n */\nimport {closestSquaredDistanceXY} from '../extent.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {linearRing as linearRingArea} from './flat/area.js';\nimport {assignClosestPoint, maxSquaredDelta} from './flat/closest.js';\nimport {deflateCoordinates} from './flat/deflate.js';\nimport {inflateCoordinates} from './flat/inflate.js';\nimport {douglasPeucker} from './flat/simplify.js';\n\n/**\n * @classdesc\n * Linear ring geometry. Only used as part of polygon; cannot be rendered\n * on its own.\n *\n * @api\n */\nclass LinearRing extends SimpleGeometry {\n /**\n * @param {Array|Array} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n if (layout !== undefined && !Array.isArray(coordinates[0])) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array} */ (coordinates),\n );\n } else {\n this.setCoordinates(\n /** @type {Array} */ (\n coordinates\n ),\n layout,\n );\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!LinearRing} Clone.\n * @api\n * @override\n */\n clone() {\n return new LinearRing(this.flatCoordinates.slice(), this.layout);\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(\n maxSquaredDelta(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n 0,\n ),\n );\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestPoint(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n this.maxDelta_,\n true,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n\n /**\n * Return the area of the linear ring on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n getArea() {\n return linearRingArea(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n );\n }\n\n /**\n * Return the coordinates of the linear ring.\n * @return {Array} Coordinates.\n * @api\n * @override\n */\n getCoordinates() {\n return inflateCoordinates(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n );\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LinearRing} Simplified LinearRing.\n * @protected\n * @override\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array} */\n const simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = douglasPeucker(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n );\n return new LinearRing(simplifiedFlatCoordinates, 'XY');\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'LinearRing';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return false;\n }\n\n /**\n * Set the coordinates of the linear ring.\n * @param {!Array} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n );\n this.changed();\n }\n}\n\nexport default LinearRing;\n","/**\n * @module ol/geom/Point\n */\nimport {containsXY, createOrUpdateFromCoordinate} from '../extent.js';\nimport {squaredDistance as squaredDx} from '../math.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {deflateCoordinate} from './flat/deflate.js';\n\n/**\n * @classdesc\n * Point geometry.\n *\n * @api\n */\nclass Point extends SimpleGeometry {\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n this.setCoordinates(coordinates, layout);\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!Point} Clone.\n * @api\n * @override\n */\n clone() {\n const point = new Point(this.flatCoordinates.slice(), this.layout);\n point.applyProperties(this);\n return point;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n const flatCoordinates = this.flatCoordinates;\n const squaredDistance = squaredDx(\n x,\n y,\n flatCoordinates[0],\n flatCoordinates[1],\n );\n if (squaredDistance < minSquaredDistance) {\n const stride = this.stride;\n for (let i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n return minSquaredDistance;\n }\n\n /**\n * Return the coordinate of the point.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinates.\n * @api\n * @override\n */\n getCoordinates() {\n return this.flatCoordinates.slice();\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @override\n */\n computeExtent(extent) {\n return createOrUpdateFromCoordinate(this.flatCoordinates, extent);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'Point';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);\n }\n\n /**\n * @param {!Array<*>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinate(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n );\n this.changed();\n }\n}\n\nexport default Point;\n","/**\n * @module ol/geom/flat/contains\n */\nimport {forEachCorner} from '../../extent.js';\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} Contains extent.\n */\nexport function linearRingContainsExtent(\n flatCoordinates,\n offset,\n end,\n stride,\n extent,\n) {\n const outside = forEachCorner(\n extent,\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains (x, y).\n */\n function (coordinate) {\n return !linearRingContainsXY(\n flatCoordinates,\n offset,\n end,\n stride,\n coordinate[0],\n coordinate[1],\n );\n },\n );\n return !outside;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingContainsXY(\n flatCoordinates,\n offset,\n end,\n stride,\n x,\n y,\n) {\n // https://web.archive.org/web/20210504233957/http://geomalgorithms.com/a03-_inclusion.html\n // Copyright 2000 softSurfer, 2012 Dan Sunday\n // This code may be freely used and modified for any purpose\n // providing that this copyright notice is included with it.\n // SoftSurfer makes no warranty for this code, and cannot be held\n // liable for any real or imagined damage resulting from its use.\n // Users of this code must verify correctness for their application.\n let wn = 0;\n let x1 = flatCoordinates[end - stride];\n let y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n if (y1 <= y) {\n if (y2 > y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) > 0) {\n wn++;\n }\n } else if (y2 <= y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) < 0) {\n wn--;\n }\n x1 = x2;\n y1 = y2;\n }\n return wn !== 0;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingsContainsXY(\n flatCoordinates,\n offset,\n ends,\n stride,\n x,\n y,\n) {\n if (ends.length === 0) {\n return false;\n }\n if (!linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) {\n return false;\n }\n for (let i = 1, ii = ends.length; i < ii; ++i) {\n if (\n linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nexport function linearRingssContainsXY(\n flatCoordinates,\n offset,\n endss,\n stride,\n x,\n y,\n) {\n if (endss.length === 0) {\n return false;\n }\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n","/**\n * @module ol/geom/flat/interiorpoint\n */\nimport {ascending} from '../../array.js';\nimport {linearRingsContainsXY} from './contains.js';\n\n/**\n * Calculates a point that is likely to lie in the interior of the linear rings.\n * Inspired by JTS's com.vividsolutions.jts.geom.Geometry#getInteriorPoint.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {Array} flatCenters Flat centers.\n * @param {number} flatCentersOffset Flat center offset.\n * @param {Array} [dest] Destination.\n * @return {Array} Destination point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nexport function getInteriorPointOfArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n flatCenters,\n flatCentersOffset,\n dest,\n) {\n let i, ii, x, x1, x2, y1, y2;\n const y = flatCenters[flatCentersOffset + 1];\n /** @type {Array} */\n const intersections = [];\n // Calculate intersections with the horizontal line\n for (let r = 0, rr = ends.length; r < rr; ++r) {\n const end = ends[r];\n x1 = flatCoordinates[end - stride];\n y1 = flatCoordinates[end - stride + 1];\n for (i = offset; i < end; i += stride) {\n x2 = flatCoordinates[i];\n y2 = flatCoordinates[i + 1];\n if ((y <= y1 && y2 <= y) || (y1 <= y && y <= y2)) {\n x = ((y - y1) / (y2 - y1)) * (x2 - x1) + x1;\n intersections.push(x);\n }\n x1 = x2;\n y1 = y2;\n }\n }\n // Find the longest segment of the horizontal line that has its center point\n // inside the linear ring.\n let pointX = NaN;\n let maxSegmentLength = -Infinity;\n intersections.sort(ascending);\n x1 = intersections[0];\n for (i = 1, ii = intersections.length; i < ii; ++i) {\n x2 = intersections[i];\n const segmentLength = Math.abs(x2 - x1);\n if (segmentLength > maxSegmentLength) {\n x = (x1 + x2) / 2;\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n pointX = x;\n maxSegmentLength = segmentLength;\n }\n }\n x1 = x2;\n }\n if (isNaN(pointX)) {\n // There is no horizontal line that has its center point inside the linear\n // ring. Use the center of the the linear ring's extent.\n pointX = flatCenters[flatCentersOffset];\n }\n if (dest) {\n dest.push(pointX, y, maxSegmentLength);\n return dest;\n }\n return [pointX, y, maxSegmentLength];\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array} flatCenters Flat centers.\n * @return {Array} Interior points as XYM coordinates, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nexport function getInteriorPointsOfMultiArray(\n flatCoordinates,\n offset,\n endss,\n stride,\n flatCenters,\n) {\n /** @type {Array} */\n let interiorPoints = [];\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n interiorPoints = getInteriorPointOfArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n flatCenters,\n 2 * i,\n interiorPoints,\n );\n offset = ends[ends.length - 1];\n }\n return interiorPoints;\n}\n","/**\n * @module ol/geom/flat/segments\n */\n\n/**\n * This function calls `callback` for each segment of the flat coordinates\n * array. If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {function(import(\"../../coordinate.js\").Coordinate, import(\"../../coordinate.js\").Coordinate): T} callback Function\n * called for each segment.\n * @return {T|boolean} Value.\n * @template T\n */\nexport function forEach(flatCoordinates, offset, end, stride, callback) {\n let ret;\n offset += stride;\n for (; offset < end; offset += stride) {\n ret = callback(\n flatCoordinates.slice(offset - stride, offset),\n flatCoordinates.slice(offset, offset + stride),\n );\n if (ret) {\n return ret;\n }\n }\n return false;\n}\n\n/**\n * Calculate the intersection point of two line segments.\n * Reference: https://stackoverflow.com/a/72474223/2389327\n * @param {Array} segment1 The first line segment as an array of two points.\n * @param {Array} segment2 The second line segment as an array of two points.\n * @return {import(\"../../coordinate.js\").Coordinate|undefined} The intersection point or `undefined` if no intersection.\n */\nexport function getIntersectionPoint(segment1, segment2) {\n const [a, b] = segment1;\n const [c, d] = segment2;\n const t =\n ((a[0] - c[0]) * (c[1] - d[1]) - (a[1] - c[1]) * (c[0] - d[0])) /\n ((a[0] - b[0]) * (c[1] - d[1]) - (a[1] - b[1]) * (c[0] - d[0]));\n const u =\n ((a[0] - c[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (a[0] - b[0])) /\n ((a[0] - b[0]) * (c[1] - d[1]) - (a[1] - b[1]) * (c[0] - d[0]));\n\n // Check if lines actually intersect\n if (0 <= t && t <= 1 && 0 <= u && u <= 1) {\n return [a[0] + t * (b[0] - a[0]), a[1] + t * (b[1] - a[1])];\n }\n return undefined;\n}\n","/**\n * @module ol/geom/flat/intersectsextent\n */\nimport {\n createEmpty,\n extendFlatCoordinates,\n intersects,\n intersectsSegment,\n} from '../../extent.js';\nimport {linearRingContainsExtent, linearRingContainsXY} from './contains.js';\nimport {forEach as forEachSegment} from './segments.js';\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {import('../../extent.js').Extent} [coordinatesExtent] Coordinates extent\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLineString(\n flatCoordinates,\n offset,\n end,\n stride,\n extent,\n coordinatesExtent,\n) {\n coordinatesExtent =\n coordinatesExtent ??\n extendFlatCoordinates(createEmpty(), flatCoordinates, offset, end, stride);\n if (!intersects(extent, coordinatesExtent)) {\n return false;\n }\n if (\n (coordinatesExtent[0] >= extent[0] && coordinatesExtent[2] <= extent[2]) ||\n (coordinatesExtent[1] >= extent[1] && coordinatesExtent[3] <= extent[3])\n ) {\n return true;\n }\n return forEachSegment(\n flatCoordinates,\n offset,\n end,\n stride,\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} point1 Start point.\n * @param {import(\"../../coordinate.js\").Coordinate} point2 End point.\n * @return {boolean} `true` if the segment and the extent intersect,\n * `false` otherwise.\n */\n function (point1, point2) {\n return intersectsSegment(extent, point1, point2);\n },\n );\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLineStringArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n extent,\n) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n if (\n intersectsLineString(flatCoordinates, offset, ends[i], stride, extent)\n ) {\n return true;\n }\n offset = ends[i];\n }\n return false;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRing(\n flatCoordinates,\n offset,\n end,\n stride,\n extent,\n) {\n if (intersectsLineString(flatCoordinates, offset, end, stride, extent)) {\n return true;\n }\n if (\n linearRingContainsXY(\n flatCoordinates,\n offset,\n end,\n stride,\n extent[0],\n extent[1],\n )\n ) {\n return true;\n }\n if (\n linearRingContainsXY(\n flatCoordinates,\n offset,\n end,\n stride,\n extent[0],\n extent[3],\n )\n ) {\n return true;\n }\n if (\n linearRingContainsXY(\n flatCoordinates,\n offset,\n end,\n stride,\n extent[2],\n extent[1],\n )\n ) {\n return true;\n }\n if (\n linearRingContainsXY(\n flatCoordinates,\n offset,\n end,\n stride,\n extent[2],\n extent[3],\n )\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRingArray(\n flatCoordinates,\n offset,\n ends,\n stride,\n extent,\n) {\n if (!intersectsLinearRing(flatCoordinates, offset, ends[0], stride, extent)) {\n return false;\n }\n if (ends.length === 1) {\n return true;\n }\n for (let i = 1, ii = ends.length; i < ii; ++i) {\n if (\n linearRingContainsExtent(\n flatCoordinates,\n ends[i - 1],\n ends[i],\n stride,\n extent,\n )\n ) {\n if (\n !intersectsLineString(\n flatCoordinates,\n ends[i - 1],\n ends[i],\n stride,\n extent,\n )\n ) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nexport function intersectsLinearRingMultiArray(\n flatCoordinates,\n offset,\n endss,\n stride,\n extent,\n) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n if (\n intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent)\n ) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n","/**\n * @module ol/geom/flat/reverse\n */\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n */\nexport function coordinates(flatCoordinates, offset, end, stride) {\n while (offset < end - stride) {\n for (let i = 0; i < stride; ++i) {\n const tmp = flatCoordinates[offset + i];\n flatCoordinates[offset + i] = flatCoordinates[end - stride + i];\n flatCoordinates[end - stride + i] = tmp;\n }\n offset += stride;\n end -= stride;\n }\n}\n","/**\n * @module ol/geom/flat/orient\n */\nimport {coordinates as reverseCoordinates} from './reverse.js';\n\n/**\n * Is the linear ring oriented clockwise in a coordinate system with a bottom-left\n * coordinate origin? For a coordinate system with a top-left coordinate origin,\n * the ring's orientation is clockwise when this function returns false.\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {boolean|undefined} Is clockwise.\n */\nexport function linearRingIsClockwise(flatCoordinates, offset, end, stride) {\n // https://stackoverflow.com/q/1165647/clockwise-method#1165943\n // https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrlinearring.cpp\n let edge = 0;\n let x1 = flatCoordinates[end - stride];\n let y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n edge += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n return edge === 0 ? undefined : edge > 0;\n}\n\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [right] Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nexport function linearRingsAreOriented(\n flatCoordinates,\n offset,\n ends,\n stride,\n right,\n) {\n right = right !== undefined ? right : false;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const isClockwise = linearRingIsClockwise(\n flatCoordinates,\n offset,\n end,\n stride,\n );\n if (i === 0) {\n if ((right && isClockwise) || (!right && !isClockwise)) {\n return false;\n }\n } else {\n if ((right && !isClockwise) || (!right && isClockwise)) {\n return false;\n }\n }\n offset = end;\n }\n return true;\n}\n\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [right] Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nexport function linearRingssAreOriented(\n flatCoordinates,\n offset,\n endss,\n stride,\n right,\n) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n if (!linearRingsAreOriented(flatCoordinates, offset, ends, stride, right)) {\n return false;\n }\n if (ends.length) {\n offset = ends[ends.length - 1];\n }\n }\n return true;\n}\n\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {boolean} [right] Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nexport function orientLinearRings(\n flatCoordinates,\n offset,\n ends,\n stride,\n right,\n) {\n right = right !== undefined ? right : false;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const isClockwise = linearRingIsClockwise(\n flatCoordinates,\n offset,\n end,\n stride,\n );\n const reverse =\n i === 0\n ? (right && isClockwise) || (!right && !isClockwise)\n : (right && !isClockwise) || (!right && isClockwise);\n if (reverse) {\n reverseCoordinates(flatCoordinates, offset, end, stride);\n }\n offset = end;\n }\n return offset;\n}\n\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `right` argument.\n *\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [right] Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nexport function orientLinearRingsArray(\n flatCoordinates,\n offset,\n endss,\n stride,\n right,\n) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n offset = orientLinearRings(\n flatCoordinates,\n offset,\n endss[i],\n stride,\n right,\n );\n }\n return offset;\n}\n\n/**\n * Return a two-dimensional endss\n * @param {Array} flatCoordinates Flat coordinates\n * @param {Array} ends Linear ring end indexes\n * @return {Array>} Two dimensional endss array that can\n * be used to construct a MultiPolygon\n */\nexport function inflateEnds(flatCoordinates, ends) {\n const endss = [];\n let offset = 0;\n let prevEndIndex = 0;\n let startOrientation;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n // classifies an array of rings into polygons with outer rings and holes\n const orientation = linearRingIsClockwise(flatCoordinates, offset, end, 2);\n if (startOrientation === undefined) {\n startOrientation = orientation;\n }\n if (orientation === startOrientation) {\n endss.push(ends.slice(prevEndIndex, i + 1));\n } else {\n if (endss.length === 0) {\n continue;\n }\n endss[endss.length - 1].push(ends[prevEndIndex]);\n }\n prevEndIndex = i + 1;\n offset = end;\n }\n return endss;\n}\n","/**\n * @module ol/geom/Polygon\n */\nimport {extend} from '../array.js';\nimport {closestSquaredDistanceXY, getCenter, isEmpty} from '../extent.js';\nimport {modulo} from '../math.js';\nimport {offset as sphereOffset} from '../sphere.js';\nimport LinearRing from './LinearRing.js';\nimport Point from './Point.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {linearRings as linearRingsArea} from './flat/area.js';\nimport {arrayMaxSquaredDelta, assignClosestArrayPoint} from './flat/closest.js';\nimport {linearRingsContainsXY} from './flat/contains.js';\nimport {deflateCoordinatesArray} from './flat/deflate.js';\nimport {inflateCoordinatesArray} from './flat/inflate.js';\nimport {getInteriorPointOfArray} from './flat/interiorpoint.js';\nimport {intersectsLinearRingArray} from './flat/intersectsextent.js';\nimport {linearRingsAreOriented, orientLinearRings} from './flat/orient.js';\nimport {quantizeArray} from './flat/simplify.js';\n\n/**\n * @classdesc\n * Polygon geometry.\n *\n * @api\n */\nclass Polygon extends SimpleGeometry {\n /**\n * @param {!Array>|!Array} coordinates\n * Array of linear rings that define the polygon. The first linear ring of the\n * array defines the outer-boundary or surface of the polygon. Each subsequent\n * linear ring defines a hole in the surface of the polygon. A linear ring is\n * an array of vertices' coordinates where the first coordinate and the last are\n * equivalent. (For internal use, flat coordinates in combination with\n * `layout` and `ends` are also accepted.)\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array} [ends] Ends (for internal use with flat coordinates).\n */\n constructor(coordinates, layout, ends) {\n super();\n\n /**\n * @type {Array}\n * @private\n */\n this.ends_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.flatInteriorPointRevision_ = -1;\n\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate|null}\n */\n this.flatInteriorPoint_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.orientedRevision_ = -1;\n\n /**\n * @private\n * @type {Array|null}\n */\n this.orientedFlatCoordinates_ = null;\n\n if (layout !== undefined && ends) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array} */ (coordinates),\n );\n this.ends_ = ends;\n } else {\n this.setCoordinates(\n /** @type {Array>} */ (\n coordinates\n ),\n layout,\n );\n }\n }\n\n /**\n * Append the passed linear ring to this polygon.\n * @param {LinearRing} linearRing Linear ring.\n * @api\n */\n appendLinearRing(linearRing) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = linearRing.getFlatCoordinates().slice();\n } else {\n extend(this.flatCoordinates, linearRing.getFlatCoordinates());\n }\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!Polygon} Clone.\n * @api\n * @override\n */\n clone() {\n const polygon = new Polygon(\n this.flatCoordinates.slice(),\n this.layout,\n this.ends_.slice(),\n );\n polygon.applyProperties(this);\n return polygon;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(\n arrayMaxSquaredDelta(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n 0,\n ),\n );\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestArrayPoint(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n this.maxDelta_,\n true,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n * @override\n */\n containsXY(x, y) {\n return linearRingsContainsXY(\n this.getOrientedFlatCoordinates(),\n 0,\n this.ends_,\n this.stride,\n x,\n y,\n );\n }\n\n /**\n * Return the area of the polygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n getArea() {\n return linearRingsArea(\n this.getOrientedFlatCoordinates(),\n 0,\n this.ends_,\n this.stride,\n );\n }\n\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for polygons.\n *\n * @param {boolean} [right] Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array>} Coordinates.\n * @api\n * @override\n */\n getCoordinates(right) {\n let flatCoordinates;\n if (right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n orientLinearRings(flatCoordinates, 0, this.ends_, this.stride, right);\n } else {\n flatCoordinates = this.flatCoordinates;\n }\n\n return inflateCoordinatesArray(flatCoordinates, 0, this.ends_, this.stride);\n }\n\n /**\n * @return {Array} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * @return {Array} Interior point.\n */\n getFlatInteriorPoint() {\n if (this.flatInteriorPointRevision_ != this.getRevision()) {\n const flatCenter = getCenter(this.getExtent());\n this.flatInteriorPoint_ = getInteriorPointOfArray(\n this.getOrientedFlatCoordinates(),\n 0,\n this.ends_,\n this.stride,\n flatCenter,\n 0,\n );\n this.flatInteriorPointRevision_ = this.getRevision();\n }\n return /** @type {import(\"../coordinate.js\").Coordinate} */ (\n this.flatInteriorPoint_\n );\n }\n\n /**\n * Return an interior point of the polygon.\n * @return {Point} Interior point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n * @api\n */\n getInteriorPoint() {\n return new Point(this.getFlatInteriorPoint(), 'XYM');\n }\n\n /**\n * Return the number of rings of the polygon, this includes the exterior\n * ring and any interior rings.\n *\n * @return {number} Number of rings.\n * @api\n */\n getLinearRingCount() {\n return this.ends_.length;\n }\n\n /**\n * Return the Nth linear ring of the polygon geometry. Return `null` if the\n * given index is out of range.\n * The exterior linear ring is available at index `0` and the interior rings\n * at index `1` and beyond.\n *\n * @param {number} index Index.\n * @return {LinearRing|null} Linear ring.\n * @api\n */\n getLinearRing(index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new LinearRing(\n this.flatCoordinates.slice(\n index === 0 ? 0 : this.ends_[index - 1],\n this.ends_[index],\n ),\n this.layout,\n );\n }\n\n /**\n * Return the linear rings of the polygon.\n * @return {Array} Linear rings.\n * @api\n */\n getLinearRings() {\n const layout = this.layout;\n const flatCoordinates = this.flatCoordinates;\n const ends = this.ends_;\n const linearRings = [];\n let offset = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const linearRing = new LinearRing(\n flatCoordinates.slice(offset, end),\n layout,\n );\n linearRings.push(linearRing);\n offset = end;\n }\n return linearRings;\n }\n\n /**\n * @return {Array} Oriented flat coordinates.\n */\n getOrientedFlatCoordinates() {\n if (this.orientedRevision_ != this.getRevision()) {\n const flatCoordinates = this.flatCoordinates;\n if (linearRingsAreOriented(flatCoordinates, 0, this.ends_, this.stride)) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n } else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length = orientLinearRings(\n this.orientedFlatCoordinates_,\n 0,\n this.ends_,\n this.stride,\n );\n }\n this.orientedRevision_ = this.getRevision();\n }\n return /** @type {Array} */ (this.orientedFlatCoordinates_);\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Polygon} Simplified Polygon.\n * @protected\n * @override\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array} */\n const simplifiedEnds = [];\n simplifiedFlatCoordinates.length = quantizeArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n Math.sqrt(squaredTolerance),\n simplifiedFlatCoordinates,\n 0,\n simplifiedEnds,\n );\n return new Polygon(simplifiedFlatCoordinates, 'XY', simplifiedEnds);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'Polygon';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return intersectsLinearRingArray(\n this.getOrientedFlatCoordinates(),\n 0,\n this.ends_,\n this.stride,\n extent,\n );\n }\n\n /**\n * Set the coordinates of the polygon.\n * @param {!Array>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const ends = deflateCoordinatesArray(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n this.ends_,\n );\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n }\n}\n\nexport default Polygon;\n\n/**\n * Create an approximation of a circle on the surface of a sphere.\n * @param {import(\"../coordinate.js\").Coordinate} center Center (`[lon, lat]` in degrees).\n * @param {number} radius The great-circle distance from the center to\n * the polygon vertices in meters.\n * @param {number} [n] Optional number of vertices for the resulting\n * polygon. Default is `32`.\n * @param {number} [sphereRadius] Optional radius for the sphere (defaults to\n * the Earth's mean radius using the WGS84 ellipsoid).\n * @return {Polygon} The \"circular\" polygon.\n * @api\n */\nexport function circular(center, radius, n, sphereRadius) {\n n = n ? n : 32;\n /** @type {Array} */\n const flatCoordinates = [];\n for (let i = 0; i < n; ++i) {\n extend(\n flatCoordinates,\n sphereOffset(center, radius, (2 * Math.PI * i) / n, sphereRadius),\n );\n }\n flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);\n return new Polygon(flatCoordinates, 'XY', [flatCoordinates.length]);\n}\n\n/**\n * Create a polygon from an extent. The layout used is `XY`.\n * @param {import(\"../extent.js\").Extent} extent The extent.\n * @return {Polygon} The polygon.\n * @api\n */\nexport function fromExtent(extent) {\n if (isEmpty(extent)) {\n throw new Error('Cannot create polygon from empty extent');\n }\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const flatCoordinates = [\n minX,\n minY,\n minX,\n maxY,\n maxX,\n maxY,\n maxX,\n minY,\n minX,\n minY,\n ];\n return new Polygon(flatCoordinates, 'XY', [flatCoordinates.length]);\n}\n\n/**\n * Create a regular polygon from a circle.\n * @param {import(\"./Circle.js\").default} circle Circle geometry.\n * @param {number} [sides] Number of sides of the polygon. Default is 32.\n * @param {number} [angle] Start angle for the first vertex of the polygon in\n * counter-clockwise radians. 0 means East. Default is 0.\n * @return {Polygon} Polygon geometry.\n * @api\n */\nexport function fromCircle(circle, sides, angle) {\n sides = sides ? sides : 32;\n const stride = circle.getStride();\n const layout = circle.getLayout();\n const center = circle.getCenter();\n const arrayLength = stride * (sides + 1);\n const flatCoordinates = new Array(arrayLength);\n for (let i = 0; i < arrayLength; i += stride) {\n flatCoordinates[i] = 0;\n flatCoordinates[i + 1] = 0;\n for (let j = 2; j < stride; j++) {\n flatCoordinates[i + j] = center[j];\n }\n }\n const ends = [flatCoordinates.length];\n const polygon = new Polygon(flatCoordinates, layout, ends);\n makeRegular(polygon, center, circle.getRadius(), angle);\n return polygon;\n}\n\n/**\n * Modify the coordinates of a polygon to make it a regular polygon.\n * @param {Polygon} polygon Polygon geometry.\n * @param {import(\"../coordinate.js\").Coordinate} center Center of the regular polygon.\n * @param {number} radius Radius of the regular polygon.\n * @param {number} [angle] Start angle for the first vertex of the polygon in\n * counter-clockwise radians. 0 means East. Default is 0.\n */\nexport function makeRegular(polygon, center, radius, angle) {\n const flatCoordinates = polygon.getFlatCoordinates();\n const stride = polygon.getStride();\n const sides = flatCoordinates.length / stride - 1;\n const startAngle = angle ? angle : 0;\n for (let i = 0; i <= sides; ++i) {\n const offset = i * stride;\n const angle = startAngle + (modulo(i, sides) * 2 * Math.PI) / sides;\n flatCoordinates[offset] = center[0] + radius * Math.cos(angle);\n flatCoordinates[offset + 1] = center[1] + radius * Math.sin(angle);\n }\n polygon.changed();\n}\n","/**\n * @module ol/geom/flat/interpolate\n */\nimport {binarySearch} from '../../array.js';\nimport {lerp} from '../../math.js';\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} fraction Fraction.\n * @param {Array} [dest] Destination.\n * @param {number} [dimension] Destination dimension (default is `2`)\n * @return {Array} Destination.\n */\nexport function interpolatePoint(\n flatCoordinates,\n offset,\n end,\n stride,\n fraction,\n dest,\n dimension,\n) {\n let o, t;\n const n = (end - offset) / stride;\n if (n === 1) {\n o = offset;\n } else if (n === 2) {\n o = offset;\n t = fraction;\n } else if (n !== 0) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n let length = 0;\n const cumulativeLengths = [0];\n for (let i = offset + stride; i < end; i += stride) {\n const x2 = flatCoordinates[i];\n const y2 = flatCoordinates[i + 1];\n length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n cumulativeLengths.push(length);\n x1 = x2;\n y1 = y2;\n }\n const target = fraction * length;\n const index = binarySearch(cumulativeLengths, target);\n if (index < 0) {\n t =\n (target - cumulativeLengths[-index - 2]) /\n (cumulativeLengths[-index - 1] - cumulativeLengths[-index - 2]);\n o = offset + (-index - 2) * stride;\n } else {\n o = offset + index * stride;\n }\n }\n dimension = dimension > 1 ? dimension : 2;\n dest = dest ? dest : new Array(dimension);\n for (let i = 0; i < dimension; ++i) {\n dest[i] =\n o === undefined\n ? NaN\n : t === undefined\n ? flatCoordinates[o + i]\n : lerp(flatCoordinates[o + i], flatCoordinates[o + stride + i], t);\n }\n return dest;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} m M.\n * @param {boolean} extrapolate Extrapolate.\n * @return {import(\"../../coordinate.js\").Coordinate|null} Coordinate.\n */\nexport function lineStringCoordinateAtM(\n flatCoordinates,\n offset,\n end,\n stride,\n m,\n extrapolate,\n) {\n if (end == offset) {\n return null;\n }\n let coordinate;\n if (m < flatCoordinates[offset + stride - 1]) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(offset, offset + stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n if (flatCoordinates[end - 1] < m) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(end - stride, end);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n // FIXME use O(1) search\n if (m == flatCoordinates[offset + stride - 1]) {\n return flatCoordinates.slice(offset, offset + stride);\n }\n let lo = offset / stride;\n let hi = end / stride;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (m < flatCoordinates[(mid + 1) * stride - 1]) {\n hi = mid;\n } else {\n lo = mid + 1;\n }\n }\n const m0 = flatCoordinates[lo * stride - 1];\n if (m == m0) {\n return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride);\n }\n const m1 = flatCoordinates[(lo + 1) * stride - 1];\n const t = (m - m0) / (m1 - m0);\n coordinate = [];\n for (let i = 0; i < stride - 1; ++i) {\n coordinate.push(\n lerp(\n flatCoordinates[(lo - 1) * stride + i],\n flatCoordinates[lo * stride + i],\n t,\n ),\n );\n }\n coordinate.push(m);\n return coordinate;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {number} m M.\n * @param {boolean} extrapolate Extrapolate.\n * @param {boolean} interpolate Interpolate.\n * @return {import(\"../../coordinate.js\").Coordinate|null} Coordinate.\n */\nexport function lineStringsCoordinateAtM(\n flatCoordinates,\n offset,\n ends,\n stride,\n m,\n extrapolate,\n interpolate,\n) {\n if (interpolate) {\n return lineStringCoordinateAtM(\n flatCoordinates,\n offset,\n ends[ends.length - 1],\n stride,\n m,\n extrapolate,\n );\n }\n let coordinate;\n if (m < flatCoordinates[stride - 1]) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(0, stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n if (flatCoordinates[flatCoordinates.length - 1] < m) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(flatCoordinates.length - stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n if (offset == end) {\n continue;\n }\n if (m < flatCoordinates[offset + stride - 1]) {\n return null;\n }\n if (m <= flatCoordinates[end - 1]) {\n return lineStringCoordinateAtM(\n flatCoordinates,\n offset,\n end,\n stride,\n m,\n false,\n );\n }\n offset = end;\n }\n return null;\n}\n","/**\n * @module ol/geom/flat/length\n */\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Length.\n */\nexport function lineStringLength(flatCoordinates, offset, end, stride) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n let length = 0;\n for (let i = offset + stride; i < end; i += stride) {\n const x2 = flatCoordinates[i];\n const y2 = flatCoordinates[i + 1];\n length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n x1 = x2;\n y1 = y2;\n }\n return length;\n}\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Perimeter.\n */\nexport function linearRingLength(flatCoordinates, offset, end, stride) {\n let perimeter = lineStringLength(flatCoordinates, offset, end, stride);\n const dx = flatCoordinates[end - stride] - flatCoordinates[offset];\n const dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1];\n perimeter += Math.sqrt(dx * dx + dy * dy);\n return perimeter;\n}\n","/**\n * @module ol/geom/LineString\n */\nimport {extend} from '../array.js';\nimport {closestSquaredDistanceXY} from '../extent.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {assignClosestPoint, maxSquaredDelta} from './flat/closest.js';\nimport {deflateCoordinates} from './flat/deflate.js';\nimport {inflateCoordinates} from './flat/inflate.js';\nimport {interpolatePoint, lineStringCoordinateAtM} from './flat/interpolate.js';\nimport {intersectsLineString} from './flat/intersectsextent.js';\nimport {lineStringLength} from './flat/length.js';\nimport {forEach as forEachSegment} from './flat/segments.js';\nimport {douglasPeucker} from './flat/simplify.js';\n\n/**\n * @classdesc\n * Linestring geometry.\n *\n * @api\n */\nclass LineString extends SimpleGeometry {\n /**\n * @param {Array|Array} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate|null}\n */\n this.flatMidpoint_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.flatMidpointRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n if (layout !== undefined && !Array.isArray(coordinates[0])) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array} */ (coordinates),\n );\n } else {\n this.setCoordinates(\n /** @type {Array} */ (\n coordinates\n ),\n layout,\n );\n }\n }\n\n /**\n * Append the passed coordinate to the coordinates of the linestring.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @api\n */\n appendCoordinate(coordinate) {\n extend(this.flatCoordinates, coordinate);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!LineString} Clone.\n * @api\n * @override\n */\n clone() {\n const lineString = new LineString(\n this.flatCoordinates.slice(),\n this.layout,\n );\n lineString.applyProperties(this);\n return lineString;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(\n maxSquaredDelta(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n 0,\n ),\n );\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestPoint(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n this.maxDelta_,\n false,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n\n /**\n * Iterate over each segment, calling the provided callback.\n * If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n *\n * @param {function(this: S, import(\"../coordinate.js\").Coordinate, import(\"../coordinate.js\").Coordinate): T} callback Function\n * called for each segment. The function will receive two arguments, the start and end coordinates of the segment.\n * @return {T|boolean} Value.\n * @template T,S\n * @api\n */\n forEachSegment(callback) {\n return forEachSegment(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n callback,\n );\n }\n\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * @param {number} m M.\n * @param {boolean} [extrapolate] Extrapolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate|null} Coordinate.\n * @api\n */\n getCoordinateAtM(m, extrapolate) {\n if (this.layout != 'XYM' && this.layout != 'XYZM') {\n return null;\n }\n extrapolate = extrapolate !== undefined ? extrapolate : false;\n return lineStringCoordinateAtM(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n m,\n extrapolate,\n );\n }\n\n /**\n * Return the coordinates of the linestring.\n * @return {Array} Coordinates.\n * @api\n * @override\n */\n getCoordinates() {\n return inflateCoordinates(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n );\n }\n\n /**\n * Return the coordinate at the provided fraction along the linestring.\n * The `fraction` is a number between 0 and 1, where 0 is the start of the\n * linestring and 1 is the end.\n * @param {number} fraction Fraction.\n * @param {import(\"../coordinate.js\").Coordinate} [dest] Optional coordinate whose values will\n * be modified. If not provided, a new coordinate will be returned.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinate of the interpolated point.\n * @api\n */\n getCoordinateAt(fraction, dest) {\n return interpolatePoint(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n fraction,\n dest,\n this.stride,\n );\n }\n\n /**\n * Return the length of the linestring on projected plane.\n * @return {number} Length (on projected plane).\n * @api\n */\n getLength() {\n return lineStringLength(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n );\n }\n\n /**\n * @return {Array} Flat midpoint.\n */\n getFlatMidpoint() {\n if (this.flatMidpointRevision_ != this.getRevision()) {\n this.flatMidpoint_ = this.getCoordinateAt(\n 0.5,\n this.flatMidpoint_ ?? undefined,\n );\n this.flatMidpointRevision_ = this.getRevision();\n }\n return /** @type {Array} */ (this.flatMidpoint_);\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LineString} Simplified LineString.\n * @protected\n * @override\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array} */\n const simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = douglasPeucker(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n );\n return new LineString(simplifiedFlatCoordinates, 'XY');\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'LineString';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return intersectsLineString(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n extent,\n this.getExtent(),\n );\n }\n\n /**\n * Set the coordinates of the linestring.\n * @param {!Array} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n );\n this.changed();\n }\n}\n\nexport default LineString;\n","/**\n * @module ol/render/EventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered before a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#prerender\n * @api\n */\n PRERENDER: 'prerender',\n\n /**\n * Triggered after a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n\n /**\n * Triggered before layers are composed. When dispatched by the map, the event object will not have\n * a `context` set. When dispatched by a layer, the event object will have a `context` set. Only\n * WebGL layers currently dispatch this event.\n * @event module:ol/render/Event~RenderEvent#precompose\n * @api\n */\n PRECOMPOSE: 'precompose',\n\n /**\n * Triggered after layers are composed. When dispatched by the map, the event object will not have\n * a `context` set. When dispatched by a layer, the event object will have a `context` set. Only\n * WebGL layers currently dispatch this event.\n * @event module:ol/render/Event~RenderEvent#postcompose\n * @api\n */\n POSTCOMPOSE: 'postcompose',\n\n /**\n * Triggered when rendering is complete, i.e. all sources and tiles have\n * finished loading for the current viewport, and all tiles are faded in.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#rendercomplete\n * @api\n */\n RENDERCOMPLETE: 'rendercomplete',\n};\n\n/**\n * @typedef {'postrender'|'precompose'|'postcompose'|'rendercomplete'} MapRenderEventTypes\n */\n\n/**\n * @typedef {'postrender'|'prerender'} LayerRenderEventTypes\n */\n","/**\n * @module ol/has\n */\n\nconst ua =\n typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined'\n ? navigator.userAgent.toLowerCase()\n : '';\n\n/**\n * User agent string says we are dealing with Safari as browser.\n * @type {boolean}\n */\nexport const SAFARI = ua.includes('safari') && !ua.includes('chrom');\n\n/**\n * https://bugs.webkit.org/show_bug.cgi?id=237906\n * @type {boolean}\n */\nexport const SAFARI_BUG_237906 =\n SAFARI &&\n (ua.includes('version/15.4') ||\n /cpu (os|iphone os) 15_4 like mac os x/.test(ua));\n\n/**\n * User agent string says we are dealing with a WebKit engine.\n * @type {boolean}\n */\nexport const WEBKIT = ua.includes('webkit') && !ua.includes('edge');\n\n/**\n * User agent string says we are dealing with a Mac as platform.\n * @type {boolean}\n */\nexport const MAC = ua.includes('macintosh');\n\n/**\n * The ratio between physical pixels and device-independent pixels\n * (dips) on the device (`window.devicePixelRatio`).\n * @const\n * @type {number}\n * @api\n */\nexport const DEVICE_PIXEL_RATIO =\n typeof devicePixelRatio !== 'undefined' ? devicePixelRatio : 1;\n\n/**\n * The execution context is a worker with OffscreenCanvas available.\n * @const\n * @type {boolean}\n */\nexport const WORKER_OFFSCREEN_CANVAS =\n typeof WorkerGlobalScope !== 'undefined' &&\n typeof OffscreenCanvas !== 'undefined' &&\n self instanceof WorkerGlobalScope; //eslint-disable-line\n\n/**\n * Image.prototype.decode() is supported.\n * @type {boolean}\n */\nexport const IMAGE_DECODE =\n typeof Image !== 'undefined' && Image.prototype.decode;\n\n/**\n * createImageBitmap() is supported.\n * @type {boolean}\n */\nexport const CREATE_IMAGE_BITMAP = typeof createImageBitmap === 'function';\n\n/**\n * @type {boolean}\n */\nexport const PASSIVE_EVENT_LISTENERS = (function () {\n let passive = false;\n try {\n const options = Object.defineProperty({}, 'passive', {\n get: function () {\n passive = true;\n },\n });\n\n // @ts-ignore Ignore invalid event type '_'\n window.addEventListener('_', null, options);\n // @ts-ignore Ignore invalid event type '_'\n window.removeEventListener('_', null, options);\n } catch {\n // passive not supported\n }\n return passive;\n})();\n","/**\n * @module ol/ImageState\n */\n\n/**\n * @enum {number}\n */\nexport default {\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n ERROR: 3,\n EMPTY: 4,\n};\n","import {WORKER_OFFSCREEN_CANVAS} from './has.js';\n\n/**\n * @module ol/dom\n */\n\n//FIXME Move this function to the canvas module\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number} [width] Canvas width.\n * @param {number} [height] Canvas height.\n * @param {Array} [canvasPool] Canvas pool to take existing canvas from.\n * @param {CanvasRenderingContext2DSettings} [settings] CanvasRenderingContext2DSettings\n * @return {CanvasRenderingContext2D} The context.\n */\nexport function createCanvasContext2D(width, height, canvasPool, settings) {\n /** @type {HTMLCanvasElement|OffscreenCanvas} */\n let canvas;\n if (canvasPool && canvasPool.length) {\n canvas = /** @type {HTMLCanvasElement} */ (canvasPool.shift());\n } else if (WORKER_OFFSCREEN_CANVAS) {\n canvas = new OffscreenCanvas(width || 300, height || 300);\n } else {\n canvas = document.createElement('canvas');\n }\n if (width) {\n canvas.width = width;\n }\n if (height) {\n canvas.height = height;\n }\n //FIXME Allow OffscreenCanvasRenderingContext2D as return type\n return /** @type {CanvasRenderingContext2D} */ (\n canvas.getContext('2d', settings)\n );\n}\n\n/** @type {CanvasRenderingContext2D} */\nlet sharedCanvasContext;\n\n/**\n * @return {CanvasRenderingContext2D} Shared canvas context.\n */\nexport function getSharedCanvasContext2D() {\n if (!sharedCanvasContext) {\n sharedCanvasContext = createCanvasContext2D(1, 1);\n }\n return sharedCanvasContext;\n}\n\n/**\n * Releases canvas memory to avoid exceeding memory limits in Safari.\n * See https://pqina.nl/blog/total-canvas-memory-use-exceeds-the-maximum-limit/\n * @param {CanvasRenderingContext2D} context Context.\n */\nexport function releaseCanvas(context) {\n const canvas = context.canvas;\n canvas.width = 1;\n canvas.height = 1;\n context.clearRect(0, 0, 1, 1);\n}\n\n/**\n * Get the current computed width for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerWidth(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The width.\n */\nexport function outerWidth(element) {\n let width = element.offsetWidth;\n const style = getComputedStyle(element);\n width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);\n\n return width;\n}\n\n/**\n * Get the current computed height for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerHeight(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The height.\n */\nexport function outerHeight(element) {\n let height = element.offsetHeight;\n const style = getComputedStyle(element);\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n\n return height;\n}\n\n/**\n * @param {Node} newNode Node to replace old node\n * @param {Node} oldNode The node to be replaced\n */\nexport function replaceNode(newNode, oldNode) {\n const parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n}\n\n/**\n * @param {Node} node The node to remove the children from.\n */\nexport function removeChildren(node) {\n while (node.lastChild) {\n node.lastChild.remove();\n }\n}\n\n/**\n * Transform the children of a parent node so they match the\n * provided list of children. This function aims to efficiently\n * remove, add, and reorder child nodes while maintaining a simple\n * implementation (it is not guaranteed to minimize DOM operations).\n * @param {Node} node The parent node whose children need reworking.\n * @param {Array} children The desired children.\n */\nexport function replaceChildren(node, children) {\n const oldChildren = node.childNodes;\n\n for (let i = 0; true; ++i) {\n const oldChild = oldChildren[i];\n const newChild = children[i];\n\n // check if our work is done\n if (!oldChild && !newChild) {\n break;\n }\n\n // check if children match\n if (oldChild === newChild) {\n continue;\n }\n\n // check if a new child needs to be added\n if (!oldChild) {\n node.appendChild(newChild);\n continue;\n }\n\n // check if an old child needs to be removed\n if (!newChild) {\n node.removeChild(oldChild);\n --i;\n continue;\n }\n\n // reorder\n node.insertBefore(newChild, oldChild);\n }\n}\n","/**\n * @module ol/color\n */\nimport {createCanvasContext2D} from './dom.js';\nimport {clamp, toFixed} from './math.js';\n\n/**\n * A color represented as a short array [red, green, blue, alpha].\n * red, green, and blue should be integers in the range 0..255 inclusive.\n * alpha should be a float in the range 0..1 inclusive. If no alpha value is\n * given then `1` will be used.\n * @typedef {Array} Color\n * @api\n */\n\n/**\n * Color to indicate that no color should be rendered. This is meant to be used for per-reference\n * comparisons only.\n * @type {Color}\n */\nexport const NO_COLOR = [NaN, NaN, NaN, 0];\n\nlet colorParseContext;\n/**\n * @return {CanvasRenderingContext2D} The color parse context\n */\nfunction getColorParseContext() {\n if (!colorParseContext) {\n colorParseContext = createCanvasContext2D(1, 1, undefined, {\n willReadFrequently: true,\n desynchronized: true,\n });\n }\n return colorParseContext;\n}\n\nconst rgbModernRegEx =\n /^rgba?\\(\\s*(\\d+%?)\\s+(\\d+%?)\\s+(\\d+%?)(?:\\s*\\/\\s*(\\d+%|\\d*\\.\\d+|[01]))?\\s*\\)$/i;\nconst rgbLegacyAbsoluteRegEx =\n /^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*(\\d+%|\\d*\\.\\d+|[01]))?\\s*\\)$/i;\nconst rgbLegacyPercentageRegEx =\n /^rgba?\\(\\s*(\\d+%)\\s*,\\s*(\\d+%)\\s*,\\s*(\\d+%)(?:\\s*,\\s*(\\d+%|\\d*\\.\\d+|[01]))?\\s*\\)$/i;\nconst hexRegEx = /^#([\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i;\n\n/**\n * @param {string} s Color component as number or percentage.\n * @param {number} divider Divider for percentage.\n * @return {number} Color component.\n */\nfunction toColorComponent(s, divider) {\n return s.endsWith('%')\n ? Number(s.substring(0, s.length - 1)) / divider\n : Number(s);\n}\n\n/**\n * @param {string} color Color string.\n */\nfunction throwInvalidColor(color) {\n throw new Error('failed to parse \"' + color + '\" as color');\n}\n\n/**\n * @param {string} color Color string.\n * @return {Color} RGBa color array.\n */\nfunction parseRgba(color) {\n // Fast lane for rgb(a) colors\n if (color.toLowerCase().startsWith('rgb')) {\n const rgb =\n color.match(rgbLegacyAbsoluteRegEx) ||\n color.match(rgbModernRegEx) ||\n color.match(rgbLegacyPercentageRegEx);\n if (rgb) {\n const alpha = rgb[4];\n const rgbDivider = 100 / 255;\n return [\n clamp((toColorComponent(rgb[1], rgbDivider) + 0.5) | 0, 0, 255),\n clamp((toColorComponent(rgb[2], rgbDivider) + 0.5) | 0, 0, 255),\n clamp((toColorComponent(rgb[3], rgbDivider) + 0.5) | 0, 0, 255),\n alpha !== undefined ? clamp(toColorComponent(alpha, 100), 0, 1) : 1,\n ];\n }\n throwInvalidColor(color);\n }\n // Fast lane for hex colors (also with alpha)\n if (color.startsWith('#')) {\n if (hexRegEx.test(color)) {\n const hex = color.substring(1);\n const step = hex.length <= 4 ? 1 : 2;\n const colorFromHex = [0, 0, 0, 255];\n for (let i = 0, ii = hex.length; i < ii; i += step) {\n let colorComponent = parseInt(hex.substring(i, i + step), 16);\n if (step === 1) {\n colorComponent += colorComponent << 4;\n }\n colorFromHex[i / step] = colorComponent;\n }\n colorFromHex[3] = colorFromHex[3] / 255;\n return colorFromHex;\n }\n throwInvalidColor(color);\n }\n // Use canvas color serialization to parse the color into hex or rgba\n // See https://www.w3.org/TR/2021/SPSD-2dcontext-20210128/#serialization-of-a-color\n const context = getColorParseContext();\n context.fillStyle = '#abcdef';\n let invalidCheckFillStyle = context.fillStyle;\n context.fillStyle = color;\n if (context.fillStyle === invalidCheckFillStyle) {\n context.fillStyle = '#fedcba';\n invalidCheckFillStyle = context.fillStyle;\n context.fillStyle = color;\n if (context.fillStyle === invalidCheckFillStyle) {\n throwInvalidColor(color);\n }\n }\n const colorString = context.fillStyle;\n if (colorString.startsWith('#') || colorString.startsWith('rgba')) {\n return parseRgba(colorString);\n }\n context.clearRect(0, 0, 1, 1);\n context.fillRect(0, 0, 1, 1);\n const colorFromImage = Array.from(context.getImageData(0, 0, 1, 1).data);\n colorFromImage[3] = toFixed(colorFromImage[3] / 255, 3);\n return colorFromImage;\n}\n\n/**\n * Return the color as an rgba string.\n * @param {Color|string} color Color.\n * @return {string} Rgba string.\n * @api\n */\nexport function asString(color) {\n if (typeof color === 'string') {\n return color;\n }\n return toString(color);\n}\n\n/**\n * @type {number}\n */\nconst MAX_CACHE_SIZE = 1024;\n\n/**\n * We maintain a small cache of parsed strings. Whenever the cache grows too large,\n * we delete an arbitrary set of the entries.\n *\n * @type {Object}\n */\nconst cache = {};\n\n/**\n * @type {number}\n */\nlet cacheSize = 0;\n\n/**\n * @param {Color} color A color that may or may not have an alpha channel.\n * @return {Color} The input color with an alpha channel. If the input color has\n * an alpha channel, the input color will be returned unchanged. Otherwise, a new\n * array will be returned with the input color and an alpha channel of 1.\n */\nexport function withAlpha(color) {\n if (color.length === 4) {\n return color;\n }\n const output = color.slice();\n output[3] = 1;\n return output;\n}\n\n// The functions b1, b2, a1, a2, rgbaToLcha and lchaToRgba below are adapted from\n// https://stackoverflow.com/a/67219995/2389327\n\n/**\n * @param {number} v Input value.\n * @return {number} Output value.\n */\nfunction b1(v) {\n return v > 0.0031308 ? Math.pow(v, 1 / 2.4) * 269.025 - 14.025 : v * 3294.6;\n}\n\n/**\n * @param {number} v Input value.\n * @return {number} Output value.\n */\nfunction b2(v) {\n return v > 0.2068965 ? Math.pow(v, 3) : (v - 4 / 29) * (108 / 841);\n}\n\n/**\n * @param {number} v Input value.\n * @return {number} Output value.\n */\nfunction a1(v) {\n return v > 10.314724 ? Math.pow((v + 14.025) / 269.025, 2.4) : v / 3294.6;\n}\n\n/**\n * @param {number} v Input value.\n * @return {number} Output value.\n */\nfunction a2(v) {\n return v > 0.0088564 ? Math.pow(v, 1 / 3) : v / (108 / 841) + 4 / 29;\n}\n\n/**\n * @param {Color} color RGBA color.\n * @return {Color} LCHuv color with alpha.\n */\nexport function rgbaToLcha(color) {\n const r = a1(color[0]);\n const g = a1(color[1]);\n const b = a1(color[2]);\n const y = a2(r * 0.222488403 + g * 0.716873169 + b * 0.06060791);\n const l = 500 * (a2(r * 0.452247074 + g * 0.399439023 + b * 0.148375274) - y);\n const q = 200 * (y - a2(r * 0.016863605 + g * 0.117638439 + b * 0.865350722));\n const h = Math.atan2(q, l) * (180 / Math.PI);\n return [\n 116 * y - 16,\n Math.sqrt(l * l + q * q),\n h < 0 ? h + 360 : h,\n color[3],\n ];\n}\n\n/**\n * @param {Color} color LCHuv color with alpha.\n * @return {Color} RGBA color.\n */\nexport function lchaToRgba(color) {\n const l = (color[0] + 16) / 116;\n const c = color[1];\n const h = (color[2] * Math.PI) / 180;\n const y = b2(l);\n const x = b2(l + (c / 500) * Math.cos(h));\n const z = b2(l - (c / 200) * Math.sin(h));\n const r = b1(x * 3.021973625 - y * 1.617392459 - z * 0.404875592);\n const g = b1(x * -0.943766287 + y * 1.916279586 + z * 0.027607165);\n const b = b1(x * 0.069407491 - y * 0.22898585 + z * 1.159737864);\n return [\n clamp((r + 0.5) | 0, 0, 255),\n clamp((g + 0.5) | 0, 0, 255),\n clamp((b + 0.5) | 0, 0, 255),\n color[3],\n ];\n}\n\n/**\n * @param {string} s String.\n * @return {Color} Color.\n */\nexport function fromString(s) {\n if (s === 'none') {\n return NO_COLOR;\n }\n if (cache.hasOwnProperty(s)) {\n return cache[s];\n }\n if (cacheSize >= MAX_CACHE_SIZE) {\n let i = 0;\n for (const key in cache) {\n if ((i++ & 3) === 0) {\n delete cache[key];\n --cacheSize;\n }\n }\n }\n\n const color = parseRgba(s);\n if (color.length !== 4) {\n throwInvalidColor(s);\n }\n for (const c of color) {\n if (isNaN(c)) {\n throwInvalidColor(s);\n }\n }\n cache[s] = color;\n ++cacheSize;\n return color;\n}\n\n/**\n * Return the color as an array. This function maintains a cache of calculated\n * arrays which means the result should not be modified.\n * @param {Color|string} color Color.\n * @return {Color} Color.\n * @api\n */\nexport function asArray(color) {\n if (Array.isArray(color)) {\n return color;\n }\n return fromString(color);\n}\n\n/**\n * @param {Color} color Color.\n * @return {string} String.\n */\nexport function toString(color) {\n let r = color[0];\n if (r != (r | 0)) {\n r = (r + 0.5) | 0;\n }\n let g = color[1];\n if (g != (g | 0)) {\n g = (g + 0.5) | 0;\n }\n let b = color[2];\n if (b != (b | 0)) {\n b = (b + 0.5) | 0;\n }\n const a = color[3] === undefined ? 1 : Math.round(color[3] * 1000) / 1000;\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n}\n\n/**\n * @param {string} s String.\n * @return {boolean} Whether the string is actually a valid color\n */\nexport function isStringColor(s) {\n try {\n fromString(s);\n return true;\n } catch {\n return false;\n }\n}\n","/**\n * @module ol/Image\n */\nimport ImageState from './ImageState.js';\nimport EventType from './events/EventType.js';\nimport EventTarget from './events/Target.js';\nimport {listenOnce, unlistenByKey} from './events.js';\nimport {toPromise} from './functions.js';\nimport {CREATE_IMAGE_BITMAP, IMAGE_DECODE} from './has.js';\n\n/**\n * A function that takes an {@link module:ol/Image~ImageWrapper} for the image and a\n * `{string}` for the src as arguments. It is supposed to make it so the\n * underlying image {@link module:ol/Image~ImageWrapper#getImage} is assigned the\n * content specified by the src. If not specified, the default is\n *\n * function(image, src) {\n * image.getImage().src = src;\n * }\n *\n * Providing a custom `imageLoadFunction` can be useful to load images with\n * post requests or - in general - through XHR requests, where the src of the\n * image element would be set to a data URI when the content is loaded.\n *\n * @typedef {function(import(\"./Image.js\").default, string): void} LoadFunction\n * @api\n */\n\n/**\n * @typedef {Object} ImageObject\n * @property {import(\"./extent.js\").Extent} [extent] Extent, if different from the requested one.\n * @property {import(\"./resolution.js\").ResolutionLike} [resolution] Resolution, if different from the requested one.\n * When x and y resolution are different, use the array type (`[xResolution, yResolution]`).\n * @property {number} [pixelRatio] Pixel ratio, if different from the requested one.\n * @property {import('./DataTile.js').ImageLike} image Image.\n */\n\n/**\n * Loader function used for image sources. Receives extent, resolution and pixel ratio as arguments.\n * For images that cover any extent and resolution (static images), the loader function should not accept\n * any arguments. The function returns an {@link import(\"./DataTile.js\").ImageLike image}, an\n * {@link import(\"./Image.js\").ImageObject image object}, or a promise for the same.\n * For loaders that generate images, the promise should not resolve until the image is loaded.\n * If the returned image does not match the extent, resolution or pixel ratio passed to the loader,\n * it has to return an {@link import(\"./Image.js\").ImageObject image object} with the `image` and the\n * correct `extent`, `resolution` and `pixelRatio`.\n *\n * @typedef {function(import(\"./extent.js\").Extent, number, number, (function(HTMLImageElement, string): void)=): import(\"./DataTile.js\").ImageLike|ImageObject|Promise} Loader\n * @api\n */\n\n/**\n * Loader function used for image sources. Receives extent, resolution and pixel ratio as arguments.\n * The function returns a promise for an {@link import(\"./Image.js\").ImageObject image object}.\n *\n * @typedef {function(import(\"./extent.js\").Extent, number, number, (function(HTMLImageElement, string): void)=): Promise} ImageObjectPromiseLoader\n */\n\nclass ImageWrapper extends EventTarget {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number|Array|undefined} resolution Resolution. If provided as array, x and y\n * resolution will be assumed.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./ImageState.js\").default|Loader} stateOrLoader State.\n */\n constructor(extent, resolution, pixelRatio, stateOrLoader) {\n super();\n\n /**\n * @protected\n * @type {import(\"./extent.js\").Extent}\n */\n this.extent = extent;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @protected\n * @type {number|Array|undefined}\n */\n this.resolution = resolution;\n\n /**\n * @protected\n * @type {import(\"./ImageState.js\").default}\n */\n this.state =\n typeof stateOrLoader === 'function' ? ImageState.IDLE : stateOrLoader;\n\n /**\n * @private\n * @type {import('./DataTile.js').ImageLike|null}\n */\n this.image_ = null;\n\n /**\n * @protected\n * @type {Loader|null}\n */\n this.loader = typeof stateOrLoader === 'function' ? stateOrLoader : null;\n }\n\n /**\n * @protected\n */\n changed() {\n this.dispatchEvent(EventType.CHANGE);\n }\n\n /**\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n getExtent() {\n return this.extent;\n }\n\n /**\n * @return {import('./DataTile.js').ImageLike} Image.\n */\n getImage() {\n return this.image_;\n }\n\n /**\n * @return {number} PixelRatio.\n */\n getPixelRatio() {\n return this.pixelRatio_;\n }\n\n /**\n * @return {number|Array} Resolution.\n */\n getResolution() {\n return /** @type {number} */ (this.resolution);\n }\n\n /**\n * @return {import(\"./ImageState.js\").default} State.\n */\n getState() {\n return this.state;\n }\n\n /**\n * Load not yet loaded URI.\n */\n load() {\n if (this.state == ImageState.IDLE) {\n if (this.loader) {\n this.state = ImageState.LOADING;\n this.changed();\n const resolution = this.getResolution();\n const requestResolution = Array.isArray(resolution)\n ? resolution[0]\n : resolution;\n toPromise(() =>\n this.loader(\n this.getExtent(),\n requestResolution,\n this.getPixelRatio(),\n ),\n )\n .then((image) => {\n if ('image' in image) {\n this.image_ = image.image;\n }\n if ('extent' in image) {\n this.extent = image.extent;\n }\n if ('resolution' in image) {\n this.resolution = image.resolution;\n }\n if ('pixelRatio' in image) {\n this.pixelRatio_ = image.pixelRatio;\n }\n if (\n image instanceof HTMLImageElement ||\n (CREATE_IMAGE_BITMAP && image instanceof ImageBitmap) ||\n image instanceof HTMLCanvasElement ||\n image instanceof HTMLVideoElement\n ) {\n this.image_ = image;\n }\n this.state = ImageState.LOADED;\n })\n .catch((error) => {\n this.state = ImageState.ERROR;\n console.error(error); // eslint-disable-line no-console\n })\n .finally(() => this.changed());\n }\n }\n }\n\n /**\n * @param {import('./DataTile.js').ImageLike} image The image.\n */\n setImage(image) {\n this.image_ = image;\n }\n\n /**\n * @param {number|Array} resolution Resolution.\n */\n setResolution(resolution) {\n this.resolution = resolution;\n }\n}\n\n/**\n * @param {import('./DataTile.js').ImageLike} image Image element.\n * @param {function():any} loadHandler Load callback function.\n * @param {function():any} errorHandler Error callback function.\n * @return {function():void} Callback to stop listening.\n */\nexport function listenImage(image, loadHandler, errorHandler) {\n const img = /** @type {HTMLImageElement} */ (image);\n let listening = true;\n let decoding = false;\n let loaded = false;\n\n const listenerKeys = [\n listenOnce(img, EventType.LOAD, function () {\n loaded = true;\n if (!decoding) {\n loadHandler();\n }\n }),\n ];\n\n if (img.src && IMAGE_DECODE) {\n decoding = true;\n img\n .decode()\n .then(function () {\n if (listening) {\n loadHandler();\n }\n })\n .catch(function (error) {\n if (listening) {\n if (loaded) {\n loadHandler();\n } else {\n errorHandler();\n }\n }\n });\n } else {\n listenerKeys.push(listenOnce(img, EventType.ERROR, errorHandler));\n }\n\n return function unlisten() {\n listening = false;\n listenerKeys.forEach(unlistenByKey);\n };\n}\n\n/**\n * Loads an image.\n * @param {HTMLImageElement} image Image, not yet loaded.\n * @param {string} [src] `src` attribute of the image. Optional, not required if already present.\n * @return {Promise} Promise resolving to an `HTMLImageElement`.\n * @api\n */\nexport function load(image, src) {\n return new Promise((resolve, reject) => {\n function handleLoad() {\n unlisten();\n resolve(image);\n }\n function handleError() {\n unlisten();\n reject(new Error('Image load error'));\n }\n function unlisten() {\n image.removeEventListener('load', handleLoad);\n image.removeEventListener('error', handleError);\n }\n image.addEventListener('load', handleLoad);\n image.addEventListener('error', handleError);\n if (src) {\n image.src = src;\n }\n });\n}\n\n/**\n * @param {HTMLImageElement} image Image, not yet loaded.\n * @param {string} [src] `src` attribute of the image. Optional, not required if already present.\n * @return {Promise} Promise resolving to an `HTMLImageElement`.\n */\nexport function decodeFallback(image, src) {\n if (src) {\n image.src = src;\n }\n return image.src && IMAGE_DECODE\n ? new Promise((resolve, reject) =>\n image\n .decode()\n .then(() => resolve(image))\n .catch((e) =>\n image.complete && image.width ? resolve(image) : reject(e),\n ),\n )\n : load(image);\n}\n\n/**\n * Loads an image and decodes it to an `ImageBitmap` if `createImageBitmap()` is supported. Returns\n * the loaded image otherwise.\n * @param {HTMLImageElement} image Image, not yet loaded.\n * @param {string} [src] `src` attribute of the image. Optional, not required if already present.\n * @return {Promise} Promise resolving to an `ImageBitmap` or an\n * `HTMLImageElement` if `createImageBitmap()` is not supported.\n * @api\n */\nexport function decode(image, src) {\n if (src) {\n image.src = src;\n }\n return image.src && IMAGE_DECODE && CREATE_IMAGE_BITMAP\n ? image\n .decode()\n .then(() => createImageBitmap(image))\n .catch((e) => {\n if (image.complete && image.width) {\n return image;\n }\n throw e;\n })\n : decodeFallback(image);\n}\n\nexport default ImageWrapper;\n","/**\n * @module ol/style/IconImageCache\n */\nimport ImageState from '../ImageState.js';\nimport {asArray} from '../color.js';\nimport {getSharedCanvasContext2D} from '../dom.js';\n\n/**\n * @classdesc\n * Singleton class. Available through {@link module:ol/style/IconImageCache.shared}.\n */\nclass IconImageCache {\n constructor() {\n /**\n * @type {!Object}\n * @private\n */\n this.cache_ = {};\n\n /**\n * @type {!Object}\n * @private\n */\n this.patternCache_ = {};\n\n /**\n * @type {number}\n * @private\n */\n this.cacheSize_ = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.maxCacheSize_ = 1024;\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n clear() {\n this.cache_ = {};\n this.patternCache_ = {};\n this.cacheSize_ = 0;\n }\n\n /**\n * @return {boolean} Can expire cache.\n */\n canExpireCache() {\n return this.cacheSize_ > this.maxCacheSize_;\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n expire() {\n if (this.canExpireCache()) {\n let i = 0;\n for (const key in this.cache_) {\n const iconImage = this.cache_[key];\n if ((i++ & 3) === 0 && !iconImage.hasListener()) {\n delete this.cache_[key];\n delete this.patternCache_[key];\n --this.cacheSize_;\n }\n }\n }\n }\n\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color|string|null} color Color.\n * @return {import(\"./IconImage.js\").default} Icon image.\n */\n get(src, crossOrigin, color) {\n const key = getCacheKey(src, crossOrigin, color);\n return key in this.cache_ ? this.cache_[key] : null;\n }\n\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color|string|null} color Color.\n * @return {CanvasPattern} Icon image.\n */\n getPattern(src, crossOrigin, color) {\n const key = getCacheKey(src, crossOrigin, color);\n return key in this.patternCache_ ? this.patternCache_[key] : null;\n }\n\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color|string|null} color Color.\n * @param {import(\"./IconImage.js\").default|null} iconImage Icon image.\n * @param {boolean} [pattern] Also cache a `'repeat'` pattern with this `iconImage`.\n */\n set(src, crossOrigin, color, iconImage, pattern) {\n const key = getCacheKey(src, crossOrigin, color);\n const update = key in this.cache_;\n this.cache_[key] = iconImage;\n if (pattern) {\n if (iconImage.getImageState() === ImageState.IDLE) {\n iconImage.load();\n }\n if (iconImage.getImageState() === ImageState.LOADING) {\n iconImage.ready().then(() => {\n this.patternCache_[key] = getSharedCanvasContext2D().createPattern(\n iconImage.getImage(1),\n 'repeat',\n );\n });\n } else {\n this.patternCache_[key] = getSharedCanvasContext2D().createPattern(\n iconImage.getImage(1),\n 'repeat',\n );\n }\n }\n if (!update) {\n ++this.cacheSize_;\n }\n }\n\n /**\n * Set the cache size of the icon cache. Default is `1024`. Change this value when\n * your map uses more than 1024 different icon images and you are not caching icon\n * styles on the application level.\n * @param {number} maxCacheSize Cache max size.\n * @api\n */\n setSize(maxCacheSize) {\n this.maxCacheSize_ = maxCacheSize;\n this.expire();\n }\n}\n\n/**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color|string|null} color Color.\n * @return {string} Cache key.\n */\nexport function getCacheKey(src, crossOrigin, color) {\n const colorString = color ? asArray(color) : 'null';\n return crossOrigin + ':' + src + ':' + colorString;\n}\n\nexport default IconImageCache;\n\n/**\n * The {@link module:ol/style/IconImageCache~IconImageCache} for\n * {@link module:ol/style/Icon~Icon} images.\n * @api\n */\nexport const shared = new IconImageCache();\n","/**\n * @module ol/style/IconImage\n */\n\nimport {decodeFallback} from '../Image.js';\nimport ImageState from '../ImageState.js';\nimport {asString} from '../color.js';\nimport {createCanvasContext2D} from '../dom.js';\nimport EventType from '../events/EventType.js';\nimport EventTarget from '../events/Target.js';\nimport {shared as iconImageCache} from './IconImageCache.js';\n\n/**\n * @type {CanvasRenderingContext2D}\n */\nlet taintedTestContext = null;\n\nclass IconImage extends EventTarget {\n /**\n * @param {HTMLImageElement|HTMLCanvasElement|ImageBitmap|null} image Image.\n * @param {string|undefined} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../ImageState.js\").default|undefined} imageState Image state.\n * @param {import(\"../color.js\").Color|string|null} color Color.\n */\n constructor(image, src, crossOrigin, imageState, color) {\n super();\n\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement|ImageBitmap}\n */\n this.hitDetectionImage_ = null;\n\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement|ImageBitmap|null}\n */\n this.image_ = image;\n\n /**\n * @private\n * @type {string|null}\n */\n this.crossOrigin_ = crossOrigin;\n\n /**\n * @private\n * @type {Object}\n */\n this.canvas_ = {};\n\n /**\n * @private\n * @type {import(\"../color.js\").Color|string|null}\n */\n this.color_ = color;\n\n /**\n * @private\n * @type {import(\"../ImageState.js\").default}\n */\n this.imageState_ = imageState === undefined ? ImageState.IDLE : imageState;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size|null}\n */\n this.size_ =\n image && image.width && image.height ? [image.width, image.height] : null;\n\n /**\n * @private\n * @type {string|undefined}\n */\n this.src_ = src;\n\n /**\n * @private\n */\n this.tainted_;\n\n /**\n * @private\n * @type {Promise|null}\n */\n this.ready_ = null;\n }\n\n /**\n * @private\n */\n initializeImage_() {\n this.image_ = new Image();\n if (this.crossOrigin_ !== null) {\n this.image_.crossOrigin = this.crossOrigin_;\n }\n }\n\n /**\n * @private\n * @return {boolean} The image canvas is tainted.\n */\n isTainted_() {\n if (this.tainted_ === undefined && this.imageState_ === ImageState.LOADED) {\n if (!taintedTestContext) {\n taintedTestContext = createCanvasContext2D(1, 1, undefined, {\n willReadFrequently: true,\n });\n }\n taintedTestContext.drawImage(this.image_, 0, 0);\n try {\n taintedTestContext.getImageData(0, 0, 1, 1);\n this.tainted_ = false;\n } catch {\n taintedTestContext = null;\n this.tainted_ = true;\n }\n }\n return this.tainted_ === true;\n }\n\n /**\n * @private\n */\n dispatchChangeEvent_() {\n this.dispatchEvent(EventType.CHANGE);\n }\n\n /**\n * @private\n */\n handleImageError_() {\n this.imageState_ = ImageState.ERROR;\n this.dispatchChangeEvent_();\n }\n\n /**\n * @private\n */\n handleImageLoad_() {\n this.imageState_ = ImageState.LOADED;\n this.size_ = [this.image_.width, this.image_.height];\n this.dispatchChangeEvent_();\n }\n\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image or Canvas element or image bitmap.\n */\n getImage(pixelRatio) {\n if (!this.image_) {\n this.initializeImage_();\n }\n this.replaceColor_(pixelRatio);\n return this.canvas_[pixelRatio] ? this.canvas_[pixelRatio] : this.image_;\n }\n\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Image or Canvas element.\n */\n getPixelRatio(pixelRatio) {\n this.replaceColor_(pixelRatio);\n return this.canvas_[pixelRatio] ? pixelRatio : 1;\n }\n\n /**\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n getImageState() {\n return this.imageState_;\n }\n\n /**\n * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image element.\n */\n getHitDetectionImage() {\n if (!this.image_) {\n this.initializeImage_();\n }\n if (!this.hitDetectionImage_) {\n if (this.isTainted_()) {\n const width = this.size_[0];\n const height = this.size_[1];\n const context = createCanvasContext2D(width, height);\n context.fillRect(0, 0, width, height);\n this.hitDetectionImage_ = context.canvas;\n } else {\n this.hitDetectionImage_ = this.image_;\n }\n }\n return this.hitDetectionImage_;\n }\n\n /**\n * Get the size of the icon (in pixels).\n * @return {import(\"../size.js\").Size} Image size.\n */\n getSize() {\n return this.size_;\n }\n\n /**\n * @return {string|undefined} Image src.\n */\n getSrc() {\n return this.src_;\n }\n\n /**\n * Load not yet loaded URI.\n */\n load() {\n if (this.imageState_ !== ImageState.IDLE) {\n return;\n }\n if (!this.image_) {\n this.initializeImage_();\n }\n\n this.imageState_ = ImageState.LOADING;\n try {\n if (this.src_ !== undefined) {\n /** @type {HTMLImageElement} */ (this.image_).src = this.src_;\n }\n } catch {\n this.handleImageError_();\n }\n if (this.image_ instanceof HTMLImageElement) {\n decodeFallback(this.image_, this.src_)\n .then((image) => {\n this.image_ = image;\n this.handleImageLoad_();\n })\n .catch(this.handleImageError_.bind(this));\n }\n }\n\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @private\n */\n replaceColor_(pixelRatio) {\n if (\n !this.color_ ||\n this.canvas_[pixelRatio] ||\n this.imageState_ !== ImageState.LOADED\n ) {\n return;\n }\n\n const image = this.image_;\n const ctx = createCanvasContext2D(\n Math.ceil(image.width * pixelRatio),\n Math.ceil(image.height * pixelRatio),\n );\n const canvas = ctx.canvas;\n\n ctx.scale(pixelRatio, pixelRatio);\n ctx.drawImage(image, 0, 0);\n\n ctx.globalCompositeOperation = 'multiply';\n ctx.fillStyle = asString(this.color_);\n ctx.fillRect(0, 0, canvas.width / pixelRatio, canvas.height / pixelRatio);\n\n ctx.globalCompositeOperation = 'destination-in';\n ctx.drawImage(image, 0, 0);\n\n this.canvas_[pixelRatio] = canvas;\n }\n\n /**\n * @return {Promise} Promise that resolves when the image is loaded.\n */\n ready() {\n if (!this.ready_) {\n this.ready_ = new Promise((resolve) => {\n if (\n this.imageState_ === ImageState.LOADED ||\n this.imageState_ === ImageState.ERROR\n ) {\n resolve();\n } else {\n const onChange = () => {\n if (\n this.imageState_ === ImageState.LOADED ||\n this.imageState_ === ImageState.ERROR\n ) {\n this.removeEventListener(EventType.CHANGE, onChange);\n resolve();\n }\n };\n this.addEventListener(EventType.CHANGE, onChange);\n }\n });\n }\n return this.ready_;\n }\n}\n\n/**\n * @param {HTMLImageElement|HTMLCanvasElement|ImageBitmap|null} image Image.\n * @param {string|undefined} cacheKey Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../ImageState.js\").default|undefined} imageState Image state.\n * @param {import(\"../color.js\").Color|string|null} color Color.\n * @param {boolean} [pattern] Also cache a `repeat` pattern with the icon image.\n * @return {IconImage} Icon image.\n */\nexport function get(image, cacheKey, crossOrigin, imageState, color, pattern) {\n let iconImage =\n cacheKey === undefined\n ? undefined\n : iconImageCache.get(cacheKey, crossOrigin, color);\n if (!iconImage) {\n iconImage = new IconImage(\n image,\n image && 'src' in image ? image.src || undefined : cacheKey,\n crossOrigin,\n imageState,\n color,\n );\n iconImageCache.set(cacheKey, crossOrigin, color, iconImage, pattern);\n }\n if (\n pattern &&\n iconImage &&\n !iconImageCache.getPattern(cacheKey, crossOrigin, color)\n ) {\n iconImageCache.set(cacheKey, crossOrigin, color, iconImage, pattern);\n }\n return iconImage;\n}\n\nexport default IconImage;\n","/**\n * @module ol/colorlike\n */\nimport ImageState from './ImageState.js';\nimport {toString} from './color.js';\nimport {createCanvasContext2D} from './dom.js';\nimport {get as getIconImage} from './style/IconImage.js';\nimport {shared as iconCache} from './style/IconImageCache.js';\n\n/**\n * @typedef {Object} PatternDescriptor\n * @property {string} src Pattern image URL\n * @property {import(\"./color.js\").Color|string} [color] Color to tint the pattern with.\n * @property {import(\"./size.js\").Size} [size] Size of the desired slice from the pattern image.\n * Use this together with `offset` when the pattern image is a sprite sheet.\n * @property {import(\"./size.js\").Size} [offset] Offset of the desired slice from the pattern image.\n * Use this together with `size` when the pattern image is a sprite sheet.\n */\n\n/**\n * A type accepted by CanvasRenderingContext2D.fillStyle\n * or CanvasRenderingContext2D.strokeStyle.\n * Represents a color, [CanvasPattern](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern),\n * or [CanvasGradient](https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient). The origin for\n * patterns and gradients as fill style is an increment of 512 css pixels from map coordinate\n * `[0, 0]`. For seamless repeat patterns, width and height of the pattern image\n * must be a factor of two (2, 4, 8, ..., 512).\n *\n * @typedef {string|CanvasPattern|CanvasGradient} ColorLike\n * @api\n */\n\n/**\n * @param {import(\"./color.js\").Color|ColorLike|PatternDescriptor|null} color Color.\n * @return {ColorLike|null} The color as an {@link ol/colorlike~ColorLike}.\n * @api\n */\nexport function asColorLike(color) {\n if (!color) {\n return null;\n }\n if (Array.isArray(color)) {\n return toString(color);\n }\n if (typeof color === 'object' && 'src' in color) {\n return asCanvasPattern(color);\n }\n return color;\n}\n\n/**\n * @param {PatternDescriptor} pattern Pattern descriptor.\n * @return {CanvasPattern|null} Canvas pattern or null if the pattern referenced in the\n * PatternDescriptor was not found in the icon image cache.\n */\nfunction asCanvasPattern(pattern) {\n if (!pattern.offset || !pattern.size) {\n return iconCache.getPattern(pattern.src, 'anonymous', pattern.color);\n }\n\n const cacheKey = pattern.src + ':' + pattern.offset;\n\n const canvasPattern = iconCache.getPattern(\n cacheKey,\n undefined,\n pattern.color,\n );\n if (canvasPattern) {\n return canvasPattern;\n }\n\n const iconImage = iconCache.get(pattern.src, 'anonymous', null);\n if (iconImage.getImageState() !== ImageState.LOADED) {\n return null;\n }\n const patternCanvasContext = createCanvasContext2D(\n pattern.size[0],\n pattern.size[1],\n );\n patternCanvasContext.drawImage(\n iconImage.getImage(1),\n pattern.offset[0],\n pattern.offset[1],\n pattern.size[0],\n pattern.size[1],\n 0,\n 0,\n pattern.size[0],\n pattern.size[1],\n );\n getIconImage(\n patternCanvasContext.canvas,\n cacheKey,\n undefined,\n ImageState.LOADED,\n pattern.color,\n true,\n );\n return iconCache.getPattern(cacheKey, undefined, pattern.color);\n}\n","/**\n * @module ol/render/VectorContext\n */\n\n/**\n * @classdesc\n * Context for drawing geometries. A vector context is available on render\n * events and does not need to be constructed directly.\n * @api\n */\nclass VectorContext {\n /**\n * Render a geometry with a custom renderer.\n *\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {Function} renderer Renderer.\n * @param {Function} hitDetectionRenderer Renderer.\n * @param {number} [index] Render order index.\n */\n drawCustom(geometry, feature, renderer, hitDetectionRenderer, index) {}\n\n /**\n * Render a geometry.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry The geometry to render.\n */\n drawGeometry(geometry) {}\n\n /**\n * Set the rendering style.\n *\n * @param {import(\"../style/Style.js\").default} style The rendering style.\n */\n setStyle(style) {}\n\n /**\n * @param {import(\"../geom/Circle.js\").default} circleGeometry Circle geometry.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawCircle(circleGeometry, feature, index) {}\n\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} [index] Render order index.\n */\n drawFeature(feature, style, index) {}\n\n /**\n * @param {import(\"../geom/GeometryCollection.js\").default} geometryCollectionGeometry Geometry collection.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawGeometryCollection(geometryCollectionGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/LineString.js\").default|import(\"./Feature.js\").default} lineStringGeometry Line string geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawLineString(lineStringGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"./Feature.js\").default} multiLineStringGeometry MultiLineString geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawMultiLineString(multiLineStringGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"./Feature.js\").default} multiPointGeometry MultiPoint geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawMultiPoint(multiPointGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/MultiPolygon.js\").default} multiPolygonGeometry MultiPolygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawMultiPolygon(multiPolygonGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/Point.js\").default|import(\"./Feature.js\").default} pointGeometry Point geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawPoint(pointGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/Polygon.js\").default|import(\"./Feature.js\").default} polygonGeometry Polygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawPolygon(polygonGeometry, feature, index) {}\n\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default|import(\"./Feature.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\n drawText(geometry, feature, index) {}\n\n /**\n * @param {import(\"../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../style/Stroke.js\").default} strokeStyle Stroke style.\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {}\n\n /**\n * @param {import(\"../style/Image.js\").default} imageStyle Image style.\n * @param {import(\"../render/canvas.js\").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with a text style.\n */\n setImageStyle(imageStyle, declutterImageWithText) {}\n\n /**\n * @param {import(\"../style/Text.js\").default} textStyle Text style.\n * @param {import(\"../render/canvas.js\").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with an image style.\n */\n setTextStyle(textStyle, declutterImageWithText) {}\n}\n\nexport default VectorContext;\n","/**\n * @module ol/css\n */\n\n/**\n * @typedef {Object} FontParameters\n * @property {string} style Style.\n * @property {string} variant Variant.\n * @property {string} weight Weight.\n * @property {string} size Size.\n * @property {string} lineHeight LineHeight.\n * @property {string} family Family.\n * @property {Array} families Families.\n */\n\n/**\n * The CSS class for hidden feature.\n *\n * @const\n * @type {string}\n */\nexport const CLASS_HIDDEN = 'ol-hidden';\n\n/**\n * The CSS class that we'll give the DOM elements to have them selectable.\n *\n * @const\n * @type {string}\n */\nexport const CLASS_SELECTABLE = 'ol-selectable';\n\n/**\n * The CSS class that we'll give the DOM elements to have them unselectable.\n *\n * @const\n * @type {string}\n */\nexport const CLASS_UNSELECTABLE = 'ol-unselectable';\n\n/**\n * The CSS class for unsupported feature.\n *\n * @const\n * @type {string}\n */\nexport const CLASS_UNSUPPORTED = 'ol-unsupported';\n\n/**\n * The CSS class for controls.\n *\n * @const\n * @type {string}\n */\nexport const CLASS_CONTROL = 'ol-control';\n\n/**\n * The CSS class that we'll give the DOM elements that are collapsed, i.e.\n * to those elements which usually can be expanded.\n *\n * @const\n * @type {string}\n */\nexport const CLASS_COLLAPSED = 'ol-collapsed';\n\n/**\n * From https://stackoverflow.com/questions/10135697/regex-to-parse-any-css-font\n * @type {RegExp}\n */\nconst fontRegEx = new RegExp(\n [\n '^\\\\s*(?=(?:(?:[-a-z]+\\\\s*){0,2}(italic|oblique))?)',\n '(?=(?:(?:[-a-z]+\\\\s*){0,2}(small-caps))?)',\n '(?=(?:(?:[-a-z]+\\\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)',\n '(?:(?:normal|\\\\1|\\\\2|\\\\3)\\\\s*){0,3}((?:xx?-)?',\n '(?:small|large)|medium|smaller|larger|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx]))',\n '(?:\\\\s*\\\\/\\\\s*(normal|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx])?))',\n '?\\\\s*([-,\\\\\"\\\\\\'\\\\sa-z0-9]+?)\\\\s*$',\n ].join(''),\n 'i',\n);\n/** @type {Array<'style'|'variant'|'weight'|'size'|'lineHeight'|'family'>} */\nconst fontRegExMatchIndex = [\n 'style',\n 'variant',\n 'weight',\n 'size',\n 'lineHeight',\n 'family',\n];\n\n/** @type {Object} */\nexport const fontWeights = {\n normal: 400,\n bold: 700,\n};\n\n/**\n * Get the list of font families from a font spec. Note that this doesn't work\n * for font families that have commas in them.\n * @param {string} fontSpec The CSS font property.\n * @return {FontParameters|null} The font parameters (or null if the input spec is invalid).\n */\nexport const getFontParameters = function (fontSpec) {\n const match = fontSpec.match(fontRegEx);\n if (!match) {\n return null;\n }\n const style = /** @type {FontParameters} */ ({\n lineHeight: 'normal',\n size: '1.2em',\n style: 'normal',\n weight: '400',\n variant: 'normal',\n });\n for (let i = 0, ii = fontRegExMatchIndex.length; i < ii; ++i) {\n const value = match[i + 1];\n if (value !== undefined) {\n style[fontRegExMatchIndex[i]] =\n typeof value === 'string' ? value.trim() : value;\n }\n }\n if (isNaN(Number(style.weight)) && style.weight in fontWeights) {\n style.weight = fontWeights[style.weight];\n }\n style.families = style.family\n .split(/,\\s?/)\n .map((f) => f.trim().replace(/^['\"]|['\"]$/g, ''));\n return style;\n};\n","/**\n * @module ol/render/canvas\n */\nimport BaseObject from '../Object.js';\nimport {fontWeights, getFontParameters} from '../css.js';\nimport {createCanvasContext2D} from '../dom.js';\nimport {WORKER_OFFSCREEN_CANVAS} from '../has.js';\nimport {clear} from '../obj.js';\n\n/**\n * @typedef {'Circle' | 'Image' | 'LineString' | 'Polygon' | 'Text' | 'Default'} BuilderType\n */\n\n/**\n * @typedef {Object} FillState\n * @property {import(\"../colorlike.js\").ColorLike} fillStyle FillStyle.\n */\n\n/**\n * @typedef Label\n * @property {number} width Width.\n * @property {number} height Height.\n * @property {Array} contextInstructions ContextInstructions.\n */\n\n/**\n * @typedef {Object} FillStrokeState\n * @property {import(\"../colorlike.js\").ColorLike} [currentFillStyle] Current FillStyle.\n * @property {import(\"../colorlike.js\").ColorLike} [currentStrokeStyle] Current StrokeStyle.\n * @property {CanvasLineCap} [currentLineCap] Current LineCap.\n * @property {Array} currentLineDash Current LineDash.\n * @property {number} [currentLineDashOffset] Current LineDashOffset.\n * @property {CanvasLineJoin} [currentLineJoin] Current LineJoin.\n * @property {number} [currentLineWidth] Current LineWidth.\n * @property {number} [currentMiterLimit] Current MiterLimit.\n * @property {number} [lastStroke] Last stroke.\n * @property {import(\"../colorlike.js\").ColorLike} [fillStyle] FillStyle.\n * @property {import(\"../colorlike.js\").ColorLike} [strokeStyle] StrokeStyle.\n * @property {CanvasLineCap} [lineCap] LineCap.\n * @property {Array} lineDash LineDash.\n * @property {number} [lineDashOffset] LineDashOffset.\n * @property {CanvasLineJoin} [lineJoin] LineJoin.\n * @property {number} [lineWidth] LineWidth.\n * @property {number} [miterLimit] MiterLimit.\n * @property {number} [fillPatternScale] Fill pattern scale.\n */\n\n/**\n * @typedef {Object} StrokeState\n * @property {CanvasLineCap} lineCap LineCap.\n * @property {Array} lineDash LineDash.\n * @property {number} lineDashOffset LineDashOffset.\n * @property {CanvasLineJoin} lineJoin LineJoin.\n * @property {number} lineWidth LineWidth.\n * @property {number} miterLimit MiterLimit.\n * @property {import(\"../colorlike.js\").ColorLike} strokeStyle StrokeStyle.\n */\n\n/**\n * @typedef {Object} TextState\n * @property {string} font Font.\n * @property {CanvasTextAlign} [textAlign] TextAlign.\n * @property {number} [repeat] Repeat.\n * @property {import(\"../style/Text.js\").TextJustify} [justify] Justify.\n * @property {CanvasTextBaseline} textBaseline TextBaseline.\n * @property {import(\"../style/Text.js\").TextPlacement} [placement] Placement.\n * @property {number} [maxAngle] MaxAngle.\n * @property {boolean} [overflow] Overflow.\n * @property {import(\"../style/Fill.js\").default} [backgroundFill] BackgroundFill.\n * @property {import(\"../style/Stroke.js\").default} [backgroundStroke] BackgroundStroke.\n * @property {import(\"../size.js\").Size} [scale] Scale.\n * @property {Array} [padding] Padding.\n */\n\n/**\n * @typedef {Object} SerializableInstructions\n * @property {Array<*>} instructions The rendering instructions.\n * @property {Array<*>} hitDetectionInstructions The rendering hit detection instructions.\n * @property {Array} coordinates The array of all coordinates.\n * @property {!Object} [textStates] The text states (decluttering).\n * @property {!Object} [fillStates] The fill states (decluttering).\n * @property {!Object} [strokeStates] The stroke states (decluttering).\n */\n\n/**\n * @typedef {Object} DeclutterImageWithText\n */\n\n/**\n * @const\n * @type {string}\n */\nexport const defaultFont = '10px sans-serif';\n\n/**\n * @const\n * @type {string}\n */\nexport const defaultFillStyle = '#000';\n\n/**\n * @const\n * @type {CanvasLineCap}\n */\nexport const defaultLineCap = 'round';\n\n/**\n * @const\n * @type {Array}\n */\nexport const defaultLineDash = [];\n\n/**\n * @const\n * @type {number}\n */\nexport const defaultLineDashOffset = 0;\n\n/**\n * @const\n * @type {CanvasLineJoin}\n */\nexport const defaultLineJoin = 'round';\n\n/**\n * @const\n * @type {number}\n */\nexport const defaultMiterLimit = 10;\n\n/**\n * @const\n * @type {import(\"../colorlike.js\").ColorLike}\n */\nexport const defaultStrokeStyle = '#000';\n\n/**\n * @const\n * @type {CanvasTextAlign}\n */\nexport const defaultTextAlign = 'center';\n\n/**\n * @const\n * @type {CanvasTextBaseline}\n */\nexport const defaultTextBaseline = 'middle';\n\n/**\n * @const\n * @type {Array}\n */\nexport const defaultPadding = [0, 0, 0, 0];\n\n/**\n * @const\n * @type {number}\n */\nexport const defaultLineWidth = 1;\n\n/**\n * @type {BaseObject}\n */\nexport const checkedFonts = new BaseObject();\n\n/**\n * @type {CanvasRenderingContext2D}\n */\nlet measureContext = null;\n\n/**\n * @type {string}\n */\nlet measureFont;\n\n/**\n * @type {!Object}\n */\nexport const textHeights = {};\n\nconst genericFontFamilies = new Set([\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui',\n 'ui-serif',\n 'ui-sans-serif',\n 'ui-monospace',\n 'ui-rounded',\n 'emoji',\n 'math',\n 'fangsong',\n]);\n\n/**\n * @param {string} style Css font-style\n * @param {string} weight Css font-weight\n * @param {string} family Css font-family\n * @return {string} Font key.\n */\nfunction getFontKey(style, weight, family) {\n return `${style} ${weight} 16px \"${family}\"`;\n}\n\n/**\n * Clears the label cache when a font becomes available.\n * @param {string} fontSpec CSS font spec.\n */\nexport const registerFont = (function () {\n const retries = 100;\n let timeout, fontFaceSet;\n\n /**\n * @param {string} fontSpec Css font spec\n * @return {Promise} Font with style and weight is available\n */\n async function isAvailable(fontSpec) {\n await fontFaceSet.ready;\n const fontFaces = await fontFaceSet.load(fontSpec);\n if (fontFaces.length === 0) {\n return false;\n }\n const font = getFontParameters(fontSpec);\n const checkFamily = font.families[0].toLowerCase();\n const checkWeight = font.weight;\n return fontFaces.some(\n /**\n * @param {import('../css.js').FontParameters} f Font.\n * @return {boolean} Font matches.\n */\n (f) => {\n const family = f.family.replace(/^['\"]|['\"]$/g, '').toLowerCase();\n const weight = fontWeights[f.weight] || f.weight;\n return (\n family === checkFamily &&\n f.style === font.style &&\n weight == checkWeight\n );\n },\n );\n }\n\n async function check() {\n await fontFaceSet.ready;\n let done = true;\n const checkedFontsProperties = checkedFonts.getProperties();\n const fonts = Object.keys(checkedFontsProperties).filter(\n (key) => checkedFontsProperties[key] < retries,\n );\n for (let i = fonts.length - 1; i >= 0; --i) {\n const font = fonts[i];\n let currentRetries = checkedFontsProperties[font];\n if (currentRetries < retries) {\n if (await isAvailable(font)) {\n clear(textHeights);\n checkedFonts.set(font, retries);\n } else {\n currentRetries += 10;\n checkedFonts.set(font, currentRetries, true);\n if (currentRetries < retries) {\n done = false;\n }\n }\n }\n }\n timeout = undefined;\n if (!done) {\n timeout = setTimeout(check, 100);\n }\n }\n\n return async function (fontSpec) {\n if (!fontFaceSet) {\n fontFaceSet = WORKER_OFFSCREEN_CANVAS ? self.fonts : document.fonts;\n }\n const font = getFontParameters(fontSpec);\n if (!font) {\n return;\n }\n const families = font.families;\n let needCheck = false;\n for (const family of families) {\n if (genericFontFamilies.has(family)) {\n continue;\n }\n const key = getFontKey(font.style, font.weight, family);\n if (checkedFonts.get(key) !== undefined) {\n continue;\n }\n checkedFonts.set(key, 0, true);\n needCheck = true;\n }\n if (needCheck) {\n clearTimeout(timeout);\n timeout = setTimeout(check, 100);\n }\n };\n})();\n\n/**\n * @param {string} font Font to use for measuring.\n * @return {import(\"../size.js\").Size} Measurement.\n */\nexport const measureTextHeight = (function () {\n /**\n * @type {HTMLDivElement}\n */\n let measureElement;\n return function (fontSpec) {\n let height = textHeights[fontSpec];\n if (height == undefined) {\n if (WORKER_OFFSCREEN_CANVAS) {\n const font = getFontParameters(fontSpec);\n const metrics = measureText(fontSpec, 'Žg');\n const lineHeight = isNaN(Number(font.lineHeight))\n ? 1.2\n : Number(font.lineHeight);\n height =\n lineHeight *\n (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent);\n } else {\n if (!measureElement) {\n measureElement = document.createElement('div');\n measureElement.innerHTML = 'M';\n measureElement.style.minHeight = '0';\n measureElement.style.maxHeight = 'none';\n measureElement.style.height = 'auto';\n measureElement.style.padding = '0';\n measureElement.style.border = 'none';\n measureElement.style.position = 'absolute';\n measureElement.style.display = 'block';\n measureElement.style.left = '-99999px';\n }\n measureElement.style.font = fontSpec;\n document.body.appendChild(measureElement);\n height = measureElement.offsetHeight;\n document.body.removeChild(measureElement);\n }\n textHeights[fontSpec] = height;\n }\n return height;\n };\n})();\n\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {TextMetrics} Text metrics.\n */\nfunction measureText(font, text) {\n if (!measureContext) {\n measureContext = createCanvasContext2D(1, 1);\n }\n if (font != measureFont) {\n measureContext.font = font;\n measureFont = measureContext.font;\n }\n return measureContext.measureText(text);\n}\n\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {number} Width.\n */\nexport function measureTextWidth(font, text) {\n return measureText(font, text).width;\n}\n\n/**\n * Measure text width using a cache.\n * @param {string} font The font.\n * @param {string} text The text to measure.\n * @param {Object} cache A lookup of cached widths by text.\n * @return {number} The text width.\n */\nexport function measureAndCacheTextWidth(font, text, cache) {\n if (text in cache) {\n return cache[text];\n }\n const width = text\n .split('\\n')\n .reduce((prev, curr) => Math.max(prev, measureTextWidth(font, curr)), 0);\n cache[text] = width;\n return width;\n}\n\n/**\n * @param {TextState} baseStyle Base style.\n * @param {Array} chunks Text chunks to measure.\n * @return {{width: number, height: number, widths: Array, heights: Array, lineWidths: Array}}} Text metrics.\n */\nexport function getTextDimensions(baseStyle, chunks) {\n const widths = [];\n const heights = [];\n const lineWidths = [];\n let width = 0;\n let lineWidth = 0;\n let height = 0;\n let lineHeight = 0;\n for (let i = 0, ii = chunks.length; i <= ii; i += 2) {\n const text = chunks[i];\n if (text === '\\n' || i === ii) {\n width = Math.max(width, lineWidth);\n lineWidths.push(lineWidth);\n lineWidth = 0;\n height += lineHeight;\n lineHeight = 0;\n continue;\n }\n const font = chunks[i + 1] || baseStyle.font;\n const currentWidth = measureTextWidth(font, text);\n widths.push(currentWidth);\n lineWidth += currentWidth;\n const currentHeight = measureTextHeight(font);\n heights.push(currentHeight);\n lineHeight = Math.max(lineHeight, currentHeight);\n }\n return {width, height, widths, heights, lineWidths};\n}\n\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} rotation Rotation.\n * @param {number} offsetX X offset.\n * @param {number} offsetY Y offset.\n */\nexport function rotateAtOffset(context, rotation, offsetX, offsetY) {\n if (rotation !== 0) {\n context.translate(offsetX, offsetY);\n context.rotate(rotation);\n context.translate(-offsetX, -offsetY);\n }\n}\n\n/**\n * @param {CanvasRenderingContext2D|import(\"../render/canvas/ZIndexContext.js\").ZIndexContextProxy} context Context.\n * @param {import(\"../transform.js\").Transform|null} transform Transform.\n * @param {number} opacity Opacity.\n * @param {Label|HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} labelOrImage Label.\n * @param {number} originX Origin X.\n * @param {number} originY Origin Y.\n * @param {number} w Width.\n * @param {number} h Height.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../size.js\").Size} scale Scale.\n */\nexport function drawImageOrLabel(\n context,\n transform,\n opacity,\n labelOrImage,\n originX,\n originY,\n w,\n h,\n x,\n y,\n scale,\n) {\n context.save();\n\n if (opacity !== 1) {\n if (context.globalAlpha === undefined) {\n context.globalAlpha = (context) => (context.globalAlpha *= opacity);\n } else {\n context.globalAlpha *= opacity;\n }\n }\n if (transform) {\n context.transform.apply(context, transform);\n }\n\n if (/** @type {*} */ (labelOrImage).contextInstructions) {\n // label\n context.translate(x, y);\n context.scale(scale[0], scale[1]);\n executeLabelInstructions(/** @type {Label} */ (labelOrImage), context);\n } else if (scale[0] < 0 || scale[1] < 0) {\n // flipped image\n context.translate(x, y);\n context.scale(scale[0], scale[1]);\n context.drawImage(\n /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (\n labelOrImage\n ),\n originX,\n originY,\n w,\n h,\n 0,\n 0,\n w,\n h,\n );\n } else {\n // if image not flipped translate and scale can be avoided\n context.drawImage(\n /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */ (\n labelOrImage\n ),\n originX,\n originY,\n w,\n h,\n x,\n y,\n w * scale[0],\n h * scale[1],\n );\n }\n\n context.restore();\n}\n\n/**\n * @param {Label} label Label.\n * @param {CanvasRenderingContext2D} context Context.\n */\nfunction executeLabelInstructions(label, context) {\n const contextInstructions = label.contextInstructions;\n for (let i = 0, ii = contextInstructions.length; i < ii; i += 2) {\n if (Array.isArray(contextInstructions[i + 1])) {\n context[contextInstructions[i]].apply(\n context,\n contextInstructions[i + 1],\n );\n } else {\n context[contextInstructions[i]] = contextInstructions[i + 1];\n }\n }\n}\n","/**\n * @module ol/render/canvas/Immediate\n */\n// FIXME test, especially polygons with holes and multipolygons\n// FIXME need to handle large thick features (where pixel size matters)\n// FIXME add offset and end to ol/geom/flat/transform~transform2D?\n\nimport {equals} from '../../array.js';\nimport {asColorLike} from '../../colorlike.js';\nimport {intersects} from '../../extent.js';\nimport {transformGeom2D} from '../../geom/SimpleGeometry.js';\nimport {transform2D} from '../../geom/flat/transform.js';\nimport {toFixed} from '../../math.js';\nimport {\n compose as composeTransform,\n create as createTransform,\n} from '../../transform.js';\nimport VectorContext from '../VectorContext.js';\nimport {\n defaultFillStyle,\n defaultFont,\n defaultLineCap,\n defaultLineDash,\n defaultLineDashOffset,\n defaultLineJoin,\n defaultLineWidth,\n defaultMiterLimit,\n defaultStrokeStyle,\n defaultTextAlign,\n defaultTextBaseline,\n} from '../canvas.js';\n\n/**\n * @classdesc\n * A concrete subclass of {@link module:ol/render/VectorContext~VectorContext} that implements\n * direct rendering of features and geometries to an HTML5 Canvas context.\n * Instances of this class are created internally by the library and\n * provided to application code as vectorContext member of the\n * {@link module:ol/render/Event~RenderEvent} object associated with postcompose, precompose and\n * render events emitted by layers and maps.\n */\nclass CanvasImmediateRenderer extends VectorContext {\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {number} [squaredTolerance] Optional squared tolerance for simplification.\n * @param {import(\"../../proj.js\").TransformFunction} [userTransform] Transform from user to view projection.\n */\n constructor(\n context,\n pixelRatio,\n extent,\n transform,\n viewRotation,\n squaredTolerance,\n userTransform,\n ) {\n super();\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.context_ = context;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.extent_ = extent;\n\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n this.transform_ = transform;\n\n /**\n * @private\n * @type {number}\n */\n this.transformRotation_ = transform\n ? toFixed(Math.atan2(transform[1], transform[0]), 10)\n : 0;\n\n /**\n * @private\n * @type {number}\n */\n this.viewRotation_ = viewRotation;\n\n /**\n * @private\n * @type {number}\n */\n this.squaredTolerance_ = squaredTolerance;\n\n /**\n * @private\n * @type {import(\"../../proj.js\").TransformFunction}\n */\n this.userTransform_ = userTransform;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.contextFillState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.contextStrokeState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").TextState}\n */\n this.contextTextState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.fillState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.strokeState_ = null;\n\n /**\n * @private\n * @type {import('../../DataTile.js').ImageLike}\n */\n this.image_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.imageAnchorX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageAnchorY_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageHeight_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageOpacity_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageOriginX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageOriginY_ = 0;\n\n /**\n * @private\n * @type {boolean}\n */\n this.imageRotateWithView_ = false;\n\n /**\n * @private\n * @type {number}\n */\n this.imageRotation_ = 0;\n\n /**\n * @private\n * @type {import(\"../../size.js\").Size}\n */\n this.imageScale_ = [0, 0];\n\n /**\n * @private\n * @type {number}\n */\n this.imageWidth_ = 0;\n\n /**\n * @private\n * @type {string}\n */\n this.text_ = '';\n\n /**\n * @private\n * @type {number}\n */\n this.textOffsetX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.textOffsetY_ = 0;\n\n /**\n * @private\n * @type {boolean}\n */\n this.textRotateWithView_ = false;\n\n /**\n * @private\n * @type {number}\n */\n this.textRotation_ = 0;\n\n /**\n * @private\n * @type {import(\"../../size.js\").Size}\n */\n this.textScale_ = [0, 0];\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.textFillState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.textStrokeState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").TextState}\n */\n this.textState_ = null;\n\n /**\n * @private\n * @type {Array}\n */\n this.pixelCoordinates_ = [];\n\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n this.tmpLocalTransform_ = createTransform();\n }\n\n /**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @private\n */\n drawImages_(flatCoordinates, offset, end, stride) {\n if (!this.image_) {\n return;\n }\n const pixelCoordinates = transform2D(\n flatCoordinates,\n offset,\n end,\n stride,\n this.transform_,\n this.pixelCoordinates_,\n );\n const context = this.context_;\n const localTransform = this.tmpLocalTransform_;\n const alpha = context.globalAlpha;\n if (this.imageOpacity_ != 1) {\n context.globalAlpha = alpha * this.imageOpacity_;\n }\n let rotation = this.imageRotation_;\n if (this.transformRotation_ === 0) {\n rotation -= this.viewRotation_;\n }\n if (this.imageRotateWithView_) {\n rotation += this.viewRotation_;\n }\n for (let i = 0, ii = pixelCoordinates.length; i < ii; i += 2) {\n const x = pixelCoordinates[i] - this.imageAnchorX_;\n const y = pixelCoordinates[i + 1] - this.imageAnchorY_;\n if (\n rotation !== 0 ||\n this.imageScale_[0] != 1 ||\n this.imageScale_[1] != 1\n ) {\n const centerX = x + this.imageAnchorX_;\n const centerY = y + this.imageAnchorY_;\n composeTransform(\n localTransform,\n centerX,\n centerY,\n 1,\n 1,\n rotation,\n -centerX,\n -centerY,\n );\n context.save();\n context.transform.apply(context, localTransform);\n context.translate(centerX, centerY);\n context.scale(this.imageScale_[0], this.imageScale_[1]);\n context.drawImage(\n this.image_,\n this.imageOriginX_,\n this.imageOriginY_,\n this.imageWidth_,\n this.imageHeight_,\n -this.imageAnchorX_,\n -this.imageAnchorY_,\n this.imageWidth_,\n this.imageHeight_,\n );\n context.restore();\n } else {\n context.drawImage(\n this.image_,\n this.imageOriginX_,\n this.imageOriginY_,\n this.imageWidth_,\n this.imageHeight_,\n x,\n y,\n this.imageWidth_,\n this.imageHeight_,\n );\n }\n }\n if (this.imageOpacity_ != 1) {\n context.globalAlpha = alpha;\n }\n }\n\n /**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @private\n */\n drawText_(flatCoordinates, offset, end, stride) {\n if (!this.textState_ || this.text_ === '') {\n return;\n }\n if (this.textFillState_) {\n this.setContextFillState_(this.textFillState_);\n }\n if (this.textStrokeState_) {\n this.setContextStrokeState_(this.textStrokeState_);\n }\n this.setContextTextState_(this.textState_);\n const pixelCoordinates = transform2D(\n flatCoordinates,\n offset,\n end,\n stride,\n this.transform_,\n this.pixelCoordinates_,\n );\n const context = this.context_;\n let rotation = this.textRotation_;\n if (this.transformRotation_ === 0) {\n rotation -= this.viewRotation_;\n }\n if (this.textRotateWithView_) {\n rotation += this.viewRotation_;\n }\n for (; offset < end; offset += stride) {\n const x = pixelCoordinates[offset] + this.textOffsetX_;\n const y = pixelCoordinates[offset + 1] + this.textOffsetY_;\n if (\n rotation !== 0 ||\n this.textScale_[0] != 1 ||\n this.textScale_[1] != 1\n ) {\n context.save();\n context.translate(x - this.textOffsetX_, y - this.textOffsetY_);\n context.rotate(rotation);\n context.translate(this.textOffsetX_, this.textOffsetY_);\n context.scale(this.textScale_[0], this.textScale_[1]);\n if (this.textStrokeState_) {\n context.strokeText(this.text_, 0, 0);\n }\n if (this.textFillState_) {\n context.fillText(this.text_, 0, 0);\n }\n context.restore();\n } else {\n if (this.textStrokeState_) {\n context.strokeText(this.text_, x, y);\n }\n if (this.textFillState_) {\n context.fillText(this.text_, x, y);\n }\n }\n }\n }\n\n /**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {boolean} close Close.\n * @private\n * @return {number} end End.\n */\n moveToLineTo_(flatCoordinates, offset, end, stride, close) {\n const context = this.context_;\n const pixelCoordinates = transform2D(\n flatCoordinates,\n offset,\n end,\n stride,\n this.transform_,\n this.pixelCoordinates_,\n );\n context.moveTo(pixelCoordinates[0], pixelCoordinates[1]);\n let length = pixelCoordinates.length;\n if (close) {\n length -= 2;\n }\n for (let i = 2; i < length; i += 2) {\n context.lineTo(pixelCoordinates[i], pixelCoordinates[i + 1]);\n }\n if (close) {\n context.closePath();\n }\n return end;\n }\n\n /**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @private\n * @return {number} End.\n */\n drawRings_(flatCoordinates, offset, ends, stride) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.moveToLineTo_(\n flatCoordinates,\n offset,\n ends[i],\n stride,\n true,\n );\n }\n return offset;\n }\n\n /**\n * Render a circle geometry into the canvas. Rendering is immediate and uses\n * the current fill and stroke styles.\n *\n * @param {import(\"../../geom/Circle.js\").default} geometry Circle geometry.\n * @api\n * @override\n */\n drawCircle(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Circle.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.fillState_ || this.strokeState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n const pixelCoordinates = transformGeom2D(\n geometry,\n this.transform_,\n this.pixelCoordinates_,\n );\n const dx = pixelCoordinates[2] - pixelCoordinates[0];\n const dy = pixelCoordinates[3] - pixelCoordinates[1];\n const radius = Math.sqrt(dx * dx + dy * dy);\n const context = this.context_;\n context.beginPath();\n context.arc(\n pixelCoordinates[0],\n pixelCoordinates[1],\n radius,\n 0,\n 2 * Math.PI,\n );\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n this.drawText_(geometry.getCenter(), 0, 2, 2);\n }\n }\n\n /**\n * Set the rendering style. Note that since this is an immediate rendering API,\n * any `zIndex` on the provided style will be ignored.\n *\n * @param {import(\"../../style/Style.js\").default} style The rendering style.\n * @api\n * @override\n */\n setStyle(style) {\n this.setFillStrokeStyle(style.getFill(), style.getStroke());\n this.setImageStyle(style.getImage());\n this.setTextStyle(style.getText());\n }\n\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n */\n setTransform(transform) {\n this.transform_ = transform;\n }\n\n /**\n * Render a geometry into the canvas. Call\n * {@link module:ol/render/canvas/Immediate~CanvasImmediateRenderer#setStyle renderer.setStyle()} first to set the rendering style.\n *\n * @param {import(\"../../geom/Geometry.js\").default|import(\"../Feature.js\").default} geometry The geometry to render.\n * @api\n * @override\n */\n drawGeometry(geometry) {\n const type = geometry.getType();\n switch (type) {\n case 'Point':\n this.drawPoint(\n /** @type {import(\"../../geom/Point.js\").default} */ (geometry),\n );\n break;\n case 'LineString':\n this.drawLineString(\n /** @type {import(\"../../geom/LineString.js\").default} */ (geometry),\n );\n break;\n case 'Polygon':\n this.drawPolygon(\n /** @type {import(\"../../geom/Polygon.js\").default} */ (geometry),\n );\n break;\n case 'MultiPoint':\n this.drawMultiPoint(\n /** @type {import(\"../../geom/MultiPoint.js\").default} */ (geometry),\n );\n break;\n case 'MultiLineString':\n this.drawMultiLineString(\n /** @type {import(\"../../geom/MultiLineString.js\").default} */ (\n geometry\n ),\n );\n break;\n case 'MultiPolygon':\n this.drawMultiPolygon(\n /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (\n geometry\n ),\n );\n break;\n case 'GeometryCollection':\n this.drawGeometryCollection(\n /** @type {import(\"../../geom/GeometryCollection.js\").default} */ (\n geometry\n ),\n );\n break;\n case 'Circle':\n this.drawCircle(\n /** @type {import(\"../../geom/Circle.js\").default} */ (geometry),\n );\n break;\n default:\n }\n }\n\n /**\n * Render a feature into the canvas. Note that any `zIndex` on the provided\n * style will be ignored - features are rendered immediately in the order that\n * this method is called. If you need `zIndex` support, you should be using an\n * {@link module:ol/layer/Vector~VectorLayer} instead.\n *\n * @param {import(\"../../Feature.js\").default} feature Feature.\n * @param {import(\"../../style/Style.js\").default} style Style.\n * @api\n * @override\n */\n drawFeature(feature, style) {\n const geometry = style.getGeometryFunction()(feature);\n if (!geometry) {\n return;\n }\n this.setStyle(style);\n this.drawGeometry(geometry);\n }\n\n /**\n * Render a GeometryCollection to the canvas. Rendering is immediate and\n * uses the current styles appropriate for each geometry in the collection.\n *\n * @param {import(\"../../geom/GeometryCollection.js\").default} geometry Geometry collection.\n * @override\n */\n drawGeometryCollection(geometry) {\n const geometries = geometry.getGeometriesArray();\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n this.drawGeometry(geometries[i]);\n }\n }\n\n /**\n * Render a Point geometry into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/Point.js\").default|import(\"../Feature.js\").default} geometry Point geometry.\n * @override\n */\n drawPoint(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Point.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n const flatCoordinates = geometry.getFlatCoordinates();\n const stride = geometry.getStride();\n if (this.image_) {\n this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n if (this.text_ !== '') {\n this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n }\n\n /**\n * Render a MultiPoint geometry into the canvas. Rendering is immediate and\n * uses the current style.\n *\n * @param {import(\"../../geom/MultiPoint.js\").default|import(\"../Feature.js\").default} geometry MultiPoint geometry.\n * @override\n */\n drawMultiPoint(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiPoint.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n const flatCoordinates = geometry.getFlatCoordinates();\n const stride = geometry.getStride();\n if (this.image_) {\n this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n if (this.text_ !== '') {\n this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n }\n\n /**\n * Render a LineString into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/LineString.js\").default|import(\"../Feature.js\").default} geometry LineString geometry.\n * @override\n */\n drawLineString(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/LineString.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n const context = this.context_;\n const flatCoordinates = geometry.getFlatCoordinates();\n context.beginPath();\n this.moveToLineTo_(\n flatCoordinates,\n 0,\n flatCoordinates.length,\n geometry.getStride(),\n false,\n );\n context.stroke();\n }\n if (this.text_ !== '') {\n const flatMidpoint = geometry.getFlatMidpoint();\n this.drawText_(flatMidpoint, 0, 2, 2);\n }\n }\n\n /**\n * Render a MultiLineString geometry into the canvas. Rendering is immediate\n * and uses the current style.\n *\n * @param {import(\"../../geom/MultiLineString.js\").default|import(\"../Feature.js\").default} geometry MultiLineString geometry.\n * @override\n */\n drawMultiLineString(geometry) {\n if (this.squaredTolerance_) {\n geometry =\n /** @type {import(\"../../geom/MultiLineString.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n const geometryExtent = geometry.getExtent();\n if (!intersects(this.extent_, geometryExtent)) {\n return;\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n const context = this.context_;\n const flatCoordinates = geometry.getFlatCoordinates();\n let offset = 0;\n const ends = /** @type {Array} */ (geometry.getEnds());\n const stride = geometry.getStride();\n context.beginPath();\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.moveToLineTo_(\n flatCoordinates,\n offset,\n ends[i],\n stride,\n false,\n );\n }\n context.stroke();\n }\n if (this.text_ !== '') {\n const flatMidpoints = geometry.getFlatMidpoints();\n this.drawText_(flatMidpoints, 0, flatMidpoints.length, 2);\n }\n }\n\n /**\n * Render a Polygon geometry into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/Polygon.js\").default|import(\"../Feature.js\").default} geometry Polygon geometry.\n * @override\n */\n drawPolygon(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Polygon.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_ || this.fillState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n const context = this.context_;\n context.beginPath();\n this.drawRings_(\n geometry.getOrientedFlatCoordinates(),\n 0,\n /** @type {Array} */ (geometry.getEnds()),\n geometry.getStride(),\n );\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n const flatInteriorPoint = geometry.getFlatInteriorPoint();\n this.drawText_(flatInteriorPoint, 0, 2, 2);\n }\n }\n\n /**\n * Render MultiPolygon geometry into the canvas. Rendering is immediate and\n * uses the current style.\n * @param {import(\"../../geom/MultiPolygon.js\").default} geometry MultiPolygon geometry.\n * @override\n */\n drawMultiPolygon(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiPolygon.js\").default} */ (\n geometry.simplifyTransformed(\n this.squaredTolerance_,\n this.userTransform_,\n )\n );\n }\n if (!intersects(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_ || this.fillState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n const context = this.context_;\n const flatCoordinates = geometry.getOrientedFlatCoordinates();\n let offset = 0;\n const endss = geometry.getEndss();\n const stride = geometry.getStride();\n context.beginPath();\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n offset = this.drawRings_(flatCoordinates, offset, ends, stride);\n }\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n const flatInteriorPoints = geometry.getFlatInteriorPoints();\n this.drawText_(flatInteriorPoints, 0, flatInteriorPoints.length, 2);\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").FillState} fillState Fill state.\n * @private\n */\n setContextFillState_(fillState) {\n const context = this.context_;\n const contextFillState = this.contextFillState_;\n if (!contextFillState) {\n context.fillStyle = fillState.fillStyle;\n this.contextFillState_ = {\n fillStyle: fillState.fillStyle,\n };\n } else {\n if (contextFillState.fillStyle != fillState.fillStyle) {\n contextFillState.fillStyle = fillState.fillStyle;\n context.fillStyle = fillState.fillStyle;\n }\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").StrokeState} strokeState Stroke state.\n * @private\n */\n setContextStrokeState_(strokeState) {\n const context = this.context_;\n const contextStrokeState = this.contextStrokeState_;\n if (!contextStrokeState) {\n context.lineCap = strokeState.lineCap;\n context.setLineDash(strokeState.lineDash);\n context.lineDashOffset = strokeState.lineDashOffset;\n context.lineJoin = strokeState.lineJoin;\n context.lineWidth = strokeState.lineWidth;\n context.miterLimit = strokeState.miterLimit;\n context.strokeStyle = strokeState.strokeStyle;\n this.contextStrokeState_ = {\n lineCap: strokeState.lineCap,\n lineDash: strokeState.lineDash,\n lineDashOffset: strokeState.lineDashOffset,\n lineJoin: strokeState.lineJoin,\n lineWidth: strokeState.lineWidth,\n miterLimit: strokeState.miterLimit,\n strokeStyle: strokeState.strokeStyle,\n };\n } else {\n if (contextStrokeState.lineCap != strokeState.lineCap) {\n contextStrokeState.lineCap = strokeState.lineCap;\n context.lineCap = strokeState.lineCap;\n }\n if (!equals(contextStrokeState.lineDash, strokeState.lineDash)) {\n context.setLineDash(\n (contextStrokeState.lineDash = strokeState.lineDash),\n );\n }\n if (contextStrokeState.lineDashOffset != strokeState.lineDashOffset) {\n contextStrokeState.lineDashOffset = strokeState.lineDashOffset;\n context.lineDashOffset = strokeState.lineDashOffset;\n }\n if (contextStrokeState.lineJoin != strokeState.lineJoin) {\n contextStrokeState.lineJoin = strokeState.lineJoin;\n context.lineJoin = strokeState.lineJoin;\n }\n if (contextStrokeState.lineWidth != strokeState.lineWidth) {\n contextStrokeState.lineWidth = strokeState.lineWidth;\n context.lineWidth = strokeState.lineWidth;\n }\n if (contextStrokeState.miterLimit != strokeState.miterLimit) {\n contextStrokeState.miterLimit = strokeState.miterLimit;\n context.miterLimit = strokeState.miterLimit;\n }\n if (contextStrokeState.strokeStyle != strokeState.strokeStyle) {\n contextStrokeState.strokeStyle = strokeState.strokeStyle;\n context.strokeStyle = strokeState.strokeStyle;\n }\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").TextState} textState Text state.\n * @private\n */\n setContextTextState_(textState) {\n const context = this.context_;\n const contextTextState = this.contextTextState_;\n const textAlign = textState.textAlign\n ? textState.textAlign\n : defaultTextAlign;\n if (!contextTextState) {\n context.font = textState.font;\n context.textAlign = textAlign;\n context.textBaseline = textState.textBaseline;\n this.contextTextState_ = {\n font: textState.font,\n textAlign: textAlign,\n textBaseline: textState.textBaseline,\n };\n } else {\n if (contextTextState.font != textState.font) {\n contextTextState.font = textState.font;\n context.font = textState.font;\n }\n if (contextTextState.textAlign != textAlign) {\n contextTextState.textAlign = textAlign;\n context.textAlign = textAlign;\n }\n if (contextTextState.textBaseline != textState.textBaseline) {\n contextTextState.textBaseline = textState.textBaseline;\n context.textBaseline = textState.textBaseline;\n }\n }\n }\n\n /**\n * Set the fill and stroke style for subsequent draw operations. To clear\n * either fill or stroke styles, pass null for the appropriate parameter.\n *\n * @param {import(\"../../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../../style/Stroke.js\").default} strokeStyle Stroke style.\n * @override\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {\n if (!fillStyle) {\n this.fillState_ = null;\n } else {\n const fillStyleColor = fillStyle.getColor();\n this.fillState_ = {\n fillStyle: asColorLike(\n fillStyleColor ? fillStyleColor : defaultFillStyle,\n ),\n };\n }\n if (!strokeStyle) {\n this.strokeState_ = null;\n } else {\n const strokeStyleColor = strokeStyle.getColor();\n const strokeStyleLineCap = strokeStyle.getLineCap();\n const strokeStyleLineDash = strokeStyle.getLineDash();\n const strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();\n const strokeStyleLineJoin = strokeStyle.getLineJoin();\n const strokeStyleWidth = strokeStyle.getWidth();\n const strokeStyleMiterLimit = strokeStyle.getMiterLimit();\n const lineDash = strokeStyleLineDash\n ? strokeStyleLineDash\n : defaultLineDash;\n this.strokeState_ = {\n lineCap:\n strokeStyleLineCap !== undefined\n ? strokeStyleLineCap\n : defaultLineCap,\n lineDash:\n this.pixelRatio_ === 1\n ? lineDash\n : lineDash.map((n) => n * this.pixelRatio_),\n lineDashOffset:\n (strokeStyleLineDashOffset\n ? strokeStyleLineDashOffset\n : defaultLineDashOffset) * this.pixelRatio_,\n lineJoin:\n strokeStyleLineJoin !== undefined\n ? strokeStyleLineJoin\n : defaultLineJoin,\n lineWidth:\n (strokeStyleWidth !== undefined\n ? strokeStyleWidth\n : defaultLineWidth) * this.pixelRatio_,\n miterLimit:\n strokeStyleMiterLimit !== undefined\n ? strokeStyleMiterLimit\n : defaultMiterLimit,\n strokeStyle: asColorLike(\n strokeStyleColor ? strokeStyleColor : defaultStrokeStyle,\n ),\n };\n }\n }\n\n /**\n * Set the image style for subsequent draw operations. Pass null to remove\n * the image style.\n *\n * @param {import(\"../../style/Image.js\").default} imageStyle Image style.\n * @override\n */\n setImageStyle(imageStyle) {\n let imageSize;\n if (!imageStyle || !(imageSize = imageStyle.getSize())) {\n this.image_ = null;\n return;\n }\n const imagePixelRatio = imageStyle.getPixelRatio(this.pixelRatio_);\n const imageAnchor = imageStyle.getAnchor();\n const imageOrigin = imageStyle.getOrigin();\n this.image_ = imageStyle.getImage(this.pixelRatio_);\n this.imageAnchorX_ = imageAnchor[0] * imagePixelRatio;\n this.imageAnchorY_ = imageAnchor[1] * imagePixelRatio;\n this.imageHeight_ = imageSize[1] * imagePixelRatio;\n this.imageOpacity_ = imageStyle.getOpacity();\n this.imageOriginX_ = imageOrigin[0];\n this.imageOriginY_ = imageOrigin[1];\n this.imageRotateWithView_ = imageStyle.getRotateWithView();\n this.imageRotation_ = imageStyle.getRotation();\n const imageScale = imageStyle.getScaleArray();\n this.imageScale_ = [\n (imageScale[0] * this.pixelRatio_) / imagePixelRatio,\n (imageScale[1] * this.pixelRatio_) / imagePixelRatio,\n ];\n this.imageWidth_ = imageSize[0] * imagePixelRatio;\n }\n\n /**\n * Set the text style for subsequent draw operations. Pass null to\n * remove the text style.\n *\n * @param {import(\"../../style/Text.js\").default} textStyle Text style.\n * @override\n */\n setTextStyle(textStyle) {\n if (!textStyle) {\n this.text_ = '';\n } else {\n const textFillStyle = textStyle.getFill();\n if (!textFillStyle) {\n this.textFillState_ = null;\n } else {\n const textFillStyleColor = textFillStyle.getColor();\n this.textFillState_ = {\n fillStyle: asColorLike(\n textFillStyleColor ? textFillStyleColor : defaultFillStyle,\n ),\n };\n }\n const textStrokeStyle = textStyle.getStroke();\n if (!textStrokeStyle) {\n this.textStrokeState_ = null;\n } else {\n const textStrokeStyleColor = textStrokeStyle.getColor();\n const textStrokeStyleLineCap = textStrokeStyle.getLineCap();\n const textStrokeStyleLineDash = textStrokeStyle.getLineDash();\n const textStrokeStyleLineDashOffset =\n textStrokeStyle.getLineDashOffset();\n const textStrokeStyleLineJoin = textStrokeStyle.getLineJoin();\n const textStrokeStyleWidth = textStrokeStyle.getWidth();\n const textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();\n this.textStrokeState_ = {\n lineCap:\n textStrokeStyleLineCap !== undefined\n ? textStrokeStyleLineCap\n : defaultLineCap,\n lineDash: textStrokeStyleLineDash\n ? textStrokeStyleLineDash\n : defaultLineDash,\n lineDashOffset: textStrokeStyleLineDashOffset\n ? textStrokeStyleLineDashOffset\n : defaultLineDashOffset,\n lineJoin:\n textStrokeStyleLineJoin !== undefined\n ? textStrokeStyleLineJoin\n : defaultLineJoin,\n lineWidth:\n textStrokeStyleWidth !== undefined\n ? textStrokeStyleWidth\n : defaultLineWidth,\n miterLimit:\n textStrokeStyleMiterLimit !== undefined\n ? textStrokeStyleMiterLimit\n : defaultMiterLimit,\n strokeStyle: asColorLike(\n textStrokeStyleColor ? textStrokeStyleColor : defaultStrokeStyle,\n ),\n };\n }\n const textFont = textStyle.getFont();\n const textOffsetX = textStyle.getOffsetX();\n const textOffsetY = textStyle.getOffsetY();\n const textRotateWithView = textStyle.getRotateWithView();\n const textRotation = textStyle.getRotation();\n const textScale = textStyle.getScaleArray();\n const textText = textStyle.getText();\n const textTextAlign = textStyle.getTextAlign();\n const textTextBaseline = textStyle.getTextBaseline();\n this.textState_ = {\n font: textFont !== undefined ? textFont : defaultFont,\n textAlign:\n textTextAlign !== undefined ? textTextAlign : defaultTextAlign,\n textBaseline:\n textTextBaseline !== undefined\n ? textTextBaseline\n : defaultTextBaseline,\n };\n this.text_ =\n textText !== undefined\n ? Array.isArray(textText)\n ? textText.reduce((acc, t, i) => (acc += i % 2 ? ' ' : t), '')\n : textText\n : '';\n this.textOffsetX_ =\n textOffsetX !== undefined ? this.pixelRatio_ * textOffsetX : 0;\n this.textOffsetY_ =\n textOffsetY !== undefined ? this.pixelRatio_ * textOffsetY : 0;\n this.textRotateWithView_ =\n textRotateWithView !== undefined ? textRotateWithView : false;\n this.textRotation_ = textRotation !== undefined ? textRotation : 0;\n this.textScale_ = [\n this.pixelRatio_ * textScale[0],\n this.pixelRatio_ * textScale[1],\n ];\n }\n }\n}\n\nexport default CanvasImmediateRenderer;\n","/**\n * @module ol/renderer/vector\n */\nimport ImageState from '../ImageState.js';\nimport {getUid} from '../util.js';\n\n/**\n * Feature callback. The callback will be called with three arguments. The first\n * argument is one {@link module:ol/Feature~Feature feature} or {@link module:ol/render/Feature~RenderFeature render feature}\n * at the pixel, the second is the {@link module:ol/layer/Layer~Layer layer} of the feature and will be null for\n * unmanaged layers. The third is the {@link module:ol/geom/SimpleGeometry~SimpleGeometry} of the feature. For features\n * with a GeometryCollection geometry, it will be the first detected geometry from the collection.\n * @template T\n * @typedef {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default, import(\"../geom/SimpleGeometry.js\").default): T} FeatureCallback\n */\n\n/**\n * Tolerance for geometry simplification in device pixels.\n * @type {number}\n */\nconst SIMPLIFY_TOLERANCE = 0.5;\n\n/**\n * @const\n * @type {Object}\n */\nconst GEOMETRY_RENDERERS = {\n 'Point': renderPointGeometry,\n 'LineString': renderLineStringGeometry,\n 'Polygon': renderPolygonGeometry,\n 'MultiPoint': renderMultiPointGeometry,\n 'MultiLineString': renderMultiLineStringGeometry,\n 'MultiPolygon': renderMultiPolygonGeometry,\n 'GeometryCollection': renderGeometryCollectionGeometry,\n 'Circle': renderCircleGeometry,\n};\n\n/**\n * @param {import(\"../Feature.js\").FeatureLike} feature1 Feature 1.\n * @param {import(\"../Feature.js\").FeatureLike} feature2 Feature 2.\n * @return {number} Order.\n */\nexport function defaultOrder(feature1, feature2) {\n return parseInt(getUid(feature1), 10) - parseInt(getUid(feature2), 10);\n}\n\n/**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Squared pixel tolerance.\n */\nexport function getSquaredTolerance(resolution, pixelRatio) {\n const tolerance = getTolerance(resolution, pixelRatio);\n return tolerance * tolerance;\n}\n\n/**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel tolerance.\n */\nexport function getTolerance(resolution, pixelRatio) {\n return (SIMPLIFY_TOLERANCE * resolution) / pixelRatio;\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Builder group.\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {number} [index] Render order index.\n */\nfunction renderCircleGeometry(builderGroup, geometry, style, feature, index) {\n const fillStyle = style.getFill();\n const strokeStyle = style.getStroke();\n if (fillStyle || strokeStyle) {\n const circleReplay = builderGroup.getBuilder(style.getZIndex(), 'Circle');\n circleReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n circleReplay.drawCircle(geometry, feature, index);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Transform from user to view projection.\n * @param {boolean} [declutter] Enable decluttering.\n * @param {number} [index] Render order index..\n * @return {boolean} `true` if style is loading.\n */\nexport function renderFeature(\n replayGroup,\n feature,\n style,\n squaredTolerance,\n listener,\n transform,\n declutter,\n index,\n) {\n const loadingPromises = [];\n const imageStyle = style.getImage();\n if (imageStyle) {\n let loading = true;\n const imageState = imageStyle.getImageState();\n if (imageState == ImageState.LOADED || imageState == ImageState.ERROR) {\n loading = false;\n } else {\n if (imageState == ImageState.IDLE) {\n imageStyle.load();\n }\n }\n if (loading) {\n loadingPromises.push(imageStyle.ready());\n }\n }\n const fillStyle = style.getFill();\n if (fillStyle && fillStyle.loading()) {\n loadingPromises.push(fillStyle.ready());\n }\n const loading = loadingPromises.length > 0;\n if (loading) {\n Promise.all(loadingPromises).then(() => listener(null));\n }\n renderFeatureInternal(\n replayGroup,\n feature,\n style,\n squaredTolerance,\n transform,\n declutter,\n index,\n );\n\n return loading;\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @param {boolean} [declutter] Enable decluttering.\n * @param {number} [index] Render order index..\n */\nfunction renderFeatureInternal(\n replayGroup,\n feature,\n style,\n squaredTolerance,\n transform,\n declutter,\n index,\n) {\n const geometry = style.getGeometryFunction()(feature);\n if (!geometry) {\n return;\n }\n const simplifiedGeometry = geometry.simplifyTransformed(\n squaredTolerance,\n transform,\n );\n const renderer = style.getRenderer();\n if (renderer) {\n renderGeometry(replayGroup, simplifiedGeometry, style, feature, index);\n } else {\n const geometryRenderer = GEOMETRY_RENDERERS[simplifiedGeometry.getType()];\n geometryRenderer(\n replayGroup,\n simplifiedGeometry,\n style,\n feature,\n index,\n declutter,\n );\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\nfunction renderGeometry(replayGroup, geometry, style, feature, index) {\n if (geometry.getType() == 'GeometryCollection') {\n const geometries =\n /** @type {import(\"../geom/GeometryCollection.js\").default} */ (\n geometry\n ).getGeometries();\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n renderGeometry(replayGroup, geometries[i], style, feature, index);\n }\n return;\n }\n const replay = replayGroup.getBuilder(style.getZIndex(), 'Default');\n replay.drawCustom(\n /** @type {import(\"../geom/SimpleGeometry.js\").default} */ (geometry),\n feature,\n style.getRenderer(),\n style.getHitDetectionRenderer(),\n index,\n );\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n * @param {number} [index] Render order index.\n */\nfunction renderGeometryCollectionGeometry(\n replayGroup,\n geometry,\n style,\n feature,\n declutterBuilderGroup,\n index,\n) {\n const geometries = geometry.getGeometriesArray();\n let i, ii;\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n const geometryRenderer = GEOMETRY_RENDERERS[geometries[i].getType()];\n geometryRenderer(\n replayGroup,\n geometries[i],\n style,\n feature,\n declutterBuilderGroup,\n index,\n );\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/LineString.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\nfunction renderLineStringGeometry(\n builderGroup,\n geometry,\n style,\n feature,\n index,\n) {\n const strokeStyle = style.getStroke();\n if (strokeStyle) {\n const lineStringReplay = builderGroup.getBuilder(\n style.getZIndex(),\n 'LineString',\n );\n lineStringReplay.setFillStrokeStyle(null, strokeStyle);\n lineStringReplay.drawLineString(geometry, feature, index);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature, index);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\nfunction renderMultiLineStringGeometry(\n builderGroup,\n geometry,\n style,\n feature,\n index,\n) {\n const strokeStyle = style.getStroke();\n if (strokeStyle) {\n const lineStringReplay = builderGroup.getBuilder(\n style.getZIndex(),\n 'LineString',\n );\n lineStringReplay.setFillStrokeStyle(null, strokeStyle);\n lineStringReplay.drawMultiLineString(geometry, feature, index);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature, index);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {number} [index] Render order index.\n */\nfunction renderMultiPolygonGeometry(\n builderGroup,\n geometry,\n style,\n feature,\n index,\n) {\n const fillStyle = style.getFill();\n const strokeStyle = style.getStroke();\n if (strokeStyle || fillStyle) {\n const polygonReplay = builderGroup.getBuilder(style.getZIndex(), 'Polygon');\n polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n polygonReplay.drawMultiPolygon(geometry, feature, index);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature, index);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/Point.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n * @param {boolean} [declutter] Enable decluttering.\n */\nfunction renderPointGeometry(\n builderGroup,\n geometry,\n style,\n feature,\n index,\n declutter,\n) {\n const imageStyle = style.getImage();\n const textStyle = style.getText();\n const hasText = textStyle && textStyle.getText();\n /** @type {import(\"../render/canvas.js\").DeclutterImageWithText} */\n const declutterImageWithText =\n declutter && imageStyle && hasText ? {} : undefined;\n if (imageStyle) {\n if (imageStyle.getImageState() != ImageState.LOADED) {\n return;\n }\n const imageReplay = builderGroup.getBuilder(style.getZIndex(), 'Image');\n imageReplay.setImageStyle(imageStyle, declutterImageWithText);\n imageReplay.drawPoint(geometry, feature, index);\n }\n if (hasText) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle, declutterImageWithText);\n textReplay.drawText(geometry, feature, index);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n * @param {boolean} [declutter] Enable decluttering.\n */\nfunction renderMultiPointGeometry(\n builderGroup,\n geometry,\n style,\n feature,\n index,\n declutter,\n) {\n const imageStyle = style.getImage();\n const hasImage = imageStyle && imageStyle.getOpacity() !== 0;\n const textStyle = style.getText();\n const hasText = textStyle && textStyle.getText();\n /** @type {import(\"../render/canvas.js\").DeclutterImageWithText} */\n const declutterImageWithText =\n declutter && hasImage && hasText ? {} : undefined;\n if (hasImage) {\n if (imageStyle.getImageState() != ImageState.LOADED) {\n return;\n }\n const imageReplay = builderGroup.getBuilder(style.getZIndex(), 'Image');\n imageReplay.setImageStyle(imageStyle, declutterImageWithText);\n imageReplay.drawMultiPoint(geometry, feature, index);\n }\n if (hasText) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle, declutterImageWithText);\n textReplay.drawText(geometry, feature, index);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/Polygon.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} [index] Render order index.\n */\nfunction renderPolygonGeometry(builderGroup, geometry, style, feature, index) {\n const fillStyle = style.getFill();\n const strokeStyle = style.getStroke();\n if (fillStyle || strokeStyle) {\n const polygonReplay = builderGroup.getBuilder(style.getZIndex(), 'Polygon');\n polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n polygonReplay.drawPolygon(geometry, feature, index);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = builderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature, index);\n }\n}\n","/**\n * @module ol/featureloader\n */\n\n/**\n *\n * @type {boolean}\n * @private\n */\nlet withCredentials = false;\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * load features.\n *\n * This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing\n * the area to be loaded, a `{number}` representing the resolution (map units per pixel), a\n * {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get\n * the loaded features passed as an argument and an optional failure callback with no arguments. If\n * the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and\n * `'featuresloaderror'` events. `this` within the function is bound to the\n * {@link module:ol/source/Vector~VectorSource} it's called from.\n *\n * The function is responsible for loading the features and adding them to the\n * source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").FeatureLike]\n * @typedef {(\n * extent: import(\"./extent.js\").Extent,\n * resolution: number,\n * projection: import(\"./proj/Projection.js\").default,\n * success?: (features: Array) => void,\n * failure?: () => void) => void} FeatureLoader\n * @api\n */\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * get the url to load features from.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area\n * to be loaded, a `{number}` representing the resolution (map units per pixel)\n * and an {@link module:ol/proj/Projection~Projection} for the projection as\n * arguments and returns a `{string}` representing the URL.\n * @typedef {function(import(\"./extent.js\").Extent, number, import(\"./proj/Projection.js\").default): string} FeatureUrlFunction\n * @api\n */\n\n/**\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array, import(\"./proj/Projection.js\").default): void} success Success\n * Function called with the loaded features and optionally with the data projection.\n * @param {function(): void} failure Failure\n * Function called when loading failed.\n */\nexport function loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n success,\n failure,\n) {\n const xhr = new XMLHttpRequest();\n xhr.open(\n 'GET',\n typeof url === 'function' ? url(extent, resolution, projection) : url,\n true,\n );\n if (format.getType() == 'arraybuffer') {\n xhr.responseType = 'arraybuffer';\n }\n xhr.withCredentials = withCredentials;\n /**\n * @param {Event} event Event.\n * @private\n */\n xhr.onload = function (event) {\n // status will be 0 for file:// urls\n if (!xhr.status || (xhr.status >= 200 && xhr.status < 300)) {\n const type = format.getType();\n try {\n /** @type {Document|Node|Object|string|undefined} */\n let source;\n if (type == 'text' || type == 'json') {\n source = xhr.responseText;\n } else if (type == 'xml') {\n source = xhr.responseXML || xhr.responseText;\n } else if (type == 'arraybuffer') {\n source = /** @type {ArrayBuffer} */ (xhr.response);\n }\n if (source) {\n success(\n /** @type {Array} */\n (\n format.readFeatures(source, {\n extent: extent,\n featureProjection: projection,\n })\n ),\n format.readProjection(source),\n );\n } else {\n failure();\n }\n } catch {\n failure();\n }\n } else {\n failure();\n }\n };\n /**\n * @private\n */\n xhr.onerror = failure;\n xhr.send();\n}\n\n/**\n * Create an XHR feature loader for a `url` and `format`. The feature loader\n * loads features (with XHR), parses the features, and adds them to the\n * vector source.\n *\n * @template {import(\"./Feature.js\").FeatureLike} [FeatureType=import(\"./Feature.js\").default]\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @return {FeatureLoader} The feature loader.\n * @api\n */\nexport function xhr(url, format) {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array): void} [success] Success\n * Function called when loading succeeded.\n * @param {function(): void} [failure] Failure\n * Function called when loading failed.\n * @this {import(\"./source/Vector.js\").default}\n */\n return function (extent, resolution, projection, success, failure) {\n loadFeaturesXhr(\n url,\n format,\n extent,\n resolution,\n projection,\n /**\n * @param {Array} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data\n * projection.\n */\n (features, dataProjection) => {\n this.addFeatures(features);\n if (success !== undefined) {\n success(features);\n }\n },\n () => {\n this.changed();\n if (failure !== undefined) {\n failure();\n }\n },\n );\n };\n}\n\n/**\n * Setter for the withCredentials configuration for the XHR.\n *\n * @param {boolean} xhrWithCredentials The value of withCredentials to set.\n * Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/\n * @api\n */\nexport function setWithCredentials(xhrWithCredentials) {\n withCredentials = xhrWithCredentials;\n}\n","/**\n * @module ol/loadingstrategy\n */\n\nimport {fromUserExtent, fromUserResolution, toUserExtent} from './proj.js';\n\n/**\n * Strategy function for loading all features with a single request.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array} Extents.\n * @api\n */\nexport function all(extent, resolution) {\n return [[-Infinity, -Infinity, Infinity, Infinity]];\n}\n\n/**\n * Strategy function for loading features based on the view's extent and\n * resolution.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array} Extents.\n * @api\n */\nexport function bbox(extent, resolution) {\n return [extent];\n}\n\n/**\n * Creates a strategy function for loading features based on a tile grid.\n * @param {import(\"./tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @return {function(import(\"./extent.js\").Extent, number, import(\"./proj.js\").Projection): Array} Loading strategy.\n * @api\n */\nexport function tile(tileGrid) {\n return (\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj.js\").Projection} projection Projection.\n * @return {Array} Extents.\n */\n function (extent, resolution, projection) {\n const z = tileGrid.getZForResolution(\n fromUserResolution(resolution, projection),\n );\n const tileRange = tileGrid.getTileRangeForExtentAndZ(\n fromUserExtent(extent, projection),\n z,\n );\n /** @type {Array} */\n const extents = [];\n /** @type {import(\"./tilecoord.js\").TileCoord} */\n const tileCoord = [z, 0, 0];\n for (\n tileCoord[1] = tileRange.minX;\n tileCoord[1] <= tileRange.maxX;\n ++tileCoord[1]\n ) {\n for (\n tileCoord[2] = tileRange.minY;\n tileCoord[2] <= tileRange.maxY;\n ++tileCoord[2]\n ) {\n extents.push(\n toUserExtent(tileGrid.getTileCoordExtent(tileCoord), projection),\n );\n }\n }\n return extents;\n }\n );\n}\n","/**\n * @module ol/geom/flat/center\n */\nimport {createEmpty, createOrUpdateFromFlatCoordinates} from '../../extent.js';\n\n/**\n * @param {Array} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array>} endss Endss.\n * @param {number} stride Stride.\n * @return {Array} Flat centers.\n */\nexport function linearRingss(flatCoordinates, offset, endss, stride) {\n const flatCenters = [];\n let extent = createEmpty();\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n extent = createOrUpdateFromFlatCoordinates(\n flatCoordinates,\n offset,\n ends[0],\n stride,\n );\n flatCenters.push((extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2);\n offset = ends[ends.length - 1];\n }\n return flatCenters;\n}\n","/**\n * @module ol/geom/GeometryCollection\n */\nimport EventType from '../events/EventType.js';\nimport {listen, unlistenByKey} from '../events.js';\nimport {\n closestSquaredDistanceXY,\n createOrUpdateEmpty,\n extend,\n getCenter,\n} from '../extent.js';\nimport Geometry from './Geometry.js';\n\n/**\n * @classdesc\n * An array of {@link module:ol/geom/Geometry~Geometry} objects.\n *\n * @api\n */\nclass GeometryCollection extends Geometry {\n /**\n * @param {Array} geometries Geometries.\n */\n constructor(geometries) {\n super();\n\n /**\n * @private\n * @type {Array}\n */\n this.geometries_ = geometries;\n\n /**\n * @private\n * @type {Array}\n */\n this.changeEventsKeys_ = [];\n\n this.listenGeometriesChange_();\n }\n\n /**\n * @private\n */\n unlistenGeometriesChange_() {\n this.changeEventsKeys_.forEach(unlistenByKey);\n this.changeEventsKeys_.length = 0;\n }\n\n /**\n * @private\n */\n listenGeometriesChange_() {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n this.changeEventsKeys_.push(\n listen(geometries[i], EventType.CHANGE, this.changed, this),\n );\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!GeometryCollection} Clone.\n * @api\n * @override\n */\n clone() {\n const geometryCollection = new GeometryCollection(\n cloneGeometries(this.geometries_),\n );\n geometryCollection.applyProperties(this);\n return geometryCollection;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n minSquaredDistance = geometries[i].closestPointXY(\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n return minSquaredDistance;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n * @override\n */\n containsXY(x, y) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].containsXY(x, y)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @override\n */\n computeExtent(extent) {\n createOrUpdateEmpty(extent);\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n extend(extent, geometries[i].getExtent());\n }\n return extent;\n }\n\n /**\n * Return the geometries that make up this geometry collection.\n * @return {Array} Geometries.\n * @api\n */\n getGeometries() {\n return cloneGeometries(this.geometries_);\n }\n\n /**\n * @return {Array} Geometries.\n */\n getGeometriesArray() {\n return this.geometries_;\n }\n\n /**\n * @return {Array} Geometries.\n */\n getGeometriesArrayRecursive() {\n /** @type {Array} */\n let geometriesArray = [];\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].getType() === this.getType()) {\n geometriesArray = geometriesArray.concat(\n /** @type {GeometryCollection} */ (\n geometries[i]\n ).getGeometriesArrayRecursive(),\n );\n } else {\n geometriesArray.push(geometries[i]);\n }\n }\n return geometriesArray;\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {GeometryCollection} Simplified GeometryCollection.\n * @override\n */\n getSimplifiedGeometry(squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n if (\n squaredTolerance < 0 ||\n (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 &&\n squaredTolerance < this.simplifiedGeometryMaxMinSquaredTolerance)\n ) {\n return this;\n }\n\n const simplifiedGeometries = [];\n const geometries = this.geometries_;\n let simplified = false;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n const geometry = geometries[i];\n const simplifiedGeometry =\n geometry.getSimplifiedGeometry(squaredTolerance);\n simplifiedGeometries.push(simplifiedGeometry);\n if (simplifiedGeometry !== geometry) {\n simplified = true;\n }\n }\n if (simplified) {\n const simplifiedGeometryCollection = new GeometryCollection(\n simplifiedGeometries,\n );\n return simplifiedGeometryCollection;\n }\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'GeometryCollection';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].intersectsExtent(extent)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return this.geometries_.length === 0;\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n * @override\n */\n rotate(angle, anchor) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].rotate(angle, anchor);\n }\n this.changed();\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n * @override\n */\n scale(sx, sy, anchor) {\n if (!anchor) {\n anchor = getCenter(this.getExtent());\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].scale(sx, sy, anchor);\n }\n this.changed();\n }\n\n /**\n * Set the geometries that make up this geometry collection.\n * @param {Array} geometries Geometries.\n * @api\n */\n setGeometries(geometries) {\n this.setGeometriesArray(cloneGeometries(geometries));\n }\n\n /**\n * @param {Array} geometries Geometries.\n */\n setGeometriesArray(geometries) {\n this.unlistenGeometriesChange_();\n this.geometries_ = geometries;\n this.listenGeometriesChange_();\n this.changed();\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n * @override\n */\n applyTransform(transformFn) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].applyTransform(transformFn);\n }\n this.changed();\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n * @override\n */\n translate(deltaX, deltaY) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].translate(deltaX, deltaY);\n }\n this.changed();\n }\n\n /**\n * Clean up.\n * @override\n */\n disposeInternal() {\n this.unlistenGeometriesChange_();\n super.disposeInternal();\n }\n}\n\n/**\n * @param {Array} geometries Geometries.\n * @return {Array} Cloned geometries.\n */\nfunction cloneGeometries(geometries) {\n return geometries.map((geometry) => geometry.clone());\n}\n\nexport default GeometryCollection;\n","/**\n * @module ol/geom/MultiLineString\n */\nimport {extend} from '../array.js';\nimport {closestSquaredDistanceXY} from '../extent.js';\nimport LineString from './LineString.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {arrayMaxSquaredDelta, assignClosestArrayPoint} from './flat/closest.js';\nimport {deflateCoordinatesArray} from './flat/deflate.js';\nimport {inflateCoordinatesArray} from './flat/inflate.js';\nimport {\n interpolatePoint,\n lineStringsCoordinateAtM,\n} from './flat/interpolate.js';\nimport {intersectsLineStringArray} from './flat/intersectsextent.js';\nimport {lineStringLength} from './flat/length.js';\nimport {douglasPeuckerArray} from './flat/simplify.js';\n\n/**\n * @classdesc\n * Multi-linestring geometry.\n *\n * @api\n */\nclass MultiLineString extends SimpleGeometry {\n /**\n * @param {Array|LineString>|Array} coordinates\n * Coordinates or LineString geometries. (For internal use, flat coordinates in\n * combination with `layout` and `ends` are also accepted.)\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array} [ends] Flat coordinate ends for internal use.\n */\n constructor(coordinates, layout, ends) {\n super();\n\n /**\n * @type {Array}\n * @private\n */\n this.ends_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n if (Array.isArray(coordinates[0])) {\n this.setCoordinates(\n /** @type {Array>} */ (\n coordinates\n ),\n layout,\n );\n } else if (layout !== undefined && ends) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array} */ (coordinates),\n );\n this.ends_ = ends;\n } else {\n const lineStrings = /** @type {Array} */ (coordinates);\n /** @type {Array} */\n const flatCoordinates = [];\n const ends = [];\n for (let i = 0, ii = lineStrings.length; i < ii; ++i) {\n const lineString = lineStrings[i];\n extend(flatCoordinates, lineString.getFlatCoordinates());\n ends.push(flatCoordinates.length);\n }\n const layout =\n lineStrings.length === 0\n ? this.getLayout()\n : lineStrings[0].getLayout();\n this.setFlatCoordinates(layout, flatCoordinates);\n this.ends_ = ends;\n }\n }\n\n /**\n * Append the passed linestring to the multilinestring.\n * @param {LineString} lineString LineString.\n * @api\n */\n appendLineString(lineString) {\n extend(this.flatCoordinates, lineString.getFlatCoordinates().slice());\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiLineString} Clone.\n * @api\n * @override\n */\n clone() {\n const multiLineString = new MultiLineString(\n this.flatCoordinates.slice(),\n this.layout,\n this.ends_.slice(),\n );\n multiLineString.applyProperties(this);\n return multiLineString;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(\n arrayMaxSquaredDelta(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n 0,\n ),\n );\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestArrayPoint(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n this.maxDelta_,\n false,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * `interpolate` controls interpolation between consecutive LineStrings\n * within the MultiLineString. If `interpolate` is `true` the coordinates\n * will be linearly interpolated between the last coordinate of one LineString\n * and the first coordinate of the next LineString. If `interpolate` is\n * `false` then the function will return `null` for Ms falling between\n * LineStrings.\n *\n * @param {number} m M.\n * @param {boolean} [extrapolate] Extrapolate. Default is `false`.\n * @param {boolean} [interpolate] Interpolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate|null} Coordinate.\n * @api\n */\n getCoordinateAtM(m, extrapolate, interpolate) {\n if (\n (this.layout != 'XYM' && this.layout != 'XYZM') ||\n this.flatCoordinates.length === 0\n ) {\n return null;\n }\n extrapolate = extrapolate !== undefined ? extrapolate : false;\n interpolate = interpolate !== undefined ? interpolate : false;\n return lineStringsCoordinateAtM(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n m,\n extrapolate,\n interpolate,\n );\n }\n\n /**\n * Return the coordinates of the multilinestring.\n * @return {Array>} Coordinates.\n * @api\n * @override\n */\n getCoordinates() {\n return inflateCoordinatesArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n );\n }\n\n /**\n * @return {Array} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * Return the linestring at the specified index.\n * @param {number} index Index.\n * @return {LineString} LineString.\n * @api\n */\n getLineString(index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new LineString(\n this.flatCoordinates.slice(\n index === 0 ? 0 : this.ends_[index - 1],\n this.ends_[index],\n ),\n this.layout,\n );\n }\n\n /**\n * Return the linestrings of this multilinestring.\n * @return {Array} LineStrings.\n * @api\n */\n getLineStrings() {\n const flatCoordinates = this.flatCoordinates;\n const ends = this.ends_;\n const layout = this.layout;\n /** @type {Array} */\n const lineStrings = [];\n let offset = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const lineString = new LineString(\n flatCoordinates.slice(offset, end),\n layout,\n );\n lineStrings.push(lineString);\n offset = end;\n }\n return lineStrings;\n }\n\n /**\n * Return the sum of all line string lengths\n * @return {number} Length (on projected plane).\n * @api\n */\n getLength() {\n const ends = this.ends_;\n let start = 0;\n let length = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n length += lineStringLength(\n this.flatCoordinates,\n start,\n ends[i],\n this.stride,\n );\n start = ends[i];\n }\n return length;\n }\n\n /**\n * @return {Array} Flat midpoints.\n */\n getFlatMidpoints() {\n /** @type {Array} */\n const midpoints = [];\n const flatCoordinates = this.flatCoordinates;\n let offset = 0;\n const ends = this.ends_;\n const stride = this.stride;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const midpoint = interpolatePoint(\n flatCoordinates,\n offset,\n end,\n stride,\n 0.5,\n );\n extend(midpoints, midpoint);\n offset = end;\n }\n return midpoints;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {MultiLineString} Simplified MultiLineString.\n * @protected\n * @override\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array} */\n const simplifiedEnds = [];\n simplifiedFlatCoordinates.length = douglasPeuckerArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n simplifiedEnds,\n );\n return new MultiLineString(simplifiedFlatCoordinates, 'XY', simplifiedEnds);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'MultiLineString';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return intersectsLineStringArray(\n this.flatCoordinates,\n 0,\n this.ends_,\n this.stride,\n extent,\n );\n }\n\n /**\n * Set the coordinates of the multilinestring.\n * @param {!Array>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const ends = deflateCoordinatesArray(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n this.ends_,\n );\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n }\n}\n\nexport default MultiLineString;\n","/**\n * @module ol/geom/MultiPoint\n */\nimport {extend} from '../array.js';\nimport {closestSquaredDistanceXY, containsXY} from '../extent.js';\nimport {squaredDistance as squaredDx} from '../math.js';\nimport Point from './Point.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {deflateCoordinates} from './flat/deflate.js';\nimport {inflateCoordinates} from './flat/inflate.js';\n\n/**\n * @classdesc\n * Multi-point geometry.\n *\n * @api\n */\nclass MultiPoint extends SimpleGeometry {\n /**\n * @param {Array|Array} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n if (layout && !Array.isArray(coordinates[0])) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array} */ (coordinates),\n );\n } else {\n this.setCoordinates(\n /** @type {Array} */ (\n coordinates\n ),\n layout,\n );\n }\n }\n\n /**\n * Append the passed point to this multipoint.\n * @param {Point} point Point.\n * @api\n */\n appendPoint(point) {\n extend(this.flatCoordinates, point.getFlatCoordinates());\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiPoint} Clone.\n * @api\n * @override\n */\n clone() {\n const multiPoint = new MultiPoint(\n this.flatCoordinates.slice(),\n this.layout,\n );\n multiPoint.applyProperties(this);\n return multiPoint;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n const flatCoordinates = this.flatCoordinates;\n const stride = this.stride;\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n const squaredDistance = squaredDx(\n x,\n y,\n flatCoordinates[i],\n flatCoordinates[i + 1],\n );\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (let j = 0; j < stride; ++j) {\n closestPoint[j] = flatCoordinates[i + j];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n }\n\n /**\n * Return the coordinates of the multipoint.\n * @return {Array} Coordinates.\n * @api\n * @override\n */\n getCoordinates() {\n return inflateCoordinates(\n this.flatCoordinates,\n 0,\n this.flatCoordinates.length,\n this.stride,\n );\n }\n\n /**\n * Return the point at the specified index.\n * @param {number} index Index.\n * @return {Point} Point.\n * @api\n */\n getPoint(index) {\n const n = this.flatCoordinates.length / this.stride;\n if (index < 0 || n <= index) {\n return null;\n }\n return new Point(\n this.flatCoordinates.slice(\n index * this.stride,\n (index + 1) * this.stride,\n ),\n this.layout,\n );\n }\n\n /**\n * Return the points of this multipoint.\n * @return {Array} Points.\n * @api\n */\n getPoints() {\n const flatCoordinates = this.flatCoordinates;\n const layout = this.layout;\n const stride = this.stride;\n /** @type {Array} */\n const points = [];\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n const point = new Point(flatCoordinates.slice(i, i + stride), layout);\n points.push(point);\n }\n return points;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'MultiPoint';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n const flatCoordinates = this.flatCoordinates;\n const stride = this.stride;\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n const x = flatCoordinates[i];\n const y = flatCoordinates[i + 1];\n if (containsXY(extent, x, y)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Set the coordinates of the multipoint.\n * @param {!Array} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = deflateCoordinates(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n );\n this.changed();\n }\n}\n\nexport default MultiPoint;\n","/**\n * @module ol/geom/MultiPolygon\n */\nimport {extend} from '../array.js';\nimport {closestSquaredDistanceXY} from '../extent.js';\nimport MultiPoint from './MultiPoint.js';\nimport Polygon from './Polygon.js';\nimport SimpleGeometry from './SimpleGeometry.js';\nimport {linearRingss as linearRingssArea} from './flat/area.js';\nimport {linearRingss as linearRingssCenter} from './flat/center.js';\nimport {\n assignClosestMultiArrayPoint,\n multiArrayMaxSquaredDelta,\n} from './flat/closest.js';\nimport {linearRingssContainsXY} from './flat/contains.js';\nimport {deflateMultiCoordinatesArray} from './flat/deflate.js';\nimport {inflateMultiCoordinatesArray} from './flat/inflate.js';\nimport {getInteriorPointsOfMultiArray} from './flat/interiorpoint.js';\nimport {intersectsLinearRingMultiArray} from './flat/intersectsextent.js';\nimport {\n linearRingssAreOriented,\n orientLinearRingsArray,\n} from './flat/orient.js';\nimport {quantizeMultiArray} from './flat/simplify.js';\n\n/**\n * @classdesc\n * Multi-polygon geometry.\n *\n * @api\n */\nclass MultiPolygon extends SimpleGeometry {\n /**\n * @param {Array>|Polygon>|Array} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` and `endss` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array>} [endss] Array of ends for internal use with flat coordinates.\n */\n constructor(coordinates, layout, endss) {\n super();\n\n /**\n * @type {Array>}\n * @private\n */\n this.endss_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.flatInteriorPointsRevision_ = -1;\n\n /**\n * @private\n * @type {Array|null}\n */\n this.flatInteriorPoints_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.orientedRevision_ = -1;\n\n /**\n * @private\n * @type {Array|null}\n */\n this.orientedFlatCoordinates_ = null;\n\n if (!endss && !Array.isArray(coordinates[0])) {\n const polygons = /** @type {Array} */ (coordinates);\n /** @type {Array} */\n const flatCoordinates = [];\n const thisEndss = [];\n for (let i = 0, ii = polygons.length; i < ii; ++i) {\n const polygon = polygons[i];\n const offset = flatCoordinates.length;\n const ends = polygon.getEnds();\n for (let j = 0, jj = ends.length; j < jj; ++j) {\n ends[j] += offset;\n }\n extend(flatCoordinates, polygon.getFlatCoordinates());\n thisEndss.push(ends);\n }\n layout =\n polygons.length === 0 ? this.getLayout() : polygons[0].getLayout();\n coordinates = flatCoordinates;\n endss = thisEndss;\n }\n if (layout !== undefined && endss) {\n this.setFlatCoordinates(\n layout,\n /** @type {Array} */ (coordinates),\n );\n this.endss_ = endss;\n } else {\n this.setCoordinates(\n /** @type {Array>>} */ (\n coordinates\n ),\n layout,\n );\n }\n }\n\n /**\n * Append the passed polygon to this multipolygon.\n * @param {Polygon} polygon Polygon.\n * @api\n */\n appendPolygon(polygon) {\n /** @type {Array} */\n let ends;\n if (!this.flatCoordinates) {\n this.flatCoordinates = polygon.getFlatCoordinates().slice();\n ends = polygon.getEnds().slice();\n this.endss_.push();\n } else {\n const offset = this.flatCoordinates.length;\n extend(this.flatCoordinates, polygon.getFlatCoordinates());\n ends = polygon.getEnds().slice();\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n ends[i] += offset;\n }\n }\n this.endss_.push(ends);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiPolygon} Clone.\n * @api\n * @override\n */\n clone() {\n const len = this.endss_.length;\n const newEndss = new Array(len);\n for (let i = 0; i < len; ++i) {\n newEndss[i] = this.endss_[i].slice();\n }\n\n const multiPolygon = new MultiPolygon(\n this.flatCoordinates.slice(),\n this.layout,\n newEndss,\n );\n multiPolygon.applyProperties(this);\n\n return multiPolygon;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n * @override\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt(\n multiArrayMaxSquaredDelta(\n this.flatCoordinates,\n 0,\n this.endss_,\n this.stride,\n 0,\n ),\n );\n this.maxDeltaRevision_ = this.getRevision();\n }\n return assignClosestMultiArrayPoint(\n this.getOrientedFlatCoordinates(),\n 0,\n this.endss_,\n this.stride,\n this.maxDelta_,\n true,\n x,\n y,\n closestPoint,\n minSquaredDistance,\n );\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n * @override\n */\n containsXY(x, y) {\n return linearRingssContainsXY(\n this.getOrientedFlatCoordinates(),\n 0,\n this.endss_,\n this.stride,\n x,\n y,\n );\n }\n\n /**\n * Return the area of the multipolygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n getArea() {\n return linearRingssArea(\n this.getOrientedFlatCoordinates(),\n 0,\n this.endss_,\n this.stride,\n );\n }\n\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for multi-polygons.\n *\n * @param {boolean} [right] Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array>>} Coordinates.\n * @api\n * @override\n */\n getCoordinates(right) {\n let flatCoordinates;\n if (right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n orientLinearRingsArray(\n flatCoordinates,\n 0,\n this.endss_,\n this.stride,\n right,\n );\n } else {\n flatCoordinates = this.flatCoordinates;\n }\n\n return inflateMultiCoordinatesArray(\n flatCoordinates,\n 0,\n this.endss_,\n this.stride,\n );\n }\n\n /**\n * @return {Array>} Endss.\n */\n getEndss() {\n return this.endss_;\n }\n\n /**\n * @return {Array} Flat interior points.\n */\n getFlatInteriorPoints() {\n if (this.flatInteriorPointsRevision_ != this.getRevision()) {\n const flatCenters = linearRingssCenter(\n this.flatCoordinates,\n 0,\n this.endss_,\n this.stride,\n );\n this.flatInteriorPoints_ = getInteriorPointsOfMultiArray(\n this.getOrientedFlatCoordinates(),\n 0,\n this.endss_,\n this.stride,\n flatCenters,\n );\n this.flatInteriorPointsRevision_ = this.getRevision();\n }\n return /** @type {Array} */ (this.flatInteriorPoints_);\n }\n\n /**\n * Return the interior points as {@link module:ol/geom/MultiPoint~MultiPoint multipoint}.\n * @return {MultiPoint} Interior points as XYM coordinates, where M is\n * the length of the horizontal intersection that the point belongs to.\n * @api\n */\n getInteriorPoints() {\n return new MultiPoint(this.getFlatInteriorPoints().slice(), 'XYM');\n }\n\n /**\n * @return {Array} Oriented flat coordinates.\n */\n getOrientedFlatCoordinates() {\n if (this.orientedRevision_ != this.getRevision()) {\n const flatCoordinates = this.flatCoordinates;\n if (\n linearRingssAreOriented(flatCoordinates, 0, this.endss_, this.stride)\n ) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n } else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length = orientLinearRingsArray(\n this.orientedFlatCoordinates_,\n 0,\n this.endss_,\n this.stride,\n );\n }\n this.orientedRevision_ = this.getRevision();\n }\n return /** @type {Array} */ (this.orientedFlatCoordinates_);\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {MultiPolygon} Simplified MultiPolygon.\n * @protected\n * @override\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array>} */\n const simplifiedEndss = [];\n simplifiedFlatCoordinates.length = quantizeMultiArray(\n this.flatCoordinates,\n 0,\n this.endss_,\n this.stride,\n Math.sqrt(squaredTolerance),\n simplifiedFlatCoordinates,\n 0,\n simplifiedEndss,\n );\n return new MultiPolygon(simplifiedFlatCoordinates, 'XY', simplifiedEndss);\n }\n\n /**\n * Return the polygon at the specified index.\n * @param {number} index Index.\n * @return {Polygon} Polygon.\n * @api\n */\n getPolygon(index) {\n if (index < 0 || this.endss_.length <= index) {\n return null;\n }\n let offset;\n if (index === 0) {\n offset = 0;\n } else {\n const prevEnds = this.endss_[index - 1];\n offset = prevEnds[prevEnds.length - 1];\n }\n const ends = this.endss_[index].slice();\n const end = ends[ends.length - 1];\n if (offset !== 0) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n ends[i] -= offset;\n }\n }\n return new Polygon(\n this.flatCoordinates.slice(offset, end),\n this.layout,\n ends,\n );\n }\n\n /**\n * Return the polygons of this multipolygon.\n * @return {Array} Polygons.\n * @api\n */\n getPolygons() {\n const layout = this.layout;\n const flatCoordinates = this.flatCoordinates;\n const endss = this.endss_;\n const polygons = [];\n let offset = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i].slice();\n const end = ends[ends.length - 1];\n if (offset !== 0) {\n for (let j = 0, jj = ends.length; j < jj; ++j) {\n ends[j] -= offset;\n }\n }\n const polygon = new Polygon(\n flatCoordinates.slice(offset, end),\n layout,\n ends,\n );\n polygons.push(polygon);\n offset = end;\n }\n return polygons;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n * @override\n */\n getType() {\n return 'MultiPolygon';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n * @override\n */\n intersectsExtent(extent) {\n return intersectsLinearRingMultiArray(\n this.getOrientedFlatCoordinates(),\n 0,\n this.endss_,\n this.stride,\n extent,\n );\n }\n\n /**\n * Set the coordinates of the multipolygon.\n * @param {!Array>>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n * @override\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 3);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const endss = deflateMultiCoordinatesArray(\n this.flatCoordinates,\n 0,\n coordinates,\n this.stride,\n this.endss_,\n );\n if (endss.length === 0) {\n this.flatCoordinates.length = 0;\n } else {\n const lastEnds = endss[endss.length - 1];\n this.flatCoordinates.length =\n lastEnds.length === 0 ? 0 : lastEnds[lastEnds.length - 1];\n }\n this.changed();\n }\n}\n\nexport default MultiPolygon;\n","/**\n * @module ol/render/Feature\n */\nimport Feature from '../Feature.js';\nimport {extend} from '../array.js';\nimport {\n createOrUpdateFromCoordinate,\n createOrUpdateFromFlatCoordinates,\n getCenter,\n getHeight,\n} from '../extent.js';\nimport {memoizeOne} from '../functions.js';\nimport {linearRingss as linearRingssCenter} from '../geom/flat/center.js';\nimport {\n getInteriorPointOfArray,\n getInteriorPointsOfMultiArray,\n} from '../geom/flat/interiorpoint.js';\nimport {interpolatePoint} from '../geom/flat/interpolate.js';\nimport {inflateEnds} from '../geom/flat/orient.js';\nimport {\n douglasPeucker,\n douglasPeuckerArray,\n quantizeArray,\n} from '../geom/flat/simplify.js';\nimport {transform2D} from '../geom/flat/transform.js';\nimport {\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from '../geom.js';\nimport {get as getProjection} from '../proj.js';\nimport {\n compose as composeTransform,\n create as createTransform,\n} from '../transform.js';\n\n/**\n * @typedef {'Point' | 'LineString' | 'LinearRing' | 'Polygon' | 'MultiPoint' | 'MultiLineString'} Type\n * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`,\n * `'Polygon'`, `'MultiPoint'` or 'MultiLineString'`.\n */\n\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nconst tmpTransform = createTransform();\n\n/**\n * Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like\n * structure, optimized for vector tile rendering and styling. Geometry access\n * through the API is limited to getting the type and extent of the geometry.\n */\nclass RenderFeature {\n /**\n * @param {Type} type Geometry type.\n * @param {Array} flatCoordinates Flat coordinates. These always need\n * to be right-handed for polygons.\n * @param {Array} ends Ends.\n * @param {number} stride Stride.\n * @param {Object} properties Properties.\n * @param {number|string|undefined} id Feature id.\n */\n constructor(type, flatCoordinates, ends, stride, properties, id) {\n /**\n * @type {import(\"../style/Style.js\").StyleFunction|undefined}\n */\n this.styleFunction;\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent|undefined}\n */\n this.extent_;\n\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = id;\n\n /**\n * @private\n * @type {Type}\n */\n this.type_ = type;\n\n /**\n * @private\n * @type {Array}\n */\n this.flatCoordinates_ = flatCoordinates;\n\n /**\n * @private\n * @type {Array}\n */\n this.flatInteriorPoints_ = null;\n\n /**\n * @private\n * @type {Array}\n */\n this.flatMidpoints_ = null;\n\n /**\n * @private\n * @type {Array|null}\n */\n this.ends_ = ends || null;\n\n /**\n * @private\n * @type {Object}\n */\n this.properties_ = properties;\n\n /**\n * @private\n * @type {number}\n */\n this.squaredTolerance_;\n\n /**\n * @private\n * @type {number}\n */\n this.stride_ = stride;\n\n /**\n * @private\n * @type {RenderFeature}\n */\n this.simplifiedGeometry_;\n }\n\n /**\n * Get a feature property by its key.\n * @param {string} key Key\n * @return {*} Value for the requested key.\n * @api\n */\n get(key) {\n return this.properties_[key];\n }\n\n /**\n * Get the extent of this feature's geometry.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getExtent() {\n if (!this.extent_) {\n this.extent_ =\n this.type_ === 'Point'\n ? createOrUpdateFromCoordinate(this.flatCoordinates_)\n : createOrUpdateFromFlatCoordinates(\n this.flatCoordinates_,\n 0,\n this.flatCoordinates_.length,\n 2,\n );\n }\n return this.extent_;\n }\n\n /**\n * @return {Array} Flat interior points.\n */\n getFlatInteriorPoint() {\n if (!this.flatInteriorPoints_) {\n const flatCenter = getCenter(this.getExtent());\n this.flatInteriorPoints_ = getInteriorPointOfArray(\n this.flatCoordinates_,\n 0,\n this.ends_,\n 2,\n flatCenter,\n 0,\n );\n }\n return this.flatInteriorPoints_;\n }\n\n /**\n * @return {Array} Flat interior points.\n */\n getFlatInteriorPoints() {\n if (!this.flatInteriorPoints_) {\n const ends = inflateEnds(this.flatCoordinates_, this.ends_);\n const flatCenters = linearRingssCenter(this.flatCoordinates_, 0, ends, 2);\n this.flatInteriorPoints_ = getInteriorPointsOfMultiArray(\n this.flatCoordinates_,\n 0,\n ends,\n 2,\n flatCenters,\n );\n }\n return this.flatInteriorPoints_;\n }\n\n /**\n * @return {Array} Flat midpoint.\n */\n getFlatMidpoint() {\n if (!this.flatMidpoints_) {\n this.flatMidpoints_ = interpolatePoint(\n this.flatCoordinates_,\n 0,\n this.flatCoordinates_.length,\n 2,\n 0.5,\n );\n }\n return this.flatMidpoints_;\n }\n\n /**\n * @return {Array} Flat midpoints.\n */\n getFlatMidpoints() {\n if (!this.flatMidpoints_) {\n this.flatMidpoints_ = [];\n const flatCoordinates = this.flatCoordinates_;\n let offset = 0;\n const ends = /** @type {Array} */ (this.ends_);\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const midpoint = interpolatePoint(flatCoordinates, offset, end, 2, 0.5);\n extend(this.flatMidpoints_, midpoint);\n offset = end;\n }\n }\n return this.flatMidpoints_;\n }\n\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is set when reading data from a remote source.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id_;\n }\n\n /**\n * @return {Array} Flat coordinates.\n */\n getOrientedFlatCoordinates() {\n return this.flatCoordinates_;\n }\n\n /**\n * For API compatibility with {@link module:ol/Feature~Feature}, this method is useful when\n * determining the geometry type in style function (see {@link #getType}).\n * @return {RenderFeature} Feature.\n * @api\n */\n getGeometry() {\n return this;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {RenderFeature} Simplified geometry.\n */\n getSimplifiedGeometry(squaredTolerance) {\n return this;\n }\n\n /**\n * Get a transformed and simplified version of the geometry.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @return {RenderFeature} Simplified geometry.\n */\n simplifyTransformed(squaredTolerance, transform) {\n return this;\n }\n\n /**\n * Get the feature properties.\n * @return {Object} Feature properties.\n * @api\n */\n getProperties() {\n return this.properties_;\n }\n\n /**\n * Get an object of all property names and values. This has the same behavior as getProperties,\n * but is here to conform with the {@link module:ol/Feature~Feature} interface.\n * @return {Object?} Object.\n */\n getPropertiesInternal() {\n return this.properties_;\n }\n\n /**\n * @return {number} Stride.\n */\n getStride() {\n return this.stride_;\n }\n\n /**\n * @return {import('../style/Style.js').StyleFunction|undefined} Style\n */\n getStyleFunction() {\n return this.styleFunction;\n }\n\n /**\n * Get the type of this feature's geometry.\n * @return {Type} Geometry type.\n * @api\n */\n getType() {\n return this.type_;\n }\n\n /**\n * Transform geometry coordinates from tile pixel space to projected.\n *\n * @param {import(\"../proj.js\").ProjectionLike} projection The data projection\n */\n transform(projection) {\n projection = getProjection(projection);\n const pixelExtent = projection.getExtent();\n const projectedExtent = projection.getWorldExtent();\n if (pixelExtent && projectedExtent) {\n const scale = getHeight(projectedExtent) / getHeight(pixelExtent);\n composeTransform(\n tmpTransform,\n projectedExtent[0],\n projectedExtent[3],\n scale,\n -scale,\n 0,\n 0,\n 0,\n );\n transform2D(\n this.flatCoordinates_,\n 0,\n this.flatCoordinates_.length,\n 2,\n tmpTransform,\n this.flatCoordinates_,\n );\n }\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n */\n applyTransform(transformFn) {\n transformFn(this.flatCoordinates_, this.flatCoordinates_, this.stride_);\n }\n\n /**\n * @return {RenderFeature} A cloned render feature.\n */\n clone() {\n return new RenderFeature(\n this.type_,\n this.flatCoordinates_.slice(),\n this.ends_?.slice(),\n this.stride_,\n Object.assign({}, this.properties_),\n this.id_,\n );\n }\n\n /**\n * @return {Array|null} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * Add transform and resolution based geometry simplification to this instance.\n * @return {RenderFeature} This render feature.\n */\n enableSimplifyTransformed() {\n this.simplifyTransformed = memoizeOne((squaredTolerance, transform) => {\n if (squaredTolerance === this.squaredTolerance_) {\n return this.simplifiedGeometry_;\n }\n this.simplifiedGeometry_ = this.clone();\n if (transform) {\n this.simplifiedGeometry_.applyTransform(transform);\n }\n const simplifiedFlatCoordinates =\n this.simplifiedGeometry_.getFlatCoordinates();\n let simplifiedEnds;\n switch (this.type_) {\n case 'LineString':\n simplifiedFlatCoordinates.length = douglasPeucker(\n simplifiedFlatCoordinates,\n 0,\n this.simplifiedGeometry_.flatCoordinates_.length,\n this.simplifiedGeometry_.stride_,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n );\n simplifiedEnds = [simplifiedFlatCoordinates.length];\n break;\n case 'MultiLineString':\n simplifiedEnds = [];\n simplifiedFlatCoordinates.length = douglasPeuckerArray(\n simplifiedFlatCoordinates,\n 0,\n this.simplifiedGeometry_.ends_,\n this.simplifiedGeometry_.stride_,\n squaredTolerance,\n simplifiedFlatCoordinates,\n 0,\n simplifiedEnds,\n );\n break;\n case 'Polygon':\n simplifiedEnds = [];\n simplifiedFlatCoordinates.length = quantizeArray(\n simplifiedFlatCoordinates,\n 0,\n this.simplifiedGeometry_.ends_,\n this.simplifiedGeometry_.stride_,\n Math.sqrt(squaredTolerance),\n simplifiedFlatCoordinates,\n 0,\n simplifiedEnds,\n );\n break;\n default:\n }\n if (simplifiedEnds) {\n this.simplifiedGeometry_ = new RenderFeature(\n this.type_,\n simplifiedFlatCoordinates,\n simplifiedEnds,\n 2,\n this.properties_,\n this.id_,\n );\n }\n this.squaredTolerance_ = squaredTolerance;\n return this.simplifiedGeometry_;\n });\n return this;\n }\n}\n\n/**\n * @return {Array} Flat coordinates.\n */\nRenderFeature.prototype.getFlatCoordinates =\n RenderFeature.prototype.getOrientedFlatCoordinates;\n\n/**\n * Create a geometry from an `ol/render/Feature`\n * @param {RenderFeature} renderFeature\n * Render Feature\n * @return {Point|MultiPoint|LineString|MultiLineString|Polygon|MultiPolygon}\n * New geometry instance.\n * @api\n */\nexport function toGeometry(renderFeature) {\n const geometryType = renderFeature.getType();\n switch (geometryType) {\n case 'Point':\n return new Point(renderFeature.getFlatCoordinates());\n case 'MultiPoint':\n return new MultiPoint(renderFeature.getFlatCoordinates(), 'XY');\n case 'LineString':\n return new LineString(renderFeature.getFlatCoordinates(), 'XY');\n case 'MultiLineString':\n return new MultiLineString(\n renderFeature.getFlatCoordinates(),\n 'XY',\n /** @type {Array} */ (renderFeature.getEnds()),\n );\n case 'Polygon':\n const flatCoordinates = renderFeature.getFlatCoordinates();\n const ends = renderFeature.getEnds();\n const endss = inflateEnds(flatCoordinates, ends);\n return endss.length > 1\n ? new MultiPolygon(flatCoordinates, 'XY', endss)\n : new Polygon(flatCoordinates, 'XY', ends);\n default:\n throw new Error('Invalid geometry type:' + geometryType);\n }\n}\n\n/**\n * Create an `ol/Feature` from an `ol/render/Feature`\n * @param {RenderFeature} renderFeature RenderFeature\n * @param {string} [geometryName] Geometry name to use\n * when creating the Feature.\n * @return {Feature} Newly constructed `ol/Feature` with properties,\n * geometry, and id copied over.\n * @api\n */\nexport function toFeature(renderFeature, geometryName) {\n const id = renderFeature.getId();\n const geometry = toGeometry(renderFeature);\n const properties = renderFeature.getProperties();\n const feature = new Feature();\n if (geometryName !== undefined) {\n feature.setGeometryName(geometryName);\n }\n feature.setGeometry(geometry);\n if (id !== undefined) {\n feature.setId(id);\n }\n feature.setProperties(properties, true);\n return feature;\n}\n\nexport default RenderFeature;\n","\n/**\n * Rearranges items so that all items in the [left, k] are the smallest.\n * The k-th element will have the (k - left + 1)-th smallest value in [left, right].\n *\n * @template T\n * @param {T[]} arr the array to partially sort (in place)\n * @param {number} k middle index for partial sorting (as defined above)\n * @param {number} [left=0] left index of the range to sort\n * @param {number} [right=arr.length-1] right index\n * @param {(a: T, b: T) => number} [compare = (a, b) => a - b] compare function\n */\nexport default function quickselect(arr, k, left = 0, right = arr.length - 1, compare = defaultCompare) {\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(arr, k, newLeft, newRight, compare);\n }\n\n const t = arr[k];\n let i = left;\n /** @type {number} */\n let j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\n/**\n * @template T\n * @param {T[]} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @returns {number}\n */\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n","import quickselect from 'quickselect';\n\nexport default class RBush {\n constructor(maxEntries = 9) {\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n this.clear();\n }\n\n all() {\n return this._all(this.data, []);\n }\n\n search(bbox) {\n let node = this.data;\n const result = [];\n\n if (!intersects(bbox, node)) return result;\n\n const toBBox = this.toBBox;\n const nodesToSearch = [];\n\n while (node) {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n const childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) this._all(child, result);\n else nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n }\n\n collides(bbox) {\n let node = this.data;\n\n if (!intersects(bbox, node)) return false;\n\n const nodesToSearch = [];\n while (node) {\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n const childBBox = node.leaf ? this.toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) return true;\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n }\n\n load(data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (let i = 0; i < data.length; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n let node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n const tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n }\n\n insert(item) {\n if (item) this._insert(item, this.data.height - 1);\n return this;\n }\n\n clear() {\n this.data = createNode([]);\n return this;\n }\n\n remove(item, equalsFn) {\n if (!item) return this;\n\n let node = this.data;\n const bbox = this.toBBox(item);\n const path = [];\n const indexes = [];\n let i, parent, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n const index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else node = null; // nothing found\n }\n\n return this;\n }\n\n toBBox(item) { return item; }\n\n compareMinX(a, b) { return a.minX - b.minX; }\n compareMinY(a, b) { return a.minY - b.minY; }\n\n toJSON() { return this.data; }\n\n fromJSON(data) {\n this.data = data;\n return this;\n }\n\n _all(node, result) {\n const nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push(...node.children);\n else nodesToSearch.push(...node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n }\n\n _build(items, left, right, height) {\n\n const N = right - left + 1;\n let M = this._maxEntries;\n let node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n const N2 = Math.ceil(N / M);\n const N1 = N2 * Math.ceil(Math.sqrt(M));\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (let i = left; i <= right; i += N1) {\n\n const right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (let j = i; j <= right2; j += N2) {\n\n const right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n }\n\n _chooseSubtree(bbox, node, level, path) {\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n let minArea = Infinity;\n let minEnlargement = Infinity;\n let targetNode;\n\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n const area = bboxArea(child);\n const enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n }\n\n _insert(item, level, isNode) {\n const bbox = isNode ? item : this.toBBox(item);\n const insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n const node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n }\n\n // split overflowed node into two\n _split(insertPath, level) {\n const node = insertPath[level];\n const M = node.children.length;\n const m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n const splitIndex = this._chooseSplitIndex(node, m, M);\n\n const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this._splitRoot(node, newNode);\n }\n\n _splitRoot(node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n }\n\n _chooseSplitIndex(node, m, M) {\n let index;\n let minOverlap = Infinity;\n let minArea = Infinity;\n\n for (let i = m; i <= M - m; i++) {\n const bbox1 = distBBox(node, 0, i, this.toBBox);\n const bbox2 = distBBox(node, i, M, this.toBBox);\n\n const overlap = intersectionArea(bbox1, bbox2);\n const area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index || M - m;\n }\n\n // sorts node children by the best axis for split\n _chooseSplitAxis(node, m, M) {\n const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n const xMargin = this._allDistMargin(node, m, M, compareMinX);\n const yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n }\n\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin(node, m, M, compare) {\n node.children.sort(compare);\n\n const toBBox = this.toBBox;\n const leftBBox = distBBox(node, 0, m, toBBox);\n const rightBBox = distBBox(node, M - m, M, toBBox);\n let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n for (let i = m; i < M - m; i++) {\n const child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (let i = M - m - 1; i >= m; i--) {\n const child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n }\n\n _adjustParentBBoxes(bbox, path, level) {\n // adjust bboxes along the given tree path\n for (let i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n }\n\n _condense(path) {\n // go through the path, removing empty nodes and updating bboxes\n for (let i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else this.clear();\n\n } else calcBBox(path[i], this.toBBox);\n }\n }\n}\n\nfunction findItem(item, items, equalsFn) {\n if (!equalsFn) return items.indexOf(item);\n\n for (let i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) return i;\n }\n return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n if (!destNode) destNode = createNode(null);\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (let i = k; i < p; i++) {\n const child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n}\n\nfunction extend(a, b) {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n const minX = Math.max(a.minX, b.minX);\n const minY = Math.max(a.minY, b.minY);\n const maxX = Math.min(a.maxX, b.maxX);\n const maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n return b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n return {\n children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n const stack = [left, right];\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n const mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n","/**\n * @module ol/structs/RBush\n */\nimport RBush_ from 'rbush';\nimport {createOrUpdate, equals} from '../extent.js';\nimport {isEmpty} from '../obj.js';\nimport {getUid} from '../util.js';\n\n/**\n * @typedef {import(\"rbush\").BBox & {value: T}} Entry\n * @template T\n */\n\n/**\n * @classdesc\n * Wrapper around the RBush by Vladimir Agafonkin.\n * See https://github.com/mourner/rbush.\n *\n * @template {Object} T\n */\nclass RBush {\n /**\n * @param {number} [maxEntries] Max entries.\n */\n constructor(maxEntries) {\n /**\n * @private\n * @type {RBush_>}\n */\n this.rbush_ = new RBush_(maxEntries);\n\n /**\n * A mapping between the objects added to this rbush wrapper\n * and the objects that are actually added to the internal rbush.\n * @private\n * @type {Object>}\n */\n this.items_ = {};\n }\n\n /**\n * Insert a value into the RBush.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {T} value Value.\n */\n insert(extent, value) {\n /** @type {Entry} */\n const item = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n value: value,\n };\n\n this.rbush_.insert(item);\n this.items_[getUid(value)] = item;\n }\n\n /**\n * Bulk-insert values into the RBush.\n * @param {Array} extents Extents.\n * @param {Array} values Values.\n */\n load(extents, values) {\n const items = new Array(values.length);\n for (let i = 0, l = values.length; i < l; i++) {\n const extent = extents[i];\n const value = values[i];\n\n /** @type {Entry} */\n const item = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n value: value,\n };\n items[i] = item;\n this.items_[getUid(value)] = item;\n }\n this.rbush_.load(items);\n }\n\n /**\n * Remove a value from the RBush.\n * @param {T} value Value.\n * @return {boolean} Removed.\n */\n remove(value) {\n const uid = getUid(value);\n\n // get the object in which the value was wrapped when adding to the\n // internal rbush. then use that object to do the removal.\n const item = this.items_[uid];\n delete this.items_[uid];\n return this.rbush_.remove(item) !== null;\n }\n\n /**\n * Update the extent of a value in the RBush.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {T} value Value.\n */\n update(extent, value) {\n const item = this.items_[getUid(value)];\n const bbox = [item.minX, item.minY, item.maxX, item.maxY];\n if (!equals(bbox, extent)) {\n this.remove(value);\n this.insert(extent, value);\n }\n }\n\n /**\n * Return all values in the RBush.\n * @return {Array} All.\n */\n getAll() {\n const items = this.rbush_.all();\n return items.map(function (item) {\n return item.value;\n });\n }\n\n /**\n * Return all values in the given extent.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {Array} All in extent.\n */\n getInExtent(extent) {\n /** @type {import(\"rbush\").BBox} */\n const bbox = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n };\n const items = this.rbush_.search(bbox);\n return items.map(function (item) {\n return item.value;\n });\n }\n\n /**\n * Calls a callback function with each value in the tree.\n * If the callback returns a truthy value, this value is returned without\n * checking the rest of the tree.\n * @param {function(T): R} callback Callback.\n * @return {R|undefined} Callback return value.\n * @template R\n */\n forEach(callback) {\n return this.forEach_(this.getAll(), callback);\n }\n\n /**\n * Calls a callback function with each value in the provided extent.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(T): R} callback Callback.\n * @return {R|undefined} Callback return value.\n * @template R\n */\n forEachInExtent(extent, callback) {\n return this.forEach_(this.getInExtent(extent), callback);\n }\n\n /**\n * @param {Array} values Values.\n * @param {function(T): R} callback Callback.\n * @return {R|undefined} Callback return value.\n * @template R\n * @private\n */\n forEach_(values, callback) {\n let result;\n for (let i = 0, l = values.length; i < l; i++) {\n result = callback(values[i]);\n if (result) {\n return result;\n }\n }\n return result;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return isEmpty(this.items_);\n }\n\n /**\n * Remove all values from the RBush.\n */\n clear() {\n this.rbush_.clear();\n this.items_ = {};\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} [extent] Extent.\n * @return {import(\"../extent.js\").Extent} Extent.\n */\n getExtent(extent) {\n const data = this.rbush_.toJSON();\n return createOrUpdate(data.minX, data.minY, data.maxX, data.maxY, extent);\n }\n\n /**\n * @param {RBush} rbush R-Tree.\n */\n concat(rbush) {\n this.rbush_.load(rbush.rbush_.all());\n for (const i in rbush.items_) {\n this.items_[i] = rbush.items_[i];\n }\n }\n}\n\nexport default RBush;\n","/**\n * @module ol/source/Source\n */\nimport BaseObject from '../Object.js';\nimport {get as getProjection} from '../proj.js';\n\n/**\n * @typedef {'undefined' | 'loading' | 'ready' | 'error'} State\n * State of the source, one of 'undefined', 'loading', 'ready' or 'error'.\n */\n\n/**\n * A function that takes a {@link import(\"../View.js\").ViewStateLayerStateExtent} and returns a string or\n * an array of strings representing source attributions.\n *\n * @typedef {function(import(\"../View.js\").ViewStateLayerStateExtent): (string|Array)} Attribution\n */\n\n/**\n * A type that can be used to provide attribution information for data sources.\n *\n * It represents either\n * a simple string (e.g. `'© Acme Inc.'`)\n * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)\n * a function that returns a string or array of strings ({@link module:ol/source/Source~Attribution})\n *\n * @typedef {string|Array|Attribution} AttributionLike\n */\n\n/**\n * @typedef {Object} Options\n * @property {AttributionLike} [attributions] Attributions.\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {import(\"./Source.js\").State} [state='ready'] State.\n * @property {boolean} [wrapX=false] WrapX.\n * @property {boolean} [interpolate=false] Use interpolated values when resampling. By default,\n * the nearest neighbor is used when resampling.\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for {@link module:ol/layer/Layer~Layer} sources.\n *\n * A generic `change` event is triggered when the state of the source changes.\n * @abstract\n * @api\n */\nclass Source extends BaseObject {\n /**\n * @param {Options} options Source options.\n */\n constructor(options) {\n super();\n\n /**\n * @protected\n * @type {import(\"../proj/Projection.js\").default|null}\n */\n this.projection = getProjection(options.projection);\n\n /**\n * @private\n * @type {?Attribution}\n */\n this.attributions_ = adaptAttributions(options.attributions);\n\n /**\n * @private\n * @type {boolean}\n */\n this.attributionsCollapsible_ = options.attributionsCollapsible ?? true;\n\n /**\n * This source is currently loading data. Sources that defer loading to the\n * map's tile queue never set this to `true`.\n * @type {boolean}\n */\n this.loading = false;\n\n /**\n * @private\n * @type {import(\"./Source.js\").State}\n */\n this.state_ = options.state !== undefined ? options.state : 'ready';\n\n /**\n * @private\n * @type {boolean}\n */\n this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;\n\n /**\n * @private\n * @type {boolean}\n */\n this.interpolate_ = !!options.interpolate;\n\n /**\n * @protected\n * @type {function(import(\"../View.js\").ViewOptions):void}\n */\n this.viewResolver = null;\n\n /**\n * @protected\n * @type {function(Error):void}\n */\n this.viewRejector = null;\n\n const self = this;\n /**\n * @private\n * @type {Promise}\n */\n this.viewPromise_ = new Promise(function (resolve, reject) {\n self.viewResolver = resolve;\n self.viewRejector = reject;\n });\n }\n\n /**\n * Get the attribution function for the source.\n * @return {?Attribution} Attribution function.\n * @api\n */\n getAttributions() {\n return this.attributions_;\n }\n\n /**\n * @return {boolean} Attributions are collapsible.\n * @api\n */\n getAttributionsCollapsible() {\n return this.attributionsCollapsible_;\n }\n\n /**\n * Get the projection of the source.\n * @return {import(\"../proj/Projection.js\").default|null} Projection.\n * @api\n */\n getProjection() {\n return this.projection;\n }\n\n /**\n * @param {import(\"../proj/Projection\").default} [projection] Projection.\n * @return {Array|null} Resolutions.\n */\n getResolutions(projection) {\n return null;\n }\n\n /**\n * @return {Promise} A promise for view-related properties.\n */\n getView() {\n return this.viewPromise_;\n }\n\n /**\n * Get the state of the source, see {@link import(\"./Source.js\").State} for possible states.\n * @return {import(\"./Source.js\").State} State.\n * @api\n */\n getState() {\n return this.state_;\n }\n\n /**\n * @return {boolean|undefined} Wrap X.\n */\n getWrapX() {\n return this.wrapX_;\n }\n\n /**\n * @return {boolean} Use linear interpolation when resampling.\n */\n getInterpolate() {\n return this.interpolate_;\n }\n\n /**\n * Refreshes the source. The source will be cleared, and data from the server will be reloaded.\n * @api\n */\n refresh() {\n this.changed();\n }\n\n /**\n * Set the attributions of the source.\n * @param {AttributionLike|undefined} attributions Attributions.\n * Can be passed as `string`, `Array`, {@link module:ol/source/Source~Attribution},\n * or `undefined`.\n * @api\n */\n setAttributions(attributions) {\n this.attributions_ = adaptAttributions(attributions);\n this.changed();\n }\n\n /**\n * Set the state of the source.\n * @param {import(\"./Source.js\").State} state State.\n */\n setState(state) {\n this.state_ = state;\n this.changed();\n }\n}\n\n/**\n * Turns the attributions option into an attributions function.\n * @param {AttributionLike|undefined} attributionLike The attribution option.\n * @return {Attribution|null} An attribution function (or null).\n */\nfunction adaptAttributions(attributionLike) {\n if (!attributionLike) {\n return null;\n }\n if (typeof attributionLike === 'function') {\n return attributionLike;\n }\n if (!Array.isArray(attributionLike)) {\n attributionLike = [attributionLike];\n }\n return (frameState) => attributionLike;\n}\n\nexport default Source;\n","/**\n * @module ol/source/VectorEventType\n */\n\n/**\n * @enum {string}\n */\nexport default {\n /**\n * Triggered when a feature is added to the source.\n * @event module:ol/source/Vector.VectorSourceEvent#addfeature\n * @api\n */\n ADDFEATURE: 'addfeature',\n\n /**\n * Triggered when a feature is updated.\n * @event module:ol/source/Vector.VectorSourceEvent#changefeature\n * @api\n */\n CHANGEFEATURE: 'changefeature',\n\n /**\n * Triggered when the clear method is called on the source.\n * @event module:ol/source/Vector.VectorSourceEvent#clear\n * @api\n */\n CLEAR: 'clear',\n\n /**\n * Triggered when a feature is removed from the source.\n * See {@link module:ol/source/Vector~VectorSource#clear source.clear()} for exceptions.\n * @event module:ol/source/Vector.VectorSourceEvent#removefeature\n * @api\n */\n REMOVEFEATURE: 'removefeature',\n\n /**\n * Triggered when features starts loading.\n * @event module:ol/source/Vector.VectorSourceEvent#featuresloadstart\n * @api\n */\n FEATURESLOADSTART: 'featuresloadstart',\n\n /**\n * Triggered when features finishes loading.\n * @event module:ol/source/Vector.VectorSourceEvent#featuresloadend\n * @api\n */\n FEATURESLOADEND: 'featuresloadend',\n\n /**\n * Triggered if feature loading results in an error.\n * @event module:ol/source/Vector.VectorSourceEvent#featuresloaderror\n * @api\n */\n FEATURESLOADERROR: 'featuresloaderror',\n};\n\n/**\n * @typedef {'addfeature'|'changefeature'|'clear'|'removefeature'|'featuresloadstart'|'featuresloadend'|'featuresloaderror'} VectorSourceEventTypes\n */\n","/**\n * @module ol/source/Vector\n */\n\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport ObjectEventType from '../ObjectEventType.js';\nimport {extend} from '../array.js';\nimport {assert} from '../asserts.js';\nimport Event from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport {listen, unlistenByKey} from '../events.js';\nimport {containsExtent, equals, wrapAndSliceX} from '../extent.js';\nimport {xhr} from '../featureloader.js';\nimport {TRUE, VOID} from '../functions.js';\nimport {all as allStrategy} from '../loadingstrategy.js';\nimport {isEmpty} from '../obj.js';\nimport RenderFeature from '../render/Feature.js';\nimport RBush from '../structs/RBush.js';\nimport {getUid} from '../util.js';\nimport Source from './Source.js';\nimport VectorEventType from './VectorEventType.js';\n\n/**\n * A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and\n * returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this\n * is one of the standard {@link module:ol/loadingstrategy} strategies.\n *\n * @typedef {function(import(\"../extent.js\").Extent, number, import(\"../proj/Projection.js\").default): Array} LoadingStrategy\n * @api\n */\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Vector~VectorSource} instances are instances of this\n * type.\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureType=import(\"../Feature.js\").default]\n */\nexport class VectorSourceEvent extends Event {\n /**\n * @param {string} type Type.\n * @param {FeatureType} [feature] Feature.\n * @param {Array} [features] Features.\n */\n constructor(type, feature, features) {\n super(type);\n\n /**\n * The added or removed feature for the `ADDFEATURE` and `REMOVEFEATURE` events, `undefined` otherwise.\n * @type {FeatureType|undefined}\n * @api\n */\n this.feature = feature;\n\n /**\n * The loaded features for the `FEATURESLOADED` event, `undefined` otherwise.\n * @type {Array|undefined}\n * @api\n */\n this.features = features;\n }\n}\n\n/***\n * @template {import(\"../Feature.js\").FeatureLike} [T=import(\"../Feature.js\").default]\n * @typedef {T extends RenderFeature ? T|Array : T} FeatureClassOrArrayOfRenderFeatures\n */\n\n/***\n * @template Return\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureType=import(\"../Feature.js\").default]\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature, Return> &\n * import(\"../Observable\").CombinedOnSignature} VectorSourceOnSignature\n */\n\n/**\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureType=import(\"../Feature.js\").default]\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {Array|Collection} [features]\n * Features. If provided as {@link module:ol/Collection~Collection}, the features in the source\n * and the collection will stay in sync.\n * @property {import(\"../format/Feature.js\").default} [format] The feature format used by the XHR\n * feature loader when `url` is set. Required if `url` is set, otherwise ignored.\n * @property {import(\"../featureloader.js\").FeatureLoader} [loader]\n * The loader function used to load features, from a remote source for example.\n * If this is not set and `url` is set, the source will create and use an XHR\n * feature loader. The `'featuresloadend'` and `'featuresloaderror'` events\n * will only fire if the `success` and `failure` callbacks are used.\n *\n * Example:\n *\n * ```js\n * import Vector from 'ol/source/Vector.js';\n * import GeoJSON from 'ol/format/GeoJSON.js';\n * import {bbox} from 'ol/loadingstrategy.js';\n *\n * const vectorSource = new Vector({\n * format: new GeoJSON(),\n * loader: function(extent, resolution, projection, success, failure) {\n * const proj = projection.getCode();\n * const url = 'https://ahocevar.com/geoserver/wfs?service=WFS&' +\n * 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' +\n * 'outputFormat=application/json&srsname=' + proj + '&' +\n * 'bbox=' + extent.join(',') + ',' + proj;\n * const xhr = new XMLHttpRequest();\n * xhr.open('GET', url);\n * const onError = function() {\n * vectorSource.removeLoadedExtent(extent);\n * failure();\n * }\n * xhr.onerror = onError;\n * xhr.onload = function() {\n * if (xhr.status == 200) {\n * const features = vectorSource.getFormat().readFeatures(xhr.responseText);\n * vectorSource.addFeatures(features);\n * success(features);\n * } else {\n * onError();\n * }\n * }\n * xhr.send();\n * },\n * strategy: bbox,\n * });\n * ```\n * @property {boolean} [overlaps=true] This source may have overlapping geometries.\n * Setting this to `false` (e.g. for sources with polygons that represent administrative\n * boundaries or TopoJSON sources) allows the renderer to optimise fill and\n * stroke operations.\n * @property {LoadingStrategy} [strategy] The loading strategy to use.\n * By default an {@link module:ol/loadingstrategy.all}\n * strategy is used, a one-off strategy which loads all features at once.\n * @property {string|import(\"../featureloader.js\").FeatureUrlFunction} [url]\n * Setting this option instructs the source to load features using an XHR loader\n * (see {@link module:ol/featureloader.xhr}). Use a `string` and an\n * {@link module:ol/loadingstrategy.all} for a one-off download of all features from\n * the given URL. Use a {@link module:ol/featureloader~FeatureUrlFunction} to generate the url with\n * other loading strategies.\n * Requires `format` to be set as well.\n * When default XHR feature loader is provided, the features will\n * be transformed from the data projection to the view projection\n * during parsing. If your remote data source does not advertise its projection\n * properly, this transformation will be incorrect. For some formats, the\n * default projection (usually EPSG:4326) can be overridden by setting the\n * dataProjection constructor option on the format.\n * Note that if a source contains non-feature data, such as a GeoJSON geometry\n * or a KML NetworkLink, these will be ignored. Use a custom loader to load these.\n * @property {boolean} [useSpatialIndex=true]\n * By default, an RTree is used as spatial index. When features are removed and\n * added frequently, and the total number of features is low, setting this to\n * `false` may improve performance.\n *\n * Note that\n * {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent},\n * {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and\n * {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is\n * set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop\n * through all features.\n *\n * When set to `false`, the features will be maintained in an\n * {@link module:ol/Collection~Collection}, which can be retrieved through\n * {@link module:ol/source/Vector~VectorSource#getFeaturesCollection}.\n * @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the\n * -180° and 180° meridians to work properly, this should be set to `false`. The\n * resulting geometry coordinates will then exceed the world bounds.\n */\n\n/**\n * @classdesc\n * Provides a source of features for vector layers. Vector features provided\n * by this source are suitable for editing. See {@link module:ol/source/VectorTile~VectorTile} for\n * vector data that is optimized for rendering.\n *\n * @fires VectorSourceEvent\n * @api\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureType=import(\"../Feature.js\").default]\n */\nclass VectorSource extends Source {\n /**\n * @param {Options} [options] Vector source options.\n */\n constructor(options) {\n options = options || {};\n\n super({\n attributions: options.attributions,\n interpolate: true,\n projection: undefined,\n state: 'ready',\n wrapX: options.wrapX !== undefined ? options.wrapX : true,\n });\n\n /***\n * @type {VectorSourceOnSignature}\n */\n this.on;\n\n /***\n * @type {VectorSourceOnSignature}\n */\n this.once;\n\n /***\n * @type {VectorSourceOnSignature}\n */\n this.un;\n\n /**\n * @private\n * @type {import(\"../featureloader.js\").FeatureLoader}\n */\n this.loader_ = VOID;\n\n /**\n * @private\n * @type {import(\"../format/Feature.js\").default|null}\n */\n this.format_ = options.format || null;\n\n /**\n * @private\n * @type {boolean}\n */\n this.overlaps_ = options.overlaps === undefined ? true : options.overlaps;\n\n /**\n * @private\n * @type {string|import(\"../featureloader.js\").FeatureUrlFunction|undefined}\n */\n this.url_ = options.url;\n\n if (options.loader !== undefined) {\n this.loader_ = options.loader;\n } else if (this.url_ !== undefined) {\n assert(this.format_, '`format` must be set when `url` is set');\n // create a XHR feature loader for \"url\" and \"format\"\n this.loader_ = xhr(this.url_, this.format_);\n }\n\n /**\n * @private\n * @type {LoadingStrategy}\n */\n this.strategy_ =\n options.strategy !== undefined ? options.strategy : allStrategy;\n\n const useSpatialIndex =\n options.useSpatialIndex !== undefined ? options.useSpatialIndex : true;\n\n /**\n * @private\n * @type {RBush}\n */\n this.featuresRtree_ = useSpatialIndex ? new RBush() : null;\n\n /**\n * @private\n * @type {RBush<{extent: import(\"../extent.js\").Extent}>}\n */\n this.loadedExtentsRtree_ = new RBush();\n\n /**\n * @type {number}\n * @private\n */\n this.loadingExtentsCount_ = 0;\n\n /**\n * @private\n * @type {!Object}\n */\n this.nullGeometryFeatures_ = {};\n\n /**\n * A lookup of features by id (the return from feature.getId()).\n * @private\n * @type {!Object>}\n */\n this.idIndex_ = {};\n\n /**\n * A lookup of features by uid (using getUid(feature)).\n * @private\n * @type {!Object}\n */\n this.uidIndex_ = {};\n\n /**\n * @private\n * @type {Object>}\n */\n this.featureChangeKeys_ = {};\n\n /**\n * @private\n * @type {Collection|null}\n */\n this.featuresCollection_ = null;\n\n /** @type {Collection} */\n let collection;\n /** @type {Array} */\n let features;\n if (Array.isArray(options.features)) {\n features = options.features;\n } else if (options.features) {\n collection = options.features;\n features = collection.getArray();\n }\n if (!useSpatialIndex && collection === undefined) {\n collection = new Collection(features);\n }\n if (features !== undefined) {\n this.addFeaturesInternal(features);\n }\n if (collection !== undefined) {\n this.bindFeaturesCollection_(collection);\n }\n }\n\n /**\n * Add a single feature to the source. If you want to add a batch of features\n * at once, call {@link module:ol/source/Vector~VectorSource#addFeatures #addFeatures()}\n * instead. A feature will not be added to the source if feature with\n * the same id is already there. The reason for this behavior is to avoid\n * feature duplication when using bbox or tile loading strategies.\n * Note: this also applies if a {@link module:ol/Collection~Collection} is used for features,\n * meaning that if a feature with a duplicate id is added in the collection, it will\n * be removed from it right away.\n * @param {FeatureType} feature Feature to add.\n * @api\n */\n addFeature(feature) {\n this.addFeatureInternal(feature);\n this.changed();\n }\n\n /**\n * Add a feature without firing a `change` event.\n * @param {FeatureType} feature Feature.\n * @protected\n */\n addFeatureInternal(feature) {\n const featureKey = getUid(feature);\n\n if (!this.addToIndex_(featureKey, feature)) {\n if (this.featuresCollection_) {\n this.featuresCollection_.remove(feature);\n }\n return;\n }\n\n this.setupChangeEvents_(featureKey, feature);\n\n const geometry = feature.getGeometry();\n if (geometry) {\n const extent = geometry.getExtent();\n if (this.featuresRtree_) {\n this.featuresRtree_.insert(extent, feature);\n }\n } else {\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n\n this.dispatchEvent(\n new VectorSourceEvent(VectorEventType.ADDFEATURE, feature),\n );\n }\n\n /**\n * @param {string} featureKey Unique identifier for the feature.\n * @param {FeatureType} feature The feature.\n * @private\n */\n setupChangeEvents_(featureKey, feature) {\n if (feature instanceof RenderFeature) {\n return;\n }\n this.featureChangeKeys_[featureKey] = [\n listen(feature, EventType.CHANGE, this.handleFeatureChange_, this),\n listen(\n feature,\n ObjectEventType.PROPERTYCHANGE,\n this.handleFeatureChange_,\n this,\n ),\n ];\n }\n\n /**\n * @param {string} featureKey Unique identifier for the feature.\n * @param {FeatureType} feature The feature.\n * @return {boolean} The feature is \"valid\", in the sense that it is also a\n * candidate for insertion into the Rtree.\n * @private\n */\n addToIndex_(featureKey, feature) {\n let valid = true;\n if (feature.getId() !== undefined) {\n const id = String(feature.getId());\n if (!(id in this.idIndex_)) {\n this.idIndex_[id] = feature;\n } else if (feature instanceof RenderFeature) {\n const indexedFeature = this.idIndex_[id];\n if (!(indexedFeature instanceof RenderFeature)) {\n valid = false;\n } else if (!Array.isArray(indexedFeature)) {\n this.idIndex_[id] = [indexedFeature, feature];\n } else {\n indexedFeature.push(feature);\n }\n } else {\n valid = false;\n }\n }\n if (valid) {\n assert(\n !(featureKey in this.uidIndex_),\n 'The passed `feature` was already added to the source',\n );\n this.uidIndex_[featureKey] = feature;\n }\n return valid;\n }\n\n /**\n * Add a batch of features to the source.\n * @param {Array} features Features to add.\n * @api\n */\n addFeatures(features) {\n this.addFeaturesInternal(features);\n this.changed();\n }\n\n /**\n * Add features without firing a `change` event.\n * @param {Array} features Features.\n * @protected\n */\n addFeaturesInternal(features) {\n const extents = [];\n /** @type {Array} */\n const newFeatures = [];\n /** @type {Array} */\n const geometryFeatures = [];\n\n for (let i = 0, length = features.length; i < length; i++) {\n const feature = features[i];\n const featureKey = getUid(feature);\n if (this.addToIndex_(featureKey, feature)) {\n newFeatures.push(feature);\n }\n }\n\n for (let i = 0, length = newFeatures.length; i < length; i++) {\n const feature = newFeatures[i];\n const featureKey = getUid(feature);\n this.setupChangeEvents_(featureKey, feature);\n\n const geometry = feature.getGeometry();\n if (geometry) {\n const extent = geometry.getExtent();\n extents.push(extent);\n geometryFeatures.push(feature);\n } else {\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n }\n if (this.featuresRtree_) {\n this.featuresRtree_.load(extents, geometryFeatures);\n }\n\n if (this.hasListener(VectorEventType.ADDFEATURE)) {\n for (let i = 0, length = newFeatures.length; i < length; i++) {\n this.dispatchEvent(\n new VectorSourceEvent(VectorEventType.ADDFEATURE, newFeatures[i]),\n );\n }\n }\n }\n\n /**\n * @param {!Collection} collection Collection.\n * @private\n */\n bindFeaturesCollection_(collection) {\n let modifyingCollection = false;\n this.addEventListener(\n VectorEventType.ADDFEATURE,\n /**\n * @param {VectorSourceEvent} evt The vector source event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n collection.push(evt.feature);\n modifyingCollection = false;\n }\n },\n );\n this.addEventListener(\n VectorEventType.REMOVEFEATURE,\n /**\n * @param {VectorSourceEvent} evt The vector source event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n collection.remove(evt.feature);\n modifyingCollection = false;\n }\n },\n );\n collection.addEventListener(\n CollectionEventType.ADD,\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt The collection event\n */\n (evt) => {\n if (!modifyingCollection) {\n modifyingCollection = true;\n this.addFeature(evt.element);\n modifyingCollection = false;\n }\n },\n );\n collection.addEventListener(\n CollectionEventType.REMOVE,\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt The collection event\n */\n (evt) => {\n if (!modifyingCollection) {\n modifyingCollection = true;\n this.removeFeature(evt.element);\n modifyingCollection = false;\n }\n },\n );\n this.featuresCollection_ = collection;\n }\n\n /**\n * Remove all features from the source.\n * @param {boolean} [fast] Skip dispatching of {@link module:ol/source/Vector.VectorSourceEvent#event:removefeature} events.\n * @api\n */\n clear(fast) {\n if (fast) {\n for (const featureId in this.featureChangeKeys_) {\n const keys = this.featureChangeKeys_[featureId];\n keys.forEach(unlistenByKey);\n }\n if (!this.featuresCollection_) {\n this.featureChangeKeys_ = {};\n this.idIndex_ = {};\n this.uidIndex_ = {};\n }\n } else {\n if (this.featuresRtree_) {\n this.featuresRtree_.forEach((feature) => {\n this.removeFeatureInternal(feature);\n });\n for (const id in this.nullGeometryFeatures_) {\n this.removeFeatureInternal(this.nullGeometryFeatures_[id]);\n }\n }\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.clear();\n }\n\n if (this.featuresRtree_) {\n this.featuresRtree_.clear();\n }\n this.nullGeometryFeatures_ = {};\n\n const clearEvent = new VectorSourceEvent(VectorEventType.CLEAR);\n this.dispatchEvent(clearEvent);\n this.changed();\n }\n\n /**\n * Iterate through all features on the source, calling the provided callback\n * with each one. If the callback returns any \"truthy\" value, iteration will\n * stop and the function will return the same value.\n * Note: this function only iterate through the feature that have a defined geometry.\n *\n * @param {function(FeatureType): T} callback Called with each feature\n * on the source. Return a truthy value to stop iteration.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n forEachFeature(callback) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.forEach(callback);\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.forEach(callback);\n }\n }\n\n /**\n * Iterate through all features whose geometries contain the provided\n * coordinate, calling the callback with each feature. If the callback returns\n * a \"truthy\" value, iteration will stop and the function will return the same\n * value.\n *\n * For {@link module:ol/render/Feature~RenderFeature} features, the callback will be\n * called for all features.\n *\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(FeatureType): T} callback Called with each feature\n * whose goemetry contains the provided coordinate.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n */\n forEachFeatureAtCoordinateDirect(coordinate, callback) {\n const extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]];\n return this.forEachFeatureInExtent(extent, function (feature) {\n const geometry = feature.getGeometry();\n if (\n geometry instanceof RenderFeature ||\n geometry.intersectsCoordinate(coordinate)\n ) {\n return callback(feature);\n }\n return undefined;\n });\n }\n\n /**\n * Iterate through all features whose bounding box intersects the provided\n * extent (note that the feature's geometry may not intersect the extent),\n * calling the callback with each feature. If the callback returns a \"truthy\"\n * value, iteration will stop and the function will return the same value.\n *\n * If you are interested in features whose geometry intersects an extent, call\n * the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent #forEachFeatureIntersectingExtent()} method instead.\n *\n * When `useSpatialIndex` is set to false, this method will loop through all\n * features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature #forEachFeature()}.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(FeatureType): T} callback Called with each feature\n * whose bounding box intersects the provided extent.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n forEachFeatureInExtent(extent, callback) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.forEachInExtent(extent, callback);\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.forEach(callback);\n }\n }\n\n /**\n * Iterate through all features whose geometry intersects the provided extent,\n * calling the callback with each feature. If the callback returns a \"truthy\"\n * value, iteration will stop and the function will return the same value.\n *\n * If you only want to test for bounding box intersection, call the\n * {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent #forEachFeatureInExtent()} method instead.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(FeatureType): T} callback Called with each feature\n * whose geometry intersects the provided extent.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n forEachFeatureIntersectingExtent(extent, callback) {\n return this.forEachFeatureInExtent(\n extent,\n /**\n * @param {FeatureType} feature Feature.\n * @return {T|undefined} The return value from the last call to the callback.\n */\n function (feature) {\n const geometry = feature.getGeometry();\n if (\n geometry instanceof RenderFeature ||\n geometry.intersectsExtent(extent)\n ) {\n const result = callback(feature);\n if (result) {\n return result;\n }\n }\n },\n );\n }\n\n /**\n * Get the features collection associated with this source. Will be `null`\n * unless the source was configured with `useSpatialIndex` set to `false`, or\n * with a {@link module:ol/Collection~Collection} as `features`.\n * @return {Collection|null} The collection of features.\n * @api\n */\n getFeaturesCollection() {\n return this.featuresCollection_;\n }\n\n /**\n * Get a snapshot of the features currently on the source in random order. The returned array\n * is a copy, the features are references to the features in the source.\n * @return {Array} Features.\n * @api\n */\n getFeatures() {\n let features;\n if (this.featuresCollection_) {\n features = this.featuresCollection_.getArray().slice(0);\n } else if (this.featuresRtree_) {\n features = this.featuresRtree_.getAll();\n if (!isEmpty(this.nullGeometryFeatures_)) {\n extend(features, Object.values(this.nullGeometryFeatures_));\n }\n }\n return features;\n }\n\n /**\n * Get all features whose geometry intersects the provided coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {Array} Features.\n * @api\n */\n getFeaturesAtCoordinate(coordinate) {\n /** @type {Array} */\n const features = [];\n this.forEachFeatureAtCoordinateDirect(coordinate, function (feature) {\n features.push(feature);\n });\n return features;\n }\n\n /**\n * Get all features whose bounding box intersects the provided extent. Note that this returns an array of\n * all features intersecting the given extent in random order (so it may include\n * features whose geometries do not intersect the extent).\n *\n * When `useSpatialIndex` is set to false, this method will return all\n * features.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {import(\"../proj/Projection.js\").default} [projection] Include features\n * where `extent` exceeds the x-axis bounds of `projection` and wraps around the world.\n * @return {Array} Features.\n * @api\n */\n getFeaturesInExtent(extent, projection) {\n if (this.featuresRtree_) {\n const multiWorld = projection && projection.canWrapX() && this.getWrapX();\n\n if (!multiWorld) {\n return this.featuresRtree_.getInExtent(extent);\n }\n\n const extents = wrapAndSliceX(extent, projection);\n\n return [].concat(\n ...extents.map((anExtent) => this.featuresRtree_.getInExtent(anExtent)),\n );\n }\n if (this.featuresCollection_) {\n return this.featuresCollection_.getArray().slice(0);\n }\n return [];\n }\n\n /**\n * Get the closest feature to the provided coordinate.\n *\n * This method is not available when the source is configured with\n * `useSpatialIndex` set to `false` and the features in this source are of type\n * {@link module:ol/Feature~Feature}.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(FeatureType):boolean} [filter] Feature filter function.\n * The filter function will receive one argument, the {@link module:ol/Feature~Feature feature}\n * and it should return a boolean value. By default, no filtering is made.\n * @return {FeatureType|null} Closest feature (or `null` if none found).\n * @api\n */\n getClosestFeatureToCoordinate(coordinate, filter) {\n // Find the closest feature using branch and bound. We start searching an\n // infinite extent, and find the distance from the first feature found. This\n // becomes the closest feature. We then compute a smaller extent which any\n // closer feature must intersect. We continue searching with this smaller\n // extent, trying to find a closer feature. Every time we find a closer\n // feature, we update the extent being searched so that any even closer\n // feature must intersect it. We continue until we run out of features.\n const x = coordinate[0];\n const y = coordinate[1];\n let closestFeature = null;\n const closestPoint = [NaN, NaN];\n let minSquaredDistance = Infinity;\n const extent = [-Infinity, -Infinity, Infinity, Infinity];\n filter = filter ? filter : TRUE;\n this.featuresRtree_.forEachInExtent(\n extent,\n /**\n * @param {FeatureType} feature Feature.\n */\n function (feature) {\n if (filter(feature)) {\n const geometry = feature.getGeometry();\n const previousMinSquaredDistance = minSquaredDistance;\n minSquaredDistance =\n geometry instanceof RenderFeature\n ? 0\n : geometry.closestPointXY(x, y, closestPoint, minSquaredDistance);\n if (minSquaredDistance < previousMinSquaredDistance) {\n closestFeature = feature;\n // This is sneaky. Reduce the extent that it is currently being\n // searched while the R-Tree traversal using this same extent object\n // is still in progress. This is safe because the new extent is\n // strictly contained by the old extent.\n const minDistance = Math.sqrt(minSquaredDistance);\n extent[0] = x - minDistance;\n extent[1] = y - minDistance;\n extent[2] = x + minDistance;\n extent[3] = y + minDistance;\n }\n }\n },\n );\n return closestFeature;\n }\n\n /**\n * Get the extent of the features currently in the source.\n *\n * This method is not available when the source is configured with\n * `useSpatialIndex` set to `false`.\n * @param {import(\"../extent.js\").Extent} [extent] Destination extent. If provided, no new extent\n * will be created. Instead, that extent's coordinates will be overwritten.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getExtent(extent) {\n return this.featuresRtree_.getExtent(extent);\n }\n\n /**\n * Get a feature by its identifier (the value returned by feature.getId()). When `RenderFeature`s\n * are used, `getFeatureById()` can return an array of `RenderFeature`s. This allows for handling\n * of `GeometryCollection` geometries, where format readers create one `RenderFeature` per\n * `GeometryCollection` member.\n * Note that the index treats string and numeric identifiers as the same. So\n * `source.getFeatureById(2)` will return a feature with id `'2'` or `2`.\n *\n * @param {string|number} id Feature identifier.\n * @return {FeatureClassOrArrayOfRenderFeatures|null} The feature (or `null` if not found).\n * @api\n */\n getFeatureById(id) {\n const feature = this.idIndex_[id.toString()];\n return feature !== undefined\n ? /** @type {FeatureClassOrArrayOfRenderFeatures} */ (\n feature\n )\n : null;\n }\n\n /**\n * Get a feature by its internal unique identifier (using `getUid`).\n *\n * @param {string} uid Feature identifier.\n * @return {FeatureType|null} The feature (or `null` if not found).\n */\n getFeatureByUid(uid) {\n const feature = this.uidIndex_[uid];\n return feature !== undefined ? feature : null;\n }\n\n /**\n * Get the format associated with this source.\n *\n * @return {import(\"../format/Feature.js\").default|null}} The feature format.\n * @api\n */\n getFormat() {\n return this.format_;\n }\n\n /**\n * @return {boolean} The source can have overlapping geometries.\n */\n getOverlaps() {\n return this.overlaps_;\n }\n\n /**\n * Get the url associated with this source.\n *\n * @return {string|import(\"../featureloader.js\").FeatureUrlFunction|undefined} The url.\n * @api\n */\n getUrl() {\n return this.url_;\n }\n\n /**\n * @param {Event} event Event.\n * @private\n */\n handleFeatureChange_(event) {\n const feature = /** @type {FeatureType} */ (event.target);\n const featureKey = getUid(feature);\n const geometry = feature.getGeometry();\n if (!geometry) {\n if (!(featureKey in this.nullGeometryFeatures_)) {\n if (this.featuresRtree_) {\n this.featuresRtree_.remove(feature);\n }\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n } else {\n const extent = geometry.getExtent();\n if (featureKey in this.nullGeometryFeatures_) {\n delete this.nullGeometryFeatures_[featureKey];\n if (this.featuresRtree_) {\n this.featuresRtree_.insert(extent, feature);\n }\n } else {\n if (this.featuresRtree_) {\n this.featuresRtree_.update(extent, feature);\n }\n }\n }\n const id = feature.getId();\n if (id !== undefined) {\n const sid = id.toString();\n if (this.idIndex_[sid] !== feature) {\n this.removeFromIdIndex_(feature);\n this.idIndex_[sid] = feature;\n }\n } else {\n this.removeFromIdIndex_(feature);\n this.uidIndex_[featureKey] = feature;\n }\n this.changed();\n this.dispatchEvent(\n new VectorSourceEvent(VectorEventType.CHANGEFEATURE, feature),\n );\n }\n\n /**\n * Returns true if the feature is contained within the source.\n * @param {FeatureType} feature Feature.\n * @return {boolean} Has feature.\n * @api\n */\n hasFeature(feature) {\n const id = feature.getId();\n if (id !== undefined) {\n return id in this.idIndex_;\n }\n return getUid(feature) in this.uidIndex_;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n if (this.featuresRtree_) {\n return (\n this.featuresRtree_.isEmpty() && isEmpty(this.nullGeometryFeatures_)\n );\n }\n if (this.featuresCollection_) {\n return this.featuresCollection_.getLength() === 0;\n }\n return true;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n */\n loadFeatures(extent, resolution, projection) {\n const loadedExtentsRtree = this.loadedExtentsRtree_;\n const extentsToLoad = this.strategy_(extent, resolution, projection);\n for (let i = 0, ii = extentsToLoad.length; i < ii; ++i) {\n const extentToLoad = extentsToLoad[i];\n const alreadyLoaded = loadedExtentsRtree.forEachInExtent(\n extentToLoad,\n /**\n * @param {{extent: import(\"../extent.js\").Extent}} object Object.\n * @return {boolean} Contains.\n */\n function (object) {\n return containsExtent(object.extent, extentToLoad);\n },\n );\n if (!alreadyLoaded) {\n ++this.loadingExtentsCount_;\n this.dispatchEvent(\n new VectorSourceEvent(VectorEventType.FEATURESLOADSTART),\n );\n this.loader_.call(\n this,\n extentToLoad,\n resolution,\n projection,\n /**\n * @param {Array} features Loaded features\n */\n (features) => {\n --this.loadingExtentsCount_;\n this.dispatchEvent(\n new VectorSourceEvent(\n VectorEventType.FEATURESLOADEND,\n undefined,\n features,\n ),\n );\n },\n () => {\n --this.loadingExtentsCount_;\n this.dispatchEvent(\n new VectorSourceEvent(VectorEventType.FEATURESLOADERROR),\n );\n },\n );\n loadedExtentsRtree.insert(extentToLoad, {extent: extentToLoad.slice()});\n }\n }\n this.loading =\n this.loader_.length < 4 ? false : this.loadingExtentsCount_ > 0;\n }\n\n /**\n * @override\n */\n refresh() {\n this.clear(true);\n this.loadedExtentsRtree_.clear();\n super.refresh();\n }\n\n /**\n * Remove an extent from the list of loaded extents.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n removeLoadedExtent(extent) {\n const loadedExtentsRtree = this.loadedExtentsRtree_;\n const obj = loadedExtentsRtree.forEachInExtent(extent, function (object) {\n if (equals(object.extent, extent)) {\n return object;\n }\n });\n if (obj) {\n loadedExtentsRtree.remove(obj);\n }\n }\n\n /**\n * Batch remove features from the source. If you want to remove all features\n * at once, use the {@link module:ol/source/Vector~VectorSource#clear #clear()} method\n * instead.\n * @param {Array} features Features to remove.\n * @api\n */\n removeFeatures(features) {\n let removed = false;\n for (let i = 0, ii = features.length; i < ii; ++i) {\n removed = this.removeFeatureInternal(features[i]) || removed;\n }\n if (removed) {\n this.changed();\n }\n }\n\n /**\n * Remove a single feature from the source. If you want to batch remove\n * features, use the {@link module:ol/source/Vector~VectorSource#removeFeatures #removeFeatures()} method\n * instead.\n * @param {FeatureType} feature Feature to remove.\n * @api\n */\n removeFeature(feature) {\n if (!feature) {\n return;\n }\n const removed = this.removeFeatureInternal(feature);\n if (removed) {\n this.changed();\n }\n }\n\n /**\n * Remove feature without firing a `change` event.\n * @param {FeatureType} feature Feature.\n * @return {boolean} True if the feature was removed, false if it was not found.\n * @protected\n */\n removeFeatureInternal(feature) {\n const featureKey = getUid(feature);\n if (!(featureKey in this.uidIndex_)) {\n return false;\n }\n\n if (featureKey in this.nullGeometryFeatures_) {\n delete this.nullGeometryFeatures_[featureKey];\n } else {\n if (this.featuresRtree_) {\n this.featuresRtree_.remove(feature);\n }\n }\n\n const featureChangeKeys = this.featureChangeKeys_[featureKey];\n featureChangeKeys?.forEach(unlistenByKey);\n delete this.featureChangeKeys_[featureKey];\n\n const id = feature.getId();\n if (id !== undefined) {\n const idString = id.toString();\n const indexedFeature = this.idIndex_[idString];\n if (indexedFeature === feature) {\n delete this.idIndex_[idString];\n } else if (Array.isArray(indexedFeature)) {\n indexedFeature.splice(indexedFeature.indexOf(feature), 1);\n if (indexedFeature.length === 1) {\n this.idIndex_[idString] = indexedFeature[0];\n }\n }\n }\n delete this.uidIndex_[featureKey];\n if (this.hasListener(VectorEventType.REMOVEFEATURE)) {\n this.dispatchEvent(\n new VectorSourceEvent(VectorEventType.REMOVEFEATURE, feature),\n );\n }\n return true;\n }\n\n /**\n * Remove a feature from the id index. Called internally when the feature id\n * may have changed.\n * @param {FeatureType} feature The feature.\n * @private\n */\n removeFromIdIndex_(feature) {\n for (const id in this.idIndex_) {\n if (this.idIndex_[id] === feature) {\n delete this.idIndex_[id];\n break;\n }\n }\n }\n\n /**\n * Set the new loader of the source. The next render cycle will use the\n * new loader.\n * @param {import(\"../featureloader.js\").FeatureLoader} loader The loader to set.\n * @api\n */\n setLoader(loader) {\n this.loader_ = loader;\n }\n\n /**\n * Points the source to a new url. The next render cycle will use the new url.\n * @param {string|import(\"../featureloader.js\").FeatureUrlFunction} url Url.\n * @api\n */\n setUrl(url) {\n assert(this.format_, '`format` must be set when `url` is set');\n this.url_ = url;\n this.setLoader(xhr(url, this.format_));\n }\n\n /**\n * @param {boolean} overlaps The source can have overlapping geometries.\n */\n setOverlaps(overlaps) {\n this.overlaps_ = overlaps;\n this.changed();\n }\n}\n\nexport default VectorSource;\n","/**\n * @module ol/style/Fill\n */\n\nimport ImageState from '../ImageState.js';\nimport {asArray} from '../color.js';\nimport {getUid} from '../util.js';\nimport {get as getIconImage} from './IconImage.js';\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|import('../colorlike.js').PatternDescriptor|null} [color=null] A color,\n * gradient or pattern.\n * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats. For polygon fills (not for {@link import(\"./RegularShape.js\").default} fills),\n * a pattern can also be provided as {@link module:ol/colorlike~PatternDescriptor}.\n * Default null; if null, the Canvas/renderer default black will be used.\n */\n\n/**\n * @classdesc\n * Set fill style for vector features.\n * @api\n */\nclass Fill {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @private\n * @type {import(\"./IconImage.js\").default|null}\n */\n this.patternImage_ = null;\n\n /**\n * @private\n * @type {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|import('../colorlike.js').PatternDescriptor|null}\n */\n this.color_ = null;\n if (options.color !== undefined) {\n this.setColor(options.color);\n }\n }\n\n /**\n * Clones the style. The color is not cloned if it is a {@link module:ol/colorlike~ColorLike}.\n * @return {Fill} The cloned style.\n * @api\n */\n clone() {\n const color = this.getColor();\n return new Fill({\n color: Array.isArray(color) ? color.slice() : color || undefined,\n });\n }\n\n /**\n * Get the fill color.\n * @return {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|import('../colorlike.js').PatternDescriptor|null} Color.\n * @api\n */\n getColor() {\n return this.color_;\n }\n\n /**\n * Set the color.\n *\n * @param {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|import('../colorlike.js').PatternDescriptor|null} color Color.\n * @api\n */\n setColor(color) {\n if (color !== null && typeof color === 'object' && 'src' in color) {\n const patternImage = getIconImage(\n null,\n color.src,\n 'anonymous',\n undefined,\n color.offset ? null : color.color ? color.color : null,\n !(color.offset && color.size),\n );\n patternImage.ready().then(() => {\n this.patternImage_ = null;\n });\n if (patternImage.getImageState() === ImageState.IDLE) {\n patternImage.load();\n }\n if (patternImage.getImageState() === ImageState.LOADING) {\n this.patternImage_ = patternImage;\n }\n }\n this.color_ = color;\n }\n\n /**\n * @return {string} Key of the fill for cache lookup.\n */\n getKey() {\n const fill = this.getColor();\n if (!fill) {\n return '';\n }\n return fill instanceof CanvasPattern || fill instanceof CanvasGradient\n ? getUid(fill)\n : typeof fill === 'object' && 'src' in fill\n ? fill.src + ':' + fill.offset\n : asArray(fill).toString();\n }\n\n /**\n * @return {boolean} The fill style is loading an image pattern.\n */\n loading() {\n return !!this.patternImage_;\n }\n\n /**\n * @return {Promise} `false` or a promise that resolves when the style is ready to use.\n */\n ready() {\n return this.patternImage_ ? this.patternImage_.ready() : Promise.resolve();\n }\n}\n\nexport default Fill;\n","/**\n * @module ol/style/Stroke\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} [color] A color, gradient or pattern.\n * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats.\n * Default null; if null, the Canvas/renderer default black will be used.\n * @property {CanvasLineCap} [lineCap='round'] Line cap style: `butt`, `round`, or `square`.\n * @property {CanvasLineJoin} [lineJoin='round'] Line join style: `bevel`, `round`, or `miter`.\n * @property {Array} [lineDash] Line dash pattern. Default is `null` (no dash).\n * @property {number} [lineDashOffset=0] Line dash offset.\n * @property {number} [miterLimit=10] Miter limit.\n * @property {number} [width] Width.\n */\n\n/**\n * @classdesc\n * Set stroke style for vector features.\n * Note that the defaults given are the Canvas defaults, which will be used if\n * option is not defined. The `get` functions return whatever was entered in\n * the options; they will not return the default.\n * @api\n */\nclass Stroke {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @private\n * @type {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike}\n */\n this.color_ = options.color !== undefined ? options.color : null;\n\n /**\n * @private\n * @type {CanvasLineCap|undefined}\n */\n this.lineCap_ = options.lineCap;\n\n /**\n * @private\n * @type {Array|null}\n */\n this.lineDash_ = options.lineDash !== undefined ? options.lineDash : null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.lineDashOffset_ = options.lineDashOffset;\n\n /**\n * @private\n * @type {CanvasLineJoin|undefined}\n */\n this.lineJoin_ = options.lineJoin;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.miterLimit_ = options.miterLimit;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.width_ = options.width;\n }\n\n /**\n * Clones the style.\n * @return {Stroke} The cloned style.\n * @api\n */\n clone() {\n const color = this.getColor();\n return new Stroke({\n color: Array.isArray(color) ? color.slice() : color || undefined,\n lineCap: this.getLineCap(),\n lineDash: this.getLineDash() ? this.getLineDash().slice() : undefined,\n lineDashOffset: this.getLineDashOffset(),\n lineJoin: this.getLineJoin(),\n miterLimit: this.getMiterLimit(),\n width: this.getWidth(),\n });\n }\n\n /**\n * Get the stroke color.\n * @return {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} Color.\n * @api\n */\n getColor() {\n return this.color_;\n }\n\n /**\n * Get the line cap type for the stroke.\n * @return {CanvasLineCap|undefined} Line cap.\n * @api\n */\n getLineCap() {\n return this.lineCap_;\n }\n\n /**\n * Get the line dash style for the stroke.\n * @return {Array|null} Line dash.\n * @api\n */\n getLineDash() {\n return this.lineDash_;\n }\n\n /**\n * Get the line dash offset for the stroke.\n * @return {number|undefined} Line dash offset.\n * @api\n */\n getLineDashOffset() {\n return this.lineDashOffset_;\n }\n\n /**\n * Get the line join type for the stroke.\n * @return {CanvasLineJoin|undefined} Line join.\n * @api\n */\n getLineJoin() {\n return this.lineJoin_;\n }\n\n /**\n * Get the miter limit for the stroke.\n * @return {number|undefined} Miter limit.\n * @api\n */\n getMiterLimit() {\n return this.miterLimit_;\n }\n\n /**\n * Get the stroke width.\n * @return {number|undefined} Width.\n * @api\n */\n getWidth() {\n return this.width_;\n }\n\n /**\n * Set the color.\n *\n * @param {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} color Color.\n * @api\n */\n setColor(color) {\n this.color_ = color;\n }\n\n /**\n * Set the line cap.\n *\n * @param {CanvasLineCap|undefined} lineCap Line cap.\n * @api\n */\n setLineCap(lineCap) {\n this.lineCap_ = lineCap;\n }\n\n /**\n * Set the line dash.\n *\n * @param {Array|null} lineDash Line dash.\n * @api\n */\n setLineDash(lineDash) {\n this.lineDash_ = lineDash;\n }\n\n /**\n * Set the line dash offset.\n *\n * @param {number|undefined} lineDashOffset Line dash offset.\n * @api\n */\n setLineDashOffset(lineDashOffset) {\n this.lineDashOffset_ = lineDashOffset;\n }\n\n /**\n * Set the line join.\n *\n * @param {CanvasLineJoin|undefined} lineJoin Line join.\n * @api\n */\n setLineJoin(lineJoin) {\n this.lineJoin_ = lineJoin;\n }\n\n /**\n * Set the miter limit.\n *\n * @param {number|undefined} miterLimit Miter limit.\n * @api\n */\n setMiterLimit(miterLimit) {\n this.miterLimit_ = miterLimit;\n }\n\n /**\n * Set the width.\n *\n * @param {number|undefined} width Width.\n * @api\n */\n setWidth(width) {\n this.width_ = width;\n }\n}\n\nexport default Stroke;\n","/**\n * @module ol/size\n */\n\n/**\n * An array of numbers representing a size: `[width, height]`.\n * @typedef {Array} Size\n * @api\n */\n\n/**\n * Returns a buffered size.\n * @param {Size} size Size.\n * @param {number} num The amount by which to buffer.\n * @param {Size} [dest] Optional reusable size array.\n * @return {Size} The buffered size.\n */\nexport function buffer(size, num, dest) {\n if (dest === undefined) {\n dest = [0, 0];\n }\n dest[0] = size[0] + 2 * num;\n dest[1] = size[1] + 2 * num;\n return dest;\n}\n\n/**\n * Determines if a size has a positive area.\n * @param {Size} size The size to test.\n * @return {boolean} The size has a positive area.\n */\nexport function hasArea(size) {\n return size[0] > 0 && size[1] > 0;\n}\n\n/**\n * Returns a size scaled by a ratio. The result will be an array of integers.\n * @param {Size} size Size.\n * @param {number} ratio Ratio.\n * @param {Size} [dest] Optional reusable size array.\n * @return {Size} The scaled size.\n */\nexport function scale(size, ratio, dest) {\n if (dest === undefined) {\n dest = [0, 0];\n }\n dest[0] = (size[0] * ratio + 0.5) | 0;\n dest[1] = (size[1] * ratio + 0.5) | 0;\n return dest;\n}\n\n/**\n * Returns an `Size` array for the passed in number (meaning: square) or\n * `Size` array.\n * (meaning: non-square),\n * @param {number|Size} size Width and height.\n * @param {Size} [dest] Optional reusable size array.\n * @return {Size} Size.\n * @api\n */\nexport function toSize(size, dest) {\n if (Array.isArray(size)) {\n return size;\n }\n if (dest === undefined) {\n dest = [size, size];\n } else {\n dest[0] = size;\n dest[1] = size;\n }\n return dest;\n}\n","/**\n * @module ol/style/Image\n */\nimport {toSize} from '../size.js';\nimport {abstract} from '../util.js';\n\n/**\n * @typedef {Object} Options\n * @property {number} opacity Opacity.\n * @property {boolean} rotateWithView If the image should get rotated with the view.\n * @property {number} rotation Rotation.\n * @property {number|import(\"../size.js\").Size} scale Scale.\n * @property {Array} displacement Displacement.\n * @property {import('../style/Style.js').DeclutterMode} declutterMode Declutter mode: `declutter`, `obstacle`, `none`.\n */\n\n/**\n * @classdesc\n * A base class used for creating subclasses and not instantiated in\n * apps. Base class for {@link module:ol/style/Icon~Icon}, {@link module:ol/style/Circle~CircleStyle} and\n * {@link module:ol/style/RegularShape~RegularShape}.\n * @abstract\n * @api\n */\nclass ImageStyle {\n /**\n * @param {Options} options Options.\n */\n constructor(options) {\n /**\n * @private\n * @type {number}\n */\n this.opacity_ = options.opacity;\n\n /**\n * @private\n * @type {boolean}\n */\n this.rotateWithView_ = options.rotateWithView;\n\n /**\n * @private\n * @type {number}\n */\n this.rotation_ = options.rotation;\n\n /**\n * @private\n * @type {number|import(\"../size.js\").Size}\n */\n this.scale_ = options.scale;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.scaleArray_ = toSize(options.scale);\n\n /**\n * @private\n * @type {Array}\n */\n this.displacement_ = options.displacement;\n\n /**\n * @private\n * @type {import('../style/Style.js').DeclutterMode}\n */\n this.declutterMode_ = options.declutterMode;\n }\n\n /**\n * Clones the style.\n * @return {ImageStyle} The cloned style.\n * @api\n */\n clone() {\n const scale = this.getScale();\n return new ImageStyle({\n opacity: this.getOpacity(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode(),\n });\n }\n\n /**\n * Get the symbolizer opacity.\n * @return {number} Opacity.\n * @api\n */\n getOpacity() {\n return this.opacity_;\n }\n\n /**\n * Determine whether the symbolizer rotates with the map.\n * @return {boolean} Rotate with map.\n * @api\n */\n getRotateWithView() {\n return this.rotateWithView_;\n }\n\n /**\n * Get the symoblizer rotation.\n * @return {number} Rotation.\n * @api\n */\n getRotation() {\n return this.rotation_;\n }\n\n /**\n * Get the symbolizer scale.\n * @return {number|import(\"../size.js\").Size} Scale.\n * @api\n */\n getScale() {\n return this.scale_;\n }\n\n /**\n * Get the symbolizer scale array.\n * @return {import(\"../size.js\").Size} Scale array.\n */\n getScaleArray() {\n return this.scaleArray_;\n }\n\n /**\n * Get the displacement of the shape\n * @return {Array} Shape's center displacement\n * @api\n */\n getDisplacement() {\n return this.displacement_;\n }\n\n /**\n * Get the declutter mode of the shape\n * @return {import(\"./Style.js\").DeclutterMode} Shape's declutter mode\n * @api\n */\n getDeclutterMode() {\n return this.declutterMode_;\n }\n\n /**\n * Get the anchor point in pixels. The anchor determines the center point for the\n * symbolizer.\n * @abstract\n * @return {Array} Anchor.\n */\n getAnchor() {\n return abstract();\n }\n\n /**\n * Get the image element for the symbolizer.\n * @abstract\n * @param {number} pixelRatio Pixel ratio.\n * @return {import('../DataTile.js').ImageLike} Image element.\n */\n getImage(pixelRatio) {\n return abstract();\n }\n\n /**\n * @abstract\n * @return {import('../DataTile.js').ImageLike} Image element.\n */\n getHitDetectionImage() {\n return abstract();\n }\n\n /**\n * Get the image pixel ratio.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel ratio.\n */\n getPixelRatio(pixelRatio) {\n return 1;\n }\n\n /**\n * @abstract\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n getImageState() {\n return abstract();\n }\n\n /**\n * @abstract\n * @return {import(\"../size.js\").Size} Image size.\n */\n getImageSize() {\n return abstract();\n }\n\n /**\n * Get the origin of the symbolizer.\n * @abstract\n * @return {Array} Origin.\n */\n getOrigin() {\n return abstract();\n }\n\n /**\n * Get the size of the symbolizer (in pixels).\n * @abstract\n * @return {import(\"../size.js\").Size} Size.\n */\n getSize() {\n return abstract();\n }\n\n /**\n * Set the displacement.\n *\n * @param {Array} displacement Displacement.\n * @api\n */\n setDisplacement(displacement) {\n this.displacement_ = displacement;\n }\n\n /**\n * Set the opacity.\n *\n * @param {number} opacity Opacity.\n * @api\n */\n setOpacity(opacity) {\n this.opacity_ = opacity;\n }\n\n /**\n * Set whether to rotate the style with the view.\n *\n * @param {boolean} rotateWithView Rotate with map.\n * @api\n */\n setRotateWithView(rotateWithView) {\n this.rotateWithView_ = rotateWithView;\n }\n\n /**\n * Set the rotation.\n *\n * @param {number} rotation Rotation.\n * @api\n */\n setRotation(rotation) {\n this.rotation_ = rotation;\n }\n\n /**\n * Set the scale.\n *\n * @param {number|import(\"../size.js\").Size} scale Scale.\n * @api\n */\n setScale(scale) {\n this.scale_ = scale;\n this.scaleArray_ = toSize(scale);\n }\n\n /**\n * @abstract\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n listenImageChange(listener) {\n abstract();\n }\n\n /**\n * Load not yet loaded URI.\n * @abstract\n */\n load() {\n abstract();\n }\n\n /**\n * @abstract\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n unlistenImageChange(listener) {\n abstract();\n }\n\n /**\n * @return {Promise} `false` or Promise that resolves when the style is ready to use.\n */\n ready() {\n return Promise.resolve();\n }\n}\n\nexport default ImageStyle;\n","/**\n * @module ol/style/RegularShape\n */\n\nimport ImageState from '../ImageState.js';\nimport {asArray} from '../color.js';\nimport {asColorLike} from '../colorlike.js';\nimport {createCanvasContext2D} from '../dom.js';\nimport {\n defaultFillStyle,\n defaultLineCap,\n defaultLineJoin,\n defaultLineWidth,\n defaultMiterLimit,\n defaultStrokeStyle,\n} from '../render/canvas.js';\nimport IconImage from './IconImage.js';\nimport {shared as iconImageCache} from './IconImageCache.js';\nimport ImageStyle from './Image.js';\n\n/**\n * Specify radius for regular polygons, or both radius and radius2 for stars.\n * @typedef {Object} Options\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {number} points Number of points for stars and regular polygons. In case of a polygon, the number of points\n * is the number of sides.\n * @property {number} radius Radius of a regular polygon.\n * @property {number} [radius2] Second radius to make a star instead of a regular polygon.\n * @property {number} [angle=0] Shape's angle in radians. A value of 0 will have one of the shape's points facing up.\n * @property {Array} [displacement=[0, 0]] Displacement of the shape in pixels.\n * Positive values will shift the shape right and up.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view.\n * @property {number|import(\"../size.js\").Size} [scale=1] Scale. Unless two dimensional scaling is required a better\n * result may be obtained with appropriate settings for `radius` and `radius2`.\n * @property {import('./Style.js').DeclutterMode} [declutterMode] Declutter mode.\n */\n\n/**\n * @typedef {Object} RenderOptions\n * @property {import(\"../colorlike.js\").ColorLike|undefined} strokeStyle StrokeStyle.\n * @property {number} strokeWidth StrokeWidth.\n * @property {number} size Size.\n * @property {CanvasLineCap} lineCap LineCap.\n * @property {Array|null} lineDash LineDash.\n * @property {number} lineDashOffset LineDashOffset.\n * @property {CanvasLineJoin} lineJoin LineJoin.\n * @property {number} miterLimit MiterLimit.\n */\n\n/**\n * @classdesc\n * Set regular shape style for vector features. The resulting shape will be\n * a regular polygon when `radius` is provided, or a star when both `radius` and\n * `radius2` are provided.\n * @api\n */\nclass RegularShape extends ImageStyle {\n /**\n * @param {Options} options Options.\n */\n constructor(options) {\n super({\n opacity: 1,\n rotateWithView:\n options.rotateWithView !== undefined ? options.rotateWithView : false,\n rotation: options.rotation !== undefined ? options.rotation : 0,\n scale: options.scale !== undefined ? options.scale : 1,\n displacement:\n options.displacement !== undefined ? options.displacement : [0, 0],\n declutterMode: options.declutterMode,\n });\n\n /**\n * @private\n * @type {HTMLCanvasElement|null}\n */\n this.hitDetectionCanvas_ = null;\n\n /**\n * @private\n * @type {import(\"./Fill.js\").default|null}\n */\n this.fill_ = options.fill !== undefined ? options.fill : null;\n\n /**\n * @private\n * @type {Array}\n */\n this.origin_ = [0, 0];\n\n /**\n * @private\n * @type {number}\n */\n this.points_ = options.points;\n\n /**\n * @protected\n * @type {number}\n */\n this.radius = options.radius;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.radius2_ = options.radius2;\n\n /**\n * @private\n * @type {number}\n */\n this.angle_ = options.angle !== undefined ? options.angle : 0;\n\n /**\n * @private\n * @type {import(\"./Stroke.js\").default|null}\n */\n this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.size_;\n\n /**\n * @private\n * @type {RenderOptions}\n */\n this.renderOptions_;\n\n /**\n * @private\n */\n this.imageState_ =\n this.fill_ && this.fill_.loading()\n ? ImageState.LOADING\n : ImageState.LOADED;\n if (this.imageState_ === ImageState.LOADING) {\n this.ready().then(() => (this.imageState_ = ImageState.LOADED));\n }\n this.render();\n }\n\n /**\n * Clones the style.\n * @return {RegularShape} The cloned style.\n * @api\n * @override\n */\n clone() {\n const scale = this.getScale();\n const style = new RegularShape({\n fill: this.getFill() ? this.getFill().clone() : undefined,\n points: this.getPoints(),\n radius: this.getRadius(),\n radius2: this.getRadius2(),\n angle: this.getAngle(),\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode(),\n });\n style.setOpacity(this.getOpacity());\n return style;\n }\n\n /**\n * Get the anchor point in pixels. The anchor determines the center point for the\n * symbolizer.\n * @return {Array} Anchor.\n * @api\n * @override\n */\n getAnchor() {\n const size = this.size_;\n const displacement = this.getDisplacement();\n const scale = this.getScaleArray();\n // anchor is scaled by renderer but displacement should not be scaled\n // so divide by scale here\n return [\n size[0] / 2 - displacement[0] / scale[0],\n size[1] / 2 + displacement[1] / scale[1],\n ];\n }\n\n /**\n * Get the angle used in generating the shape.\n * @return {number} Shape's rotation in radians.\n * @api\n */\n getAngle() {\n return this.angle_;\n }\n\n /**\n * Get the fill style for the shape.\n * @return {import(\"./Fill.js\").default|null} Fill style.\n * @api\n */\n getFill() {\n return this.fill_;\n }\n\n /**\n * Set the fill style.\n * @param {import(\"./Fill.js\").default|null} fill Fill style.\n * @api\n */\n setFill(fill) {\n this.fill_ = fill;\n this.render();\n }\n\n /**\n * @return {HTMLCanvasElement} Image element.\n * @override\n */\n getHitDetectionImage() {\n if (!this.hitDetectionCanvas_) {\n this.hitDetectionCanvas_ = this.createHitDetectionCanvas_(\n this.renderOptions_,\n );\n }\n return this.hitDetectionCanvas_;\n }\n\n /**\n * Get the image icon.\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLCanvasElement} Image or Canvas element.\n * @api\n * @override\n */\n getImage(pixelRatio) {\n const fillKey = this.fill_?.getKey();\n const cacheKey =\n `${pixelRatio},${this.angle_},${this.radius},${this.radius2_},${this.points_},${fillKey}` +\n Object.values(this.renderOptions_).join(',');\n let image = /** @type {HTMLCanvasElement} */ (\n iconImageCache.get(cacheKey, null, null)?.getImage(1)\n );\n if (!image) {\n const renderOptions = this.renderOptions_;\n const size = Math.ceil(renderOptions.size * pixelRatio);\n const context = createCanvasContext2D(size, size);\n this.draw_(renderOptions, context, pixelRatio);\n\n image = context.canvas;\n iconImageCache.set(\n cacheKey,\n null,\n null,\n new IconImage(image, undefined, null, ImageState.LOADED, null),\n );\n }\n return image;\n }\n\n /**\n * Get the image pixel ratio.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel ratio.\n * @override\n */\n getPixelRatio(pixelRatio) {\n return pixelRatio;\n }\n\n /**\n * @return {import(\"../size.js\").Size} Image size.\n * @override\n */\n getImageSize() {\n return this.size_;\n }\n\n /**\n * @return {import(\"../ImageState.js\").default} Image state.\n * @override\n */\n getImageState() {\n return this.imageState_;\n }\n\n /**\n * Get the origin of the symbolizer.\n * @return {Array} Origin.\n * @api\n * @override\n */\n getOrigin() {\n return this.origin_;\n }\n\n /**\n * Get the number of points for generating the shape.\n * @return {number} Number of points for stars and regular polygons.\n * @api\n */\n getPoints() {\n return this.points_;\n }\n\n /**\n * Get the (primary) radius for the shape.\n * @return {number} Radius.\n * @api\n */\n getRadius() {\n return this.radius;\n }\n\n /**\n * Get the secondary radius for the shape.\n * @return {number|undefined} Radius2.\n * @api\n */\n getRadius2() {\n return this.radius2_;\n }\n\n /**\n * Get the size of the symbolizer (in pixels).\n * @return {import(\"../size.js\").Size} Size.\n * @api\n * @override\n */\n getSize() {\n return this.size_;\n }\n\n /**\n * Get the stroke style for the shape.\n * @return {import(\"./Stroke.js\").default|null} Stroke style.\n * @api\n */\n getStroke() {\n return this.stroke_;\n }\n\n /**\n * Set the stroke style.\n * @param {import(\"./Stroke.js\").default|null} stroke Stroke style.\n * @api\n */\n setStroke(stroke) {\n this.stroke_ = stroke;\n this.render();\n }\n\n /**\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @override\n */\n listenImageChange(listener) {}\n\n /**\n * Load not yet loaded URI.\n * @override\n */\n load() {}\n\n /**\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @override\n */\n unlistenImageChange(listener) {}\n\n /**\n * Calculate additional canvas size needed for the miter.\n * @param {string} lineJoin Line join\n * @param {number} strokeWidth Stroke width\n * @param {number} miterLimit Miter limit\n * @return {number} Additional canvas size needed\n * @private\n */\n calculateLineJoinSize_(lineJoin, strokeWidth, miterLimit) {\n if (\n strokeWidth === 0 ||\n this.points_ === Infinity ||\n (lineJoin !== 'bevel' && lineJoin !== 'miter')\n ) {\n return strokeWidth;\n }\n // m | ^\n // i | |\\ .\n // t >| #\\\n // e | |\\ \\ .\n // r \\s\\\n // | \\t\\ . .\n // \\r\\ . .\n // | \\o\\ . . . . .\n // e \\k\\ . . . .\n // | \\e\\ . . . . .\n // d \\ \\ . . . .\n // | _ _a_ _\\# . . .\n // r1 / ` . .\n // | . .\n // b / . .\n // | . .\n // / r2 . .\n // | . .\n // / . .\n // |α . .\n // / . .\n // ° center\n let r1 = this.radius;\n let r2 = this.radius2_ === undefined ? r1 : this.radius2_;\n if (r1 < r2) {\n const tmp = r1;\n r1 = r2;\n r2 = tmp;\n }\n const points =\n this.radius2_ === undefined ? this.points_ : this.points_ * 2;\n const alpha = (2 * Math.PI) / points;\n const a = r2 * Math.sin(alpha);\n const b = Math.sqrt(r2 * r2 - a * a);\n const d = r1 - b;\n const e = Math.sqrt(a * a + d * d);\n const miterRatio = e / a;\n if (lineJoin === 'miter' && miterRatio <= miterLimit) {\n return miterRatio * strokeWidth;\n }\n // Calculate the distance from center to the stroke corner where\n // it was cut short because of the miter limit.\n // l\n // ----+---- <= distance from center to here is maxr\n // /####|k ##\\\n // /#####^#####\\\n // /#### /+\\# s #\\\n // /### h/+++\\# t #\\\n // /### t/+++++\\# r #\\\n // /### a/+++++++\\# o #\\\n // /### p/++ fill +\\# k #\\\n ///#### /+++++^+++++\\# e #\\\n //#####/+++++/+\\+++++\\#####\\\n const k = strokeWidth / 2 / miterRatio;\n const l = (strokeWidth / 2) * (d / e);\n const maxr = Math.sqrt((r1 + k) * (r1 + k) + l * l);\n const bevelAdd = maxr - r1;\n if (this.radius2_ === undefined || lineJoin === 'bevel') {\n return bevelAdd * 2;\n }\n // If outer miter is over the miter limit the inner miter may reach through the\n // center and be longer than the bevel, same calculation as above but swap r1 / r2.\n const aa = r1 * Math.sin(alpha);\n const bb = Math.sqrt(r1 * r1 - aa * aa);\n const dd = r2 - bb;\n const ee = Math.sqrt(aa * aa + dd * dd);\n const innerMiterRatio = ee / aa;\n if (innerMiterRatio <= miterLimit) {\n const innerLength = (innerMiterRatio * strokeWidth) / 2 - r2 - r1;\n return 2 * Math.max(bevelAdd, innerLength);\n }\n return bevelAdd * 2;\n }\n\n /**\n * @return {RenderOptions} The render options\n * @protected\n */\n createRenderOptions() {\n let lineCap = defaultLineCap;\n let lineJoin = defaultLineJoin;\n let miterLimit = 0;\n let lineDash = null;\n let lineDashOffset = 0;\n let strokeStyle;\n let strokeWidth = 0;\n\n if (this.stroke_) {\n strokeStyle = asColorLike(this.stroke_.getColor() ?? defaultStrokeStyle);\n strokeWidth = this.stroke_.getWidth() ?? defaultLineWidth;\n lineDash = this.stroke_.getLineDash();\n lineDashOffset = this.stroke_.getLineDashOffset() ?? 0;\n lineJoin = this.stroke_.getLineJoin() ?? defaultLineJoin;\n lineCap = this.stroke_.getLineCap() ?? defaultLineCap;\n miterLimit = this.stroke_.getMiterLimit() ?? defaultMiterLimit;\n }\n\n const add = this.calculateLineJoinSize_(lineJoin, strokeWidth, miterLimit);\n const maxRadius = Math.max(this.radius, this.radius2_ || 0);\n const size = Math.ceil(2 * maxRadius + add);\n\n return {\n strokeStyle: strokeStyle,\n strokeWidth: strokeWidth,\n size: size,\n lineCap: lineCap,\n lineDash: lineDash,\n lineDashOffset: lineDashOffset,\n lineJoin: lineJoin,\n miterLimit: miterLimit,\n };\n }\n\n /**\n * @protected\n */\n render() {\n this.renderOptions_ = this.createRenderOptions();\n const size = this.renderOptions_.size;\n this.hitDetectionCanvas_ = null;\n this.size_ = [size, size];\n }\n\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @param {CanvasRenderingContext2D} context The rendering context.\n * @param {number} pixelRatio The pixel ratio.\n */\n draw_(renderOptions, context, pixelRatio) {\n context.scale(pixelRatio, pixelRatio);\n // set origin to canvas center\n context.translate(renderOptions.size / 2, renderOptions.size / 2);\n\n this.createPath_(context);\n\n if (this.fill_) {\n let color = this.fill_.getColor();\n if (color === null) {\n color = defaultFillStyle;\n }\n context.fillStyle = asColorLike(color);\n context.fill();\n }\n if (renderOptions.strokeStyle) {\n context.strokeStyle = renderOptions.strokeStyle;\n context.lineWidth = renderOptions.strokeWidth;\n if (renderOptions.lineDash) {\n context.setLineDash(renderOptions.lineDash);\n context.lineDashOffset = renderOptions.lineDashOffset;\n }\n context.lineCap = renderOptions.lineCap;\n context.lineJoin = renderOptions.lineJoin;\n context.miterLimit = renderOptions.miterLimit;\n context.stroke();\n }\n }\n\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @return {HTMLCanvasElement} Canvas containing the icon\n */\n createHitDetectionCanvas_(renderOptions) {\n let context;\n if (this.fill_) {\n let color = this.fill_.getColor();\n\n // determine if fill is transparent (or pattern or gradient)\n let opacity = 0;\n if (typeof color === 'string') {\n color = asArray(color);\n }\n if (color === null) {\n opacity = 1;\n } else if (Array.isArray(color)) {\n opacity = color.length === 4 ? color[3] : 1;\n }\n if (opacity === 0) {\n // if a transparent fill style is set, create an extra hit-detection image\n // with a default fill style\n context = createCanvasContext2D(renderOptions.size, renderOptions.size);\n this.drawHitDetectionCanvas_(renderOptions, context);\n }\n }\n return context ? context.canvas : this.getImage(1);\n }\n\n /**\n * @private\n * @param {CanvasRenderingContext2D} context The context to draw in.\n */\n createPath_(context) {\n let points = this.points_;\n const radius = this.radius;\n if (points === Infinity) {\n context.arc(0, 0, radius, 0, 2 * Math.PI);\n } else {\n const radius2 = this.radius2_ === undefined ? radius : this.radius2_;\n if (this.radius2_ !== undefined) {\n points *= 2;\n }\n const startAngle = this.angle_ - Math.PI / 2;\n const step = (2 * Math.PI) / points;\n for (let i = 0; i < points; i++) {\n const angle0 = startAngle + i * step;\n const radiusC = i % 2 === 0 ? radius : radius2;\n context.lineTo(radiusC * Math.cos(angle0), radiusC * Math.sin(angle0));\n }\n context.closePath();\n }\n }\n\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @param {CanvasRenderingContext2D} context The context.\n */\n drawHitDetectionCanvas_(renderOptions, context) {\n // set origin to canvas center\n context.translate(renderOptions.size / 2, renderOptions.size / 2);\n\n this.createPath_(context);\n\n context.fillStyle = defaultFillStyle;\n context.fill();\n if (renderOptions.strokeStyle) {\n context.strokeStyle = renderOptions.strokeStyle;\n context.lineWidth = renderOptions.strokeWidth;\n if (renderOptions.lineDash) {\n context.setLineDash(renderOptions.lineDash);\n context.lineDashOffset = renderOptions.lineDashOffset;\n }\n context.lineJoin = renderOptions.lineJoin;\n context.miterLimit = renderOptions.miterLimit;\n context.stroke();\n }\n }\n\n /**\n * @override\n */\n ready() {\n return this.fill_ ? this.fill_.ready() : Promise.resolve();\n }\n}\n\nexport default RegularShape;\n","/**\n * @module ol/style/Circle\n */\n\nimport RegularShape from './RegularShape.js';\n\n/**\n * @typedef {Object} Options\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {number} radius Circle radius.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {Array} [displacement=[0,0]] displacement\n * @property {number|import(\"../size.js\").Size} [scale=1] Scale. A two dimensional scale will produce an ellipse.\n * Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for `radius`.\n * @property {number} [rotation=0] Rotation in radians\n * (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).\n * @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view\n * (meaningful only when used in conjunction with a two dimensional scale).\n * @property {import('./Style.js').DeclutterMode} [declutterMode] Declutter mode\n */\n\n/**\n * @classdesc\n * Set circle style for vector features.\n * @api\n */\nclass CircleStyle extends RegularShape {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {radius: 5};\n\n super({\n points: Infinity,\n fill: options.fill,\n radius: options.radius,\n stroke: options.stroke,\n scale: options.scale !== undefined ? options.scale : 1,\n rotation: options.rotation !== undefined ? options.rotation : 0,\n rotateWithView:\n options.rotateWithView !== undefined ? options.rotateWithView : false,\n displacement:\n options.displacement !== undefined ? options.displacement : [0, 0],\n declutterMode: options.declutterMode,\n });\n }\n\n /**\n * Clones the style.\n * @return {CircleStyle} The cloned style.\n * @api\n * @override\n */\n clone() {\n const scale = this.getScale();\n const style = new CircleStyle({\n fill: this.getFill() ? this.getFill().clone() : undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n radius: this.getRadius(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode(),\n });\n style.setOpacity(this.getOpacity());\n return style;\n }\n\n /**\n * Set the circle radius.\n *\n * @param {number} radius Circle radius.\n * @api\n */\n setRadius(radius) {\n this.radius = radius;\n this.render();\n }\n}\n\nexport default CircleStyle;\n","/**\n * @module ol/style/Style\n */\n\nimport {assert} from '../asserts.js';\nimport CircleStyle from './Circle.js';\nimport Fill from './Fill.js';\nimport Stroke from './Stroke.js';\n\n/**\n * Defines how symbols and text are decluttered on layers ith `declutter` set to `true`\n * **declutter**: Overlapping symbols and text are decluttered.\n * **obstacle**: Symbols and text are rendered, but serve as obstacle for subsequent attempts\n * to place a symbol or text at the same location.\n * **none**: No decluttering is done.\n *\n * @typedef {\"declutter\"|\"obstacle\"|\"none\"} DeclutterMode\n */\n\n/**\n * A function that takes a {@link module:ol/Feature~Feature} and a `{number}`\n * representing the view's resolution. The function should return a\n * {@link module:ol/style/Style~Style} or an array of them. This way e.g. a\n * vector layer can be styled. If the function returns `undefined`, the\n * feature will not be rendered.\n *\n * @typedef {function(import(\"../Feature.js\").FeatureLike, number):(Style|Array